/* HPSR Alumni — one stylesheet for the whole site.
   The four house colours (Vijayanagara red, Asif Jahi yellow, Kakatiya green,
   Satavahana blue) come from the association's logo and carry the brand.
   Type is large and contrast high: many readers are in their 60s and 70s. */

:root {
  --navy: #13284a;
  --navy-2: #1c3a66;
  --red: #d42a20;
  --yellow: #f0b323;
  --green: #3d9a4e;
  --blue: #2a6db5;

  --paper: #faf8f3;
  --card: #ffffff;
  --ink: #1c1e22;
  --muted: #555c69;
  --line: #e2ddd1;
  --link: #1d5797;
  --focus: #f0b323;
  --ok: #2f7d3f;
  --warn: #9a5b00;
  --bad: #b3261e;
  --tint: #f1ede3;

  --font-body: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-head: 'Roboto Slab', Georgia, serif;
  --radius: 12px;
  --shadow: 0 1px 2px rgb(19 40 74 / 6%), 0 6px 20px rgb(19 40 74 / 7%);
  --wrap: 1120px;
  --gutter: 16px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e1623;
    --card: #162133;
    --ink: #eef1f6;
    --muted: #aab3c2;
    --line: #2a3850;
    --link: #8dbcf0;
    --tint: #1b2940;
    --ok: #6cc47d;
    --warn: #e8b04a;
    --bad: #ff8a80;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0e1623;
  --card: #162133;
  --ink: #eef1f6;
  --muted: #aab3c2;
  --line: #2a3850;
  --link: #8dbcf0;
  --tint: #1b2940;
  --ok: #6cc47d;
  --warn: #e8b04a;
  --bad: #ff8a80;
  color-scheme: dark;
}

@media (min-width: 720px) { :root { --gutter: 24px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.125rem/1.6 var(--font-body);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; line-height: 1.2; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: .95rem; }
.center { text-align: center; }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--yellow); color: #000; padding: 10px 16px; z-index: 100; border-radius: 6px; }
.skip:focus { top: 8px; }

/* --- house stripe: the signature element ----------------------------------- */
.stripe { display: flex; height: 6px; }
.stripe i { flex: 1; }
.stripe i:nth-child(1) { background: var(--red); }
.stripe i:nth-child(2) { background: var(--yellow); }
.stripe i:nth-child(3) { background: var(--green); }
.stripe i:nth-child(4) { background: var(--blue); }

/* --- wordmark -------------------------------------------------------------- */
.wordmark { display: inline-flex; flex-direction: column; text-decoration: none; line-height: 1; color: #fff; }
.wordmark b { font: 800 1.9rem/1 var(--font-head); letter-spacing: .01em; }
.wordmark b span:nth-child(1) { color: #ff4a3d; }
.wordmark b span:nth-child(2) { color: var(--yellow); }
.wordmark b span:nth-child(3) { color: #5cc46c; }
.wordmark b span:nth-child(4) { color: #5aa2ec; }
.wordmark small { font: 600 .72rem/1.4 var(--font-body); letter-spacing: .16em; text-transform: uppercase; margin-top: 3px; }

/* --- header ---------------------------------------------------------------- */
.site-header { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 50; }
.site-header .bar { display: flex; align-items: center; gap: 16px; min-height: 72px; }
.site-header nav { margin-left: auto; }
.menu { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; align-items: center; }
.menu a { display: block; color: #fff; text-decoration: none; padding: 10px 12px; border-radius: 8px; font-weight: 600; font-size: 1.02rem; }
.menu a:hover { background: rgb(255 255 255 / 10%); }
.menu a[aria-current="page"] { background: rgb(255 255 255 / 14%); }
.menu .cta { background: var(--yellow); color: #1a1a1a; }
.menu .cta:hover { background: #ffc94a; }
.menu-toggle { display: none; margin-left: auto; background: none; border: 2px solid rgb(255 255 255 / 40%); color: #fff;
  font: 600 1rem var(--font-body); padding: 8px 14px; border-radius: 8px; cursor: pointer; }
@media (max-width: 1100px) {
  .menu-toggle { display: block; }
  .site-header nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--navy); margin: 0;
    display: none; border-top: 1px solid rgb(255 255 255 / 12%); padding: 8px var(--gutter) 16px; }
  .site-header nav.open { display: block; }
  .menu { flex-direction: column; align-items: stretch; }
  .menu a { padding: 14px 12px; font-size: 1.1rem; }
}

.waking { background: var(--yellow); color: #1a1a1a; text-align: center; padding: 10px var(--gutter); font-weight: 600; }

/* --- page sections --------------------------------------------------------- */
main { display: block; min-height: 60vh; }
.page-head { padding: 48px 0 24px; }
.page-head p { font-size: 1.2rem; color: var(--muted); max-width: 680px; }
.section { padding: 40px 0; }
.section-tint { background: var(--tint); }
.eyebrow { font: 700 .85rem/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--red); margin-bottom: 12px; }
:root[data-theme="dark"] .eyebrow { color: #ff7a70; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .eyebrow { color: #ff7a70; } }

.hero { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; padding: 64px 0 72px; position: relative; overflow: hidden; }
.hero.photo { background: linear-gradient(90deg, rgb(19 40 74 / 94%) 0%, rgb(19 40 74 / 80%) 55%, rgb(19 40 74 / 45%) 100%),
  url('/images/school/campus.jpg') center / cover no-repeat; padding: 80px 0 96px; }
@media (max-width: 899px) { .hero.photo { background: linear-gradient(rgb(19 40 74 / 88%), rgb(19 40 74 / 88%)), url('/images/school/campus.jpg') center / cover no-repeat; } }
.photo-band { border-radius: var(--radius); width: 100%; aspect-ratio: 16 / 7; object-fit: cover; margin: 8px 0 24px; }
.people-plain .person { cursor: pointer; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); max-width: 14ch; }
.hero p { font-size: 1.25rem; max-width: 560px; color: rgb(255 255 255 / 88%); }
.hero .eyebrow { color: var(--yellow); }
.hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.2fr .8fr; } }
.houses { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.house { border-radius: var(--radius); padding: 18px; color: #fff; min-height: 110px; display: flex; flex-direction: column; justify-content: flex-end; }
.house b { font: 700 1.2rem var(--font-head); }
.house span { font-size: .95rem; opacity: .9; }
.house.red { background: #c4271e; }
.house.yellow { background: #f0b323; color: #1d1d1d; }
.house.green { background: #34874a; }
.house.blue { background: #2a63a6; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-top: -40px; position: relative; }
.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; border-top: 4px solid var(--blue); }
.stat:nth-child(1) { border-color: var(--red); }
.stat:nth-child(2) { border-color: var(--yellow); }
.stat:nth-child(3) { border-color: var(--green); }
.stat b { display: block; font: 700 2rem/1.1 var(--font-head); }
.stat span { color: var(--muted); }

/* --- buttons --------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 22px;
  border-radius: 10px; border: 2px solid transparent; font: 700 1.05rem var(--font-body); text-decoration: none; cursor: pointer;
  background: var(--blue); color: #fff; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-yellow { background: var(--yellow); color: #1a1a1a; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost-light { background: transparent; color: #fff; border-color: rgb(255 255 255 / 50%); }
.btn-danger { background: var(--bad); }
.btn-small { min-height: 38px; padding: 6px 14px; font-size: .95rem; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* --- cards and grids ------------------------------------------------------- */
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card img.cover { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; background: var(--tint); }
.card h3 { margin: 0; font-size: 1.2rem; }
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.card .meta { font-size: .95rem; color: var(--muted); }
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
@media (min-width: 720px) { .panel { padding: 32px; } }
.cover-ph { aspect-ratio: 16 / 10; display: grid; place-items: center; background: var(--navy); position: relative; }
.cover-ph::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 6px;
  background: linear-gradient(90deg, var(--red) 25%, var(--yellow) 25% 50%, var(--green) 50% 75%, var(--blue) 75%); }
.cover-ph .wordmark b { font-size: 2.6rem; }

/* --- articles -------------------------------------------------------------- */
.article { max-width: 760px; }
.article .lead-img { border-radius: var(--radius); margin: 8px 0 24px; width: 100%; }
.article img { border-radius: 8px; margin: 12px 0; }
.article figure { margin: 20px 0; }
.article figcaption { font-size: .95rem; color: var(--muted); }
.article blockquote { margin: 20px 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--yellow); }
.back { display: inline-block; margin-bottom: 16px; font-weight: 600; }

.list-plain { list-style: none; margin: 0; padding: 0; }
.memoriam li { padding: 16px 0; border-bottom: 1px solid var(--line); }
.memoriam li b { font-family: var(--font-head); font-size: 1.15rem; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 2px solid var(--line); margin-bottom: 24px; }
.tabs button, .tabs a { background: none; border: 0; padding: 12px 16px; font: 700 1.05rem var(--font-body); color: var(--muted);
  cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; text-decoration: none; }
.tabs [aria-selected="true"], .tabs .active { color: var(--ink); border-bottom-color: var(--blue); }

/* --- forms ----------------------------------------------------------------- */
.form { display: grid; gap: 18px; }
.form-grid { display: grid; gap: 18px; }
@media (min-width: 720px) { .form-grid.two { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 6px; }
.field label, .label { font-weight: 700; }
.field .hint { font-size: .95rem; color: var(--muted); }
input[type="text"], input[type="email"], input[type="tel"], input[type="url"], input[type="search"], input[type="number"],
input[type="date"], select, textarea {
  width: 100%; min-height: 50px; padding: 10px 14px; font: 400 1.1rem var(--font-body); color: var(--ink);
  background: var(--card); border: 2px solid var(--line); border-radius: 10px;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgb(42 109 181 / 25%); }
.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; }
.check input { width: 24px; height: 24px; margin-top: 2px; flex: none; accent-color: var(--blue); }
.hp { position: absolute; left: -5000px; }
.notice { padding: 14px 18px; border-radius: 10px; background: var(--tint); border-left: 5px solid var(--blue); }
.notice.ok { border-color: var(--ok); }
.notice.bad { border-color: var(--bad); }
.notice.warn { border-color: var(--warn); }

/* --- directory ------------------------------------------------------------- */
.filters { display: grid; gap: 12px; grid-template-columns: 1fr; margin-bottom: 20px; }
@media (min-width: 720px) { .filters { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.people { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.person { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: flex; gap: 16px;
  text-align: left; border: 2px solid transparent; cursor: pointer; font: inherit; color: inherit; width: 100%; }
.person:hover { border-color: var(--line); }
.avatar { width: 64px; height: 64px; border-radius: 50%; flex: none; object-fit: cover; display: grid; place-items: center;
  font: 700 1.3rem var(--font-head); color: #fff; background: var(--navy-2); }
.avatar.big { width: 112px; height: 112px; font-size: 2.2rem; }
.person b { display: block; font-size: 1.15rem; }
.person .meta { color: var(--muted); font-size: 1rem; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .9rem; font-weight: 700; background: var(--tint); }
.chip.red { background: #fde4e1; color: #8e1a13; }
.chip.yellow { background: #fdf0cc; color: #6b4d00; }
.chip.green { background: #ddf1e0; color: #1f5e2c; }
.chip.blue { background: #dde9f8; color: #1b4a80; }
.chip.pending { background: #fdf0cc; color: #6b4d00; }
.chip.approved { background: #ddf1e0; color: #1f5e2c; }
.chip.rejected, .chip.removed { background: #fde4e1; color: #8e1a13; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 28px 0; }

dialog { border: 0; border-radius: var(--radius); padding: 0; max-width: min(640px, calc(100vw - 24px)); width: 100%;
  background: var(--card); color: var(--ink); box-shadow: 0 20px 60px rgb(0 0 0 / 30%); }
dialog::backdrop { background: rgb(10 20 35 / 55%); }
.dialog-body { padding: 24px; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.close { background: none; border: 0; font-size: 1.8rem; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 16px 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; overflow-wrap: anywhere; }

/* --- admin ----------------------------------------------------------------- */
.table-wrap { overflow-x: auto; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
table.data { border-collapse: collapse; width: 100%; font-size: 1rem; }
table.data th, table.data td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-size: .9rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
table.data tr.click { cursor: pointer; }
table.data tr.click:hover td { background: var(--tint); }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 24px; }
.kpi { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.kpi b { display: block; font: 700 1.7rem var(--font-head); }
.kpi span { color: var(--muted); font-size: .95rem; }
.progress { height: 14px; background: var(--tint); border-radius: 999px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--green); transition: width .4s; }

.compose { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .compose { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .compose .preview { position: sticky; top: 90px; } }
.compose .preview iframe { width: 100%; height: 78vh; border: 0; border-radius: var(--radius); background: #f4f1ea; box-shadow: var(--shadow); }
.block { border: 2px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--card); display: grid; gap: 12px; }
.block-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.block-head b { text-transform: capitalize; }

/* --- footer ---------------------------------------------------------------- */
.site-footer { background: var(--navy); color: rgb(255 255 255 / 85%); margin-top: 56px; }
.site-footer a { color: #fff; }
.site-footer .cols { display: grid; gap: 28px; padding-block: 40px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.site-footer h3 { font-size: 1.05rem; color: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer .base { border-top: 1px solid rgb(255 255 255 / 12%); padding-block: 16px 24px; font-size: .95rem; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--paper);
  padding: 14px 22px; border-radius: 10px; font-weight: 600; z-index: 200; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .site-header, .site-footer, .actions { display: none; } body { background: #fff; } }

/* --- gallery albums -------------------------------------------------------- */
.album { aspect-ratio: 4 / 3; justify-content: flex-end; padding: 22px; color: #fff; text-decoration: none; position: relative;
  font: 700 1.45rem/1.2 var(--font-head); transition: transform .15s; }
.album::after { content: 'Open album →'; font: 600 1rem var(--font-body); opacity: .9; margin-top: 6px; }
.album:hover { transform: translateY(-2px); }
.album.red { background: linear-gradient(150deg, #d9372d, #a61f17); }
.album.yellow { background: linear-gradient(150deg, #f5c33f, #d99a0b); color: #1d1d1d; }
.album.green { background: linear-gradient(150deg, #47a85a, #2b7a3d); }
.album.blue { background: linear-gradient(150deg, #3a7fc7, #23558f); }

/* --- payments -------------------------------------------------------------- */
#amount-choices button[aria-pressed="true"] { background: var(--yellow); color: #1a1a1a; border-color: var(--yellow); }
#pay-status, #test-mode { margin-bottom: 24px; }
