/*
Theme Name: Alvaro
Theme URI: https://alvaromarin.es/
Author: Alvaro Marin
Description: Tema editorial, ligero y accesible para la web personal de Alvaro Marin.
Version: 1.1.0
Requires at least: 6.4
Tested up to: 7.0
Requires PHP: 8.1
Text Domain: alvaro
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

@font-face {
  font-family: "Lora";
  src: url("assets/fonts/lora-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("assets/fonts/plus-jakarta-sans-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --color-paper: #fbfaf7;
  --color-paper-deep: #f0ede6;
  --color-ink: #181817;
  --color-muted: #5f5d57;
  --color-rule: #d5d1c8;
  --color-accent: #cf5938;
  --font-editorial: "Lora", Georgia, "Times New Roman", serif;
  --font-interface: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --shell: 72rem;
  --measure: 43rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--color-paper);
  color-scheme: light;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-editorial);
  font-size: clamp(1.05rem, 0.99rem + 0.2vw, 1.16rem);
  font-weight: 400;
  line-height: 1.68;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.admin-bar .site-header {
  margin-top: 2rem;
}

a {
  color: inherit;
  text-decoration-color: var(--color-accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 0.13em;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 4px;
}

img {
  display: block;
  height: auto;
  max-width: 100%;
}

::selection {
  background: var(--color-ink);
  color: var(--color-paper);
}

.skip-link,
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  z-index: 100000;
  top: 0.75rem;
  left: 0.75rem;
  width: auto;
  height: auto;
  padding: 0.75rem 1rem;
  margin: 0;
  clip: auto;
  background: var(--color-ink);
  color: var(--color-paper);
  font: 700 0.8rem/1 var(--font-interface);
}

.site-shell,
.section-shell {
  width: min(100%, var(--shell));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.site-header {
  display: flex;
  min-height: 5.25rem;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  border-bottom: 1px solid var(--color-rule);
  font-family: var(--font-interface);
}

.site-brand {
  font-size: 0.83rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-decoration: none;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(1.1rem, 3vw, 2.25rem);
  font-size: 0.79rem;
  font-weight: 600;
}

.site-nav a {
  text-decoration: none;
}

.site-nav a:hover {
  text-decoration: underline;
  text-decoration-color: var(--color-accent);
}

.home-main {
  overflow: hidden;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(20rem, 0.92fr);
  gap: clamp(3rem, 7vw, 6rem);
  align-items: center;
  padding-block: clamp(4rem, 8vw, 7rem);
}

.hero-copy {
  padding-block: 1rem;
}

.hero-title,
.section-heading h2,
.writing-title h2,
.newsletter-title,
.article-title {
  margin: 0;
  font-family: var(--font-interface);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.06;
  text-wrap: balance;
}

.hero-title {
  max-width: 12ch;
  font-size: clamp(2.75rem, 5.6vw, 4.85rem);
}

.hero-intro,
.hero-projects {
  max-width: 39rem;
  margin: 2rem 0 0;
  font-size: clamp(1.12rem, 1.02rem + 0.32vw, 1.3rem);
  line-height: 1.58;
}

.hero-intro p {
  margin: 0;
}

.hero-projects {
  margin-top: 1.25rem;
  color: var(--color-muted);
}

.portrait {
  margin: 0;
}

.portrait img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 58% 46%;
  background: var(--color-paper-deep);
}

.portrait figcaption {
  margin-top: 0.7rem;
  color: var(--color-muted);
  font: 500 0.68rem/1.5 var(--font-interface);
}

.projects-section {
  padding-block: clamp(5rem, 9vw, 8rem);
  border-top: 1px solid var(--color-rule);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(18rem, 1.05fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
  margin-bottom: clamp(3.25rem, 6vw, 5rem);
}

.section-heading h2,
.writing-title h2 {
  font-size: clamp(2rem, 3.5vw, 3.2rem);
}

.section-heading p {
  max-width: 34rem;
  margin: 0.2rem 0 0;
  color: var(--color-muted);
  font-size: 1.05rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(2rem, 5vw, 4.5rem);
}

.project-card {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  gap: 0 0.75rem;
  padding-block: 1.75rem 2rem;
  border-top: 1px solid var(--color-ink);
  text-decoration: none;
}

.project-number {
  grid-row: 1 / span 2;
  padding-top: 0.25rem;
  color: var(--color-accent);
  font: 700 0.68rem/1 var(--font-interface);
  letter-spacing: 0.08em;
}

.project-card h3 {
  display: inline;
  width: fit-content;
  margin: 0;
  font: 700 clamp(1.22rem, 1.1rem + 0.35vw, 1.48rem)/1.25 var(--font-interface);
  letter-spacing: -0.025em;
}

.project-card p {
  margin: 0.7rem 0 0;
  color: var(--color-muted);
  font-size: 0.96rem;
  line-height: 1.58;
}

.project-card:hover h3 {
  text-decoration: underline;
  text-decoration-color: var(--color-accent);
  text-decoration-thickness: 0.1em;
  text-underline-offset: 0.18em;
}

.writing-section {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(18rem, 1.28fr);
  gap: clamp(2.5rem, 7vw, 7rem);
  margin-bottom: clamp(5rem, 9vw, 8rem);
  padding-block: clamp(3.5rem, 7vw, 6rem);
  background: var(--color-paper-deep);
  box-shadow: 0 0 0 100vmax var(--color-paper-deep);
  clip-path: inset(0 -100vmax);
}

.writing-copy {
  max-width: 38rem;
  font-size: clamp(1.08rem, 1rem + 0.2vw, 1.2rem);
}

.writing-copy p {
  margin: 0 0 1.35em;
}

.writing-copy p:last-child {
  margin-bottom: 0;
}

.newsletter {
  padding: clamp(4.5rem, 9vw, 7.5rem) var(--gutter);
  border-block: 1px solid var(--color-rule);
}

.newsletter-inner {
  display: grid;
  width: min(100%, var(--shell));
  margin-inline: auto;
  grid-template-columns: minmax(15rem, 0.78fr) minmax(20rem, 1.22fr);
  grid-template-rows: auto auto;
  gap: 2rem clamp(3rem, 8vw, 8rem);
  align-items: start;
}

.newsletter-title {
  grid-row: 1 / span 2;
  max-width: 11ch;
  font-size: clamp(2.35rem, 4.4vw, 4rem);
}

.newsletter-copy {
  max-width: 38rem;
  color: var(--color-muted);
  font-size: 1.08rem;
}

.newsletter-copy p {
  margin: 0;
}

.newsletter-form-area {
  max-width: 38rem;
}

.newsletter-form-area .newsletter-form-wrap,
.newsletter-form-wrap .newsletter-form-wrap {
  margin: 0;
}

.newsletter-form {
  margin: 0;
}

.newsletter-form__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: stretch;
}

.newsletter-form label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.newsletter-form input[type="email"] {
  min-width: 0;
  min-height: 3.65rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--color-ink);
  border-radius: 0;
  background: #fff;
  color: var(--color-ink);
  font: 500 0.92rem/1.25 var(--font-interface);
  appearance: none;
}

.newsletter-form input[type="email"]::placeholder {
  color: #77736a;
  opacity: 1;
}

.newsletter-form button,
.newsletter-form input[type="submit"] {
  min-height: 3.65rem;
  padding: 0.9rem 1.35rem;
  border: 1px solid var(--color-ink);
  border-radius: 0;
  background: var(--color-ink);
  color: var(--color-paper);
  cursor: pointer;
  font: 700 0.78rem/1.15 var(--font-interface);
}

.newsletter-form button:hover,
.newsletter-form input[type="submit"]:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.newsletter-form__privacy,
.newsletter-form__message,
.form-note {
  margin: 0.85rem 0 0;
  color: var(--color-muted);
  font: 400 0.7rem/1.55 var(--font-interface);
}

.newsletter-form__message {
  margin: 0 0 1rem;
  color: var(--color-ink);
  font-size: 0.82rem;
}

.newsletter-form__message--error {
  color: #7a2828;
}

.newsletter-form__trap,
.newsletter-form .website,
.newsletter-form [aria-hidden="true"] {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.thank-you {
  grid-column: 1 / -1;
  width: min(100%, 44rem);
  margin-inline: auto;
}

.thank-you .newsletter-title {
  max-width: 14ch;
  margin-bottom: 2rem;
}

.thank-you p {
  margin: 0 0 1.1em;
  font-size: 1.08rem;
}

.thank-you .signature {
  margin-top: 2rem;
  white-space: pre-line;
}

.site-footer {
  display: flex;
  width: min(100%, var(--shell));
  margin-inline: auto;
  padding: 1.6rem var(--gutter) 2.3rem;
  justify-content: space-between;
  gap: 1rem;
  color: var(--color-muted);
  font: 500 0.66rem/1.5 var(--font-interface);
}

.site-footer p {
  margin: 0;
}

.article-shell {
  width: min(100%, var(--measure));
  margin-inline: auto;
  padding: clamp(4rem, 9vw, 8rem) var(--gutter);
}

.article-title {
  font-size: clamp(2.5rem, 5.5vw, 4.5rem);
}

.article-meta {
  margin: 1.2rem 0 3.5rem;
  color: var(--color-muted);
  font: 500 0.72rem/1.5 var(--font-interface);
}

.entry-content p {
  margin: 0 0 1.55em;
}

.entry-content h2 {
  margin: 2.5em 0 0.7em;
  font: 700 clamp(1.7rem, 1.4rem + 1vw, 2.35rem)/1.2 var(--font-interface);
  letter-spacing: -0.03em;
}

.entry-content h3 {
  margin: 2.2em 0 0.6em;
  font: 700 1.25rem/1.3 var(--font-interface);
}

.entry-content ul,
.entry-content ol {
  margin: 0 0 1.6em;
  padding-left: 1.2em;
}

.entry-content blockquote {
  margin: 2.2em 0;
  padding-left: 1.2em;
  border-left: 3px solid var(--color-accent);
  font-size: 1.12em;
}

@media (max-width: 56rem) {
  .hero {
    grid-template-columns: 1fr;
    gap: 3rem;
    padding-block: 3.5rem 5rem;
  }

  .hero-copy {
    max-width: 43rem;
    padding: 0;
  }

  .portrait {
    width: min(100%, 38rem);
  }

  .portrait img {
    aspect-ratio: 5 / 4;
    object-position: 57% 42%;
  }

  .section-heading,
  .writing-section,
  .newsletter-inner {
    grid-template-columns: 1fr;
  }

  .newsletter-title {
    grid-row: auto;
    max-width: 14ch;
  }

  .newsletter-copy,
  .newsletter-form-area {
    max-width: 42rem;
  }
}

@media (max-width: 40rem) {
  body.admin-bar .site-header {
    margin-top: 2.875rem;
  }

  .site-header {
    min-height: 4.5rem;
  }

  .site-nav {
    gap: 1rem;
    font-size: 0.7rem;
  }

  .site-nav a:nth-child(2) {
    display: none;
  }

  .hero-title {
    max-width: 10ch;
  }

  .portrait img {
    aspect-ratio: 4 / 5;
    object-position: 58% 45%;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .writing-section {
    margin-bottom: 4.5rem;
  }

  .newsletter-form__row {
    grid-template-columns: 1fr;
  }

  .newsletter-form button,
  .newsletter-form input[type="submit"] {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  body {
    background: #fff;
  }

  .site-header,
  .newsletter,
  .site-footer {
    display: none;
  }
}
