/*
 * CSR listing styles — CSR Page design.
 *
 * Standalone on purpose: main.scss / main.css are untouched, so this file can be
 * folded into the SCSS build later without unpicking anything. Loaded only on
 * the CSR archive and single articles (see inc/enqueue.php).
 *
 * Palette and type come from the theme: #52283B brown, #A3AE3A pill green,
 * #F0EDE8 sand, MarkPro faces.
 */

:root {
    --csr-brown: #52283B;
    --csr-green: #A3AE3A;
    --csr-sand: #F0EDE8;
    --csr-body: #4A4A4A;
    --csr-meta: #6B6B6B;
}

/* ---------------------------------------------------------------- Hero --- */

/*
 * Built to match .hero_inner on the Developments archive: same viewport-based
 * height, same gradient, same bottom-aligned .wrap. Full-bleed edge to edge —
 * only the title is held to the 1400px content column.
 *
 * Do not reach for `aspect-ratio` here. Paired with a `max-height`, Chrome
 * preserves the ratio by shrinking the box's *width* instead, which left the
 * hero 1251px wide inside a 1512px viewport and broke the full-bleed edge.
 * A height in viewport units keeps the width at 100% unconditionally.
 *
 * The fallback image is the container's own background, so it is what the
 * visitor sees while the video buffers, when no video is uploaded, and when
 * playback fails.
 */
.csr_hero {
    position: relative;
    height: calc(100vh - 220px);
    min-height: 420px;
    overflow: hidden;
    background-color: #1c0d15;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.csr_hero_video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    z-index: 1;
}

/* Set by csr.js when the video errors or is never able to start: drop back to
   the container's fallback image and take the useless sound toggle with it. */
.csr_hero.video_failed .csr_hero_video,
.csr_hero.video_failed .csr_hero_sound {
    display: none;
}

.csr_hero:after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0) 40%,
        rgba(0, 0, 0, 0.5) 65%,
        rgba(0, 0, 0, 0.85) 100%
    );
    z-index: 1;
}

/* The flex lives on .wrap, not on .csr_hero — same as .hero_inner. Keeping the
   hero a plain block means the theme's `.wrap { margin: auto }` centres it
   horizontally and resolves to 0 vertically, instead of fighting align-items. */
.csr_hero .wrap {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    padding-bottom: 70px;
}

.csr_hero_title {
    color: #fff;
    font-family: 'MarkProBold', Helvetica, sans-serif;
    font-weight: normal;
    font-size: 2.4em;
    line-height: 1.15;
    margin: 0;
}

.csr_hero_sound {
    position: absolute;
    right: 24px;
    top: 24px;
    z-index: 3;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.csr_hero_sound:hover,
.csr_hero_sound:focus-visible {
    background: rgba(0, 0, 0, 0.6);
    border-color: #fff;
}

.csr_hero_sound_icon {
    width: 22px;
    height: 22px;
}

/* Muted is the default state: show the crossed-out speaker, hide the waves. */
.csr_hero_sound .csr_hero_sound_on {
    display: none;
}

.csr_hero_sound.is_unmuted .csr_hero_sound_on {
    display: block;
}

.csr_hero_sound.is_unmuted .csr_hero_sound_off {
    display: none;
}

/* ------------------------------------------------------------- Layout --- */

.csr_section {
    padding: 60px 0 90px;
}

.csr_layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    grid-gap: 60px;
    align-items: start;
}

/* No sidebar until the archive paginates — let the list breathe instead of
   leaving a dead column. */
.csr_layout--full {
    grid-template-columns: minmax(0, 1fr);
    max-width: 860px;
    margin: 0 auto;
}

.csr_main {
    min-width: 0;
}

/* --------------------------------------------------------------- List --- */

.csr_list {
    display: flex;
    flex-direction: column;
    gap: 64px;
}

.csr_item {
    display: flex;
    flex-direction: column;
}

.csr_item_image {
    display: block;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 22px;
}

.csr_item_image img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.csr_item_image:hover img {
    transform: scale(1.03);
}

.csr_item_meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.csr_item_pill {
    flex: 0 0 auto;
    background: var(--csr-green);
    color: #fff;
    font-size: 0.75em;
    line-height: 1;
    padding: 8px 16px;
    border-radius: 999px;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.csr_item_pill:hover {
    opacity: 0.85;
    color: #fff;
    text-decoration: none;
}

.csr_item_rule {
    flex: 1 1 auto;
    height: 1px;
    background: #DCDCDC;
}

.csr_item_date {
    flex: 0 0 auto;
    color: var(--csr-meta);
    font-size: 0.75em;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.csr_item_title {
    font-family: 'MarkProBold', Helvetica, sans-serif;
    font-weight: normal;
    font-size: 1.75em;
    line-height: 1.25;
    margin: 0 0 14px;
}

.csr_item_title a {
    color: var(--csr-brown);
    text-decoration: none;
}

.csr_item_title a:hover {
    text-decoration: underline;
}

.csr_item_excerpt {
    color: var(--csr-body);
    font-size: 0.95em;
    line-height: 1.7;
    margin: 0;
}

.csr_empty {
    color: var(--csr-body);
}

/* --------------------------------------------------------- Pagination --- */

.csr_pagination {
    margin-top: 70px;
}

.csr_pagination ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0;
}

.csr_pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 8px;
    border-radius: 50%;
    color: var(--csr-brown);
    font-size: 0.9em;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.csr_pagination a.page-numbers:hover {
    background: var(--csr-sand);
    text-decoration: none;
}

.csr_pagination .page-numbers.current {
    background: var(--csr-brown);
    color: #fff;
}

/* ------------------------------------------------------------ Sidebar --- */

.csr_sidebar {
    position: sticky;
    top: 110px;
}

.csr_sidebar_block + .csr_sidebar_block {
    margin-top: 44px;
    padding-top: 44px;
    border-top: 1px solid #E5E1DC;
}

.csr_sidebar_title {
    font-family: 'MarkProBold', Helvetica, sans-serif;
    font-weight: normal;
    font-size: 1.15em;
    color: var(--csr-brown);
    margin: 0 0 18px;
}

.csr_search {
    display: flex;
    align-items: center;
    background: #F5F5F5;
    border-radius: 4px;
    padding: 0 14px;
}

.csr_search_input {
    flex: 1 1 auto;
    border: 0;
    background: transparent;
    padding: 14px 0;
    font-size: 0.9em;
    color: var(--csr-body);
    min-width: 0;
}

.csr_search_submit {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: var(--csr-brown);
    cursor: pointer;
    padding: 6px;
    display: flex;
}

.csr_search_icon {
    width: 18px;
    height: 18px;
}

.csr_recent {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.csr_recent_link {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    text-decoration: none;
}

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

.csr_recent_image {
    flex: 0 0 62px;
    width: 62px;
    height: 62px;
    border-radius: 4px;
    background-size: cover;
    background-position: center;
}

.csr_recent_title {
    font-family: 'MarkProBold', Helvetica, sans-serif;
    font-size: 0.85em;
    line-height: 1.4;
    color: var(--csr-brown);
}

.csr_recent_link:hover .csr_recent_title {
    text-decoration: underline;
}

.csr_categories {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.csr_categories_pill {
    display: inline-block;
    background: var(--csr-sand);
    color: var(--csr-brown);
    font-size: 0.78em;
    padding: 8px 16px;
    border-radius: 999px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.csr_categories_pill:hover {
    background: #E3DDD5;
    color: var(--csr-brown);
    text-decoration: none;
}

/* -------------------------------------------------------- Share: copy --- */

.article_share_copy {
    position: relative;
}

.article_share_copied {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--csr-brown);
    color: #fff;
    font-size: 0.7em;
    line-height: 1;
    padding: 7px 10px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.article_share_copy.is_copied .article_share_copied {
    opacity: 1;
    visibility: visible;
}

/* ------------------------------------------------------------ Responsive - */

@media (max-width: 1440px) {
    .csr_hero .wrap,
    .csr_section .wrap {
        padding-left: 30px;
        padding-right: 30px;
    }
}

@media (max-width: 1024px) {
    .csr_layout {
        grid-template-columns: minmax(0, 1fr);
        grid-gap: 60px;
    }

    .csr_sidebar {
        position: static;
    }
}

@media (max-width: 767px) {
    .csr_hero {
        height: calc(100vh - 140px);
        min-height: 340px;
    }

    .csr_hero .wrap {
        padding-bottom: 40px;
    }

    .csr_hero_title {
        font-size: 1.8em;
    }

    .csr_hero_sound {
        right: 16px;
        top: 16px;
        width: 38px;
        height: 38px;
    }

    .csr_section {
        padding: 40px 0 60px;
    }

    .csr_list {
        gap: 48px;
    }

    .csr_item_title {
        font-size: 1.35em;
    }

    .csr_item_meta {
        gap: 12px;
    }

    .csr_item_rule {
        display: none;
    }

    .csr_item_date {
        margin-left: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .csr_item_image img,
    .csr_hero_sound,
    .csr_categories_pill {
        transition: none;
    }
}
