/* ==========================================================================
   JFA Website — Design tokens
   Palette drawn directly from the JFA emblem: maroon figures, navy seal text, gold sun
   ========================================================================== */
:root {
    --navy-900: #5c0a1a;
    --navy-800: #7a0f22;
    --navy-700: #171874;
    --navy-100: #e9e6f2;
    --gold-500: #f2c200;
    --gold-600: #d9a900;
    --paper: #f7f5f0;
    --ink: #202730;
    --ink-soft: #57616e;
    --line: #dfe3e8;
    --white: #ffffff;
    --success: #2f7d4f;
    --danger: #b3341f;

    --font-display: 'Merriweather', Georgia, 'Times New Roman', serif;
    --font-body: 'Source Sans 3', 'Segoe UI', Roboto, Arial, sans-serif;

    --radius: 4px;
    --shadow-sm: 0 1px 3px rgba(92, 10, 26, 0.1);
    --shadow-md: 0 4px 16px rgba(92, 10, 26, 0.15);
}

@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700;900&family=Source+Sans+3:wght@400;500;600;700&display=swap');

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--paper);
    line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: var(--navy-700); text-decoration: none; }
a:hover { color: var(--gold-600); }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--navy-900); line-height: 1.25; margin: 0 0 0.5em; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
    background: var(--navy-900);
    border-bottom: 3px solid var(--gold-500);
    position: sticky; top: 0; z-index: 100;
}
.header-inner { display: flex; align-items: center; justify-content: space-between;  }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--gold-500); color: var(--navy-900);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-weight: 900; font-size: 15px;
    border: 2px solid var(--white);
}
.brand-logo-img {    flex-shrink: 0;
    height: 125px;
    background: white;}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-title { color: var(--white); font-family: var(--font-display); font-weight: 700; font-size: 23px; }
.brand-sub { color: #d7c3cb; font-size: 13px; letter-spacing: 0.3px; }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a {
    color: #dbe4f0; font-weight: 600; font-size: 14.5px;
    padding: 10px 14px; border-radius: var(--radius);
    transition: background 0.15s, color 0.15s;
}
.site-nav a:hover, .site-nav a.active { background: rgba(232,163,61,0.15); color: var(--gold-500); }
.nav-toggle { display: none; background: none; border: none; color: var(--white); font-size: 24px; cursor: pointer; }

/* ---------- Nav dropdown (Announcements / Documents) ---------- */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
    background: none; border: none; cursor: pointer; font-family: inherit;
    color: #dbe4f0; font-weight: 600; font-size: 14.5px;
    padding: 10px 14px; border-radius: var(--radius);
    display: inline-flex; align-items: center; gap: 6px;
    transition: background 0.15s, color 0.15s;
}
.nav-dropdown-toggle .caret { font-size: 10px; line-height: 1; transition: transform 0.15s; }
.nav-dropdown-toggle:hover,
.nav-dropdown-toggle.active,
.nav-dropdown.active-group .nav-dropdown-toggle,
.nav-dropdown.open .nav-dropdown-toggle {
    background: rgba(232,163,61,0.15); color: var(--gold-500);
}
.nav-dropdown.open .nav-dropdown-toggle .caret { transform: rotate(180deg); }
.nav-dropdown-menu {
    display: none; position: absolute; top: 100%; left: 0; margin-top: 4px; min-width: 230px;
    background: var(--navy-800); border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 6px; z-index: 150;
}
.nav-dropdown-menu a {
    display: block; padding: 9px 12px; border-radius: var(--radius);
    white-space: nowrap; color: #dbe4f0; font-weight: 600; font-size: 14.5px;
}
.nav-dropdown-menu a:hover, .nav-dropdown-menu a.active { background: rgba(232,163,61,0.15); color: var(--gold-500); }
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu { display: block; }

@media (max-width: 900px) {
    .nav-toggle { display: block; }
    .site-nav {
        display: none; flex-direction: column; width: 100%;
        background: var(--navy-800); position: absolute; left: 0; top: 100%;
        padding: 10px 20px 16px; box-shadow: var(--shadow-md);
    }
    .site-nav.open { display: flex; }
    .nav-dropdown-toggle { width: 100%; justify-content: space-between; }
    .nav-dropdown-menu {
        display: none; position: static; width: 100%; margin-top: 2px;
        background: rgba(0,0,0,0.15); box-shadow: none; border: none;
    }
    .nav-dropdown.open .nav-dropdown-menu { display: block; }
}

/* ---------- Hero ---------- */
.hero {
    background: linear-gradient(160deg, var(--navy-900) 0%, var(--navy-700) 100%);
    color: var(--white);
    padding: 64px 0 72px;
    position: relative;
    overflow: hidden;
}
.hero::after {
    content: ""; position: absolute; right: -80px; top: -80px;
    width: 320px; height: 320px; border-radius: 50%;
    background: radial-gradient(circle, rgba(242,194,0,0.25), transparent 70%);
}
.hero .eyebrow {
    text-transform: uppercase; letter-spacing: 2px; font-size: 12.5px;
    color: var(--gold-500); font-weight: 700; margin-bottom: 14px; display: block;
}
.hero h1 { color: var(--white); font-size: clamp(28px, 4vw, 42px); max-width: 720px; }
.hero p { color: #cdd8e8; max-width: 620px; font-size: 17px; }
.hero .badges { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.hero .badge {
    border: 1px solid rgba(255,255,255,0.25); color: #e7edf5;
    padding: 6px 14px; border-radius: 999px; font-size: 13px;
}
.hero-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; position: relative; z-index: 1; }
.hero-text { flex: 1; min-width: 0; }
.hero-logo {
    width: 176px; height: 176px; border-radius: 50%; flex-shrink: 0;
    background: var(--white); padding: 8px; border: 3px solid var(--gold-500);
    box-shadow: var(--shadow-md);
}
@media (max-width: 800px) {
    .hero-inner { flex-direction: column-reverse; text-align: center; gap: 20px; }
    .hero-logo { width: 130px; height: 130px; }
    .hero .badges { justify-content: center; }
}

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section-alt { background: var(--white); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 28px; flex-wrap: wrap; gap: 10px; }
.section-head h2 { font-size: 26px; }
.section-head .see-all { font-weight: 600; font-size: 14px; }
.eyebrow-line {
    display: inline-block; width: 42px; height: 3px; background: var(--gold-500);
    margin-bottom: 10px;
}

/* ---------- Cards ---------- */
.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 800px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
    background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 22px; box-shadow: var(--shadow-sm); transition: box-shadow 0.15s, transform 0.15s;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card .date-tag {
    display: inline-block; font-size: 12px; font-weight: 700; color: var(--navy-700);
    background: var(--navy-100); padding: 3px 10px; border-radius: 999px; margin-bottom: 10px;
}
.card h3 { font-size: 18px; margin-bottom: 8px; }
.card p { color: var(--ink-soft); font-size: 14.5px; margin: 0; }

/* ---------- Committee ---------- */
.committee-category { margin-bottom: 36px; }
.committee-category h3 {
    font-size: 16px; text-transform: uppercase; letter-spacing: 1px;
    color: var(--gold-600); border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 18px;
}
.member-card {
    display: flex; align-items: center; gap: 14px; background: var(--white);
    border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
}
.member-avatar {
    width: 50px; height: 50px; border-radius: 50%; background: var(--navy-100);
    color: var(--navy-800); display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-weight: 700; font-size: 16px; flex-shrink: 0;
    overflow: hidden;
}
.member-avatar img { width: 100%; height: 100%; object-fit: cover; }
.member-name { font-weight: 700; color: var(--navy-900); font-size: 15px; }
.member-role { font-size: 13px; color: var(--gold-600); font-weight: 600; }
.member-dept { font-size: 13px; color: var(--ink-soft); }

/* ---------- Gallery ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.gallery-item { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/3; background: var(--navy-100); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s; }
.gallery-item:hover img { transform: scale(1.06); }
.gallery-caption {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 10px;
    background: linear-gradient(to top, rgba(92,10,26,0.85), transparent);
    color: var(--white); font-size: 13px;
}

/* ---------- Gallery: event albums ---------- */
.back-link { display: inline-block; margin-bottom: 18px; font-weight: 600; font-size: 14px; color: var(--navy-700); }
.event-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.event-card {
    display: block; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow-sm); transition: transform 0.15s, box-shadow 0.15s;
}
.event-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.event-card-cover { position: relative; aspect-ratio: 4/3; background: var(--navy-100); overflow: hidden; }
.event-card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s; }
.event-card:hover .event-card-cover img { transform: scale(1.06); }
.event-card-noimg { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 40px; }
.event-card-count {
    position: absolute; right: 10px; bottom: 10px; background: rgba(23,24,116,0.82); color: var(--white);
    font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
}
.event-card-body { padding: 14px 16px; }
.event-card-body h3 { font-size: 17px; margin: 0 0 6px; }
.event-card-body p { font-size: 13.5px; color: var(--ink-soft); margin: 0; }

/* ---------- Gallery: Facebook-style album viewer ---------- */
.fb-album { display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: start; }
.fb-album-info {
    background: var(--navy-900); color: #e8ecf3; border-radius: var(--radius);
    padding: 22px 20px; position: sticky; top: 90px;
}
.fb-album-info h1 { color: var(--white); font-size: 21px; margin: 0 0 8px; }
.fb-album-meta { font-size: 12.5px; color: #b9c3d6; margin: 0 0 14px; }
.fb-album-desc { font-size: 14px; line-height: 1.65; color: #dbe4f0; }
.fb-album-viewer { min-width: 0; }
.fb-viewer-main {
    position: relative; background: #0d0d10; border-radius: var(--radius); overflow: hidden;
    display: flex; align-items: center; justify-content: center; min-height: 320px;
}
.fb-viewer-main img { width: 100%; max-height: 78vh; object-fit: contain; display: block; background: #0d0d10; }
.fb-nav-btn {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
    width: 42px; height: 42px; border-radius: 50%; border: none; cursor: pointer;
    background: rgba(0,0,0,0.45); color: var(--white); font-size: 16px;
    display: flex; align-items: center; justify-content: center; transition: background 0.15s;
}
.fb-nav-btn:hover { background: rgba(0,0,0,0.7); }
.fb-nav-btn.prev { left: 14px; }
.fb-nav-btn.next { right: 14px; }
.fb-counter {
    position: absolute; top: 12px; right: 14px; background: rgba(0,0,0,0.5); color: var(--white);
    font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
}
.fb-photo-caption { padding: 10px 2px 0; font-size: 14px; color: var(--ink); min-height: 20px; }
.fb-thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 12px 2px 2px; scrollbar-width: thin; }
.fb-thumb {
    width: 68px; height: 68px; object-fit: cover; border-radius: var(--radius); cursor: pointer;
    opacity: 0.55; flex-shrink: 0; border: 2px solid transparent; transition: opacity 0.15s, border-color 0.15s;
}
.fb-thumb:hover { opacity: 0.85; }
.fb-thumb.active { opacity: 1; border-color: var(--gold-500); }

@media (max-width: 900px) {
    .fb-album { grid-template-columns: 1fr; }
    .fb-album-info { position: static; }
    .fb-viewer-main img { max-height: 55vh; }
    .fb-nav-btn { width: 36px; height: 36px; }
}

/* ---------- Guidelines list ---------- */
.doc-list { list-style: none; padding: 0; margin: 0; }
.doc-item {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 14px 18px; margin-bottom: 12px;
}
.doc-item .doc-icon {
    width: 38px; height: 38px; border-radius: var(--radius); background: var(--navy-100);
    color: var(--navy-800); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; flex-shrink: 0;
}
.doc-title { font-weight: 600; color: var(--navy-900); }
.doc-meta { font-size: 12.5px; color: var(--ink-soft); }
.btn {
    display: inline-block; background: var(--navy-800); color: var(--white);
    padding: 8px 16px; border-radius: var(--radius); font-weight: 600; font-size: 14px;
    border: none; cursor: pointer;
}
.btn:hover { background: var(--navy-700); color: var(--white); }
.btn-gold { background: var(--gold-500); color: var(--navy-900); }
.btn-gold:hover { background: var(--gold-600); }
.btn-outline { background: transparent; border: 1px solid var(--navy-700); color: var(--navy-700); }
.btn-danger { background: var(--danger); }
.btn-sm { padding: 5px 12px; font-size: 13px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-900); color: #c3cede; padding: 32px 0 10px; margin-top: 40px; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: 14px; }
.footer-links a { color: #dbe4f0; }
.footer-copy { font-size: 12.5px; color: #8ea0bb; padding: 18px 0 4px; text-align: center; border-top: 1px solid rgba(255,255,255,0.08); margin-top: 20px; }

/* ---------- Empty states ---------- */
.empty-state { text-align: center; padding: 40px 20px; color: var(--ink-soft); }
.empty-state .icon { font-size: 34px; margin-bottom: 10px; }

/* ---------- Embedded PDF viewer (Rules & Regulations / Societies Act) ---------- */
.pdf-frame-wrap {
    width: 100%; background: var(--white); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden;
}
.pdf-frame-wrap iframe { display: block; width: 100%; height: 85vh; border: 0; }
.pdf-fallback { padding: 18px 20px; font-size: 14px; color: var(--ink-soft); }
@media (max-width: 800px) {
    .pdf-frame-wrap iframe { height: 65vh; }
}

/* ---------- Forms (public + admin shared basics) ---------- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--navy-900); }
input[type=text], input[type=password], input[type=date], input[type=email], input[type=file], textarea, select {
    width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius);
    font-family: var(--font-body); font-size: 14.5px; background: var(--white);
}
textarea { resize: vertical; min-height: 120px; }

/* ---------- Alerts / flash ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 18px; font-size: 14.5px; }
.alert-success { background: #e7f4ec; color: var(--success); border: 1px solid #bfe3cc; }
.alert-error { background: #fbe9e6; color: var(--danger); border: 1px solid #f2c3ba; }

/* ---------- Page content typography ---------- */
.prose { max-width: 780px; }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 16px 22px; }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
