/* SWC Archive theme — News: the index and category pages (template-parts/news-index.php, news-card.php) and single
   posts (template-parts/news-post.php). Loaded on those pages only (functions.php), after badge.css, which holds the
   page background, colours, title band, sheet, frame and bottom strip. Index: dark cards on the starfield, like the
   archive pages. Post: the badge sheet with a sidebar. */

/* ---- Index ---- */
.swc-news {
    max-width: 1180px;
    margin: 0 auto;
    padding: 40px 22px 80px;
}
.swc-news-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    gap: 24px;
    align-items: center;
    padding: clamp(24px, 4vw, 44px);
    border: 1px solid var(--news-line);
    border-radius: 30px;
    background: var(--news-card);
}
.swc-news-hero__title {
    margin: 0 0 12px;
    color: #fff;
    font-size: clamp(2.2rem, 5.5vw, 3.6rem);
    font-weight: 800;
    line-height: 0.96;
    letter-spacing: -0.045em;
    text-transform: uppercase;
    text-wrap: balance;
}
.swc-news-hero__intro { margin: 0; max-width: 46ch; color: #c8d4e8; font-size: 1.05rem; line-height: 1.6; }
.swc-news-next {
    display: flex;
    flex-direction: column;
    padding: 22px 24px;
    border: 1px solid var(--news-line);
    border-radius: 22px;
    background: rgba(2, 8, 23, 0.45);
    color: var(--news-text);
    text-decoration: none;
    transition: border-color 0.15s ease;
}
.swc-news-next:hover, .swc-news-next:focus-visible { border-color: rgba(246, 200, 76, 0.6); color: var(--news-text); }
.swc-news-next__count { color: #fff; font-size: clamp(2.4rem, 5vw, 3.2rem); font-weight: 800; line-height: 1; letter-spacing: -0.04em; }
.swc-news-next__unit { margin: 4px 0 14px; color: var(--news-muted); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.swc-news-next__name { color: #fff; font-weight: 800; }
.swc-news-next__dates { color: var(--news-muted); font-size: 0.9rem; }

.swc-news-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 22px; }
.swc-chip {
    padding: 7px 15px;
    border: 1px solid rgba(246, 200, 76, 0.45);
    border-radius: 999px;
    color: var(--news-gold);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-decoration: none;
}
.swc-chip:hover, .swc-chip:focus-visible { background: rgba(246, 200, 76, 0.12); color: var(--news-gold); }
.swc-chip.is-current { background: var(--news-gold); border-color: var(--news-gold); color: #241a00; }

.swc-news-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--news-line);
    border-radius: 22px;
    background: var(--news-card);
    transition: border-color 0.15s ease;
}
.swc-news-card:hover, .swc-news-card:focus-within { border-color: rgba(246, 200, 76, 0.5); }
.swc-news-card__media { position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 9; background: #13233f; }
/* Absolutely placed, so the image's own height cannot stretch the 16:9 frame. */
.swc-news-card__media img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.swc-news-card__placeholder {
    display: flex; align-items: center; justify-content: center; height: 100%;
    color: rgba(246, 200, 76, 0.55); font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.8rem;
}
.swc-news-card__body { display: flex; flex-direction: column; flex: 1; padding: 18px 20px 20px; }
.swc-news-card__title { margin: 0 0 8px; font-size: 1.12rem; font-weight: 800; line-height: 1.25; }
.swc-news-card__title a { color: #fff; text-decoration: none; }
.swc-news-card__title a::after { content: ""; position: absolute; inset: 0; }
.swc-news-card { position: relative; }
.swc-news-card__title a:focus-visible { outline: none; }
.swc-news-card:focus-within { outline: 2px solid var(--news-gold); outline-offset: 2px; }
.swc-news-card__excerpt { margin: 0 0 12px; color: #c8d4e8; line-height: 1.6; }
.swc-news-card__meta { margin: auto 0 0; color: var(--news-muted); font-size: 0.82rem; }

.swc-news-card--featured { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: stretch; margin-bottom: 18px; }
/* The image fills its whole column. An aspect-ratio here would let the row height set the width (the column was
   left half empty); the image is absolutely placed, so a portrait photo cannot make the card tall either. */
.swc-news-card--featured .swc-news-card__media { width: 100%; aspect-ratio: auto; min-height: 360px; }
.swc-news-card--featured .swc-news-card__body { justify-content: center; padding: clamp(22px, 3vw, 36px); }
.swc-news-card--featured .swc-news-card__title { font-size: clamp(1.4rem, 2.6vw, 2rem); line-height: 1.1; letter-spacing: -0.02em; text-transform: uppercase; }
.swc-news-card--featured .swc-news-card__meta { margin-top: 0; }

.swc-news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }

.swc-news-pagination { margin-top: 32px; }
.swc-news-pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.swc-news-pagination .page-numbers {
    min-width: 40px; padding: 8px 12px; border: 1px solid var(--news-line); border-radius: 999px;
    color: var(--news-text); text-align: center; text-decoration: none; font-weight: 700;
}
.swc-news-pagination .page-numbers.current { background: var(--news-gold); border-color: var(--news-gold); color: #241a00; }
.swc-news-pagination .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.swc-news-empty { padding: 36px; border: 1px solid var(--news-line); border-radius: 22px; background: var(--news-card); }
.swc-news-empty h2 { margin: 0 0 8px; color: #fff; font-size: 1.3rem; }
.swc-news-empty p { margin: 0; color: #c8d4e8; }
.swc-news-empty a { color: var(--news-gold); }

@media (max-width: 900px) {
    .swc-news-hero, .swc-news-card--featured { grid-template-columns: 1fr; }
    .swc-news-card--featured .swc-news-card__media { aspect-ratio: 16 / 9; }
    .swc-news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .swc-news { padding: 24px 16px 56px; }
    .swc-news-hero { border-radius: 22px; }
    .swc-news-grid { grid-template-columns: 1fr; }
}

/* ---- Single post ---- */
.swc-post__sheet {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: clamp(32px, 3.5vw, 48px);
}
.swc-post__sheet > .swc-badge-foot { grid-column: 1 / -1; margin-top: 0; }
.swc-post__main { max-width: 760px; min-width: 0; }

.swc-post__image { margin: 0 0 28px; }
.swc-post__image img { display: block; width: 100%; height: auto; max-height: 520px; object-fit: cover; border-radius: 12px; }
.swc-post__image figcaption { margin-top: 8px; color: var(--sheet-muted); font-size: 0.82rem; }

.swc-post__content {
    font-family: Charter, "Iowan Old Style", Georgia, Cambria, serif;
    font-size: 1.22rem;
    line-height: 1.75;
}
.swc-post__content > * { margin-top: 0; margin-bottom: 1.25em; }
.swc-post__content h2, .swc-post__content h3, .swc-post__content h4 {
    margin: 1.8em 0 0.6em;
    color: #0b1730;
    font-family: var(--global-body-font-family);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.01em;
}
.swc-post__content h2 { font-size: 1.5rem; }
.swc-post__content h3 { font-size: 1.22rem; }
.swc-post__content a { color: var(--sheet-link); text-decoration: underline; text-underline-offset: 0.15em; }
.swc-post__content a:hover { text-decoration-thickness: 2px; }
.swc-post__content img { max-width: 100%; height: auto; border-radius: 10px; }
.swc-post__content figcaption { color: var(--sheet-muted); font-family: var(--global-body-font-family); font-size: 0.82rem; }
.swc-post__content ul, .swc-post__content ol { padding-left: 1.3em; }
.swc-post__content li + li { margin-top: 0.35em; }
.swc-post__content blockquote {
    margin-left: 0; padding: 0.2em 0 0.2em 1.1em; border-left: 3px solid var(--sheet-line); color: #3a4152; font-style: italic;
}
.swc-post__content hr { border: 0; border-top: 1px solid var(--sheet-line); }
.swc-post__content table { width: 100%; border-collapse: collapse; font-family: var(--global-body-font-family); font-size: 0.95rem; }
.swc-post__content th, .swc-post__content td { padding: 8px 10px; border-bottom: 1px solid var(--sheet-line); text-align: left; }

/* "At a glance" (Group block style registered by the plugin's news module). */
.swc-post__content .is-style-swc-glance {
    padding: 4px 0 4px 18px;
    border-left: 3px solid #d4a72c;
    font-family: var(--global-body-font-family);
    font-size: 1rem;
    line-height: 1.6;
}
.swc-post__content .is-style-swc-glance > :first-child { margin-top: 0; }
.swc-post__content .is-style-swc-glance > :last-child { margin-bottom: 0; }
.swc-post__content .is-style-swc-glance > * { margin: 0 0 0.5em; }
.swc-post__content .is-style-swc-glance h2,
.swc-post__content .is-style-swc-glance h3,
.swc-post__content .is-style-swc-glance h4 {
    color: #8a6a10; font-size: 0.74rem; font-weight: 900; letter-spacing: 0.13em; text-transform: uppercase;
}

.swc-post__archive {
    margin: 32px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--sheet-line);
    font-size: 0.95rem;
}
.swc-post__archive span { color: var(--sheet-muted); font-weight: 700; }
.swc-post__archive a { color: var(--sheet-link); }

/* Comments sit on the sheet: no second box. */
.swc-post .swc-comments { margin: 40px 0 0; padding: 28px 0 0; border-top: 1px solid var(--sheet-line); background: transparent; box-shadow: none; }

/* Sidebar: panels on a warm tint, led by the dark Next Celebration card (the site's signature look). */
.swc-post__side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.swc-side-block { padding: 20px 22px; border: 1px solid var(--sheet-line); border-radius: 18px; background: #f2eee3; }
.swc-side-block__title {
    margin: 0 0 14px; color: #8a6a10; font-size: 0.74rem; font-weight: 900; letter-spacing: 0.13em; text-transform: uppercase;
}
.swc-side-list, .swc-side-links { margin: 0; padding: 0; list-style: none; }
.swc-side-list li + li { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--sheet-line); }
.swc-side-list a { display: flex; gap: 12px; align-items: flex-start; color: var(--sheet-text); text-decoration: none; }
.swc-side-list strong { display: block; font-weight: 800; line-height: 1.3; }
.swc-side-list small { display: block; margin-top: 3px; color: var(--sheet-muted); font-size: 0.78rem; }
.swc-side-list a:hover strong, .swc-side-list a:focus-visible strong { color: var(--sheet-link); text-decoration: underline; }
.swc-side-list img { flex: none; width: 72px; height: 54px; object-fit: cover; border-radius: 8px; }

.swc-side-links li + li { border-top: 1px solid var(--sheet-line); }
.swc-side-links a {
    display: flex; align-items: baseline; gap: 10px;
    padding: 10px 0; color: var(--sheet-text); font-weight: 800; text-decoration: none;
}
.swc-side-links li:first-child a { padding-top: 0; }
.swc-side-links li:last-child a { padding-bottom: 0; }
.swc-side-links span { margin-left: auto; color: var(--sheet-muted); font-size: 0.82rem; font-weight: 700; white-space: nowrap; }
.swc-side-links a::after { content: "\203A"; color: #b08a1a; font-size: 1.2rem; line-height: 1; }
.swc-side-links a:hover, .swc-side-links a:focus-visible { color: var(--sheet-link); }

.swc-side-next {
    display: block; padding: 22px 22px 20px; border-radius: 18px;
    background: url("../img/starfield.svg") 120px 80px / 800px 600px repeat, linear-gradient(135deg, #0b1830 0%, #10284a 54%, #0c1f3a 100%);
    color: #e5edf8; text-decoration: none; box-shadow: 0 14px 30px rgba(4, 12, 24, 0.18);
}
.swc-side-next .swc-kicker { margin-bottom: 10px; }
.swc-side-next__count { display: block; color: #fff; font-size: 2.6rem; font-weight: 800; line-height: 1; letter-spacing: -0.04em; }
.swc-side-next__unit { display: block; margin: 4px 0 14px; color: #9fb0cc; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.swc-side-next__name { display: block; color: #fff; font-weight: 800; line-height: 1.3; }
.swc-side-next__dates { display: block; color: #9fb0cc; font-size: 0.85rem; }
.swc-side-next__cta { display: inline-block; margin-top: 14px; color: var(--news-gold); font-size: 0.8rem; font-weight: 800; }
.swc-side-next:hover .swc-side-next__cta, .swc-side-next:focus-visible .swc-side-next__cta { text-decoration: underline; }

/* Ad slots: heights reserved so the page does not shift when an ad loads. */
.swc-ad { display: flex; flex-direction: column; align-items: center; }
.swc-ad__label { margin-bottom: 4px; color: var(--sheet-muted); font-family: var(--global-body-font-family); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; }
.swc-ad--post-sidebar { min-height: 270px; }
.swc-ad--post-sidebar-sticky { position: sticky; top: 24px; min-height: 620px; }
.swc-ad--post-inline { min-height: 280px; margin: 0 0 1.25em; padding: 12px 0; border-top: 1px solid var(--sheet-line); border-bottom: 1px solid var(--sheet-line); }

@media (max-width: 1180px) and (min-width: 1101px) {
    .swc-post__sheet { grid-template-columns: minmax(0, 1fr) 270px; }
}
/* Below 1100 px the sidebar would squeeze the article, so it moves under it, as a two-column row where it fits. */
@media (max-width: 1100px) {
    .swc-post__sheet { grid-template-columns: 1fr; gap: 40px; }
    .swc-post__main { max-width: 760px; }
    .swc-post__side { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: start; padding-top: 32px; border-top: 1px solid var(--sheet-line); }
    .swc-ad--post-sidebar-sticky { position: static; min-height: 270px; }
}
@media (max-width: 600px) {
    .swc-post__content { font-size: 1.08rem; }
}
