:root {
  --red: #d41e2c;       /* Troy High official cardinal (from troyhigh.com) */
  --red-dark: #a81824;
  --ink: #1a1a1a;
  --line: #e3e3e3;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, Arial, sans-serif;
  color: var(--ink);
  background: #f4f4f5;
}
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- site header ---- */
header.site {
  background: var(--red);
  color: #fff;
  padding: 18px 24px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
}
.site-nav a { color: #fff; text-decoration: none; font-weight: 600; margin-left: 14px; padding: 6px 12px; border: 1px solid rgba(255, 255, 255, .55); border-radius: 6px; display: inline-block; }
.site-nav a:hover { background: rgba(255, 255, 255, .18); text-decoration: none; }
header.site h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic; font-weight: 700; font-size: 30px; letter-spacing: .5px;
}
header.site h1 a { color: #fff; text-decoration: none; }
header.site .sub { opacity: .9; font-size: 14px; margin-top: 2px; }

/* ---- toolbar / year picker ---- */
.toolbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  background: #fff; border-bottom: 3px solid var(--red);
  padding: 12px 24px; box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
}
.toolbar label { font-weight: 600; }
.toolbar select, .toolbar button { font-size: 15px; padding: 6px 10px; border: 1px solid #bbb; border-radius: 6px; }
.toolbar button { background: var(--red); color: #fff; border-color: var(--red-dark); cursor: pointer; font-weight: 600; }
.toolbar .count { color: #555; font-size: 14px; }
.toolbar .count b { color: var(--red); }

/* ---- main ---- */
main { max-width: 1140px; margin: 22px auto; padding: 0 16px; }
body.wide main { max-width: none; }   /* yearbook: use the full screen width */

/* ---- alumni table ---- */
table.alumni {
  width: 100%; border-collapse: collapse; background: #fff;
  border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
}
table.alumni thead th {
  background: var(--ink); color: #fff; text-align: left; padding: 8px 14px;
  font-size: 13px; text-transform: uppercase; letter-spacing: .6px;
  position: sticky; z-index: 4; white-space: nowrap;   /* top offset set by JS = toolbar height */
}
table.alumni tbody td { padding: 5px 14px; border-top: 1px solid var(--line); font-size: 15px; vertical-align: middle; white-space: nowrap; }
table.alumni tbody tr:nth-child(even) { background: #faf7f7; }
table.alumni tbody tr:hover { background: #fde9ec; }
.deceased { color: var(--ink); font-style: italic; margin-left: 3px; }
table.alumni td.icons img { vertical-align: middle; margin-right: 3px; }
table.alumni td.empty { text-align: center; color: #777; padding: 24px; }
table.alumni th.col-photo, table.alumni td.col-photo { width: 44px; padding-left: 8px; padding-right: 4px; }
.sortarrows { display: inline-flex; flex-direction: column; line-height: .72; margin-left: 5px; vertical-align: middle; }
.sortarrows a { color: #b9b9b9; text-decoration: none; font-size: 9px; }
.sortarrows a:first-child { position: relative; top: -2px; }   /* separate ▲ from ▼ (was a diamond) */
.sortarrows a:hover { color: #fff; text-decoration: none; }
table.alumni img.thumb { height: 32px; width: auto; display: block; border: 1px solid #ccc; border-radius: 2px; background: #fff; }

/* yearbook photo on the detail page */
.detail-photo { text-align: center; padding: 16px 16px 0; }
.detail-photo img { max-height: 260px; border: 2px solid var(--red-dark); border-radius: 4px; background: #fff; }

/* ---- detail page ---- */
.detail { max-width: 760px; margin: 22px auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.06); overflow: hidden; }
.detail-head { background: var(--ink); color: #fff; padding: 16px 22px; display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.detail-head h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; }
.detail-head .year { color: #f0c0c5; font-size: 14px; }
.detail dl { margin: 0; padding: 18px 22px; display: grid; grid-template-columns: 160px 1fr; gap: 10px 16px; }
.detail dt { font-weight: 600; color: var(--red-dark); }
.detail dd { margin: 0; }
.detail dd.ml { white-space: pre-line; }     /* keep line breaks in Children/Occupation/etc. */
.detail-photos { padding: 6px 22px 0; }
.detail-actions { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; gap: 16px; align-items: center; }

/* ---- buttons ---- */
.btn { display: inline-block; background: var(--red); color: #fff; padding: 8px 14px; border-radius: 6px; font-weight: 600; border: none; cursor: pointer; }
.btn:hover { background: var(--red-dark); text-decoration: none; }
.btn-link { color: #555; }

/* ---- edit/add form ---- */
.form { max-width: 760px; margin: 22px auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.06); padding: 22px; }
.form h2 { margin-top: 0; font-family: Georgia, "Times New Roman", serif; color: var(--red-dark); }
.field { margin-bottom: 14px; display: flex; flex-direction: column; }
.field label { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.field input, .field select, .field textarea { font: inherit; padding: 7px 9px; border: 1px solid #bbb; border-radius: 6px; }
.field textarea { resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }
.form-actions { margin-top: 18px; display: flex; gap: 16px; align-items: center; }
.validation { color: #b00020; margin-bottom: 12px; }
.field-validation-error { color: #b00020; font-size: 13px; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.ro-line { padding: 7px 0; font-size: 16px; }
.ro-label { font-weight: 600; }
.lock-note { margin: 2px 0 14px; font-size: 13px; color: #777; }
@media (max-width: 640px) { .row2, .row3 { grid-template-columns: 1fr; } }

/* ---- search box + year column ---- */
.toolbar .picker { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar input[type="search"] { font: inherit; padding: 6px 10px; border: 1px solid #bbb; border-radius: 6px; min-width: 260px; }
table.alumni th.col-year, table.alumni td.col-year { width: 56px; }

/* ---- yearbook tiled page ---- */
.yearbook { display: flex; flex-wrap: wrap; gap: 14px; padding: 18px 0; }
.yb-tile { width: 104px; text-align: center; color: var(--ink); text-decoration: none; }
.yb-tile img { width: 104px; height: auto; display: block; border: 1px solid #ccc; border-radius: 3px; background: #fff; }
.yb-tile:hover { text-decoration: none; }
.yb-tile:hover img { border-color: var(--red); box-shadow: 0 2px 8px rgba(0, 0, 0, .2); }
.yb-name { display: block; font-size: 12px; margin-top: 4px; line-height: 1.2; color: var(--ink); }
.yearbook .empty { color: #777; padding: 20px; }

/* ---- footer ---- */
footer.site-footer { text-align: center; color: #888; font-size: 13px; padding: 24px; }
