/* miguelsobrado.com: an editorial archive.
   Warm paper, ink, and the cobalt of the wall behind the portrait on his homepage. */

:root {
  --paper: #f3eee4;
  --paper-2: #ebe4d6;
  --ink: #1b1a17;
  --ink-2: #4a463e;
  --muted: #7a7366;
  --rule: #d9d0bf;
  --cobalt: #2340c9;
  --cobalt-ink: #1a2f96;
  --cobalt-wash: rgba(35, 64, 201, .08);
  --display: "Gloock", "Iowan Old Style", Georgia, serif;
  --text: "Newsreader", "Iowan Old Style", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --wrap: 1180px;
  --text-col: 680px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14130f;
    --paper-2: #1d1b16;
    --ink: #ece6da;
    --ink-2: #c4bcad;
    --muted: #8f877a;
    --rule: #34302a;
    --cobalt: #8ea2ff;
    --cobalt-ink: #b3c0ff;
    --cobalt-wash: rgba(142, 162, 255, .1);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.125rem/1.6 var(--text);
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
/* faint paper grain */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body > * { position: relative; z-index: 1; }

a { color: var(--cobalt); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--cobalt-ink); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; border-radius: 2px; }
img { max-width: 100%; height: auto; display: block; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 16px; }
@media (min-width: 720px) { .wrap { padding-inline: 32px; } }
.wrap--text { max-width: calc(var(--text-col) + 64px); }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 10; background: var(--ink); color: var(--paper); padding: 8px 12px; }

.label, .meta, .kicker, .ficha dt {
  font: 500 .72rem/1.4 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.meta { display: block; margin: 0 0 .35rem; }

/* ---------- masthead */
.masthead { border-bottom: 1px solid var(--rule); background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 5; }
.masthead__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 32px; padding-block: 14px; }
.brand { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; }
.brand__name { font: 400 1.5rem/1 var(--display); letter-spacing: -.01em; }
.brand__tag { font: 500 .62rem/1.6 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.nav { display: flex; gap: 4px 18px; flex-wrap: wrap; font: 500 .92rem/1.2 var(--text); }
.nav a { color: var(--ink-2); text-decoration: none; padding: 4px 0; border-bottom: 1px solid transparent; }
.nav a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.nav a[aria-current] { color: var(--cobalt); border-bottom-color: var(--cobalt); }
@media (max-width: 719px) {
  .masthead { position: static; }
  .nav { overflow-x: auto; flex-wrap: nowrap; width: 100%; padding-bottom: 2px; scrollbar-width: none; }
  .nav a { white-space: nowrap; }
}

/* ---------- hero */
.hero { display: grid; gap: 40px; padding-block: 56px 48px; align-items: center; }
@media (min-width: 960px) { .hero { grid-template-columns: 1.05fr 1fr; gap: 64px; padding-block: 88px 72px; } }
.hero__title {
  font: 400 clamp(2.5rem, 6.2vw, 4.6rem)/1.02 var(--display);
  letter-spacing: -.02em; margin: 14px 0 26px;
}
.hero__title em { font-style: normal; color: var(--cobalt); }
.hero__lede p { color: var(--ink-2); margin: 0 0 1em; max-width: 34em; }
.hero__lede p:first-child { font-size: 1.22rem; color: var(--ink); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.btn {
  display: inline-block; font: 500 .95rem/1 var(--text); text-decoration: none;
  background: var(--ink); color: var(--paper); padding: 14px 20px; border-radius: 999px;
  transition: transform .2s ease, background .2s ease;
}
.btn:hover { color: var(--paper); background: var(--cobalt); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--rule); }
.btn--ghost:hover { background: var(--cobalt-wash); color: var(--cobalt-ink); box-shadow: inset 0 0 0 1px var(--cobalt); }
.hero__photo { margin: 0; position: relative; }
.hero__photo img { border-radius: 4px; box-shadow: 0 30px 60px -30px rgba(20, 30, 90, .45); transform: rotate(-1.2deg); }
.hero__photo figcaption { font: 400 .78rem/1.4 var(--mono); color: var(--muted); margin-top: 16px; text-align: right; }

@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(14px); animation: rise .9s cubic-bezier(.2, .7, .2, 1) forwards; }
  .reveal:nth-child(2) { animation-delay: .08s; }
  .reveal:nth-child(3) { animation-delay: .16s; }
  .reveal:nth-child(4) { animation-delay: .24s; }
  .hero__photo.reveal { animation-delay: .3s; }
  @keyframes rise { to { opacity: 1; transform: none; } }
}

/* ---------- section heads */
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; border-top: 2px solid var(--ink); padding-top: 14px; margin: 64px 0 24px; }
.section-head h2 { font: 400 clamp(1.7rem, 3.4vw, 2.4rem)/1.1 var(--display); margin: 0; letter-spacing: -.01em; }
.section-head p { margin: 0; color: var(--muted); max-width: 46ch; font-size: 1rem; }
.section-head a { font: 500 .78rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; text-decoration: none; }
.section-head--small { border-top-width: 1px; margin-top: 56px; }
.section-head--small h2 { font-size: 1.6rem; }

/* ---------- timeline */
.timeline__bars { list-style: none; margin: 0 0 26px; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; height: 180px; position: relative; }
.timeline__bars li { display: flex; align-items: flex-end; position: relative; border-bottom: 1px solid var(--rule); }
.timeline__bars a {
  display: block; width: 100%; height: max(var(--h), 4px); background: var(--ink);
  border-radius: 2px 2px 0 0; transition: background .2s ease, transform .2s ease; transform-origin: bottom;
}
.timeline__bars a:hover, .timeline__bars a:focus-visible { background: var(--cobalt); transform: scaleY(1.04); }
.timeline__year { position: absolute; bottom: -24px; left: 0; font: 500 .68rem/1 var(--mono); color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .timeline__bars a { animation: grow 1.1s cubic-bezier(.2, .7, .2, 1) both; }
  .timeline__bars li:nth-child(3n) a { animation-delay: .1s; }
  .timeline__bars li:nth-child(3n+1) a { animation-delay: .2s; }
  @keyframes grow { from { transform: scaleY(0); } }
}

/* ---------- chapters (home) */
.chapters__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0 40px; counter-reset: c; }
@media (min-width: 720px) { .chapters__list { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1040px) { .chapters__list { grid-template-columns: 1fr 1fr 1fr; } }
.chapters__list a { display: grid; grid-template-columns: auto 1fr; gap: 2px 16px; padding: 16px 0; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--ink); }
.chapters__num { font: 400 2rem/1 var(--display); color: var(--cobalt); grid-row: span 2; min-width: 2ch; }
.chapters__title { font: 500 1.15rem/1.25 var(--text); }
.chapters__meta { font: 500 .7rem/1.4 var(--mono); color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.chapters__list a:hover .chapters__title { color: var(--cobalt); }

/* ---------- cards */
.split { display: grid; gap: 0 56px; }
@media (min-width: 960px) { .split { grid-template-columns: 1.7fr 1fr; } }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 0 32px; }
@media (min-width: 720px) { .cards { grid-template-columns: 1fr 1fr; } .cards--wide { grid-template-columns: 1fr 1fr 1fr; } }
.card a { display: block; padding: 18px 0 22px; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--ink); height: 100%; }
.card h3 { font: 500 1.25rem/1.25 var(--text); margin: 0 0 8px; transition: color .2s ease; }
.card p:last-child { margin: 0; color: var(--ink-2); font-size: 1rem; line-height: 1.5; }
.card a:hover h3 { color: var(--cobalt); }
.cards--wide { margin-bottom: 80px; }

.press { list-style: none; margin: 0; padding: 0; }
.press a { display: block; padding: 12px 0; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--ink); font: 500 1.05rem/1.3 var(--text); }
.press a:hover { color: var(--cobalt); }
.press--list { columns: 1; }
@media (min-width: 900px) { .press--list { columns: 2; column-gap: 48px; } .press--list li { break-inside: avoid; } }

/* ---------- mosaic */
.mosaic { list-style: none; margin: 0 0 80px; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 900px) { .mosaic { grid-template-columns: repeat(3, 1fr); } }
.mosaic a { display: block; position: relative; overflow: hidden; border-radius: 3px; aspect-ratio: 4 / 3; background: var(--paper-2); text-decoration: none; }
.mosaic img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .7, .2, 1), filter .4s; filter: saturate(.92); }
.mosaic a:hover img { transform: scale(1.04); filter: saturate(1.05); }
.mosaic span {
  position: absolute; inset: auto 0 0 0; padding: 40px 14px 12px; color: #fff;
  font: 500 1rem/1.25 var(--text); background: linear-gradient(transparent, rgba(10, 10, 20, .78));
}
.mosaic small { display: block; font: 500 .66rem/1.5 var(--mono); letter-spacing: .06em; text-transform: uppercase; opacity: .8; margin-top: 4px; }
.mosaic__text a { display: flex; align-items: flex-end; border: 1px solid var(--rule); background: transparent; }
.mosaic__text span { position: static; background: none; color: var(--ink); padding: 14px; }

/* ---------- page heads + listings */
.page-head { padding-block: 64px 24px; }
.page-head h1 { font: 400 clamp(2.4rem, 5.6vw, 4rem)/1.04 var(--display); letter-spacing: -.02em; margin: 10px 0 18px; }
.page-head__lede { font-size: 1.2rem; color: var(--ink-2); max-width: 44em; margin: 0; }

.memoria-list { list-style: none; margin: 16px auto 96px; padding-top: 0; }
.memoria-list a { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: start; padding: 28px 0; border-top: 1px solid var(--rule); text-decoration: none; color: var(--ink); }
@media (min-width: 820px) { .memoria-list a { grid-template-columns: 90px 1fr 260px; gap: 32px; } }
.memoria-list__num { font: 400 3rem/1 var(--display); color: var(--cobalt); }
.memoria-list__body { display: flex; flex-direction: column; gap: 8px; }
.memoria-list__title { font: 400 clamp(1.5rem, 2.6vw, 2rem)/1.1 var(--display); }
.memoria-list__excerpt { color: var(--ink-2); font-size: 1.02rem; }
.memoria-list__img { grid-column: 1 / -1; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 3px; }
@media (min-width: 820px) { .memoria-list__img { grid-column: auto; } }
.memoria-list a:hover .memoria-list__title { color: var(--cobalt); }

.year-index { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 24px; }
.year-index a { font: 500 .78rem/1 var(--mono); text-decoration: none; padding: 8px 10px; border: 1px solid var(--rule); border-radius: 999px; color: var(--ink-2); }
.year-index a:hover { border-color: var(--cobalt); color: var(--cobalt); }
.year-block { display: grid; gap: 4px 40px; padding: 26px 0; border-top: 1px solid var(--ink); scroll-margin-top: 90px; }
@media (min-width: 820px) { .year-block { grid-template-columns: 140px 1fr; } }
.year-block__year { font: 400 2.4rem/1 var(--display); margin: 6px 0 0; color: var(--cobalt); }
#archivo, .year-block:last-of-type { margin-bottom: 96px; }

.search input {
  width: 100%; max-width: 520px; margin-top: 8px; font: 400 1.1rem/1 var(--text); color: var(--ink);
  background: transparent; border: 0; border-bottom: 2px solid var(--ink); padding: 12px 0; border-radius: 0;
}
.search input:focus { outline: none; border-bottom-color: var(--cobalt); }
.empty { color: var(--muted); }

/* ---------- article */
.article__head { padding-block: 56px 8px; }
.kicker a { color: var(--cobalt); text-decoration: none; }
.article__head h1 { font: 400 clamp(2.1rem, 5vw, 3.4rem)/1.06 var(--display); letter-spacing: -.015em; margin: 12px 0 26px; text-wrap: balance; }
.ficha { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 0 0 8px; padding: 14px 0; border-block: 1px solid var(--rule); }
.ficha div { display: flex; flex-direction: column; gap: 2px; }
.ficha dd { margin: 0; font: 400 .95rem/1.3 var(--text); }
.ficha dd a { color: var(--ink); }

.prose { padding-block: 24px 40px; font-size: 1.2rem; line-height: 1.7; }
.prose > p:first-of-type::first-letter { font: 400 3.6em/.82 var(--display); float: left; margin: .06em .1em 0 0; color: var(--cobalt); }
.prose p { margin: 0 0 1.15em; hanging-punctuation: first; }
.prose h2, .prose h3, .prose h4 { font: 400 1.7rem/1.2 var(--display); margin: 1.8em 0 .6em; }
.prose h3, .prose h4 { font-size: 1.35rem; }
.prose blockquote { margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--cobalt); color: var(--ink-2); font-style: italic; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }
.prose img { margin: 1.6em auto; border-radius: 3px; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.4em 0; }
.prose em:only-child { color: var(--muted); }
.prose .gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 1.6em 0; }
@media (min-width: 720px) { .prose .gallery { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .prose .gallery { margin-inline: -120px; } }
.prose .gallery a { display: block; overflow: hidden; border-radius: 3px; }
.prose .gallery img { margin: 0; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.prose .gallery a:hover img { transform: scale(1.04); }
.video { position: relative; aspect-ratio: 16 / 9; margin: 1.8em 0; background: #000; border-radius: 3px; overflow: hidden; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.pager { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; padding-block: 28px 96px; border-top: 2px solid var(--ink); }
.pager a { text-decoration: none; color: var(--ink); font: 500 1.05rem/1.3 var(--text); display: flex; flex-direction: column; gap: 6px; }
.pager a:hover { color: var(--cobalt); }
.pager__next { text-align: right; grid-column: 2; }

/* ---------- footer */
.footer { border-top: 1px solid var(--rule); background: var(--paper-2); padding-block: 40px 56px; font-size: 1rem; color: var(--ink-2); }
.footer__inner { display: grid; gap: 24px 48px; }
@media (min-width: 820px) { .footer__inner { grid-template-columns: 2fr 1fr 1.4fr; } }
.footer p { margin: 0 0 6px; }
.footer__name { font: 400 1.4rem/1.2 var(--display); color: var(--ink); }

@media print {
  .masthead, .footer, .pager, body::before { display: none; }
  body { background: #fff; color: #000; }
}
