/*
 * Sorority-verified fraternity tier voting -- styles for the vote form and
 * the drag-and-drop tier board. Separate from tgg-boards.css/js on purpose
 * (see tgg_boards_enqueue_vote_assets() in the plugin file) -- this never
 * needs to load on the homepage or discussion pages.
 */

.tgg-vote-page {
    --green: #0F7B6C;
    --green-dark: #0B5F53;
    --gold: #D4AF37;
    --dark: #0B0F19;
    --text: #374151;
    --muted: #6B7280;
    --light: #F7F8FA;
    --border: #E5E7EB;
    font-family: Inter, system-ui, sans-serif;
    margin: 28px 0;
}

.tgg-vote-page * {
    box-sizing: border-box;
}

/* The theme's own native page title/header would otherwise render above
   this content with its own (here, badly-spaced) default styling -- every
   other custom page in this plugin suppresses it the same way, since the
   kicker+h2 below already serves as the page's real title. */
.entry-header,
.entry-title,
.ast-single-post-order {
    display: none !important;
}

.tgg-vote-shell {
    background: #F7F8FA;
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 24px;
}

.tgg-vote-kicker {
    color: var(--green);
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: 13px;
    font-weight: 900;
    margin-bottom: 8px;
}

/* Scoped to .tgg-vote-shell (present in all three views: countdown,
   picker, and school board) rather than the narrower .tgg-vote-header
   that only wraps the school-board view's heading -- the other two views'
   h2s were falling through to the theme's unstyled/default heading rules
   without this. */
.tgg-vote-shell h2 {
    color: var(--dark);
    font-size: 30px !important;
    line-height: 1.1 !important;
    letter-spacing: -.03em !important;
    word-spacing: normal !important;
    margin: 0 !important;
    font-weight: 900;
}

.tgg-vote-sub {
    color: var(--muted);
    margin: 10px 0 0;
    font-size: 16px;
    line-height: 1.55;
}

.tgg-vote-closed {
    background: white;
    border: 1px dashed var(--border);
    border-radius: 20px;
    padding: 22px;
    margin-top: 18px;
    color: var(--muted);
    font-weight: 750;
    line-height: 1.55;
}

.tgg-vote-message {
    border-radius: 16px;
    padding: 14px 16px;
    margin: 18px 0 0;
    font-weight: 800;
    line-height: 1.45;
}

.tgg-vote-success {
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    color: #065F46;
}

.tgg-vote-error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #991B1B;
}

.tgg-vote-form {
    margin-top: 20px;
}

.tgg-vote-hidden {
    display: none !important;
}

.tgg-vote-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
}

.tgg-vote-field label {
    display: block;
    color: var(--dark);
    font-size: 14px;
    font-weight: 900;
    margin: 0 0 7px;
}

.tgg-vote-field label span {
    color: var(--muted);
    font-weight: 700;
}

.tgg-vote-field input {
    width: 100%;
    border: 1px solid var(--border) !important;
    border-radius: 16px !important;
    padding: 13px 14px !important;
    font-family: Inter, system-ui, sans-serif;
    font-size: 16px;
    color: var(--dark);
    background: #fff;
    outline: none;
    box-shadow: none !important;
}

.tgg-vote-field input:focus {
    border-color: rgba(15, 123, 108, .55) !important;
}

.tgg-vote-privacy-note {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    margin: 10px 0 0;
}

.tgg-vote-turnstile-wrap {
    margin-top: 16px;
}

.tgg-vote-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 48px;
    margin-top: 16px;
    padding: 14px 22px;
    border: none;
    border-radius: 14px;
    background: var(--green);
    color: white;
    font-family: Inter, system-ui, sans-serif;
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
    transition: .18s ease;
}

.tgg-vote-btn:hover {
    background: var(--green-dark);
    transform: translateY(-2px);
}

/* Drag-and-drop tier board */

.tgg-vote-board {
    margin-top: 20px;
    touch-action: none;
}

.tgg-vb-tiers {
    display: grid;
    gap: 14px;
}

.tgg-vb-tier {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 16px;
}

.tgg-vb-tier-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 10px;
}

.tgg-vb-tier-head strong {
    color: var(--dark);
    font-size: 16px;
    font-weight: 900;
}

.tgg-vb-tier-head span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.tgg-vb-dropzone {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 48px;
    border-radius: 14px;
    padding: 6px;
    transition: background-color .12s ease, box-shadow .12s ease;
}

.tgg-vb-dropzone-hover {
    background: #ECFDF5;
    box-shadow: inset 0 0 0 2px rgba(15, 123, 108, .35);
}

.tgg-vb-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--light);
    border: 1px solid var(--border);
    color: var(--dark);
    font-size: 14px;
    font-weight: 850;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.tgg-vb-chip:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 2px;
}

.tgg-vb-chip-dragging {
    cursor: grabbing;
    background: white;
    border-color: var(--green);
    box-shadow: 0 14px 28px rgba(15, 23, 42, .18);
}

@media (max-width: 640px) {
    .tgg-vote-fields {
        grid-template-columns: minmax(0, 1fr);
    }

    .tgg-vb-chip {
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* Admin override screen re-uses the same board component in a slightly
   more compact context. */

.tgg-vote-admin-board .tgg-vb-tier {
    padding: 12px;
}

/* Countdown gate */

.tgg-vote-countdown-shell {
    text-align: center;
}

.tgg-vote-countdown {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin: 28px 0 14px;
    flex-wrap: wrap;
}

.tgg-vote-countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 84px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px 14px;
}

.tgg-vote-countdown-value {
    display: block;
    color: var(--dark);
    font-size: 32px;
    font-weight: 900;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.tgg-vote-countdown-label {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-top: 8px;
}

.tgg-vote-countdown-date {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

@media (max-width: 640px) {
    .tgg-vote-countdown-unit {
        min-width: 68px;
        padding: 14px 10px;
    }

    .tgg-vote-countdown-value {
        font-size: 24px;
    }
}

/* School selector */

.tgg-vote-picker-form {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.tgg-vote-picker-form select {
    flex: 1;
    min-width: 220px;
    border: 1px solid var(--border) !important;
    border-radius: 16px !important;
    padding: 13px 14px !important;
    font-family: Inter, system-ui, sans-serif;
    font-size: 16px;
    color: var(--dark);
    background: #fff;
    outline: none;
}

.tgg-vote-picker-form select:focus {
    border-color: rgba(15, 123, 108, .55) !important;
}

.tgg-vote-picker-form .tgg-vote-btn {
    width: auto;
    margin-top: 0;
    flex: 0 0 auto;
    padding: 14px 24px;
}

@media (max-width: 640px) {
    .tgg-vote-picker-form {
        flex-direction: column;
    }

    .tgg-vote-picker-form .tgg-vote-btn {
        width: 100%;
    }
}

/* Back-to-picker link on a school's board */

.tgg-vote-back {
    margin: 0 0 16px;
}

.tgg-vote-back a {
    color: var(--green) !important;
    text-decoration: none !important;
    font-weight: 800;
    font-size: 14px;
}

.tgg-vote-back a:hover {
    text-decoration: underline !important;
}
