/* Diseño DEFINITIVO del blog de Flatifly.
   Base: A (Revista cálida) + notas al margen de C + barra de progreso de B. */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,900;1,9..144,500&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;1,6..72,400&family=Caveat:wght@500;700&display=swap');

:root {
  --bg: #faf6ef; --ink: #1b1a17; --muted: #6b6459; --teal: #057d7d; --teal-bright: #00a3a3;
  --line: #e7e0d3; --note: #fbf3d9; --note-ink: #5a4d12; --hand: 'Caveat', cursive;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'Newsreader', Georgia, serif; font-size: 20px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 28px; }
a { color: inherit; }

/* Barra de progreso (de B) */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--teal-bright); z-index: 60; transition: width .08s linear; }

/* Cabecera */
.masthead { border-bottom: 1px solid var(--line); padding: 20px 0; }
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.masthead .logo { font-family: 'Fraunces'; font-weight: 900; font-size: 26px; letter-spacing: -0.02em; text-decoration: none; display: flex; align-items: center; }
.masthead .logo em { font-style: normal; color: var(--teal); }
.masthead .logo img { height: 28px; width: auto; display: block; }
.mast-nav { display: flex; align-items: center; gap: 22px; font-family: 'Newsreader', Georgia, serif; font-size: 16px; }
.mast-nav a { color: var(--muted); text-decoration: none; white-space: nowrap; transition: color .15s; }
.mast-nav a:hover { color: var(--ink); }
.mast-nav a.active { color: var(--teal); font-weight: 600; }
.masthead .cta { background: var(--teal); color: #fff; font-style: normal; font-weight: 700; font-size: 15px; letter-spacing: -0.01em; padding: 9px 17px; border-radius: 10px; text-decoration: none; white-space: nowrap; transition: background .15s, transform .15s; }
.masthead .cta:hover { background: var(--teal-bright); transform: translateY(-1px); }
@media (max-width: 860px) {
  .mast-nav { order: 3; width: 100%; gap: 18px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
  .mast-nav::-webkit-scrollbar { display: none; }
}

.kicker { font-size: 13px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--teal); font-family: 'Newsreader'; font-weight: 500; }
.meta { color: var(--muted); font-size: 15px; font-style: italic; margin-top: 10px; }

/* RETÍCULA (de A) */
.grid-head { padding: 56px 0 30px; max-width: 760px; }
.grid-head h1 { font-family: 'Fraunces'; font-weight: 900; font-size: clamp(36px, 6vw, 60px); line-height: 1.02; letter-spacing: -0.03em; margin: 0 0 14px; }
.grid-head p { color: var(--muted); font-size: 21px; margin: 0; }

.grid-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 44px 48px; padding-bottom: 70px; }
.card { text-decoration: none; }
.card-img, .card-thumb { border-radius: 10px; overflow: hidden; background: #efe8da; aspect-ratio: 16 / 10; }
.card-img img, .card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .45s ease; }

/* Destacada: imagen + texto */
.card.featured { grid-column: 1 / -1; display: grid; grid-template-columns: 1.15fr 1fr; gap: 44px; align-items: center; padding: 34px 0 46px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); }
.card.featured:hover .card-img img { transform: scale(1.03); }
.card.featured .kicker { font-family: 'Newsreader'; font-style: italic; }
.card.featured h2 { font-family: 'Fraunces'; font-weight: 900; font-size: clamp(28px, 3.8vw, 46px); line-height: 1.04; letter-spacing: -0.02em; margin: 12px 0 12px; }
.card.featured:hover h2 { color: var(--teal); }
.card.featured .excerpt { color: var(--muted); font-size: 19px; margin: 0 0 10px; }

/* Secundarias: miniatura + texto */
.grid-wrap > .card:not(.featured) { display: block; }
.grid-wrap > .card:not(.featured) .card-thumb { margin-bottom: 16px; }
.grid-wrap > .card:not(.featured):hover .card-thumb img { transform: scale(1.03); }
.grid-wrap > .card:not(.featured) h3 { font-family: 'Fraunces'; font-weight: 600; font-size: 24px; line-height: 1.14; letter-spacing: -0.01em; margin: 8px 0 8px; }
.grid-wrap > .card:not(.featured):hover h3 { color: var(--teal); }
.grid-wrap > .card:not(.featured) .excerpt { color: var(--muted); font-size: 17px; margin: 0; }
@media (max-width: 720px) { .grid-wrap { grid-template-columns: 1fr; } .card.featured { grid-template-columns: 1fr; } }

/* LECTURA (de A) con índice lateral */
.reader { display: grid; grid-template-columns: 1fr; max-width: 1080px; margin: 0 auto; padding: 0 28px; }
@media (min-width: 1000px) { .reader { grid-template-columns: 220px minmax(0, 680px); gap: 60px; justify-content: center; } }
.reader-toc { display: none; }
@media (min-width: 1000px) { .reader-toc { display: block; position: sticky; top: 40px; align-self: start; font-size: 15px; padding-top: 80px; } }
.reader-toc .label { text-transform: uppercase; letter-spacing: 0.12em; font-size: 12px; color: var(--muted); font-style: italic; margin-bottom: 12px; }
.reader-toc a { display: block; color: var(--muted); text-decoration: none; padding: 5px 0; border-left: 2px solid var(--line); padding-left: 12px; }
.reader-toc a:hover { color: var(--teal); border-color: var(--teal); }

article.post { padding: 70px 0 90px; }
.post .kicker { font-size: 14px; }
.post h1 { font-family: 'Fraunces'; font-weight: 900; font-size: clamp(34px, 5.4vw, 58px); line-height: 1.04; letter-spacing: -0.03em; margin: 14px 0 14px; }
.post .subtitle { font-style: italic; color: var(--muted); font-size: 23px; margin: 0 0 18px; }
.post .byline { color: var(--muted); font-size: 16px; border-bottom: 1px solid var(--line); padding-bottom: 26px; }

.body { font-size: 20px; line-height: 1.62; margin-top: 30px; }
.body > p:first-of-type::first-letter { font-family: 'Fraunces'; font-weight: 900; float: left; font-size: 76px; line-height: 0.78; padding: 8px 12px 0 0; color: var(--teal); }
.body h2 { font-family: 'Fraunces'; font-weight: 600; font-size: 30px; letter-spacing: -0.01em; margin: 46px 0 14px; }
.body p { margin: 0 0 22px; }
.body ul, .body ol { padding-left: 24px; }
.body li { margin: 7px 0; }
.body code { font-family: ui-monospace, monospace; background: #efe8da; padding: 2px 6px; border-radius: 5px; font-size: 0.82em; }
.body pre { background: #1b1a17; color: #faf6ef; padding: 18px; border-radius: 10px; overflow-x: auto; font-size: 15px; }
.body pre code { background: none; color: inherit; }
.body table { width: 100%; border-collapse: collapse; font-size: 16px; margin: 22px 0; }
.body th, .body td { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; }

/* NOTA AL MARGEN (de C, recoloreada al mundo cálido de A).
   Cualquier blockquote del Markdown se convierte en una nota manuscrita al margen derecho. */
.body blockquote {
  float: right; clear: right; width: 240px; margin: 6px -270px 22px 28px;
  background: var(--note); color: var(--note-ink); padding: 16px 18px; border-radius: 4px;
  border-left: 3px solid var(--teal); font-family: var(--hand); font-size: 22px; line-height: 1.32;
  transform: rotate(1.2deg); box-shadow: 2px 4px 0 rgba(27,26,23,.08);
}
.body blockquote p { margin: 0; }
.body blockquote p + p { margin-top: 8px; }
@media (max-width: 1100px) { .body blockquote { float: none; width: auto; margin: 24px 0; transform: none; } }

.endcta { max-width: 680px; margin: 30px auto 0; text-align: center; border-top: 2px solid var(--ink); padding-top: 30px; }
.endcta strong { font-family: 'Fraunces'; font-weight: 900; font-size: 26px; display: block; }
.endcta a { display: inline-block; margin-top: 20px; background: var(--teal); color: #fff; font-weight: 700; font-style: normal; font-size: 17px; letter-spacing: -0.01em; padding: 13px 28px; border-radius: 12px; text-decoration: none; transition: background .15s, transform .15s; }
.endcta a:hover { background: var(--teal-bright); transform: translateY(-2px); text-decoration: none; }
