﻿/* ============================================================
   SURVEYOURS — TOPIC DETAILS PAGE, CLEAN CSS
   ============================================================
   One file, from scratch, to replace the old
   castyourvote.css link in ViewTopicDetails.cshtml
   (currently commented out in the page file).

   Target: the Topic Details mockup (artifact
   surveyours-topic-details-mockup) — #EDF0F3 page,
   white cards, navy #08284E, red #D01C03 only on
   actions, Poppins, large tappable vote rows.

   How to use it:
   1. Save this file as updated_css/surveyours-topic-details.css
   2. In ViewTopicDetails.cshtml, replace this line:
        @* <link href="~/new-css/castyourvote.css" rel="stylesheet" /> *@
      with:
        <link href="~/updated_css/surveyours-topic-details.css" rel="stylesheet" asp-append-version="true" />
   3. No Razor changes are needed for the styling
      below. The header and footer are NOT in this
      file — they come from LoginLayout
      (surveyours-shared.css + header_footer.css).

   What CSS alone cannot do here:
   - The mockup's right-hand sidebar (Live results
     + More in General) has no markup on this page,
     so it cannot be styled into existence. Live
     results live on the VoteStats page instead.
     Adding that sidebar would be a Razor change.
   - The mockup's "Related news" grid is, on the
     live page, the rssapp list at the bottom
     (.rss-feed-section). It is styled here as far
     as the page can reach it; the items inside
     the widget itself are rendered by rssapp.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700;800&display=swap');

/* ---------- 1. TOKENS ---------- */
/* Canonical homepage values, so this page lines
   up with the homepage and Topics page. The
   mockup used a slightly lighter navy (#12365E);
   the live navy is #08284E everywhere else. */
:root {
    --sv-page: #EDF0F3;
    --sv-card: #FFFFFF;
    --sv-navy: #08284E;
    --sv-navy-soft: #E8EEF4;
    --sv-navy-mid: #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);
}

/* ---------- 3. TOPIC CARD ---------- */
/* The whole page is one card: .card-topic-detail
   inside the shared .container (max-width 1200px).
   Mockup: white card, 14px radius, soft shadow,
   26px top/bottom, 28px left/right. */
.card-topic-detail {
    background: var(--sv-card) !important;
    border: 1px solid #E6EAF0 !important;
    border-radius: var(--sv-radius) !important;
    box-shadow: var(--sv-shadow) !important;
    padding: 26px 28px !important;
    margin-top: 0 !important;
}

    /* ---------- 4. TITLE ---------- */
    /* "Cast your Vote" / "Topic Detail" — mockup h1,
   30px, navy, tight line-height. The red word is
   already wrapped in <span class="accent">. */
    .card-topic-detail h1.title {
        font-size: 30px !important;
        line-height: 1.2 !important;
        font-weight: 700 !important;
        color: var(--sv-navy) !important;
        letter-spacing: -.2px;
        margin: 10px 0 6px !important;
    }

        .card-topic-detail h1.title .accent {
            color: var(--sv-red) !important
        }

/* ---------- 5. LISTEN BUTTON ---------- */
/* Live button keeps its inline gradient pill.
   Just give it a little breathing room below. */
#tts-control-btn {
    margin-bottom: 4px !important
}

/* ---------- 6. POSTED TIME ---------- */
.posted-time {
    color: #DB5867 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    margin: 6px 0 10px !important;
}

/* ---------- 7. BADGES ---------- */
/* Category and Views badges are navy blocks with
   inline styles in the Razor. The mockup has them
   as white pills with a navy border instead, so
   the inline colours are overridden here. */
.card-topic-detail .badge {
    background: var(--sv-card) !important;
    border: 1.5px solid var(--sv-navy) !important;
    color: var(--sv-navy) !important;
    border-radius: 999px !important;
    padding: 3px 13px !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
    min-height: 32px !important;
    display: inline-flex !important;
    align-items: center !important;
}

    .card-topic-detail .badge i {
        color: var(--sv-navy) !important
    }

/* Share / copy-link icon buttons sit in the same
   row as the badges. Keep them quiet and navy. */
.topic-action-icons {
    display: inline-flex !important;
    gap: 4px !important;
    align-items: center !important
}

    .topic-action-icons button {
        background: transparent !important;
        border: 0 !important;
        color: var(--sv-muted) !important;
        font-size: 18px !important;
        padding: 6px 8px !important;
        border-radius: 8px !important;
    }

        .topic-action-icons button:hover {
            color: var(--sv-navy) !important;
            background: var(--sv-navy-soft) !important
        }

/* ---------- 8. TOPIC NAME ---------- */
/* The question itself, shown once at the top of
   the card. 22px, navy, 700 — the mockup's h1
   size scaled down, since the page title already
   sits above it. */
.card-topic-detail .topic {
    font-size: 22px !important;
    font-weight: 700 !important;
    color: var(--sv-navy) !important;
    line-height: 1.3 !important;
    margin: 8px 0 4px !important;
}
/* The question is repeated a second time inside
   the vote form. Hide the duplicate so it only
   appears once, at the top of the card. */
.form-card .topic {
    display: none !important
}

/* ---------- 9. DESCRIPTION ---------- */
/* The article text. 16px, comfortable line-height,
   readable width — the mockup shows two lines up
   front with the rest behind "Read more", but the
   live page has no read-more toggle, so the full
   text shows as it does now, just tidied. */
.desc {
    font-size: 16px !important;
    line-height: 1.6 !important;
    color: var(--sv-ink) !important;
    margin: 10px 0 18px !important;
}

    .desc p {
        margin: 0 0 12px !important
    }

        .desc p:last-child {
            margin-bottom: 0 !important
        }

    .desc img {
        max-width: 100% !important;
        height: auto !important;
        border-radius: 10px !important
    }

/* ---------- 10. VOTE CARD ---------- */
/* The vote form is its own card in the mockup —
   a separate white card below the article card,
   with a 22px gap between them and a 5px navy
   top border. On the live page the form sits
   inside the same .card-topic-detail as the
   article, so to get that gap the Razor needs
   to close the first card after the description
   and open a second card for the form, called
   "vote-card":
     <div class="card-topic-detail vote-card">
   Once split, this rule styles that second
   card. The .form-card inside it is then just
   a plain wrapper, not a card itself. */
.card-topic-detail.vote-card {
    background: var(--sv-card) !important;
    border: 1px solid #E6EAF0 !important;
    border-top: 5px solid var(--sv-navy) !important;
    border-radius: var(--sv-radius) !important;
    box-shadow: var(--sv-shadow) !important;
    padding: 26px 28px !important;
    margin-top: 22px !important;
}

.form-card {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-top: 0 !important;
}
/* Vote card heading — "Cast your Vote" with the
   red word, and the subtitle underneath. This
   goes at the top of the vote-card, before the
   form, as:
     <h2>Cast your <span class="accent">Vote</span></h2>
     <p class="vote-sub">Pick one option below.
     Voting happens right here on the page.</p> */
.card-topic-detail.vote-card h2 {
    margin: 0 !important;
    font-size: 21px !important;
    font-weight: 700 !important;
    color: var(--sv-navy) !important;
}

    .card-topic-detail.vote-card h2 .accent {
        color: var(--sv-red) !important
    }

.card-topic-detail.vote-card .vote-sub {
    color: var(--sv-muted) !important;
    font-size: 13.5px !important;
    margin: 4px 0 18px !important;
}
/* The form column was col-lg-9 (three-quarters).
   The mockup's vote card is full width, so the
   form now takes the whole card. */
.form-card .col-lg-9,
.form-card .col-md-10 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
}

/* ---------- 11. ANSWER ROWS ---------- */
/* Mockup: the tiny checkboxes become full-width
   tappable rows — 58px tall, 2px border, 11px
   radius, 15.5px text. Live markup per answer:
   <li class="switch_item"> with a checkbox
   (.nisheCheck), an empty <label> (the box),
   and <span class="color_text"> the answer. */
.answer-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}

    .answer-list .switch_item {
        display: flex !important;
        align-items: center !important;
        gap: 13px !important;
        width: 100% !important;
        min-height: 58px !important;
        padding: 12px 16px !important;
        background: var(--sv-card) !important;
        border: 2px solid var(--sv-border) !important;
        border-radius: 11px !important;
        cursor: pointer !important;
        transition: border-color .15s ease, background .15s ease !important;
    }

        .answer-list .switch_item:hover {
            border-color: var(--sv-navy) !important
        }
    /* The real checkbox is hidden; the empty <label>
   is drawn as the 24px box on the left. */
    .answer-list .nisheCheck {
        position: absolute !important;
        opacity: 0 !important;
        width: 1px !important;
        height: 1px !important;
    }

    .answer-list .switch_item label {
        flex: 0 0 auto !important;
        width: 24px !important;
        height: 24px !important;
        border-radius: 7px !important;
        border: 2px solid #8494A8 !important;
        background: #fff !important;
        margin: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        color: #fff !important;
        font-size: 14px !important;
        line-height: 1 !important;
        cursor: pointer !important;
    }

    .answer-list .switch_item .color_text {
        font-size: 15.5px !important;
        font-weight: 500 !important;
        color: var(--sv-ink) !important;
    }
    /* Selected row: navy fill, white text, white box
   with a navy tick. :has() matches when the
   checkbox inside the row is checked — the
   SelectAnswer() script checks it on click. */
    .answer-list .switch_item:has(.nisheCheck:checked) {
        border-color: var(--sv-navy) !important;
        background: var(--sv-navy) !important;
    }

        .answer-list .switch_item:has(.nisheCheck:checked) label {
            border-color: #fff !important;
            background: #fff !important;
            color: var(--sv-navy) !important;
        }

            .answer-list .switch_item:has(.nisheCheck:checked) label::after {
                content: "\2713" !important;
                font-weight: 700 !important;
            }

        .answer-list .switch_item:has(.nisheCheck:checked) .color_text {
            color: #fff !important;
            font-weight: 600 !important;
        }

/* ---------- 12. COMMENT ---------- */
.form-card label[for="Comment"] {
    display: block !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: var(--sv-navy) !important;
    margin: 22px 0 8px !important;
}

#Comment {
    width: 100% !important;
    min-height: 96px !important;
    resize: vertical !important;
    border: 1.5px solid var(--sv-border) !important;
    border-radius: 11px !important;
    padding: 12px 14px !important;
    font-size: 14.5px !important;
    color: var(--sv-ink) !important;
    background: #FBFCFD !important;
}

    #Comment:focus {
        outline: none !important;
        border-color: var(--sv-navy) !important;
        background: #fff !important;
    }

#wordCountDisplay {
    font-size: 12.5px !important;
    color: #8494A8 !important
}

/* "Once your vote has been cast, it cannot be
   changed!" — small muted note, like the mockup. */
.form-card p {
    font-size: 14px !important;
    color: var(--sv-muted) !important;
}

/* ---------- 13. SUBMIT ---------- */
/* Mockup: red is kept for one thing only — the
   Submit button. Full width, 50px tall, 10px
   radius, 15.5px, 600. The live button has an
   inline min-width of 240px; this overrides it. */
.form-card .cta .btn-primary,
.form-card .cta button {
    background: var(--sv-red) !important;
    border: 0 !important;
    border-radius: 10px !important;
    color: #fff !important;
    font-size: 15.5px !important;
    font-weight: 600 !important;
    min-width: 0 !important;
    width: 100% !important;
    min-height: 50px !important;
    padding: 0 26px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 9px !important;
}

    .form-card .cta .btn-primary:hover,
    .form-card .cta button:hover {
        background: var(--sv-red-dark) !important
    }
    /* Disabled, before an option is picked — grey,
   like the mockup. The button starts disabled
   in the Razor, and the script below enables it
   when an answer is checked, which turns it red. */
    .form-card .cta .btn-primary:disabled,
    .form-card .cta button:disabled {
        background: #C9D2DE !important;
        color: #5B6B7F !important;
        cursor: not-allowed !important;
    }

/* ---------- 14. RELATED NEWS ---------- */
/* The mockup's Related news is a 2-column grid
   of white cards, each with a red source line
   and a navy headline — not the rssapp widget.
   The widget cannot be restyled into this grid,
   so the Razor replaces it with this markup:
     <section class="news">
       <h2>Related news</h2>
       <p class="sub">…</p>
       <div class="news-grid">
         <a class="news-item" href="#">
           <p class="src">MASHABLE.COM</p>
           <p class="headline">…</p>
         </a> … x4
       </div>
     </section>
   The old .rss-feed-section rules are kept
   below, in case the widget is kept anywhere. */
.news {
    margin-top: 22px !important
}

    .news h2 {
        margin: 0 0 4px !important;
        font-size: 20px !important;
        font-weight: 700 !important;
        color: var(--sv-navy) !important;
    }

    .news .sub {
        color: var(--sv-muted) !important;
        font-size: 13.5px !important;
        margin: 0 0 18px !important;
    }

.news-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
}

.news-item {
    background: var(--sv-card) !important;
    border: 1px solid #E6EAF0 !important;
    border-radius: var(--sv-radius) !important;
    box-shadow: var(--sv-shadow) !important;
    padding: 18px 20px !important;
    text-decoration: none !important;
    display: block !important;
}

    .news-item:hover {
        border-color: var(--sv-navy) !important
    }

    .news-item .src {
        font-size: 11px !important;
        font-weight: 700 !important;
        letter-spacing: .8px !important;
        text-transform: uppercase !important;
        color: var(--sv-red) !important;
        margin: 0 0 6px !important;
    }

    .news-item .headline {
        font-size: 15px !important;
        font-weight: 600 !important;
        color: var(--sv-ink) !important;
        line-height: 1.45 !important;
        margin: 0 !important;
    }
/* When the RSS widget is kept, the heading sits
   OUTSIDE the white card — on the grey page
   background, like the mockup — and the widget
   card sits below it. Structure:
     <section class="news">
       <h2>Related news</h2>
       <p class="sub">…</p>
       <div class="rss-feed-section">…widget…</div>
     </section>
   If the heading is put inside .rss-feed-section
   instead, it gets a white background, because
   that whole section is a white card. */
.news .rss-feed-section {
    margin-top: 0 !important
}

/* ---------- 15. RSS FEED (if kept) ---------- */
/* The rssapp list at the bottom of the page —
   the live equivalent of the mockup's Related
   news. The items inside are rendered by rssapp
   and cannot be restyled from here, but the
   section itself gets the same white-card
   treatment as everything else, with a heading
   like the mockup's "Related news". */
.rss-feed-section {
    /* No white card of its own — the widget items
     are already white cards, so an outer white
     card just doubles the white and washes them
     out. The section sits on the grey page
     background instead, like the mockup's news
     grid, with the items as the white cards. */
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-top: 0 !important;
}

    .rss-feed-section h2 {
        margin: 0 0 4px !important;
        font-size: 20px !important;
        font-weight: 700 !important;
        color: var(--sv-navy) !important;
    }

    .rss-feed-section .rss-feed-sub {
        color: var(--sv-muted) !important;
        font-size: 13.5px !important;
        margin: 0 0 18px !important;
    }

/* ---------- 15. MOBILE ---------- */
@media (max-width:560px) {
    .card-topic-detail {
        padding: 20px 18px !important
    }

        .card-topic-detail h1.title {
            font-size: 25px !important
        }

        .card-topic-detail .topic {
            font-size: 19px !important
        }
}
