/*
Theme Name: CHINA NEWS Diario
Description: Portada editorial y archivo de CHINA NEWS.
Version: 1.10.2
Requires PHP: 8.3
*/

:root {
    --paper: #ffffff;
    --ink: #171717;
    --muted: #575757;
    --line: #e0e1e9;
    --white: #fff;
    --accent: #cc0038;
    --accent-text: #a3162f;
    --tint: #f2f2f2;
    --display: "PolySans", "Bricolage Grotesque", Arial, sans-serif;
    --mono: "PolySans Mono", "IBM Plex Mono", monospace;
    --reading: "FK Roman Standard", Newsreader, Georgia, serif;
    --body: var(--display);
}

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

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 16px/1.55 var(--body);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: .2em; }

:focus-visible {
    outline: 3px solid #3159ea;
    outline-offset: 4px;
}

img { display: block; width: 100%; height: auto; }
figure, h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; }

.wrap {
    width: min(1280px, calc(100% - 72px));
    margin-inline: auto;
}

.skip {
    position: absolute;
    top: -10rem;
    left: 1rem;
    z-index: 10;
    padding: .55rem .85rem;
    background: var(--white);
}

.skip:focus { top: 1rem; }

.masthead {
    background: var(--white);
}

.masthead .masthead-inner {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    align-items: center;
    column-gap: clamp(10px, 1.6vw, 24px);
    min-height: 62px;
    padding-block: 6px;
}

.masthead-tools {
    justify-self: end;
}

.footer .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: 9px;
    white-space: nowrap;
}

.brand:hover { text-decoration: none; }

.brand-name {
    font: 800 clamp(23px, 2.2vw, 32px)/.95 var(--display);
    letter-spacing: -.085em;
}

.masthead-tools .button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 2px;
    background: var(--accent);
    color: white;
    font: 600 .68rem/1.15 var(--mono);
    letter-spacing: .045em;
    text-transform: uppercase;
    white-space: nowrap;
}

.masthead-tools .button:hover { background: #aa002c; text-decoration: none; }

.sections {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.sections a {
    flex-shrink: 0;
    font: 500 clamp(.84rem, 1.15vw, 1rem)/1.15 var(--display);
}

.sections a + a {
    position: relative;
    margin-inline-start: clamp(10px, 1.15vw, 17px);
    padding-inline-start: clamp(10px, 1.15vw, 17px);
}

.sections a + a::before {
    position: absolute;
    inset-inline-start: 0;
    inset-block: .1em;
    border-inline-start: 1px solid var(--line);
    content: "";
}

.sections a:hover, .sections a[aria-current] {
    color: var(--accent);
    text-decoration-thickness: 2px;
}

.home-lead {
    padding-block: clamp(16px, 1.7vw, 24px);
    background: #f0f2f4;
}

.feature-grid {
    display: grid;
    grid-template-columns: minmax(0, 2.4fr) minmax(240px, 1fr);
    gap: clamp(18px, 2.4vw, 32px);
    align-items: start;
}

.feature-cover, .article-cover, .desk-cover { position: relative; }
.feature-carousel { min-width: 0; }
.feature-slides { display: grid; }
.feature-slide {
    display: grid;
    grid-area: 1 / 1;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: clamp(160px, min(23vw, 36svh), 290px) 1fr 1fr;
    align-self: start;
    min-width: 0;
}
.feature-slide[inert] { visibility: hidden; }
.feature-cover { grid-area: 1 / 1 / 3; }
.feature-cover .feature-image {
    position: absolute;
    inset: 0;
    height: 100%;
    max-height: none;
    aspect-ratio: auto;
}
.carousel-controls:not([hidden]) {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 10px;
}
.carousel-controls button {
    min-width: 38px;
    min-height: 36px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--paper);
    color: var(--accent-text);
    font: 700 1.15rem var(--display);
    cursor: pointer;
}
.carousel-progress {
    position: absolute;
    inset: auto 0 0;
    height: 2px;
    overflow: hidden;
    background: #f7e6ea;
}
.carousel-progress span {
    display: block;
    height: 100%;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left center;
}
.carousel-controls button:hover { border-color: var(--accent); }
.feature-image { width: 100%; aspect-ratio: 2.05; overflow: hidden; background: #e9e9e9; }
.feature-image img { width: 100%; height: 100%; object-fit: cover; object-position: 57% 56%; }
.cover-placeholder {
    display: grid;
    place-items: center;
    height: 100%;
    background: var(--accent);
    color: white;
    font: 800 clamp(1rem, 4vw, 3rem)/1 var(--display);
    letter-spacing: -.06em;
}
.credit {
    position: absolute;
    right: 7px;
    top: 7px;
    display: flex;
    gap: 7px;
    padding: 3px 6px;
    background: white;
    color: var(--muted);
    font-size: .65rem;
}

.feature-copy {
    position: relative;
    grid-area: 2 / 1 / 4;
    width: min(85%, 680px);
    margin-inline-start: clamp(12px, 3.2vw, 52px);
    padding: clamp(14px, 2vw, 28px) clamp(17px, 2.7vw, 40px) clamp(13px, 1.7vw, 23px);
    background: white;
    box-shadow: 0 8px 32px #1c141607;
}

.eyebrow, .stamp {
    display: block;
    color: var(--accent);
    font: 600 .7rem/1.35 var(--mono);
    letter-spacing: .035em;
    text-transform: uppercase;
}

.feature-title {
    margin: .15em 0 .17em;
    font: 800 clamp(27px, 3.35vw, 42px)/1.08 var(--display);
    letter-spacing: -.045em;
    overflow-wrap: break-word;
}

.feature-title a:hover { color: var(--accent); text-decoration: none; }

.feature-copy p {
    max-width: 52ch;
    font: 400 clamp(1rem, 1.45vw, 1.19rem)/1.4 var(--body);
}

.text-link { display: inline-block; color: var(--accent); font-size: .86rem; font-weight: 800; }
.rail { min-width: 0; padding-top: 3px; }
.rail-heading { margin-bottom: 15px; }
.rail-heading h2 {
    display: inline-block;
    padding: 7px 12px;
    border-radius: 3px;
    background: var(--accent);
    color: white;
    font: 600 .75rem/1.3 var(--mono);
    text-transform: uppercase;
}
.news-item { margin-bottom: 25px; }
.rail .news-item {
    display: grid;
    grid-template-columns: clamp(56px, 5.5vw, 78px) minmax(0, 1fr);
    gap: 11px;
    align-items: center;
    margin-bottom: 11px;
}
.rail-thumbnail {
    display: grid;
    place-items: center;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 3px;
    background: var(--accent);
    color: white;
    font: 800 1.35rem/1 var(--display);
}
.rail-thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.rail .stamp { margin-bottom: 3px; font-size: .64rem; }
.rail .story-title { font-size: clamp(.95rem, 1.25vw, 1.1rem); line-height: 1.16; }
.rail-credits { color: var(--muted); font-size: .72rem; }
.rail-credits summary { cursor: pointer; }
.rail-credits ul { margin-top: 5px; padding-inline-start: 16px; }
.rail-credits a { text-decoration: underline; }
.stamp { margin-bottom: 6px; }
.story-title { font: 800 clamp(1.19rem, 2vw, 1.59rem)/1.05 var(--display); letter-spacing: -.03em; }
.empty { color: var(--muted); font-size: .95rem; }

.desks { margin-top: clamp(38px, 6vw, 76px); }
.desks h2 { margin-bottom: 18px; font: 800 clamp(25px, 3.2vw, 40px)/1 var(--display); }
.desk-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.desk h3 { margin-bottom: 10px; font: 800 1.15rem/1.15 var(--display); }
.desk h3 a { color: var(--accent-text); }
.desk-cover { margin-bottom: 8px; }
.desk-cover .feature-image { aspect-ratio: 2.2; }
.desk-story + .desk-story { margin-top: 10px; }
.desk-story h4 { margin: 0; font-size: clamp(.98rem, 1.5vw, 1.25rem); line-height: 1.15; }

.footer { margin-top: 55px; padding-block: 14px; background: var(--paper); }
.footer .wrap { min-height: 52px; flex-wrap: wrap; }
.footer strong { font: 800 1.27rem/1 var(--display); letter-spacing: -.06em; }
.footer nav { display: flex; flex-wrap: wrap; gap: 16px; font-size: .81rem; }

.article-page, .archive-page {
    max-width: 790px;
    min-height: 55vh;
    margin: 31px auto 0;
    padding: clamp(17px, 4vw, 43px);
    border-radius: 18px;
    background: var(--white);
}

.article-page h1, .archive-page h1 {
    margin-bottom: 17px;
    font-size: clamp(38px, 5vw, 69px);
    line-height: .99;
    letter-spacing: -.065em;
}

.article-body { margin-top: 20px; font: 400 1.2rem/1.55 var(--reading); }
.article-cover .feature-image { aspect-ratio: 2 / 1; max-height: 350px; }
.article-body p, .article-body ul, .article-body h2 { margin-bottom: .95em; }
.article-body a { color: var(--accent-text); text-decoration: underline; }
.archive-page .news-item p { margin-top: 5px; color: var(--muted); font-size: .88rem; }
.navigation.pagination { margin-top: 16px; }
.nav-links a, .nav-links span { padding-right: 12px; }

.menu-toggle {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    margin-inline-start: -8px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
}

.menu-toggle:hover { color: var(--accent); }

.menu-icon {
    position: relative;
    width: 25px;
    height: 15px;
    border-block: 2px solid currentColor;
}

.menu-icon::after {
    position: absolute;
    inset: 50% 0 auto;
    height: 2px;
    background: currentColor;
    transform: translateY(-50%);
    content: "";
}

.site-menu {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(100%, 460px);
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: var(--accent);
    color: white;
    box-shadow: 12px 0 48px #17171726;
    overscroll-behavior: contain;
}

.site-menu::backdrop { background: #17171730; }
.site-menu[open] { animation: menu-enter .2s ease-out; }
.site-menu :focus-visible { outline-color: white; }
html:has(.site-menu[open]) { overflow: hidden; }

@keyframes menu-enter {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
    .site-menu[open] { animation: none; }
}

.menu-panel { min-height: 100%; padding: clamp(17px, 4vw, 34px); }

.menu-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.menu-bar h2 { font: 600 .76rem/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; }

.menu-close {
    width: 40px;
    height: 40px;
    border: 0;
    background: transparent;
    color: white;
    font: 400 30px/1 var(--body);
    cursor: pointer;
}

.menu-close:hover { background: #0002; }

.menu-search {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 25px;
    padding: 4px;
    border-radius: 3px;
    background: white;
    color: var(--ink);
}

.menu-search input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 0;
    background: transparent;
    color: inherit;
    font: 500 1.04rem/1.2 var(--body);
}

.menu-search :focus-visible { outline-color: var(--accent); outline-offset: -1px; }

.menu-search button {
    display: grid;
    width: 42px;
    min-height: 42px;
    place-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
}

.search-icon {
    position: relative;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-radius: 50%;
}

.search-icon::after {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 7px;
    height: 2px;
    background: currentColor;
    transform: rotate(45deg);
    transform-origin: left center;
    content: "";
}

.menu-groups summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 0;
    color: inherit;
    font: 650 clamp(26px, 5vw, 36px)/1.08 var(--display);
    letter-spacing: -.04em;
    cursor: pointer;
    list-style: none;
}

.menu-groups summary::-webkit-details-marker { display: none; }
.menu-groups summary::after { content: "+" / ""; color: white; }
.menu-groups details[open] summary::after { content: "−" / ""; }
.menu-groups a { display: block; padding: 6px 10px; font-size: .92rem; }
.menu-groups a:last-child { margin-bottom: 11px; }
.menu-groups a[aria-current] { color: white; font-weight: 800; text-decoration: underline; }

@media (min-width: 661px) {
    .feature-image { max-height: min(340px, 40svh); }
    .feature-copy {
        width: min(91%, 735px);
        padding: 16px clamp(17px, 2.4vw, 34px) 15px;
    }
    .desks { margin-top: clamp(24px, 3vw, 43px); }
}

@media (max-width: 890px) {
    .wrap { width: calc(100% - 40px); }
    .feature-grid { grid-template-columns: minmax(0, 1fr) 230px; }
    .rail { padding: 16px; }
    .desk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .masthead .masthead-inner {
        grid-template-columns: auto minmax(0, 1fr) auto;
        column-gap: 9px;
        min-height: 58px;
    }
    .sections { display: none; }
}

@media (max-width: 660px) {
    .wrap { width: calc(100% - 28px); }
    .home-lead { padding-block: 12px; }
    .feature-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .feature-image { aspect-ratio: 1.8; }
    .feature-slide { grid-template-rows: clamp(130px, 40vw, 234px) 1fr 1fr; }
    .feature-title { font-size: clamp(24px, 6.3vw, 34px); }
    .rail { padding: 12px 0 0; }
    .desk-grid { grid-template-columns: 1fr; gap: 8px; }
    .footer .wrap { padding-block: 13px; }
}

@media (max-width: 360px) {
    .brand { gap: 6px; }
    .brand-name { font-size: 22px; }
    .masthead-tools .button span { display: none; }
}
