:root {
    /* Saraswati Girls' Hindu College inspired palette: maroon, gold and white */
    --primary: #8a1538;
    --primary-dark: #5b0d25;
    --secondary: #a86f00;
    --accent: #f2c14e;
    --accent-soft: #fff0bd;
    --ink: #2d1b22;
    --muted: #6f6065;
    --bg: #fff9f2;
    --card: #fff;
    --border: #e7d8cc;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; }
.container { width: min(1160px, 92%); margin: auto; }
.top { background: var(--primary); color: white; padding: .55rem 0; font-size: .9rem; }
.nav { background: white; position: sticky; top: 0; z-index: 10; box-shadow: 0 2px 14px #5b0d2514; border-bottom: 1px solid #8a153812; }
.navin { display: flex; align-items: center; justify-content: space-between; min-height: 74px; gap: 1rem; }
.brand { font-weight: 800; font-size: 1.15rem; }
.brand:hover { text-decoration: none; }
.links { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .92rem; }
.links a[aria-current="page"] { color: var(--primary); font-weight: 800; border-bottom: 2px solid var(--accent); }
.nav-toggle { display: none; border: 0; background: transparent; font-size: 1.65rem; cursor: pointer; }
.hero {
    min-height: 520px;
    display: grid;
    place-items: center;
    color: white;
    background: linear-gradient(90deg, #5b0d25ee, #8a1538c9), url('https://images.unsplash.com/photo-1523050854058-8df90110c9f1?auto=format&fit=crop&w=1800&q=80') center/cover;
}
.hero h1 { font-size: clamp(2.4rem, 6vw, 5rem); line-height: 1.05; margin: .2rem 0; }
.hero-copy { max-width: 650px; font-size: 1.15rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-weight: 700; color: #ffe7a1; }
.eyebrow-secondary { color: var(--secondary); }
.btn {
    display: inline-block;
    border: 0;
    padding: .8rem 1.1rem;
    border-radius: .65rem;
    background: var(--accent);
    color: #3a2415;
    font-weight: 800;
    margin: .35rem .4rem .35rem 0;
    cursor: pointer;
}
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn.alt { background: white; color: var(--primary); }
section { padding: 4rem 0; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.card { background: white; border-radius: 1rem; padding: 1.25rem; border: 1px solid #8a15380d; box-shadow: 0 8px 30px #5b0d2512; }
.card h3 { margin-top: .2rem; }
.muted { color: var(--muted); }
.notice { background: #fff8df; border-left: 5px solid var(--accent); padding: 1rem; border-radius: .5rem; }
.sectionhead { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.sectionhead h2 { font-size: 2rem; margin: 0; }
.footer { background: var(--primary-dark); color: #fff4e7; padding: 3rem 0 1.5rem; border-top: 4px solid var(--accent); }
.footer a:hover { color: white; }
.footergrid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
.pagehero { padding: 4rem 0; background: linear-gradient(135deg, var(--primary), var(--secondary)); color: white; }
.content { max-width: 850px; }
.form { display: grid; gap: 1rem; }
.form label { font-weight: 700; }
.form input, .form textarea, .form select { width: 100%; padding: .85rem; border: 1px solid var(--border); border-radius: .6rem; font: inherit; margin-top: .25rem; background: white; }
.form input:focus, .form textarea:focus, .form select:focus { outline: 3px solid #f2c14e66; border-color: var(--secondary); }
.honeypot { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(1px,1px,1px,1px) !important; white-space: nowrap !important; }
.alert { padding: .85rem 1rem; border-radius: .6rem; }
.alert.success { background: #ecfdf5; border: 1px solid #86efac; color: #166534; }
.alert.error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.map { width: 100%; height: 260px; border: 0; }
.admin { display: grid; grid-template-columns: 240px 1fr; min-height: 80vh; }
.sidebar { background: var(--primary-dark); color: white; padding: 1.5rem; border-right: 4px solid var(--accent); }
.adminmain { padding: 2rem; min-width: 0; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.stat { background: white; padding: 1rem; border-radius: .8rem; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: white; color: var(--ink); padding: .5rem; z-index: 99; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 850px) {
    .navin { flex-wrap: wrap; }
    .nav-toggle { display: block; }
    .links { display: none; width: 100%; flex-direction: column; padding: 0 0 1rem; }
    .links.is-open { display: flex; }
    .grid, .stats, .footergrid { grid-template-columns: 1fr; }
    .admin { grid-template-columns: 1fr; }
    .sidebar { display: none; }
    .hero { min-height: 440px; }
    section { padding: 3rem 0; }
    .sectionhead { align-items: start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

/* Admin CRUD */
.auth-wrap { max-width: 560px; }
.auth-card { padding: 2rem; }
.admin-brand h2 { margin: 0; }
.admin-brand p { margin-top: .25rem; color: #ffe7a1; font-size: .9rem; }
.admin-nav { display: grid; gap: .2rem; margin-top: 1.2rem; }
.admin-nav a { padding: .6rem .7rem; border-radius: .55rem; color: #fff4e7; }
.admin-nav a:hover, .admin-nav a.active { background: #f2c14e24; color: white; text-decoration: none; box-shadow: inset 3px 0 0 var(--accent); }
.admin-logout { display: inline-block; margin-top: 1.5rem; color: #ffe7a1; }
.admin-topbar { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.25rem; }
.admin-topbar h1 { margin: .1rem 0 0; }
.admin-section { padding: 2rem 0 0; }
.admin-module-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.admin-module-card { display: block; transition: transform .15s ease, box-shadow .15s ease; }
.admin-module-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 12px 34px #5b0d2520; }
.text-link { color: var(--secondary); font-weight: 800; }
.badge { display: inline-flex; min-width: 1.4rem; min-height: 1.4rem; align-items: center; justify-content: center; border-radius: 999px; background: var(--accent); color: #3a2415; font-size: .75rem; font-weight: 800; padding: 0 .35rem; }
.admin-table-wrap { overflow-x: auto; background: white; border-radius: .8rem; border: 1px solid #8a15380d; box-shadow: 0 8px 30px #5b0d2512; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 780px; }
.admin-table th, .admin-table td { text-align: left; vertical-align: top; padding: .9rem 1rem; border-bottom: 1px solid #e5e7eb; }
.admin-table th { background: #fff6ea; color: #6a3c49; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
.admin-table tr:last-child td { border-bottom: 0; }
.message-cell { max-width: 340px; white-space: normal; }
.status { display: inline-flex; padding: .2rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 800; background: #e2e8f0; }
.status.published, .status.read { color: #166534; background: #dcfce7; }
.status.draft, .status.new { color: #92400e; background: #fef3c7; }
.status.archived { color: #475569; background: #e2e8f0; }
.row-actions { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.row-actions form { margin: 0; }
.btn-small { padding: .48rem .7rem; font-size: .85rem; margin: 0; }
.btn.alt-outline { background: transparent; color: var(--primary); border: 1px solid #c9aeb7; }
.btn.danger { background: #b91c1c; color: white; }
.form-grid { display: grid; gap: 1rem; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.admin-form-card { max-width: 1050px; }
.empty-state { text-align: center; padding: 3rem 1.5rem; }
.sectionhead.compact { margin-bottom: 1rem; }
.sectionhead.compact h2 { font-size: 1.5rem; }

@media (max-width: 1100px) {
    .admin-module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid.three { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 850px) {
    .admin-topbar { align-items: start; flex-direction: column; }
    .admin-module-grid, .form-grid.two, .form-grid.three { grid-template-columns: 1fr; }
}
