﻿/* ============================================================
   SURVEYOURS — TOPICS PAGE, CLEAN CSS
   ============================================================
   One file, from scratch, to replace the inline <style>
   block in Topics.cshtml and the old hot-topics.css link.

   Target: the General topics mockup (artifact
   surveyours-topics-page-mockup) — #EDF0F3 page,
   white cards, navy #08284E, red #D01C03 only on
   actions, Poppins headings, identical topic cards.

   How to use it:
   1. Save this file as new-css/surveyours-topics.css
   2. In Topics.cshtml, replace this line:
        <link href="~/new-css/hot-topics.css" rel="stylesheet" />
      with:
        <link href="~/new-css/surveyours-topics.css" rel="stylesheet" />
   3. Delete the whole inline <style> ... </style> block
      at the top of Topics.cshtml — everything in it
      now lives in this file, in Section 2.
   4. The header and footer are NOT in this file.
      They are in new-css/surveyours-header-footer.css,
      which _LoginLayout already loads.

   This file styles all categories at once, because
   Topics.cshtml renders every category with the
   same template — General, Movies, Money, and so on.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700;800&display=swap');

/* ---------- 1. TOKENS ---------- */
:root {
    --sv-page: #EDF0F3;
    --sv-card: #FFFFFF;
    --sv-navy: #08284E;
    --sv-navy-soft: #3E6390;
    --sv-ink: #22364C;
    --sv-muted: #52677E;
    --sv-border: #D8DEE5;
    --sv-track: #E4EAF0;
    --sv-red: #D01C03;
    --sv-red-dark: #A81502;
    --sv-radius: 14px;
    --sv-shadow: 0 1px 3px rgba(19,46,77,.07), 0 8px 24px rgba(19,46,77,.05);
}

/* ---------- 2. PAGE ---------- */
body {
    background: var(--sv-page) !important;
    color: var(--sv-ink);
    font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}

h1, h2, h3, h6 {
    font-family: 'Poppins',sans-serif !important;
    color: var(--sv-navy);
}

a {
    color: inherit
}

/* ---------- 3. CATEGORY HERO ---------- */
/* Target: the mockup's category band — white card,
   heading + description + pills on the left,
   image on the right. The pills sit directly
   under the description, not pushed to the
   bottom of the column. */

.hero-section {
    background: var(--sv-card) !important;
    border: 1px solid var(--sv-border);
    border-radius: var(--sv-radius);
    box-shadow: var(--sv-shadow);
    padding: 26px 28px !important;
    margin-top: 16px;
    overflow: hidden;
}

/* Desktop hero layout — left text, right image.
   The image column is narrower than the text,
   like the mockup (text 1fr, image 320px). */
.hero-layout {
    display: grid;
    grid-template-columns: minmax(0,1fr) 320px;
    grid-template-areas: "left image";
    column-gap: 28px;
    align-items: center;
}

.hero-left-area {
    grid-area: left;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.hero-description-area {
    min-width: 0
}

.hero-image-area {
    grid-area: image;
    min-width: 0;
}

/* Heading: icon + category name, tight. */
.description-block h1 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: var(--sv-navy);
    line-height: 1.15;
}

    .description-block h1 img {
        width: 42px !important;
        height: 42px !important;
        object-fit: contain;
        flex-shrink: 0;
        border-radius: 10px;
        background: var(--sv-navy);
        padding: 10px;
    }

.description-block p {
    margin: 8px 0 0;
    max-width: 52ch;
    color: var(--sv-ink);
    font-size: 1.02rem;
    line-height: 1.55;
}

/* Pills — directly under the description. */
.category-theme-block {
    margin-top: 20px;
    margin-bottom: 0;
    padding-top: 0;
    width: 100%;
}

.category-theme-heading {
    color: var(--sv-muted);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .14em;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.category-theme-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.category-theme-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #FFFFFF;
    color: var(--sv-navy);
    border: 1.5px solid var(--sv-navy-soft);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: .88rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    cursor: default;
    user-select: none;
}

/* Hero image / video — 218px tall, like the mockup,
   same slot for image and video. */
.hero-img {
    width: 100%
}

.hero-image-caption {
    font-size: .78rem;
    color: var(--sv-muted);
    margin: 6px 0 0;
    line-height: 1.4;
}

.image-slider {
    position: relative;
    width: 100%;
    height: 218px;
    border-radius: 10px;
    overflow: hidden;
}

.slider-image {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: none;
}

    .slider-image.active {
        display: block
    }

/* ---------- 4B. TOPICS SECTION HEADING ---------- */
/* "Topics in {Category}" — the heading that sits
   between the ticker and the list of topics.
   This is in the mockup but not in Topics.cshtml
   yet — add the Razor block below, just before
   the @foreach loop, and this styles it. */
.section-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 28px 4px 12px;
    flex-wrap: wrap;
}

    .section-head h2 {
        margin: 0;
        font-size: 1.3rem;
        font-weight: 700;
        color: var(--sv-navy);
    }

    .section-head p {
        margin: 0;
        color: var(--sv-muted);
        font-size: .92rem;
    }

/* ---------- 4. TOPIC CARDS ---------- */
/* Target: the mockup's topic cards — white card,
   thumb on the left (196px wide, 168px tall),
   title + blurb + results on the right.
   Every card is identical. */

.qcard.topic-qcard {
    background: var(--sv-card) !important;
    border: 1px solid var(--sv-border) !important;
    border-radius: var(--sv-radius);
    box-shadow: var(--sv-shadow);
    padding: 20px !important;
    margin-bottom: 14px !important;
    /* The rows are Bootstrap .row elements, which
     carry -12px side margins — that is what was
     making each card stick out past the header
     and hero on desktop. Zero them here, on
     every screen size, not just mobile. */
    margin-left: 0 !important;
    margin-right: 0 !important;
    /* Force the card to the full width of its
     parent, even if a parent row or column is
     still pulling it in on one side. */
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.ad-qcard {
    margin-left: 0 !important;
    margin-right: 0 !important;
}
/* The Pop Culture carousel strip is a plain
   .row.qcard (no .topic-qcard on it), so the
   topic-row fix above does not reach it — and
   it has the same Bootstrap -12px side margins,
   which is what was making the strip stick out
   past the header and hero. Zero them here. */
.row.qcard:not(.topic-qcard) {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.qcard.topic-qcard .thumb {
    padding: 0;
}

    .qcard.topic-qcard .thumb img {
        width: 196px;
        height: 168px;
        object-fit: cover;
        border-radius: 10px;
        display: block;
    }

.qcard.topic-qcard h3.qtitle {
    margin: 0 0 4px;
    font-size: 1.12rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--sv-navy);
}

.qcard.topic-qcard p.qdesc {
    margin: 0;
    color: var(--sv-ink);
    font-size: .95rem;
    line-height: 1.55;
    max-width: 65ch;
}

    .qcard.topic-qcard p.qdesc a {
        color: var(--sv-red) !important;
        font-weight: 700;
        text-decoration: none;
        display: block;
        margin-top: 6px;
    }

        .qcard.topic-qcard p.qdesc a:hover {
            text-decoration: underline
        }

.posted-time {
    font-size: .85rem;
    color: var(--sv-muted);
    margin-bottom: 4px;
}

/* Results, when signed in — navy bars, like the
   mockup. The partial's own bar markup is kept,
   only its colours are matched here. */
.qcard.topic-qcard hr {
    border-top: 1px solid var(--sv-border);
    margin: 12px 0;
}

.results-link:hover {
    color: var(--sv-red) !important;
    text-decoration: underline !important;
}

/* ---------- 5. CATEGORY TICKERS ---------- */
/* Movies, Sports, Social Studies, Money, General
   and Pop Culture strips — white card, same
   radius and border as everything else. */
.movies-ticker-container,
.social-studies-container,
.sports-ticker-container {
    background: var(--sv-card) !important;
    border: 1px solid var(--sv-border) !important;
    border-radius: var(--sv-radius) !important;
    box-shadow: var(--sv-shadow);
}

/* The RSS ticker strip — the same strip on every
   category page except Sports and Pop Culture.
   It was overlapping itself: the widget had no
   height of its own, so its headlines stacked
   on top of each other. Give it a fixed height,
   hide anything outside it, and let it take
   the full width left after the favicon. */
rssapp-ticker {
    display: block !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: 100% !important;
    height: 60px !important;
    overflow: hidden !important;
}

    rssapp-ticker iframe {
        width: 100% !important;
        height: 60px !important;
    }

/* ---------- 6. SPACING ---------- */
/* Reduce the gaps between the hero, the ticker
   and the topics. Each section sits in its own
   .container, and every .container had 24px of
   padding at the top and 48px at the bottom, so
   the gaps stacked up to about 70px between
   sections. On this page only, the containers
   are tighter: 12px at the top, 16px at the
   bottom. */
.container {
    padding-top: 12px !important;
    padding-bottom: 16px !important;
}

.hero-section {
    margin-top: 0 !important
}

.section-head {
    margin-top: 16px !important
}

/* ---------- 7. VOTING RESULTS ---------- */
/* The _VotesPercentagePartial, shown when signed
   in. In the screenshot it was just "No 100%"
   with no bar — because .vote-bar had no height,
   no width and no track colour, so the fill had
   nothing to show in. Give the row a real layout:
   label on the left, a track in the middle, the
   percent on the right. The <br /> after each row
   is hidden — the row's own margin does the
   spacing. */
.voting-results {
    margin-top: 12px !important
}

    .voting-results br {
        display: none !important
    }

.vote-row {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin-bottom: 8px !important;
}

    .vote-row:last-child {
        margin-bottom: 0 !important
    }

.vote-label {
    /* Mockup: plain navy text, no coloured pill —
     "Yes" / "No" as text on the left, not a
     red or navy badge. The inline background
     on the label span in the partial was removed,
     so this is just text. */
    flex: 0 0 auto !important;
    min-width: 52px !important;
    text-align: left !important;
    background: transparent !important;
    color: var(--sv-navy) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

.vote-bar {
    flex: 1 1 auto !important;
    height: 10px !important;
    background: var(--sv-track) !important;
    border-radius: 999px !important;
    overflow: hidden !important;
}

.vote-fill {
    height: 100% !important;
    border-radius: 999px !important;
}
    /* Mockup bars are both navy — Yes the deep
   navy, No a lighter navy — never red.
   #3E6390 was too close to #08284E at 10px
   tall, so the two bars looked identical.
   No is now a much lighter steel-blue
   (#8AA5BF), so the difference is obvious
   at a glance. The partial sets the fill
   colour inline (yesColor #08284E, noColor
   #8AA5BF), so these classes are only a
   backstop. */
    .vote-fill.yes {
        background: #08284E !important
    }

    .vote-fill.no {
        background: #8AA5BF !important
    }

.vote-percent {
    flex: 0 0 auto !important;
    min-width: 42px !important;
    text-align: right !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: var(--sv-navy) !important;
}

/* ---------- 8. MOBILE ---------- */
@media (max-width:991.98px) {
    .hero-layout {
        grid-template-columns: minmax(0,1fr);
        grid-template-areas: "description" "image" "pills";
        row-gap: 14px;
    }

    .hero-left-area {
        display: contents
    }

    .hero-description-area {
        grid-area: description
    }

    .hero-image-area {
        grid-area: image;
        width: 100%
    }

    .category-theme-block {
        grid-area: pills;
        margin-top: 0;
        padding-top: 0;
        margin-bottom: 8px;
    }

    .image-slider {
        height: 168px
    }

    .qcard.topic-qcard .thumb img {
        width: 100%;
        height: 168px
    }
}

@media (max-width:767.98px) {
    .hero-section {
        padding: 20px !important
    }

    .description-block h1 {
        font-size: 1.65rem
    }

    .category-theme-heading {
        font-size: 12px;
        margin-bottom: 8px
    }

    .category-theme-pills {
        gap: 8px
    }

    .category-theme-pill {
        padding: 6px 14px;
        font-size: 14px
    }

        .category-theme-pill:nth-child(n+5) {
            display: none
        }
    /* Topic rows and ad spaces on mobile — they
     were too wide, running off the right edge
     of the phone. A Bootstrap .row carries
     negative side margins, so the card was
     wider than the screen. On mobile the rows
     and the ad cards sit inside the container
     instead of hanging over its edges, and
     the thumb goes full width on top. */
    .qcard.topic-qcard,
    .ad-qcard {
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

        .qcard.topic-qcard .thumb {
            margin-bottom: 12px
        }

            .qcard.topic-qcard .thumb img {
                width: 100% !important;
                height: 168px !important;
            }
}
