/* GT PSAS - simple starter styles. The full design comes later. */
:root {
  --navy: #003057;
  --navy-dark: #00223e;
  --gold: #b3a369;
  --gold-light: #eae4cf;
  --ink: #1d232a;
  --muted: #5b6672;
  --line: #d9dde2;
  --bg: #f7f7f4;
  --white: #ffffff;
  --error-bg: #fbeaea;  --error-ink: #8a1c1c;
  --success-bg: #e8f3ea; --success-ink: #1f5d2c;
  --info-bg: #eaf0f7;    --info-ink: #1d3e63;
  --radius: 6px;
  font-size: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; padding-top: 2rem; padding-bottom: 3rem; }
a { color: var(--navy); }
h1, h2 { line-height: 1.2; color: var(--navy); }
h1 { font-size: 1.9rem; margin: 0 0 .75rem; }
h2 { font-size: 1.2rem; margin: 0 0 .5rem; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }

/* Header */
.site-header { background: var(--navy); color: var(--white); border-bottom: 4px solid var(--gold); }
.header-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; padding-top: .75rem; padding-bottom: .75rem; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--white); text-decoration: none; margin-right: auto; }
.brand-mark { background: var(--gold); color: var(--navy-dark); font-weight: 800; letter-spacing: .05em; padding: .2rem .45rem; border-radius: 4px; font-size: .9rem; }
.brand-name { font-weight: 600; }
.main-nav, .account { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; }
.site-header a, .link-button { color: var(--white); text-decoration: none; font-size: .95rem; }
.site-header a:hover, .link-button:hover { text-decoration: underline; }
.site-header a[aria-current="page"] { color: var(--gold); }
.who { font-size: .95rem; color: var(--gold-light); }
.badge { background: var(--gold); color: var(--navy-dark); font-size: .7rem; font-weight: 700; padding: .05rem .4rem; border-radius: 999px; margin-left: .25rem; vertical-align: middle; }
form.inline { display: inline; margin: 0; }
.link-button { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }

/* Footer */
.site-footer { background: var(--navy-dark); color: var(--gold-light); font-size: .85rem; padding: 1rem 0; }

/* Home */
.hero { padding: 1rem 0 2rem; max-width: 760px; }
.lead { font-size: 1.1rem; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.card { background: var(--white); border: 1px solid var(--line); border-top: 3px solid var(--gold); border-radius: var(--radius); padding: 1.25rem; }
.card p { margin: 0; color: var(--muted); }

/* Buttons */
.button {
  display: inline-block; background: var(--navy); color: var(--white); border: 1px solid var(--navy);
  border-radius: var(--radius); padding: .6rem 1.1rem; font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer; margin: 0 .5rem .5rem 0;
}
.button:hover { background: var(--navy-dark); }
.button.secondary { background: var(--white); color: var(--navy); }
.button.secondary:hover { background: var(--gold-light); }

/* Forms */
.form-page { max-width: 520px; }
.stack { display: flex; flex-direction: column; gap: 1rem; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; margin: 1rem 0; }
.stack .button { align-self: flex-start; margin: 0; }
label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .95rem; }
.hint { font-weight: 400; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"] {
  font: inherit; font-weight: 400; padding: .55rem .7rem; border: 1px solid #b9c0c8; border-radius: var(--radius); width: 100%; background: var(--white);
}
input:focus, .button:focus-visible, a:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.aside { color: var(--muted); font-size: .95rem; }

/* Messages */
.flash { border-radius: var(--radius); padding: .75rem 1rem; margin: 0 0 1rem; }
.flash-error   { background: var(--error-bg);   color: var(--error-ink); }
.flash-success { background: var(--success-bg); color: var(--success-ink); }
.flash-info    { background: var(--info-bg);    color: var(--info-ink); }

@media (max-width: 560px) {
  .two-col { grid-template-columns: 1fr; }
  h1 { font-size: 1.5rem; }
}

/* ---------- Directory and profiles ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.title-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin-bottom: .5rem; }
.title-row h1 { margin: 0; }
.title-actions .button { margin: 0 0 0 .5rem; }
.crumbs { margin: 0 0 .75rem; font-size: .95rem; }
.subtitle { color: var(--muted); margin: 0 0 1.25rem; }

.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem 1rem; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin: 1rem 0; }
.filters label:first-child { flex: 1 1 260px; }
.filters .button { margin: 0; }
.filters .clear { align-self: center; }
select, input[type="search"], input[type="url"] {
  font: inherit; font-weight: 400; padding: .55rem .7rem; border: 1px solid #b9c0c8; border-radius: var(--radius); background: var(--white); width: 100%;
}
select { width: auto; min-width: 7rem; }
.count { color: var(--muted); font-size: .95rem; margin: 0 0 .5rem; }

.table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: .55rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
thead th { background: #eef0f2; font-weight: 700; white-space: nowrap; }
thead th a { color: var(--navy); text-decoration: none; }
thead th a:hover { text-decoration: underline; }
table.directory tbody tr:hover { background: #fafaf5; }
table.directory td a { text-decoration: none; font-weight: 600; }
table.directory td a:hover { text-decoration: underline; }
td.same { color: var(--muted); }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .02em; padding: .05rem .45rem; border-radius: 999px; background: var(--gold-light); color: #5a4d1f; vertical-align: middle; }
.tag-warn { background: var(--error-bg); color: var(--error-ink); }
.pager { display: flex; justify-content: center; gap: 1.5rem; margin: 1rem 0; }

.details { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 1.5rem; }
.details > div { padding: .7rem 1rem; border-bottom: 1px solid var(--line); }
.details dt { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.details dd { margin: .15rem 0 0; overflow-wrap: anywhere; }
.none { color: #9aa3ad; }
ul.plain { list-style: none; margin: 0; padding: 0; }
.admin-box { border: 1px dashed var(--gold); border-radius: var(--radius); padding: 1rem 1.25rem; background: #fffdf6; }
.admin-box h2 { font-size: 1rem; }

/* Edit forms */
.edit-page { max-width: 900px; }
.edit-page h2 { margin-top: 2rem; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem 1.25rem; }
.grid-form .field { display: flex; flex-direction: column; gap: .3rem; }
.grid-form .field.wide { grid-column: 1 / -1; }
.grid-form .field > label { display: block; }
.grid-form .label { font-weight: 600; font-size: .95rem; }
.readonly { padding: .55rem 0; }
.field .hint { font-size: .85rem; }
.field-error { color: var(--error-ink); font-size: .88rem; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--error-ink); background: #fffafa; }
.inline-form { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .35rem .75rem; margin: 0 .75rem 0 0; }
label.check { display: inline-flex; flex-direction: row; align-items: center; gap: .35rem; font-weight: 400; }
.link-button.dark { color: var(--navy); text-decoration: underline; }
.link-button.danger { color: var(--error-ink); text-decoration: underline; }
td.actions { white-space: nowrap; }
.add-email { margin: 1rem 0; max-width: 520px; }
.add-email .row { display: flex; gap: .5rem; margin-top: .3rem; }
.add-email .row .button { margin: 0; }
.tag-muted { background: #eceef0; color: var(--muted); }
.button.danger-outline { color: var(--error-ink); border-color: var(--error-ink); }
.button.danger-outline:hover { background: var(--error-bg); }

/* Profile page */
.profile .title-row { margin-bottom: 1rem; }
.profile-card { background: var(--white); border: 1px solid var(--line); border-top: 3px solid var(--gold); border-radius: var(--radius); margin: 0 0 1.5rem; }
.p-line { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .75rem 2rem; padding: 1rem 1.25rem; }
.p-line + .p-line { border-top: 1px solid var(--line); }
.p-item { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.p-label { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.p-value { font-size: 1.05rem; overflow-wrap: anywhere; }
.p-value ul.plain li + li { margin-top: .2rem; }

/* Change record */
.nowrap { white-space: nowrap; }
table.changes td.val { max-width: 260px; overflow-wrap: anywhere; }
input[type="date"] { font: inherit; padding: .5rem .6rem; border: 1px solid #b9c0c8; border-radius: var(--radius); background: var(--white); }
.filters label.check { align-self: center; }

/* Email list sync */
.tag { white-space: nowrap; }
section > h2 { margin-top: 2rem; }

/* Front page: social links */
.connect { margin-top: 2.5rem; }
.connect h2 { margin-bottom: .75rem; }
.connect-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.connect-link { display: flex; flex-direction: column; gap: .2rem; background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--navy); border-radius: var(--radius); padding: 1rem 1.25rem; text-decoration: none; color: var(--ink); }
.connect-link:hover { border-left-color: var(--gold); background: #fffdf6; }
.connect-name { font-weight: 700; color: var(--navy); font-size: 1.05rem; }
.connect-desc { color: var(--muted); font-size: .95rem; }

.card h2 a { color: inherit; text-decoration: none; }
.card h2 a:hover { text-decoration: underline; }

/* Front page banner (the PSAS banner used on social media) */
.home-banner { background: #e5e5e5; border-bottom: 1px solid #d4d4d4; padding: 1.25rem 16px; text-align: center; }
.home-banner img { display: block; width: 100%; max-width: 760px; height: auto; margin: 0 auto; }
@media (max-width: 560px) { .home-banner { padding: .75rem 12px; } }

/* Events */
.events-heading { margin: 1.75rem 0 .75rem; }
.event-list { display: flex; flex-direction: column; gap: 1rem; }
.event-card { display: grid; grid-template-columns: 220px 1fr; gap: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.event-card:not(:has(.event-thumb)) { grid-template-columns: 1fr; }
.event-thumb { display: block; background: #eef0f2; }
.event-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; aspect-ratio: 3 / 2; }
.event-body { padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: .35rem; }
.event-body h3 { margin: 0; font-size: 1.2rem; line-height: 1.25; }
.event-body h3 a { color: var(--navy); text-decoration: none; }
.event-body h3 a:hover { text-decoration: underline; }
.event-when { margin: 0; font-size: .85rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: #8a6d1f; }
.event-where { margin: 0; color: var(--muted); }
.event-summary { margin: .25rem 0 0; }
.event-more { margin-top: auto; padding-top: .25rem; font-weight: 600; text-decoration: none; }
.event-card.past .event-thumb img { filter: saturate(.75); }
@media (max-width: 640px) { .event-card { grid-template-columns: 1fr; } }

.event-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 2rem; align-items: start; }
.event-layout.no-image { grid-template-columns: minmax(0, 1fr); max-width: 760px; }
.event-facts { margin: 0 0 1.25rem; background: var(--white); border: 1px solid var(--line); border-top: 3px solid var(--gold); border-radius: var(--radius); }
.event-facts > div { display: grid; grid-template-columns: 7rem 1fr; gap: 1rem; padding: .7rem 1rem; border-bottom: 1px solid var(--line); }
.event-facts > div:last-child { border-bottom: 0; }
.event-facts dt { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding-top: .15rem; }
.event-facts dd { margin: 0; overflow-wrap: anywhere; }
.event-description p { margin: 0 0 1rem; }
.event-graphic { margin: 0; }
.event-graphic img { display: block; width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: 0 4px 18px rgba(0, 34, 62, .12); }
.event-graphic figcaption { font-size: .85rem; color: var(--muted); margin-top: .4rem; }
@media (max-width: 800px) { .event-layout { grid-template-columns: 1fr; } .event-graphic { order: -1; } }

textarea { font: inherit; padding: .55rem .7rem; border: 1px solid #b9c0c8; border-radius: var(--radius); width: 100%; resize: vertical; background: var(--white); }
input[type="time"], input[type="file"] { font: inherit; }
input[type="time"] { padding: .5rem .6rem; border: 1px solid #b9c0c8; border-radius: var(--radius); background: var(--white); }
.current-graphic { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.current-graphic img { width: 180px; height: auto; border-radius: 4px; border: 1px solid var(--line); }
.danger-zone { margin: 1.5rem 0; }
/* Show whole flyers in the list rather than cropping them */
.event-card { grid-template-columns: 260px 1fr; }
.event-thumb { align-self: start; padding: 1rem 0 1rem 1rem; background: none; }
.event-thumb img { height: auto; aspect-ratio: auto; object-fit: contain; border-radius: 4px; border: 1px solid var(--line); }
@media (max-width: 640px) {
  .event-card { grid-template-columns: 1fr; }
  .event-thumb { padding: 1rem 1rem 0; }
  .event-facts > div { grid-template-columns: 5.5rem 1fr; gap: .75rem; }
}

/* Fields hidden by the member-type switch */
[hidden] { display: none !important; }
.tag-friend { background: #e3ecf5; color: var(--navy); }

/* Password requests */
.pwreq-detail { font-size: .85rem; margin-top: .25rem; }
table.pwreq td.val { max-width: 420px; }

/* Home page cards: three across, then two across, so none is left on its own */
@media (min-width: 760px) {
  .home-cards { grid-template-columns: repeat(6, 1fr); }
  .home-cards .card { grid-column: span 2; }
  .home-cards .card:nth-child(n+4) { grid-column: span 3; }
}

/* Leadership */
.board { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.board-card { background: var(--white); border: 1px solid var(--line); border-top: 3px solid var(--gold); border-radius: var(--radius); padding: 1.5rem 1rem 1.25rem; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .2rem; }
.board-photo { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; margin-bottom: .75rem; background: #eceef0; }
.board-initials { display: flex; align-items: center; justify-content: center; font-size: 2.25rem; font-weight: 700; color: var(--navy); background: var(--gold-light); }
.board-title { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #6f5f22; }
.board-name { font-size: 1.1rem; font-weight: 700; color: var(--navy); }
.board-open { font-weight: 400; font-style: italic; color: var(--muted); font-size: 1rem; }
.board-line { color: var(--muted); font-size: .92rem; }
.board-edit { margin-top: .5rem; font-size: .85rem; }
.current-graphic img.board-photo { width: 120px; height: 120px; border-radius: 50%; margin: 0; }
.board-empty { color: #b3a46a; }
@media (max-width: 560px) {
  .board { grid-template-columns: 1fr 1fr; gap: .75rem; }
  .board-card { padding: 1rem .5rem; }
  .board-photo { width: 88px; height: 88px; margin-bottom: .5rem; }
  .board-initials { font-size: 1.6rem; }
  .board-empty svg { width: 42px; height: 42px; }
  .board-name { font-size: 1rem; }
  .board-title { font-size: .7rem; }
}
