/* =========================================================
   EC-IITK — Election Commission IIT Kanpur
   Stylesheet: styles.css  (Responsive Edition)
   ========================================================= */

/* ----- CSS Variables ----- */
:root {
    --navy: #1A2744;
    --navy-light: #243460;
    --crimson: #C0392B;
    --ivory: #F5F0E8;
    --ivory-dark: #EDE6D6;
    --slate: #4A5568;
    --slate-light: #718096;
    --white: #FFFFFF;
    --border: #D8CFC0;
    --shadow: rgba(26, 39, 68, 0.12);
}

/* ----- Reset ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--ivory);
    color: var(--navy);
    min-height: 100vh;
    overflow-x: hidden;
}

/* =========================================================
   NAVIGATION
   ========================================================= */

nav {
    background: whitesmoke;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 3px solid var(--crimson);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
    position: relative;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    cursor: pointer;
    flex-shrink: 0;
}

.nav-logo {
    width: 42px;
    height: 42px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-logo svg {
    width: 42px;
    height: 42px;
}

.nav-title {
    color: var(--navy);
}

.nav-title .t1 {
    display: block;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.1;
}

.nav-title .t2 {
    display: block;
    font-size: 0.65rem;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.8);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* Hamburger button — hidden on desktop */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    z-index: 110;
}

.nav-hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--navy);
    border-radius: 2px;
    transition: all 0.25s ease;
    transform-origin: center;
}

.nav-hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-hamburger.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.nav-hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav-links {
    display: flex;
    gap: 0;
    list-style: none;
}

.nav-links a {
    display: block;
    padding: 0 1rem;
    height: 68px;
    line-height: 68px;
    color: rgba(0, 0, 0, 0.4);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
    margin-bottom: -3px;
    cursor: pointer;
    white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
    color: black;
    border-bottom-color: var(--crimson);
    background: rgba(255, 255, 255, 0.04);
}

/* =========================================================
   PAGE SYSTEM
   ========================================================= */

.page {
    display: none;
}

.page.active {
    display: block;
}

/* =========================================================
   HERO
   ========================================================= */

.hero {
    background: var(--navy);
    color: var(--white);
    padding: 4rem 2rem 3.5rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 45%;
    height: 100%;
    background: linear-gradient(135deg, transparent 40%, rgba(192, 57, 43, 0.07) 100%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--crimson), transparent 60%);
}

.hero-inner {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.hero-tag {
    display: inline-block;
    background: var(--crimson);
    color: var(--white);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 4px 12px;
    margin-bottom: 1.2rem;
}

.hero h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2rem, 5vw, 3.8rem);
    font-weight: 600;
    line-height: 1.08;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.58);
    max-width: 500px;
    line-height: 1.75;
    font-weight: 300;
}

.hero-meta {
    display: flex;
    gap: 2rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
}

.hero-stat .num {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--ivory);
    line-height: 1;
    display: block;
}

.hero-stat .lbl {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-top: 4px;
    display: block;
}

/* =========================================================
   LAYOUT UTILITIES
   ========================================================= */

.main-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

.sec-head {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.sec-head h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.55rem;
    font-weight: 600;
    color: var(--navy);
    white-space: nowrap;
}

.sec-line {
    flex: 1;
    min-width: 20px;
    height: 1px;
    background: var(--border);
}

.sec-tag {
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--crimson);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    background: rgba(192, 57, 43, 0.08);
    padding: 3px 10px;
    border-radius: 2px;
    white-space: nowrap;
}

/* =========================================================
   HOME PAGE
   ========================================================= */

.home-grid {
    display: grid;
    grid-template-columns: 1fr 330px;
    gap: 2.5rem;
}

/* --- Announcements --- */

.announce-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.announce-item {
    background: var(--white);
    border-left: 3px solid transparent;
    padding: 1.2rem 1.4rem;
    display: flex;
    gap: 1.2rem;
    align-items: flex-start;
    transition: border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
    flex-wrap: wrap;
}

.announce-item:hover {
    border-left-color: var(--crimson);
    box-shadow: 0 2px 16px var(--shadow);
}

.announce-item.urgent {
    border-left-color: var(--crimson);
}

.announce-date {
    flex-shrink: 0;
    text-align: center;
    min-width: 44px;
}

.announce-date .d {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1;
    display: block;
}

.announce-date .m {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--slate-light);
    display: block;
    margin-top: 2px;
}

.announce-body {
    flex: 1;
    min-width: 0;
}

.announce-title {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--navy);
    line-height: 1.4;
    margin-bottom: 0.3rem;
}

.announce-desc {
    font-size: 0.78rem;
    color: var(--slate-light);
    line-height: 1.55;
}

.announce-badge {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 2px;
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 2px;
    white-space: nowrap;
}

.badge-urgent {
    background: rgba(192, 57, 43, 0.1);
    color: var(--crimson);
}

.badge-notice {
    background: rgba(26, 39, 68, 0.08);
    color: var(--navy);
}

.badge-result {
    background: rgba(39, 174, 96, 0.1);
    color: #27ae60;
}

/* --- Notice Board --- */

.notice-board {
    background: var(--white);
    padding: 1.5rem;
    border-top: 3px solid var(--navy);
}

.notice-board h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.notice-item {
    padding: 0.7rem 0;
    border-bottom: 1px dashed var(--border);
    cursor: pointer;
}

.notice-item:last-child {
    border-bottom: none;
}

.notice-item p {
    font-size: 0.8rem;
    color: var(--slate);
    line-height: 1.5;
    transition: color 0.18s;
    word-break: break-word;
}

.notice-item p:hover {
    color: var(--crimson);
}

.notice-item .nd {
    font-size: 0.65rem;
    color: var(--slate-light);
    margin-top: 3px;
}

/* =========================================================
   CANDIDATES PAGE
   ========================================================= */

.cand-filter {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--white);
    border: 1.5px solid var(--border);
    color: var(--slate);
    padding: 6px 18px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s;
    font-family: 'DM Sans', sans-serif;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--navy);
    border-color: var(--navy);
    color: var(--white);
}

.cand-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5px;
}

.cand-card {
    background: var(--white);
    padding: 1.8rem 1.5rem;
    border-top: 3px solid transparent;
    transition: border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.cand-card:hover {
    border-top-color: var(--crimson);
    box-shadow: 0 4px 24px var(--shadow);
}

.cand-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--navy);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--ivory);
    margin-bottom: 1rem;
    position: relative;
    flex-shrink: 0;
}

.cand-status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--white);
    background: #27ae60;
}

.cand-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--navy);
    margin-bottom: 0.25rem;
}

.cand-roll {
    font-size: 0.72rem;
    color: var(--slate-light);
    letter-spacing: 0.05em;
    margin-bottom: 0.6rem;
}

.cand-post {
    display: inline-block;
    background: rgba(26, 39, 68, 0.07);
    color: var(--navy);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 9px;
    margin-bottom: 0.8rem;
}

.cand-desc {
    font-size: 0.78rem;
    color: var(--slate);
    line-height: 1.55;
}

/* =========================================================
   ABOUT PAGE
   ========================================================= */

.about-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.about-text p {
    font-size: 0.9rem;
    color: var(--slate);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.about-text h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.3rem;
    color: var(--navy);
    margin: 1.8rem 0 0.8rem;
}

.mandate-list {
    list-style: none;
    margin-top: 1rem;
}

.mandate-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.7rem 0;
    border-bottom: 1px dashed var(--border);
    font-size: 0.85rem;
    color: var(--slate);
    line-height: 1.5;
}

.mandate-list li::before {
    content: '—';
    color: var(--crimson);
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

.team-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    margin-top: 0.5rem;
}

.team-card {
    background: var(--white);
    padding: 1.2rem;
    border-top: 2px solid var(--navy);
}

.team-card .role {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--crimson);
    margin-bottom: 0.4rem;
}

.team-card .tname {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--navy);
    margin-bottom: 0.2rem;
}

.team-card .troll {
    font-size: 0.72rem;
    color: var(--slate-light);
}

/* =========================================================
   CALENDAR PAGE
   ========================================================= */

.cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.cal-header-h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.7rem;
    font-weight: 600;
    color: var(--navy);
}

.cal-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cal-btn {
    background: var(--white);
    border: 1.5px solid var(--border);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    color: var(--navy);
    transition: all 0.18s;
    flex-shrink: 0;
}

.cal-btn:hover {
    background: var(--navy);
    color: var(--white);
    border-color: var(--navy);
}

.cal-month-label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--navy);
    min-width: 120px;
    text-align: center;
}

.cal-grid {
    background: var(--white);
    border: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--navy);
    min-width: 560px;
}

.cal-weekdays span {
    text-align: center;
    padding: 0.7rem 0.25rem;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}

.cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    min-width: 560px;
}

.cal-day {
    min-height: 80px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 0.35rem;
    overflow: hidden;
}

.cal-day:nth-child(7n) {
    border-right: none;
}

.cal-day.empty {
    background: rgba(0, 0, 0, 0.015);
}

.cal-day.today .day-num {
    background: var(--navy);
    color: var(--white);
    border-radius: 50%;
}

.day-num {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--slate);
    margin-bottom: 4px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cal-event {
    font-size: 0.58rem;
    font-weight: 500;
    padding: 2px 4px;
    margin-bottom: 2px;
    border-radius: 2px;
    line-height: 1.3;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.ev-red {
    background: rgba(192, 57, 43, 0.12);
    color: var(--crimson);
}

.ev-navy {
    background: rgba(26, 39, 68, 0.1);
    color: var(--navy);
}

.ev-green {
    background: rgba(39, 174, 96, 0.1);
    color: #27ae60;
}

.ev-amber {
    background: rgba(230, 126, 34, 0.12);
    color: #E67E22;
}

.cal-legend {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.2rem;
    flex-wrap: wrap;
}

.leg-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    color: var(--slate);
}

.leg-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* =========================================================
   FAQ PAGE
   ========================================================= */

.faq-wrap {
    max-width: 780px;
}

.faq-item {
    background: var(--white);
    margin-bottom: 1px;
    border-left: 3px solid transparent;
    transition: border-color 0.2s;
}

.faq-item.open {
    border-left-color: var(--crimson);
}

.faq-q {
    padding: 1.2rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    gap: 1rem;
}

.faq-q span:first-child {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--navy);
    line-height: 1.4;
}

.faq-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--crimson);
    transition: transform 0.22s;
    font-weight: 300;
    line-height: 1;
}

.faq-item.open .faq-icon {
    transform: rotate(45deg);
}

.faq-a {
    display: none;
    padding: 0 1.5rem 1.2rem;
    font-size: 0.84rem;
    color: var(--slate);
    line-height: 1.8;
}

.faq-item.open .faq-a {
    display: block;
}

/* =========================================================
   FOOTER
   ========================================================= */

footer {
    background: var(--navy);
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    padding: 2rem 1.5rem;
    font-size: 0.75rem;
    margin-top: 4rem;
    letter-spacing: 0.04em;
    border-top: 3px solid var(--crimson);
    word-break: break-word;
}

footer strong {
    color: rgba(255, 255, 255, 0.75);
}

/* =========================================================
   RESPONSIVE — TABLET  (≤ 960px)
   ========================================================= */

@media (max-width: 960px) {

    /* Nav links shrink */
    .nav-links a {
        padding: 0 0.7rem;
        font-size: 0.72rem;
    }

    /* Home two-col → single col */
    .home-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* About two-col → single col */
    .about-wrap {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* Team grid stays 2-col but narrower */
    .team-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* =========================================================
   RESPONSIVE — MOBILE  (≤ 720px)
   ========================================================= */

@media (max-width: 700px) {

    /* ---------- NAV ---------- */
    .nav-hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 68px;
        left: 0;
        right: 0;
        background: var(--navy);
        flex-direction: column;
        padding: 0.5rem 0 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        border-bottom: 3px solid var(--crimson);
        display: none;
        transition: transform 0.28s ease;
        z-index: 99;
        gap: 0;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        height: 48px;
        line-height: 48px;
        padding: 0 1.5rem;
        font-size: 0.8rem;
        color: whitesmoke;
        border-bottom: none;
        border-left: 3px solid transparent;
        margin-bottom: 0;
    }

    .nav-links a:hover,
    .nav-links a.active {
        border-bottom: none;
        border-left-color: var(--crimson);
        background: rgba(255, 255, 255, 0.06);
    }

    /* ---------- HERO ---------- */
    .hero {
        padding: 2.5rem 1.25rem 2rem;
    }

    .hero-meta {
        gap: 1.5rem;
    }

    /* ---------- MAIN WRAP ---------- */
    .main-wrap {
        padding: 2rem 1.25rem;
    }

    /* ---------- HOME ---------- */
    .home-grid {
        grid-template-columns: 1fr;
    }

    .announce-item {
        padding: 1rem 1rem;
        gap: 0.9rem;
    }

    .announce-badge {
        display: none;
        /* hide on tiny screens to save space */
    }

    /* ---------- CANDIDATES ---------- */
    .cand-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .cand-card {
        padding: 1.2rem 1rem;
    }

    /* ---------- CALENDAR ---------- */
    .cal-header {
        flex-direction: column;
        align-items: flex-start;
    }

    /* cal-grid scrolls horizontally — already handled */

    /* ---------- ABOUT ---------- */
    .about-wrap {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .team-grid {
        grid-template-columns: 1fr;
    }

    /* ---------- FAQ ---------- */
    .faq-q {
        padding: 1rem 1rem;
    }

    .faq-a {
        padding: 0 1rem 1rem;
    }

    /* ---------- FOOTER ---------- */
    footer {
        padding: 1.5rem 1rem;
        font-size: 0.72rem;
    }
}

/* =========================================================
   RESPONSIVE — SMALL MOBILE  (≤ 400px)
   ========================================================= */

@media (max-width: 400px) {
    .nav-title .t1 {
        font-size: 0.88rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-stat .num {
        font-size: 1.6rem;
    }

    .cand-grid {
        grid-template-columns: 1fr 1fr;
    }

    .filter-btn {
        padding: 5px 12px;
        font-size: 0.72rem;
    }

    .announce-date .d {
        font-size: 1.3rem;
    }
}