/* ==========================================================================
   B DE BLOG — editorial / cinematic design system
   Desktop, laptop & tablet (loaded when viewport >= 768px)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300..900&family=Space+Grotesk:wght@400;500;600&family=Literata:ital,opsz,wght@0,18..144,400;0,18..144,500;1,18..144,400&display=swap');

:root {
    /* -- Surfaces: warm near-black, never pure blue-black -- */
    --void: #0b0a08;
    --charcoal: #161410;
    --panel: #1b1815;
    --panel-hi: #262219;

    /* -- Lines -- */
    --line: rgba(236, 230, 216, 0.09);
    --line-strong: rgba(236, 230, 216, 0.20);

    /* -- Ink: aged paper, not pure white -- */
    --paper: #ece6d8;
    --paper-dim: #a49c88;
    --paper-faint: #6b6558;

    /* -- Accent: restrained, desaturated blood red -- */
    --red: #7c2530;
    --red-soft: #9c3540;

    /* -- Accent: aged brass (ratings, fine details) -- */
    --gold: #b4915a;
    --gold-soft: #cdae7c;

    /* -- Type families -- */
    --f-display: 'Fraunces', Georgia, serif;
    --f-ui: 'Space Grotesk', 'Segoe UI', sans-serif;
    --f-body: 'Literata', Georgia, serif;

    /* -- Fluid type scale: clamp(min, preferred, max), tuned for 768px-1920px --
       every size below is built from this scale — nothing is a one-off px value. */
    --fs-2xs: clamp(0.6875rem, 0.65rem + 0.15vw, 0.75rem);   /* 11   -> 12   */
    --fs-xs:  clamp(0.8125rem, 0.77rem + 0.22vw, 0.9375rem); /* 13   -> 15   */
    --fs-sm:  clamp(0.9375rem, 0.89rem + 0.24vw, 1.0625rem); /* 15   -> 17   */
    --fs-base:clamp(1.125rem, 1.05rem + 0.38vw, 1.3125rem);  /* 18   -> 21   */
    --fs-md:  clamp(1.375rem, 1.2rem + 0.9vw, 1.75rem);      /* 22   -> 28   */
    --fs-lg:  clamp(1.5rem, 1.28rem + 1.1vw, 2rem);          /* 24   -> 32   */
    --fs-xl:  clamp(2rem, 1.6rem + 2vw, 2.875rem);           /* 32   -> 46   */
    --fs-2xl: clamp(2.75rem, 2.05rem + 3.5vw, 4.75rem);      /* 44   -> 76   */
    --fs-3xl: clamp(3.5rem, 2.3rem + 6vw, 6.75rem);          /* 56   -> 108  */

    /* -- Fluid spacing -- */
    --sp-gutter: clamp(1.75rem, 1rem + 3.5vw, 3.5rem);
    --sp-section: clamp(3.5rem, 2.2rem + 6vw, 7.5rem);

    --nav-h: 104px;
    --radius: 3px;
    --radius-lg: 6px;
    --ease: cubic-bezier(.25, .7, .15, 1);
}

/* ---------------------------------------------------------------------- */
/* Reset / base                                                           */
/* ---------------------------------------------------------------------- */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background-color: var(--void);
    color: var(--paper);
    font-family: var(--f-body);
    font-size: var(--fs-base);
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    position: relative;

    /* atmosphere: soft top light, deep vignette, no hard grid — this is film, not a terminal */
    background-image:
        radial-gradient(ellipse 70% 50% at 50% -5%, rgba(124, 37, 48, 0.10), transparent 60%),
        radial-gradient(ellipse 130% 90% at 50% 115%, rgba(0, 0, 0, 0.85), transparent 55%);
    background-attachment: fixed;
}

body::after {
    /* film grain, generated — no image asset */
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    opacity: 0.04;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3 { margin: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: var(--red); color: var(--paper); }

::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-track { background: var(--void); }
::-webkit-scrollbar-thumb { background: var(--panel-hi); border: 2px solid var(--void); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--red); }

/* ---------------------------------------------------------------------- */
/* Banner / navigation — a masthead, not a toolbar                       */
/* ---------------------------------------------------------------------- */

.banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.6rem var(--sp-gutter);
    background: rgba(11, 10, 8, 0.72);
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    border-bottom: 1px solid var(--line);
    transition: padding .4s var(--ease), background .4s var(--ease);
}

.banner.scrolled {
    padding: 0.85rem var(--sp-gutter);
    background: rgba(8, 7, 6, 0.92);
    border-bottom-color: var(--line-strong);
}

.banner-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
}

.banner-title {
    font-family: var(--f-display);
    font-optical-sizing: auto;
    font-weight: 600;
    font-style: italic;
    font-size: clamp(1.5rem, 1.3rem + 0.7vw, 1.875rem);
    letter-spacing: 0.01em;
    color: var(--paper);
    transition: font-size .4s var(--ease);
}

.banner.scrolled .banner-title { font-size: clamp(1.125rem, 1rem + 0.4vw, 1.375rem); }

.banner-image {
    height: 5.75rem;
    width: auto;
    margin-left: 1.5rem;
    opacity: 0.92;
    filter: sepia(0.15) saturate(1.1);
    transition: height .4s var(--ease);
}

.banner.scrolled .banner-image { height: 3rem; }

.banner-menu {
    display: flex;
    align-items: center;
    gap: clamp(1.5rem, 1.2rem + 1vw, 2.25rem);
}

.menu-button {
    font-family: var(--f-ui);
    font-weight: 500;
    font-size: var(--fs-xs);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 0.6rem 0;
    background: none;
    color: var(--paper-dim);
    border: none;
    border-bottom: 1px solid transparent;
    cursor: pointer;
    transition: color .3s var(--ease), border-color .3s var(--ease);
}

.menu-button:hover,
.menu-button.active {
    color: var(--paper);
    border-bottom-color: var(--red-soft);
}

/* ---------------------------------------------------------------------- */
/* Hero (home) — asymmetric, editorial masthead                          */
/* ---------------------------------------------------------------------- */

.hero {
    width: 100%;
    max-width: 1280px;
    margin-top: calc(var(--nav-h) + var(--sp-section));
    padding: 0 var(--sp-gutter) var(--sp-section);
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
    gap: clamp(2rem, 1.2rem + 3vw, 4.5rem);
}

.hero-copy { text-align: left; }

.hero-kicker {
    display: block;
    font-family: var(--f-ui);
    font-size: var(--fs-xs);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--red-soft);
    margin-bottom: 1.5rem;
}

.hero-title {
    font-family: var(--f-display);
    font-optical-sizing: auto;
    font-weight: 340;
    font-style: italic;
    font-size: var(--fs-3xl);
    line-height: 0.98;
    color: var(--paper);
}

.hero-title em {
    font-style: normal;
    font-weight: 600;
    color: var(--gold-soft);
}

.hero-subtitle {
    margin-top: 1.75rem;
    max-width: 32rem;
    font-family: var(--f-body);
    font-size: var(--fs-base);
    line-height: 1.8;
    color: var(--paper-dim);
}

.hero-divider {
    width: 3rem;
    height: 1px;
    margin: 2.5rem 0;
    background: var(--line-strong);
}

.hero-actions {
    display: flex;
    gap: 2.25rem;
    align-items: center;
    flex-wrap: wrap;
}

.hero-cta {
    font-family: var(--f-ui);
    font-weight: 500;
    font-size: var(--fs-xs);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    transition: color .3s var(--ease), gap .3s var(--ease);
}

.hero-cta.primary {
    padding: 1.05rem 2rem;
    background: var(--paper);
    color: var(--void);
    border-radius: var(--radius);
}

.hero-cta.primary:hover { background: var(--gold-soft); }

.hero-cta.ghost {
    background: none;
    color: var(--paper-dim);
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--line-strong);
}

.hero-cta.ghost:hover { color: var(--paper); border-bottom-color: var(--paper); gap: 0.875rem; }

.hero-portrait {
    position: relative;
    aspect-ratio: 4 / 5;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--line-strong);
    background: var(--panel);
}

.hero-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(0.5) contrast(1.08) brightness(0.8) sepia(0.12);
}

.hero-portrait::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(11,10,8,0.15), rgba(11,10,8,0.55) 100%);
}

/* ---------------------------------------------------------------------- */
/* Page header (Historias / Reseñas)                                      */
/* ---------------------------------------------------------------------- */

.page-header {
    width: 100%;
    max-width: 1280px;
    margin-top: calc(var(--nav-h) + clamp(2.5rem, 1.8rem + 3vw, 4.5rem));
    padding: 0 var(--sp-gutter);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 2.5rem;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--line);
    padding-bottom: clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem);
}

.page-kicker {
    display: block;
    font-family: var(--f-ui);
    font-size: var(--fs-xs);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--red-soft);
    margin-bottom: 1.125rem;
}

.page-title {
    font-family: var(--f-display);
    font-optical-sizing: auto;
    font-weight: 340;
    font-style: italic;
    font-size: var(--fs-2xl);
    color: var(--paper);
    line-height: 1;
}

.page-subtitle {
    max-width: 22rem;
    color: var(--paper-dim);
    font-family: var(--f-body);
    font-size: var(--fs-sm);
    line-height: 1.7;
    text-align: right;
}

/* ---------------------------------------------------------------------- */
/* Category tabs (e.g. Historias sueltas / Escuadrón Imposible)           */
/* ---------------------------------------------------------------------- */

.category-tabs {
    display: flex;
    justify-content: center;
    gap: clamp(1.75rem, 1.4rem + 1.5vw, 3rem);
    width: 100%;
    max-width: 1280px;
    margin: clamp(2rem, 1.5rem + 2vw, 3rem) 0 0;
    padding: 0 var(--sp-gutter);
}

.category-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0 0 0.75rem;
    font-family: var(--f-ui);
    font-weight: 500;
    font-size: var(--fs-xs);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--paper-faint);
    cursor: pointer;
    transition: color .3s var(--ease), border-color .3s var(--ease);
}

.category-tab:hover { color: var(--paper-dim); }

.category-tab.is-active {
    color: var(--paper);
    border-bottom-color: var(--gold-soft);
}

/* ---------------------------------------------------------------------- */
/* Editorial card grid — one featured cover, rest as an index             */
/* ---------------------------------------------------------------------- */

.card-grid {
    width: 100%;
    max-width: 1280px;
    margin: clamp(2.5rem, 1.8rem + 3vw, 4.5rem) 0 var(--sp-section);
    padding: 0 var(--sp-gutter);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.25rem clamp(1.5rem, 1rem + 2vw, 2.5rem);
}

.story-card {
    position: relative;
    display: block;
    overflow: hidden;
    background: var(--panel);
    border-top: 1px solid var(--line);
    padding-top: 1.5rem;
    cursor: pointer;
    transition: opacity .22s var(--ease), transform .22s var(--ease);
}

/* !important here is deliberate: .story-card also carries the scroll-reveal
   .reveal/.in-view classes (see interactions.js), which declare their own
   opacity/transform/transition on the same properties. The category filter
   must always win regardless of reveal state or class order. */
.story-card.is-category-hidden {
    opacity: 0 !important;
    transform: translateY(10px) !important;
    transition-duration: .22s !important;
    transition-timing-function: var(--ease) !important;
    pointer-events: none;
}

/* !important is deliberate: .featured sets its own `display: grid` at the
   same specificity (two classes) and is declared later in this file, so
   without it a hidden-but-featured card would win the cascade tie and stay
   visible regardless of category — confirmed live before adding this. */
.story-card.is-category-removed {
    display: none !important;
}

.story-card-media-wrap {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: var(--radius);
}

.story-card-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(0.45) contrast(1.08) brightness(0.66) sepia(0.08);
    transform: scale(1.03);
    transition: filter .8s var(--ease), transform 1.4s var(--ease);
}

.story-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(11,10,8,0) 40%, rgba(11,10,8,0.75) 100%);
}

.story-card-index {
    position: absolute;
    top: 0.875rem;
    left: 0.875rem;
    font-family: var(--f-ui);
    font-size: var(--fs-2xs);
    letter-spacing: 0.14em;
    color: var(--paper-dim);
}

.story-card-body {
    padding-top: 1.125rem;
}

.story-card-author {
    display: block;
    font-family: var(--f-ui);
    font-size: var(--fs-2xs);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold-soft);
    margin-bottom: 0.5rem;
}

.story-card-title {
    font-family: var(--f-display);
    font-optical-sizing: auto;
    font-weight: 480;
    font-size: var(--fs-lg);
    line-height: 1.22;
    color: var(--paper);
    transition: color .3s var(--ease);
}

.story-card-rating {
    display: block;
    margin-top: 0.5rem;
    font-family: var(--f-ui);
    font-size: var(--fs-2xs);
    letter-spacing: 0.04em;
    color: var(--gold-soft);
    opacity: 0.85;
}

.story-card-arrow {
    display: inline-block;
    margin-top: 0.75rem;
    font-family: var(--f-ui);
    font-size: var(--fs-2xs);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--paper-faint);
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity .35s var(--ease), transform .35s var(--ease);
}

.story-card:hover .story-card-media {
    filter: grayscale(0.1) contrast(1.05) brightness(0.9) sepia(0.03);
    transform: scale(1.08);
}

.story-card:hover .story-card-title { color: var(--gold-soft); }
.story-card:hover .story-card-arrow { opacity: 1; transform: translateX(0); }

/* Featured (first) card spans the full width, image on one side, copy on the other */
.story-card.featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: clamp(1.5rem, 1rem + 2vw, 2.75rem);
    align-items: center;
    padding-top: 0;
    border-top: none;
    padding-bottom: clamp(2rem, 1.5rem + 2vw, 3.5rem);
    border-bottom: 1px solid var(--line);
    margin-bottom: 1.5rem;
}

.story-card.featured .story-card-media-wrap { aspect-ratio: 16 / 10; }
.story-card.featured .story-card-index { top: 1.125rem; left: 1.125rem; }
.story-card.featured .story-card-body { padding-top: 0; }
.story-card.featured .story-card-author { font-size: var(--fs-xs); }
.story-card.featured .story-card-title { font-size: var(--fs-xl); font-weight: 440; }

/* ---------------------------------------------------------------------- */
/* Article layout (stories & reviews)                                     */
/* ---------------------------------------------------------------------- */

.container {
    width: 88%;
    max-width: 44rem;
    margin: 0 auto;
    padding: 0 1.25rem;
    margin-top: calc(var(--nav-h) + clamp(3rem, 2.2rem + 3vw, 5.5rem));
    text-align: left;
}

.story-title {
    font-family: var(--f-display);
    font-optical-sizing: auto;
    font-weight: 360;
    font-style: italic;
    font-size: var(--fs-2xl);
    line-height: 1.06;
    color: var(--paper);
    text-align: center;
    overflow-wrap: break-word;
}

.container::before {
    content: '';
    display: block;
    width: 2.5rem;
    height: 1px;
    margin: 1.75rem auto 2.75rem;
    background: var(--line-strong);
}

.story-text {
    width: 100%;
    margin: 0 auto;
    text-align: justify;
    hyphens: auto;
    font-family: var(--f-body);
    font-size: var(--fs-base);
    line-height: 1.95;
    color: var(--paper-dim);
}

.story-text p { margin: 0 0 1.7em; }

.story-text p:first-of-type::first-letter {
    font-family: var(--f-display);
    font-weight: 500;
    font-size: clamp(3.5rem, 3rem + 1.5vw, 4.5rem);
    line-height: 0.72;
    float: left;
    padding: 0.5rem 0.625rem 0 0;
    color: var(--red-soft);
}

.story-text em { color: var(--paper); font-style: italic; }

.story-author {
    display: block;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
    font-family: var(--f-ui);
    font-style: normal;
    font-weight: 500;
    font-size: var(--fs-xs);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-align: right;
    color: var(--gold-soft);
}

.image-container {
    width: 100%;
    margin: 3rem auto 0;
    text-align: center;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--line);
}

.story-image {
    max-width: 100%;
    height: auto;
    display: block;
    filter: grayscale(0.15) contrast(1.05) brightness(0.92) sepia(0.05);
    transition: filter .8s var(--ease);
}

.image-container:hover .story-image { filter: none; }

/* ---------------------------------------------------------------------- */
/* Series navigation (prev/next between parts of a multi-part story)      */
/* ---------------------------------------------------------------------- */

.series-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    width: 100%;
    margin: 2.5rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
}

.series-nav-link {
    font-family: var(--f-ui);
    font-weight: 500;
    font-size: var(--fs-xs);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--paper-dim);
    border-bottom: 1px solid var(--line-strong);
    padding-bottom: 0.2rem;
    transition: color .3s var(--ease), border-color .3s var(--ease);
}

.series-nav-link:hover { color: var(--gold-soft); border-color: var(--gold-soft); }

.series-nav-prev { justify-self: start; }
.series-nav-next { justify-self: end; }

.series-nav-label {
    justify-self: center;
    font-family: var(--f-display);
    font-style: italic;
    font-size: var(--fs-sm);
    color: var(--paper-faint);
    white-space: nowrap;
}

/* ---------------------------------------------------------------------- */
/* Rating widget                                                          */
/* ---------------------------------------------------------------------- */

.rating-container {
    width: 100%;
    margin: 3.75rem auto 0;
    padding: 2rem 1.75rem;
    text-align: center;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

.rating-container h3 {
    font-family: var(--f-ui);
    font-weight: 500;
    font-size: var(--fs-xs);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--paper-dim);
    margin-bottom: 1.375rem;
}

.stars-average {
    display: flex;
    justify-content: center;
    gap: 0.625rem;
}

.star {
    --star-shape: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    position: relative;
    width: 2.25rem;
    height: 2.25rem;
    clip-path: var(--star-shape);
    background: var(--panel-hi);
    box-shadow: 0 0 0 1px var(--line) inset;
    cursor: pointer;
    transition: transform .3s var(--ease);
}

.star:hover { transform: scale(1.12); }

.star::before {
    content: '';
    position: absolute;
    inset: 0;
    clip-path: var(--star-shape);
    background: linear-gradient(160deg, var(--gold-soft), var(--gold));
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 var(--fill, 0%), transparent var(--fill, 0%));
    mask-image: linear-gradient(90deg, #000 0, #000 var(--fill, 0%), transparent var(--fill, 0%));
    transition: mask-image .6s var(--ease), -webkit-mask-image .6s var(--ease);
}

.rating-count {
    margin: 0.75rem 0 0;
    font-family: var(--f-ui);
    font-size: var(--fs-2xs);
    letter-spacing: 0.06em;
    color: var(--paper-faint);
}

#rating-msg {
    margin: 1.125rem 0 0;
    min-height: 1.4em;
    font-family: var(--f-ui);
    font-size: var(--fs-xs);
    color: var(--gold-soft);
}

/* ---------------------------------------------------------------------- */
/* Comments                                                                */
/* ---------------------------------------------------------------------- */

.comments-section {
    width: 100%;
    margin: 3.75rem auto 0;
    text-align: left;
}

.comments-section h3 {
    font-family: var(--f-ui);
    font-weight: 500;
    font-size: var(--fs-xs);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--paper-dim);
    margin-bottom: 1.25rem;
}

.comment-form {
    padding: 1.75rem;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

.comment-field {
    margin-bottom: 1.125rem;
}

.comment-field label {
    display: block;
    font-family: var(--f-ui);
    font-size: var(--fs-2xs);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--paper-faint);
    margin-bottom: 0.5rem;
}

.comment-apodo-field,
.comment-texto-field {
    width: 100%;
    background: var(--void);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    color: var(--paper);
    font-family: var(--f-body);
    font-size: var(--fs-sm);
    padding: 0.75rem 0.875rem;
    transition: border-color .3s var(--ease);
}

.comment-texto-field {
    resize: vertical;
    min-height: 6rem;
    line-height: 1.6;
    font-family: inherit;
}

.comment-apodo-field:focus,
.comment-texto-field:focus {
    outline: none;
    border-color: var(--gold-soft);
}

.comment-counter {
    display: block;
    margin-top: 0.5rem;
    text-align: right;
    font-family: var(--f-ui);
    font-size: var(--fs-2xs);
    color: var(--paper-faint);
}

.comment-counter.over-limit { color: var(--red-soft); }

.comment-submit {
    font-family: var(--f-ui);
    font-weight: 500;
    font-size: var(--fs-xs);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 0.85rem 1.75rem;
    background: var(--paper);
    color: var(--void);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background .3s var(--ease);
}

.comment-submit:hover { background: var(--gold-soft); }

.comment-feedback {
    margin: 1rem 0 0;
    min-height: 1.4em;
    font-family: var(--f-ui);
    font-size: var(--fs-xs);
    color: var(--gold-soft);
}

.comment-feedback.is-error { color: var(--red-soft); }

.comments-list {
    margin-top: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.comments-empty {
    margin-top: 1.75rem;
    font-family: var(--f-ui);
    font-size: var(--fs-xs);
    color: var(--paper-faint);
}

.comment-item {
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

.comment-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.comment-author {
    font-family: var(--f-ui);
    font-weight: 500;
    font-size: var(--fs-xs);
    letter-spacing: 0.04em;
    color: var(--gold-soft);
}

.comment-fecha {
    font-family: var(--f-ui);
    font-size: var(--fs-2xs);
    color: var(--paper-faint);
    white-space: nowrap;
}

.comment-body {
    margin: 0;
    font-family: var(--f-body);
    font-size: var(--fs-sm);
    line-height: 1.7;
    color: var(--paper-dim);
    overflow-wrap: break-word;
}

/* ---------------------------------------------------------------------- */
/* Classified dossier insert (in-story document prop, e.g. Escuadrón      */
/* Imposible Parte 2) — scoped entirely to .expediente*, never touches    */
/* .story-text or any other paragraph, card, rating, or comment style.    */
/* ---------------------------------------------------------------------- */

.expediente {
    max-width: 560px;
    margin: 2.75rem auto;
    padding: 1.75rem 2rem 2rem;
    background: #e7e0cb;
    color: #2b2620;
    border: 1px solid #b9ae8f;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.15);
    font-family: "Courier New", Courier, monospace;
    font-size: 0.9375rem;
    line-height: 1.55;
    text-align: left;
}

.expediente-header {
    text-align: center;
    margin-bottom: 1rem;
}

.expediente-header p {
    margin: 0 0 0.375rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.8125rem;
}

.expediente-reservado {
    display: inline-block;
    margin-top: 0.5rem !important;
    padding: 0.2rem 0.7rem;
    border: 2px solid #7a1f22;
    color: #7a1f22;
    letter-spacing: 0.12em;
    transform: rotate(-2deg);
    font-size: 0.75rem !important;
}

.expediente hr {
    border: none;
    border-top: 1px dashed #a89c7a;
    margin: 1rem 0 1.25rem;
}

.expediente p {
    margin: 0 0 0.5rem;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    text-align: left;
}

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

.expediente strong {
    font-weight: 700;
    color: #1b1712;
}

/* The story's drop-cap rule (.story-text p:first-of-type::first-letter)
   matches any <p> that is the first <p> among its own siblings — which
   includes the dossier's nested paragraphs (M in "Ministerio", N in
   "Nombre"), since :first-of-type is scoped per-parent, not globally to
   .story-text. Reset it back to plain typewriter text inside the dossier
   only; the real story drop cap is untouched everywhere else. */
.expediente p::first-letter,
.expediente-header p::first-letter {
    font-size: inherit !important;
    font-family: inherit !important;
    font-weight: inherit !important;
    color: inherit !important;
    float: none !important;
    line-height: inherit !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ---------------------------------------------------------------------- */
/* Scroll-reveal utility (driven by static/interactions.js)               */
/* transition lives on the REVEALED state only — the hidden state must    */
/* apply instantly or the reveal itself becomes a visible fade-to-black.  */
/* ---------------------------------------------------------------------- */

.reveal {
    opacity: 0;
    transform: translateY(20px);
}

.reveal.in-view {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 1s var(--ease), transform 1s var(--ease);
}

/* ---------------------------------------------------------------------- */
/* Site footer (injected at runtime by static/interactions.js)            */
/* ---------------------------------------------------------------------- */

.site-footer {
    width: 100%;
    margin-top: var(--sp-section);
    padding: 3rem 2.5rem 2.75rem;
    text-align: center;
    border-top: 1px solid var(--line);
}

.site-footer img {
    width: 2.125rem;
    height: auto;
    margin: 0 auto 1rem;
    opacity: 0.7;
    filter: grayscale(0.4) sepia(0.15);
}

.site-footer p {
    margin: 0.25rem 0;
    font-family: var(--f-ui);
    font-size: var(--fs-xs);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--paper-faint);
}

.site-footer strong { color: var(--paper-dim); }

/* ---------------------------------------------------------------------- */
/* Tablet / small laptop (768px – 1024px): the 2/3-column layouts above   */
/* get cramped here, so stack them instead of shrinking everything.       */
/* ---------------------------------------------------------------------- */

@media (max-width: 1024px) {
    .hero {
        grid-template-columns: 1fr;
        gap: clamp(2rem, 4vw, 3rem);
    }

    .hero-portrait { aspect-ratio: 16 / 9; order: -1; }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .page-subtitle { text-align: left; max-width: 34rem; }

    .card-grid { grid-template-columns: repeat(2, 1fr); }

    .story-card.featured {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}
