/* ==========================================================================
   Rajputi theme layer
   Loaded after app.css. Everything here is presentation: colours, ornament,
   and the grouped navigation. No layout rule depends on it, so the portal
   still works if this file is removed.
   ========================================================================== */

:root {
    /* A deeper, more regal palette than the base: Mewar maroon, antique gold,
       haldi saffron and an ivory ground. */
    --maroon:        #6d1220;
    --maroon-dark:   #4a0b16;
    --maroon-light:  #8f2233;
    --crimson:       #a52a3a;
    --gold:          #c9a227;
    --gold-deep:     #a8811a;
    --gold-soft:     #e6cf87;
    --saffron:       #e08a1e;
    --ivory:         #fdf9f2;
    --surface-alt:   #f6f2ea;
    --surface-tint:  #fbf3e8;
    --line:          #e6ddcd;
    --ink:           #241a18;
    --ink-soft:      #5d5148;
    --ink-faint:     #8d8177;
    --shadow:        0 1px 3px rgba(74, 11, 22, .07), 0 4px 16px rgba(74, 11, 22, .06);
    --shadow-lg:     0 6px 18px rgba(74, 11, 22, .14), 0 16px 40px rgba(74, 11, 22, .10);
}

body {
    background-color: var(--surface-alt);
    /* A faint buti (dot-and-diamond) motif, the kind printed on Rajasthani
       textiles. Kept very low contrast so text stays comfortable. */
    background-image:
        radial-gradient(circle at 50% 50%, rgba(109, 18, 32, .045) 1.2px, transparent 1.3px),
        radial-gradient(circle at 0 0,     rgba(201, 162, 39, .05) 1.2px, transparent 1.3px);
    background-size: 26px 26px, 26px 26px;
    background-position: 0 0, 13px 13px;
}

/* --- Header ---------------------------------------------------------------- */
.site-header {
    background:
        linear-gradient(180deg, rgba(255,255,255,.06), transparent 45%),
        linear-gradient(135deg, var(--maroon-dark) 0%, var(--maroon) 45%, var(--crimson) 100%);
    border-bottom: 3px solid var(--gold);
    box-shadow: 0 2px 14px rgba(74, 11, 22, .25);
}

/* Gold hairline above the nav, echoing an inlaid border. */
.site-header::after {
    content: ""; display: block; height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
    opacity: .5;
}

/* The emblem supplies its own colour, so the mark is just a frame for it. */
.brand-mark {
    background: none; box-shadow: none;
    width: 46px; height: 46px; flex-basis: 46px;
    display: grid; place-items: center;
}
.brand-mark .emblem { display: block; }
.brand-name { letter-spacing: .01em; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.brand-tag  { color: var(--gold-soft); opacity: .95; letter-spacing: .06em; }

/* --- Two-row masthead ------------------------------------------------------ */
/* On phones the brand and the menu control share one row and everything else
   drops into a drawer beneath them. */
.header-bar { align-items: center; gap: 14px; flex-wrap: wrap; }
.header-right { flex: 1 0 100%; min-width: 0; }
/* Collapsed only when scripting is available to reopen it. */
.js .header-right { display: none; }
.js .site-header.header-open .header-right { display: block; padding-bottom: 10px; }
.header-open .header-utility { justify-content: flex-start; flex-wrap: wrap; }
.header-open .header-main { flex-direction: column; align-items: stretch; gap: 10px; }
.header-open .header-actions { justify-content: flex-start; flex-wrap: wrap; }

.header-utility {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 14px; padding: 5px 0;
    border-bottom: 1px solid rgba(230,207,135,.22);
    font-size: .74rem;
}
.greetings { display: flex; gap: 10px; color: var(--gold-soft); letter-spacing: .04em; }
.social-links { display: flex; gap: 9px; }
.social-links a {
    display: grid; place-items: center; width: 24px; height: 24px;
    border-radius: 50%; color: #fff;
    background: rgba(255,255,255,.1); border: 1px solid rgba(230,207,135,.3);
}
.social-links a:hover { background: var(--gold); color: var(--maroon-dark); border-color: var(--gold); }

.header-main {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 10px; flex-wrap: wrap; row-gap: 6px;
}
.header-main .site-nav { background: transparent; flex: 1 1 auto; min-width: 0; }
.header-main .site-nav .wrap { max-width: none; padding: 0; }
/* Never shrink below its content, and never sit on top of the menu. */
.header-actions { flex: 0 0 auto; gap: 6px; padding-block: 4px; }

.btn-outline {
    background: transparent; color: #fff;
    border: 1px solid rgba(230,207,135,.55);
}
.btn-outline:hover { background: rgba(255,255,255,.14); color: #fff; }

/* --- Grouped navigation ---------------------------------------------------- */
.site-nav { background: var(--maroon-dark); }

.nav-groups {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-direction: column;
}

.nav-group > .nav-group-toggle,
.nav-group > a.nav-link {
    display: flex; align-items: center; gap: 8px; width: 100%;
    padding: 11px 16px; font: inherit; font-size: .92rem; font-weight: 600;
    color: #fff; background: transparent; border: 0; border-bottom: 1px solid rgba(255,255,255,.08);
    cursor: pointer; text-align: start;
}
.nav-group > .nav-group-toggle:hover,
.nav-group > a.nav-link:hover { background: rgba(255,255,255,.1); text-decoration: none; }
.nav-group.is-current > .nav-group-toggle,
.nav-group > a.nav-link.is-active { background: rgba(201,162,39,.2); box-shadow: inset 3px 0 0 var(--gold); }

.nav-caret { margin-inline-start: auto; font-size: .7rem; opacity: .75; transition: transform .15s ease; }
.nav-group.is-open .nav-caret { transform: rotate(180deg); }

/* Without JavaScript every submenu stays expanded, so the whole menu is still
   usable. `js-nav` is added by app.js once it can operate the toggles. */
.nav-submenu {
    list-style: none; margin: 0; padding: 4px 0 8px;
    background: rgba(0,0,0,.22);
    display: block;
}
.js-nav .nav-submenu { display: none; }
.js-nav .nav-group.is-open > .nav-submenu { display: block; }
.nav-submenu a {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 16px 9px 34px; font-size: .88rem; color: rgba(255,255,255,.92);
}
.nav-submenu a:hover { background: rgba(255,255,255,.12); text-decoration: none; color: #fff; }
.nav-submenu a.is-active { color: var(--gold-soft); font-weight: 600; }
.nav-submenu .nav-icon { width: 1.4em; text-align: center; }

/* --- Shared components (every page) ---------------------------------------- */
.ornament { display: flex; justify-content: center; margin: 18px 0; }
.ornament svg { max-width: 100%; height: auto; }

.crest { max-width: 100%; height: auto; }

/* Inline stroke icons. Colour and size come from the parent. */
.ico { display: inline-block; vertical-align: -.15em; flex: 0 0 auto; }

/* Small gold label above a heading. */
.eyebrow {
    color: var(--gold-deep); font-size: .82rem; font-weight: 600;
    letter-spacing: .06em; margin: 0 0 6px;
}
.hero .eyebrow, .home-hero .eyebrow, .home-event .eyebrow { color: var(--gold-soft); }

.section-title { text-align: center; margin: 0; font-size: 1.5rem; }

/* Placeholder shown wherever a photograph has not been uploaded. */
.photo-ph {
    position: relative; width: 100%; height: 100%;
    background: var(--surface-tint); min-height: 120px;
}
.photo-ph svg { width: 100%; height: 100%; display: block; }
.photo-ph-caption {
    position: absolute; inset-block-end: 0; inset-inline: 0;
    display: flex; flex-direction: column; align-items: center; gap: 1px;
    padding: 7px 8px;
    background: linear-gradient(180deg, transparent, rgba(74,11,22,.72));
    text-align: center; line-height: 1.35;
}
.photo-ph-what { font-size: .74rem; font-weight: 600; color: #fff; }
.photo-ph-size {
    font-size: .7rem; color: var(--gold-soft);
    font-variant-numeric: tabular-nums; letter-spacing: .02em;
}
.photo-ph-stage .photo-ph-caption { background: linear-gradient(180deg, transparent, rgba(0,0,0,.6)); }

/* --- Hero: a mehrab (arched niche) silhouette ------------------------------ */
.hero {
    position: relative; overflow: hidden;
    background:
        /* A restrained warm glow low on the panel, so the gold reads as light
           falling on the arch rather than muddying the maroon. */
        radial-gradient(ellipse 70% 45% at 50% 112%, rgba(201,162,39,.20), transparent 70%),
        linear-gradient(150deg, var(--maroon-dark) 0%, var(--maroon) 58%, #7d1a2a 100%);
    border-bottom: 3px solid var(--gold);
}

/* Repeating arcade of arches across the top, as on a haveli facade. */
.hero::before {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 46px;
    background-image:
        radial-gradient(circle at 50% 100%, transparent 21px, rgba(201,162,39,.30) 22px, transparent 23px);
    background-size: 52px 46px;
    background-repeat: repeat-x;
    opacity: .85; pointer-events: none;
}

.hero .wrap { position: relative; z-index: 1; }
.hero h1 {
    font-family: "Nirmala UI", "Noto Sans Devanagari", Georgia, serif;
    text-shadow: 0 2px 10px rgba(0,0,0,.32);
    letter-spacing: .005em;
}
.hero p { color: var(--gold-soft); opacity: 1; }

.hero .btn:not(.btn-secondary) {
    background: linear-gradient(180deg, var(--gold-soft), var(--gold) 45%, var(--gold-deep));
    color: var(--maroon-dark); border-color: rgba(255,255,255,.35);
    box-shadow: 0 3px 12px rgba(0,0,0,.24);
    font-weight: 700;
}
.hero .btn:not(.btn-secondary):hover {
    background: linear-gradient(180deg, var(--gold), var(--gold-deep));
    color: var(--maroon-dark);
}

/* --- Section headings with a small gold rule ------------------------------- */
.page-head h1,
.card-head h2 { position: relative; }

h1, h2 { font-family: "Nirmala UI", "Noto Sans Devanagari", Georgia, serif; }

.page-head > div > h1::after {
    content: ""; display: block; width: 54px; height: 3px; margin-top: 7px;
    background: linear-gradient(90deg, var(--gold), transparent);
    border-radius: 2px;
}

/* --- Cards ----------------------------------------------------------------- */
.card {
    background: var(--ivory);
    border-color: var(--line);
}
.card-head {
    background: linear-gradient(180deg, var(--surface-tint), var(--ivory));
    border-bottom-color: var(--gold-soft);
}

.stat { background: var(--ivory); border-color: var(--line); }
.stat::before {
    content: ""; display: block; width: 26px; height: 2px; margin-bottom: 8px;
    background: var(--gold); border-radius: 2px;
}
.stat-value { font-family: "Nirmala UI", "Noto Sans Devanagari", Georgia, serif; }

.tile { background: var(--ivory); }
.tile-foot { background: var(--surface-tint); border-top-color: var(--line); }

table.data th {
    background: linear-gradient(180deg, var(--surface-tint), var(--surface-alt));
    border-bottom: 2px solid var(--gold-soft);
    color: var(--maroon-dark);
}

/* --- Buttons --------------------------------------------------------------- */
.btn {
    background: linear-gradient(180deg, var(--maroon-light), var(--maroon));
    box-shadow: 0 1px 3px rgba(74,11,22,.28);
}
.btn:hover { background: linear-gradient(180deg, var(--maroon), var(--maroon-dark)); }
.btn-secondary {
    background: var(--ivory); color: var(--maroon-dark); border-color: var(--gold-soft);
}
.btn-secondary:hover { background: var(--surface-tint); color: var(--maroon-dark); }

/* The gold call-to-action, used across the site. Declared after .btn so its
   gradient wins — both are single-class selectors, so order decides. */
.btn-gold {
    background: linear-gradient(180deg, var(--gold-soft), var(--gold) 46%, var(--gold-deep));
    color: var(--maroon-dark); border-color: rgba(255,255,255,.4); font-weight: 700;
}
.btn-gold:hover {
    background: linear-gradient(180deg, var(--gold), var(--gold-deep));
    color: var(--maroon-dark);
}

/* --- Membership card: gold-bordered, arched header ------------------------- */
.mcard {
    background:
        radial-gradient(ellipse at 50% -10%, rgba(201,162,39,.30), transparent 60%),
        linear-gradient(135deg, var(--maroon-dark), var(--maroon) 55%, var(--crimson));
    border: 2px solid var(--gold);
    box-shadow: var(--shadow-lg);
    position: relative;
}
.mcard::after {
    /* Inner gold hairline, like a card mount. */
    content: ""; position: absolute; inset: 5px;
    border: 1px solid rgba(230,207,135,.42); border-radius: 9px; pointer-events: none;
}
.mcard-head {
    border-bottom: 1px solid rgba(230,207,135,.42);
    background: linear-gradient(180deg, rgba(0,0,0,.16), transparent);
}
.mcard-org { color: #fff; }
.mcard-sub { color: var(--gold-soft); opacity: 1; }
.mcard-photo { border: 2px solid rgba(230,207,135,.55); }
.mcard-name { color: var(--gold-soft); }
.mcard-foot { background: var(--ivory); border-top: 2px solid var(--gold); }
.mcard-no { color: inherit; }

/* --- Footer ---------------------------------------------------------------- */
.site-footer {
    background: linear-gradient(180deg, var(--maroon-dark), #3a0810);
    border-top: 3px solid var(--gold);
    padding-top: 32px;
}
.site-footer h4 {
    color: var(--gold-soft); font-size: .95rem; margin-bottom: 12px;
    padding-bottom: 8px; border-bottom: 1px solid rgba(230,207,135,.22);
}

.footer-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.footer-name { color: #fff; font-weight: 700; font-size: 1rem; margin: 0; line-height: 1.3; }
.footer-tag { color: var(--gold-soft); font-size: .74rem; margin: 2px 0 0; letter-spacing: .05em; }
.footer-blurb { font-size: .84rem; line-height: 1.75; margin-bottom: 14px; }

.footer-social { display: flex; gap: 9px; }
.footer-social a {
    display: grid; place-items: center; width: 32px; height: 32px;
    border-radius: 50%; font-size: .82rem; font-weight: 700;
    background: rgba(255,255,255,.1); border: 1px solid rgba(230,207,135,.3); color: #fff;
}
.footer-social a:hover { background: var(--gold); color: var(--maroon-dark); text-decoration: none; }

.footer-contact { list-style: none; margin: 0; padding: 0; font-size: .85rem; }
.footer-contact li { display: flex; gap: 9px; margin-bottom: 11px; line-height: 1.6; }
.footer-ico { color: var(--gold); flex: 0 0 auto; margin-top: 1px; }
.footer-empty { color: rgba(255,255,255,.5); font-style: italic; }

.footer-bottom {
    display: flex; flex-direction: column; gap: 6px;
    align-items: center; text-align: center;
}
.footer-policy { margin: 0; display: flex; gap: 9px; align-items: center; }
.footer-policy span { opacity: .4; }

/* --- Admin shell ----------------------------------------------------------- */
.admin-banner { background: var(--maroon-dark); border-bottom: 1px solid var(--gold-deep); }
.admin-side nav a.is-active {
    background: linear-gradient(180deg, var(--maroon-light), var(--maroon));
    box-shadow: inset 3px 0 0 var(--gold);
}

/* --- Demo card page -------------------------------------------------------- */
.demo-features { display: grid; gap: 14px; grid-template-columns: 1fr; margin-top: 20px; }
.demo-feature {
    background: var(--ivory); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 14px; text-align: center; box-shadow: var(--shadow);
}
.demo-feature-icon { font-size: 1.6rem; display: block; margin-bottom: 6px; }
.demo-feature h3 { font-size: .95rem; margin-bottom: 4px; }
.demo-feature p { font-size: .82rem; color: var(--ink-soft); margin: 0; }

.demo-stage {
    background:
        radial-gradient(ellipse at 50% 0%, rgba(201,162,39,.14), transparent 65%),
        var(--surface-tint);
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 28px 16px; margin-bottom: 6px;
}

/* --- Responsive ------------------------------------------------------------ */
@media (min-width: 900px) {
    /* The masthead becomes two rows: utility strip above, nav and actions below. */
    .header-right,
    .js .header-right { display: block; flex: 1; }
    .header-bar { align-items: stretch; padding: 0; flex-wrap: nowrap; }
    .brand { align-self: center; }
    .site-header .site-nav { position: static; }
    .site-header .site-nav[hidden] { display: block; }

    .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1.4fr; gap: 28px; }
    .footer-bottom { flex-direction: row; justify-content: space-between; text-align: start; }

    .nav-groups { flex-direction: row; flex-wrap: wrap; }

    .nav-group { position: relative; }
    .nav-group > .nav-group-toggle,
    .nav-group > a.nav-link {
        width: auto; border-bottom: 0; padding: 11px 9px; font-size: .84rem;
        white-space: nowrap; gap: 6px;
    }
    .nav-group > .nav-group-toggle .nav-caret { margin-inline-start: 2px; }
    /* The brand yields space first, but the menu must still be allowed to wrap:
       a signed-in member has eight groups plus two buttons, and forcing that
       onto one line makes the buttons overlap the menu instead of moving down. */
    .nav-groups { flex-wrap: wrap; row-gap: 2px; }
    .brand { flex: 0 1 auto; min-width: 0; max-width: 25%; }
    .nav-group.is-current > .nav-group-toggle,
    .nav-group > a.nav-link.is-active {
        box-shadow: inset 0 -3px 0 var(--gold); background: rgba(255,255,255,.1);
    }

    /* Dropdowns open on hover and on keyboard focus, so the menu is reachable
       without a pointer. */
    .nav-submenu,
    .js-nav .nav-submenu {
        position: absolute; top: 100%; inset-inline-start: 0; z-index: 60;
        min-width: 232px; padding: 6px 0;
        background: var(--maroon-dark);
        border: 1px solid var(--gold-deep); border-top: 0;
        border-radius: 0 0 var(--radius-sm) var(--radius-sm);
        box-shadow: 0 12px 28px rgba(0,0,0,.34);
        display: none;
    }
    .nav-group:hover > .nav-submenu,
    .nav-group:focus-within > .nav-submenu,
    .js-nav .nav-group:hover > .nav-submenu,
    .js-nav .nav-group:focus-within > .nav-submenu,
    .js-nav .nav-group.is-open > .nav-submenu { display: block; }

    .nav-submenu a { padding: 9px 16px; }

    .demo-features { grid-template-columns: repeat(3, 1fr); }
    .hero::before { height: 60px; background-size: 68px 60px; }
}
