/* ==========================================================================
   Criterio.Capital cc.19 — «Lo que leí esta semana» (seccion-lecturas.hbs y tag-lo-que-lei-esta-semana.hbs)
   Se carga SOLO en esas plantillas (contentFor "cc_head").
   Paleta: navy #122036 · navy-2 #1a2c47 · dorado #CDA862 · dorado oscuro #7A5E28 · crema #F0ECE2
   Contrastes: dorado/navy 7,3:1 · crema/navy 13,9:1 · #c9cfd9/navy 10,4:1 · muted/blanco 7,2:1 · dorado oscuro/blanco 6,1:1
   Sin fuentes, scripts ni imágenes de terceros.
   ========================================================================== */

.cc-lec {
    --cc-navy: #122036;
    --cc-navy-2: #1a2c47;
    --cc-gold: #cda862;
    --cc-gold-dark: #7a5e28;
    --cc-cream: #f0ece2;
    --cc-cream-2: #f7f5ef;
    --cc-ink: #16202e;
    --cc-muted: #4f5868;
    --cc-on-navy-muted: #c9cfd9;
    --cc-line: rgb(18 32 54 / 0.14);
    --cc-serif: "IBM Plex Serif", "EB Garamond", Georgia, "Times New Roman", serif;
    --cc-sans: var(--gh-font-body, var(--font-sans));
    --cc-gap: clamp(20px, 4vw, 40px);
    padding: 0 !important;      /* gh-main trae padding vertical: la cabecera navy va pegada al menú */
    font-family: var(--cc-sans);
    color: var(--cc-ink);
}

@counter-style cc-pad3 { system: extends decimal; pad: 3 "0"; }

.cc-lec-wrap {
    width: 100%;
    max-width: calc(1120px + 2 * var(--cc-gap));
    margin-inline: auto;
    padding-inline: var(--cc-gap);
}

.cc-lec a:focus-visible,
.cc-lec button:focus-visible,
.cc-lec input:focus-visible {
    outline: 3px solid var(--cc-gold);
    outline-offset: 3px;
}

.cc-sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Menú navy (como en la home) solo en esta página ---------- */
body:has(.cc-lec) .gh-navigation {
    --background-color: #122036;
    --color-darker-gray: #fff;
    --color-secondary-text: rgb(255 255 255 / 0.72);
    --color-border: rgb(255 255 255 / 0.14);
    background-color: #122036;
    color: #f0ece2;
    border-bottom: 1px solid rgb(255 255 255 / 0.1);
}
body:has(.cc-lec) .gh-navigation .gh-navigation-menu a { color: #c9cfd9; }
body:has(.cc-lec) .gh-navigation .gh-navigation-menu a:hover,
body:has(.cc-lec) .gh-navigation .nav-current a { color: #fff; opacity: 1; }
body:has(.cc-lec) .gh-navigation .gh-button { color: #122036; background-color: #cda862; border-radius: 6px; }

/* ---------- Cabecera navy: título + subtítulo + alta | última edición ---------- */
.cc-lec-head {
    position: relative;
    color: var(--cc-cream);
    background:
        radial-gradient(120% 80% at 100% 0%, rgb(205 168 98 / 0.10), transparent 55%),
        linear-gradient(180deg, var(--cc-navy) 0%, var(--cc-navy-2) 100%);
    border-bottom: 3px solid var(--cc-gold);
}

.cc-lec-head-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(40px, 6vw, 88px);
    align-items: center;
    padding-block: clamp(56px, 8vw, 104px);
}

.cc-lec-title {
    margin: 0;
    font-family: var(--cc-serif);
    font-size: clamp(4.4rem, 3rem + 3.6vw, 7.2rem);
    font-weight: 500;
    line-height: 1.04;
    letter-spacing: -0.01em;
    color: #fff;
}

.cc-lec-sub {
    max-width: 46ch;
    margin: 24px 0 0;
    font-size: clamp(1.7rem, 1.6rem + 0.3vw, 1.95rem);
    line-height: 1.55;
    color: var(--cc-on-navy-muted);
}

/* Formulario (mismo partial que la home: home/alta) */
.cc-lec .cc-form { max-width: 520px; margin-top: 32px; }
.cc-lec .cc-form-row { display: flex; gap: 8px; padding: 6px; background: #fff; border-radius: 8px; }
.cc-lec .cc-form-input {
    flex: 1 1 auto; min-width: 0; height: 48px; padding: 0 14px;
    font: inherit; font-size: 1.6rem; color: var(--cc-ink); background: transparent; border: 0; outline: none;
}
.cc-lec .cc-form-input::placeholder { color: #6b7280; }
.cc-lec .cc-btn {
    display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center;
    height: 48px; padding: 0 22px; font: inherit; font-size: 1.5rem; font-weight: 600;
    cursor: pointer; border: 0; border-radius: 6px; transition: background-color 0.15s ease;
}
.cc-lec .cc-btn--gold { color: var(--cc-navy); background: var(--cc-gold); }
.cc-lec .cc-btn--gold:hover { background: #d8b878; }
.cc-lec .cc-btn-loading,
.cc-lec .cc-form-success,
.cc-lec .cc-form-error { display: none; }
.cc-lec .cc-form.loading .cc-btn-default { display: none; }
.cc-lec .cc-form.loading .cc-btn-loading { display: inline; }
.cc-lec .cc-form.success .cc-form-row,
.cc-lec .cc-form.success .cc-form-cta,
.cc-lec .cc-form.success .cc-form-privacy { display: none; }
.cc-lec .cc-form.success .cc-form-success {
    display: block; margin: 0; padding: 14px 16px; font-size: 1.5rem;
    color: var(--cc-navy); background: var(--cc-cream); border-radius: 8px;
}
.cc-lec .cc-form.error .cc-form-error { display: block; margin: 10px 0 0; font-size: 1.4rem; color: #ffb4a8; }
.cc-lec .cc-form-cta {
    margin: 16px 0 0;
    font-family: var(--cc-serif);
    font-size: clamp(1.8rem, 1.65rem + 0.35vw, 2.1rem);
    font-weight: 500;
    line-height: 1.35;
    color: var(--cc-gold);
}
.cc-lec .cc-form-privacy { margin: 8px 0 0; font-size: 1.3rem; line-height: 1.4; }
.cc-lec .cc-form-privacy a { color: var(--cc-on-navy-muted); text-decoration: underline; text-underline-offset: 3px; }
.cc-lec .cc-form-privacy a:hover { color: #fff; }

/* Última edición */
.cc-lec-latest {
    display: flex;
    flex-direction: column;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}
.cc-lec-latest:hover { opacity: 1; }

.cc-lec-latest-media {
    display: block;
    margin-bottom: 10px;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--cc-cream-2);
    border-radius: 4px;
    box-shadow: 0 24px 48px -24px rgb(0 0 0 / 0.55);
}
.cc-lec-latest-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.cc-lec-latest:hover .cc-lec-latest-media img { transform: scale(1.02); }

.cc-lec-latest-meta { font-size: 1.4rem; color: var(--cc-on-navy-muted); }
.cc-lec-latest-title {
    font-family: var(--cc-serif);
    font-size: clamp(2.4rem, 1.9rem + 1.1vw, 3.2rem);
    font-weight: 500;
    line-height: 1.22;
    color: #fff;
}
.cc-lec-latest:hover .cc-lec-latest-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }
.cc-lec-latest-more {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-top: 6px;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--cc-gold);
}

/* Flecha circular (cabecera y filas) */
.cc-lec-circle {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    font-size: 1.6rem;
    line-height: 1;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.cc-lec-latest:hover .cc-lec-circle { color: var(--cc-navy); background: var(--cc-gold); border-color: var(--cc-gold); }

/* ---------- Arte de marca cuando el post no tiene imagen ---------- */
.cc-lec-art {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    height: 100%;
    color: var(--cc-gold);
    background:
        repeating-linear-gradient(90deg, rgb(205 168 98 / 0.07) 0 1px, transparent 1px 28px),
        linear-gradient(135deg, var(--cc-navy-2) 0%, var(--cc-navy) 70%);
}
.cc-lec-art::before {                 /* filete dorado interior */
    content: "";
    position: absolute;
    inset: 8%;
    border: 1px solid rgb(205 168 98 / 0.55);
    pointer-events: none;
}
.cc-lec-art-kicker {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--cc-on-navy-muted);
}
.cc-lec-art-num {
    font-family: var(--cc-serif);
    font-weight: 500;
    line-height: 1;
    font-size: 2.2rem;
}
.cc-lec-art-num::before { content: "Nº\00a0" counter(cc-ed, cc-pad3); }
.cc-lec-art--big .cc-lec-art-num { font-size: clamp(5.6rem, 4rem + 4vw, 9.6rem); }
.cc-lec-art-num--last::before { content: "Nº\00a0" counter(cc-last, cc-pad3); }
.cc-lec-art--big { box-shadow: inset 0 0 0 1px rgb(205 168 98 / 0.25); }
.cc-lec-art--big .cc-lec-art-num::after {     /* rayita dorada bajo el número */
    content: "";
    display: block;
    width: 56px;
    height: 3px;
    margin: 18px auto 0;
    background: var(--cc-gold);
}
/* En /page/2/ y siguientes el contador no sabe el n.º real: monograma */
.is-later-page .cc-lec-art-num::before { content: "CC"; letter-spacing: 0.08em; }

/* ---------- Archivo ---------- */
.cc-lec-archive { padding-block: clamp(56px, 8vw, 96px); background: #fff; }

.cc-lec-archive-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px 32px;
    padding-bottom: 24px;
    border-bottom: 1.5px solid var(--cc-navy);
}
.cc-lec-h2 {
    margin: 0;
    font-family: var(--cc-serif);
    font-size: clamp(3rem, 2.4rem + 1.6vw, 4.4rem);
    font-weight: 500;
    line-height: 1.1;
    color: var(--cc-navy);
}
.cc-lec-count { margin: 0; font-size: 1.5rem; color: var(--cc-muted); }

.cc-lec-list { margin: 0; padding: 0; list-style: none; }
.cc-lec-item + .cc-lec-item { counter-increment: cc-ed -1; }
.cc-lec-item { border-bottom: 1px solid var(--cc-line); }

.cc-lec-row {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(16px, 3vw, 32px);
    padding-block: 20px;
    color: inherit;
    text-decoration: none;
}
.cc-lec-row:hover { opacity: 1; }

.cc-lec-thumb {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--cc-cream-2);
    border-radius: 3px;
    box-shadow: 0 0 0 1px var(--cc-line);
}
.cc-lec-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cc-lec-thumb .cc-lec-art::before { inset: 7px; }

.cc-lec-row-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cc-lec-row-meta { font-size: 1.35rem; color: var(--cc-muted); }
.cc-lec-row-title {
    font-family: var(--cc-serif);
    font-size: clamp(1.9rem, 1.7rem + 0.5vw, 2.4rem);
    font-weight: 500;
    line-height: 1.28;
    color: var(--cc-navy);
}
.cc-lec-row:hover .cc-lec-row-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.cc-lec-row .cc-lec-circle { color: var(--cc-navy); }
.cc-lec-row:hover .cc-lec-circle { color: #fff; background: var(--cc-navy); border-color: var(--cc-navy); }

.cc-lec-pages { display: flex; justify-content: space-between; gap: 16px; margin-top: 28px; font-size: 1.5rem; font-weight: 600; }
.cc-lec-pages:empty { display: none; }
.cc-lec-pages a { color: var(--cc-gold-dark); text-decoration: none; }
.cc-lec-pages a:hover { text-decoration: underline; }

.cc-lec-empty-kicker { margin: 0 0 8px; font-size: 1.2rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cc-gold-dark); }
.cc-lec-empty { margin: 0; font-size: 1.7rem; color: var(--cc-muted); }

/* Menos blanco sobre el pie (Source trae mucho margen) */
.cc-lec ~ .gh-footer { margin-top: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .cc-lec-head-grid { grid-template-columns: 1fr; gap: 48px; }
    .cc-lec-sub { max-width: none; }
}

@media (max-width: 600px) {
    .cc-lec-head-grid { padding-block: 44px 52px; }
    .cc-lec .cc-form-row { flex-direction: column; }
    .cc-lec .cc-btn { width: 100%; }
    .cc-lec-row { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding-block: 16px; }
    .cc-lec-row .cc-lec-circle { display: none; }     /* toda la fila es el enlace; la flecha ocupa sitio en móvil */
    .cc-lec-row-title { font-size: 1.8rem; }
    .cc-lec-row-meta { font-size: 1.25rem; }
    .cc-lec-thumb .cc-lec-art-num { font-size: 1.6rem; }
    .cc-lec-thumb .cc-lec-art::before { inset: 5px; }
}

@media (prefers-reduced-motion: reduce) {
    .cc-lec-latest-media img, .cc-lec-circle { transition: none; }
}
