/* ==========================================================================
   Site styles: design tokens, top bar + medal, content, cards, article page,
   comments, forms, footer. CMS-only rules live in cms.css.
   ========================================================================== */

/* ---------- Variables ---------- */
:root {
  --maroon: #3a0000;
  --maroon-light: #5a0a0a;
  --maroon-dark: #260000;
  --gold: #c9a227;          /* main gold for borders and badges */
  --gold-dark: #a16207;     /* darker gold for depth */
  --gold-light: #e8c766;    /* highlight gold for thin lines and hover */
  --gold-faint: rgba(201, 162, 39, 0.45);
  --gold-text: #7a4a06;     /* gold dark enough for small text on light backgrounds (WCAG AA) */
  --page-bg: #ebe6dc;       /* light stone page background */
  --card-bg: #f7f3ea;
  --ink: #241c17;
  --ink-soft: #6b5f55;
  --line: #d8d0c0;
  --cream-text: #e8dcc0;    /* light text on maroon */
  --topbar-height: 136px;
  --medal-size: 150px;
  --font-heading: "Newsreader", "Iowan Old Style", "Times New Roman", serif;
  --font-body: "Spectral", Georgia, "Times New Roman", serif;
  --font-ui: "Marcellus", "Iowan Old Style", Georgia, serif;   /* menus, labels, buttons: classical capitals */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 3px;
  --shadow: 0 6px 18px rgba(40, 20, 10, 0.12);
  --shadow-strong: 0 12px 28px rgba(40, 20, 10, 0.2);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }   /* keep the hidden attribute working despite display rules below */
.form .EasyMDEContainer textarea { display: none; }   /* EasyMDE replaces the textarea with its own editor */

html { scroll-padding-top: 20px; }

body {
  background: var(--page-bg);
  font-family: var(--font-body);
  font-size: 17px;
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;             /* column layout so the footer sticks to the bottom */
  flex-direction: column;
}

h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 600; color: var(--maroon); line-height: 1.15; }
a { color: var(--gold-text); }

/* ---------- Accessibility ---------- */
/* Skip link: hidden until focused, then shown at the top left */
.skip-link {
  position: absolute;
  left: -999px; top: 8px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--maroon);
  color: var(--gold-light);
  border: 2px solid var(--gold);
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-decoration: none;
}
.skip-link:focus { left: 8px; outline: none; }

/* One clear focus ring everywhere, on dark and light backgrounds (WCAG 2.4.7 / 2.4.11) */
:focus-visible { outline: 3px solid var(--gold-dark); outline-offset: 3px; }
.topbar :focus-visible, .bottombar :focus-visible { outline-color: #fff; }
#main:focus { outline: none; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
img { max-width: 100%; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.85rem; }
.help { color: var(--ink-soft); font-size: 0.85rem; font-weight: 400; font-family: var(--font-sans); }
.lead { color: var(--ink-soft); font-size: 1.15rem; font-style: italic; }
.empty { text-align: center; color: var(--ink-soft); padding: 60px 0; }

/* Small uppercase labels used for menus, dates and badges */
.ui-caps, .badge, .card-meta, .article-meta, .nav-side a, .account-strip, .nav-account, .footer-links a, .btn, .tag, .page-indicator {
  font-family: var(--font-ui);
  font-weight: 400;              /* Marcellus has one weight; never synthesise bold */
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* ---------- Top bar ---------- */
.topbar {
  position: relative;
  z-index: 10;
  height: var(--topbar-height);
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 4px),   /* fine horizontal linen texture */
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.07), transparent 60%),
    linear-gradient(180deg, var(--maroon-light) 0%, var(--maroon) 55%, var(--maroon-dark) 100%);
  border-top: 3px solid var(--gold);
  border-bottom: 4px solid var(--gold);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* Thin hairlines inside both gold rules, for a double-rule look */
.topbar::before, .topbar::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: var(--gold-light);
  opacity: 0.55;
  pointer-events: none;
}
.topbar::before { top: 4px; }
.topbar::after { bottom: 6px; }

/* Golden relief of the thinkers, far left (wide screens only) */
.topbar-ornament {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  height: 122px;
  pointer-events: none;
}
.topbar-ornament img { height: 100%; width: auto; display: block; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.55)); }

/* Small account links in the top-right corner (desktop) */
.account-strip {
  position: absolute;
  top: 12px; right: 26px;
  z-index: 3;
  display: flex;
  align-items: center;
  font-size: 0.72rem;
  color: var(--cream-text);
}
/* Fixed-height separators between the items, so they line up whatever each item's height */
.account-strip > * + *::before { content: ""; display: inline-block; width: 1px; height: 12px; margin: 0 10px; background: var(--gold-faint); vertical-align: middle; }
.account-strip .inline-form { display: inline-flex; align-items: center; }
.account-strip a, .account-strip .link-button { display: inline-block; padding: 6px 0; color: var(--gold-light); text-decoration: none; letter-spacing: inherit; text-transform: inherit; font-family: inherit; }   /* 24px tall targets */
.account-strip a:hover, .account-strip .link-button:hover { color: #fff; }
.account-name { opacity: 0.75; letter-spacing: 0.06em; }
.inline-form { display: inline; }

/* Main menu: two columns of links either side of the medal */
.main-nav {
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 250px;          /* clears the ornament on the left; the same on the right keeps the medal centred */
}
.nav-side { flex: 1; display: flex; flex-wrap: wrap; align-items: center; row-gap: 2px; list-style: none; }
.nav-left { justify-content: flex-end; }
.nav-right { justify-content: flex-start; }
.medal-spacer { flex: none; width: calc(var(--medal-size) + 56px); }

/* Small gold diamond between menu items */
.nav-side li + li::before {
  content: "\25C6";
  display: inline-block;
  margin: 0 18px;
  font-size: 0.42rem;
  color: var(--gold);
  vertical-align: middle;
  opacity: 0.9;
}

.nav-side a {
  position: relative;
  display: inline-block;
  padding: 8px 2px;
  color: var(--cream-text);
  text-decoration: none;
  font-size: 0.95rem;
  letter-spacing: 0.15em;
  white-space: nowrap;
  transition: color 0.2s;
}
.nav-side a::after {
  content: "";
  position: absolute;
  left: 2px; right: 2px; bottom: 3px;
  height: 1px;
  background: var(--gold-light);
  transform: scaleX(0);
  transition: transform 0.25s ease;
}
.nav-side a:hover, .nav-side a.active { color: var(--gold-light); text-shadow: 0 0 12px rgba(232, 199, 102, 0.45); }
.nav-side a:hover::after, .nav-side a.active::after { transform: scaleX(1); }

/* Mobile-only controls, hidden on desktop */
.nav-toggle, .account-compact, .nav-account { display: none; }

/* ---------- Medal ---------- */
/* Hangs from the top of the bar and overlaps its bottom edge */
.medal {
  position: absolute;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  z-index: 2;
  width: var(--medal-size);
  height: var(--medal-size);
  border-radius: 50%;
  border: 5px solid var(--gold);
  background: var(--maroon);
  box-shadow:
    0 0 0 4px var(--maroon),             /* dark ring between gold edges */
    0 0 0 6px var(--gold-dark),          /* outer thin gold ring */
    0 0 18px rgba(201, 162, 39, 0.35),   /* soft gold glow */
    0 8px 20px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  transition: transform 0.3s ease;
}
.medal:hover { transform: translateX(-50%) scale(1.04); }
.medal img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }

/* ---------- Content ---------- */
.content {
  flex: 1;                     /* fills the space between the bars */
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 84px 24px 56px;     /* top padding clears the hanging medal */
}

.page-header { text-align: center; margin-bottom: 36px; }
.page-header h1 { font-size: clamp(2.2rem, 4vw, 3rem); margin-bottom: 8px; }
.page-header h1::after {
  content: "";
  display: block;
  width: 64px; height: 3px;
  margin: 14px auto 0;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-light), var(--gold-dark));
}

/* One-shot messages after an action */
.flash {
  margin: 0 auto 24px;
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid;
  font-family: var(--font-sans);
  font-size: 0.95rem;
}
.flash-success { background: #eaf3e4; border-color: #b9d4a8; color: #2f5f1f; }
.flash-error   { background: #fbe9e7; border-color: #e3b4ad; color: #7a1c1c; }
.flash-info    { background: #f3ede0; border-color: var(--line); color: var(--ink); }
.notice { background: #fff6d6; border: 1px solid var(--gold); padding: 10px 14px; border-radius: var(--radius); margin-bottom: 20px; font-family: var(--font-sans); font-size: 0.95rem; }
.staff-tools { text-align: right; font-size: 0.9rem; margin-bottom: 8px; font-family: var(--font-sans); }

/* ---------- Article cards ---------- */
.article-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 26px;
}

/* A gold double frame: outer rule on the card, inner hairline on the link, corner brackets */
.card {
  position: relative;
  padding: 6px;
  background: var(--card-bg);
  border: 1px solid var(--gold-dark);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.card-link {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--gold-faint);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s;
}
.card::before, .card::after, .card-link::before, .card-link::after {
  content: "";
  position: absolute;
  width: 12px; height: 12px;
  border: 0 solid var(--gold);
  z-index: 2;
  transition: border-color 0.2s;
}
.card::before { top: 2px; left: 2px; border-top-width: 2px; border-left-width: 2px; }
.card::after { bottom: 2px; right: 2px; border-bottom-width: 2px; border-right-width: 2px; }
.card-link::before { top: -5px; right: -5px; border-top-width: 2px; border-right-width: 2px; }
.card-link::after { bottom: -5px; left: -5px; border-bottom-width: 2px; border-left-width: 2px; }

.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-strong); border-color: var(--gold); }
.card:hover .card-link { border-color: var(--gold); }
.card:hover::before, .card:hover::after, .card:hover .card-link::before, .card:hover .card-link::after { border-color: var(--gold-light); }

.card-media { aspect-ratio: 16 / 9; background: var(--maroon); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s; }
.card:hover .card-media img { transform: scale(1.04); }

/* Articles without an image get a maroon panel with a faded logo */
.card-media.placeholder {
  display: flex; align-items: center; justify-content: center;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 50% 40%, var(--maroon-light), var(--maroon-dark));
}
.card-media.placeholder::after {
  content: "";
  width: 34%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid rgba(201, 162, 39, 0.5);
  background: url("/resources/logo.jpg") center / cover;
  opacity: 0.35;
}

.card-body { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; }
.card-title { font-size: 1.25rem; font-weight: 600; }
.card-summary { color: var(--ink-soft); font-size: 0.98rem; }
.card-meta { margin-top: auto; font-size: 0.74rem; color: var(--gold-text); }

.card-badges { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; }
.article-header .card-badges { justify-content: center; align-self: center; }
.badge-lang { background: var(--card-bg); color: var(--gold-text); border-color: var(--gold); }
.lang-note { font-family: var(--font-sans); font-size: 0.85rem; color: var(--ink-soft); margin-top: 6px; }

.badge {
  align-self: flex-start;
  display: inline-block;
  padding: 2px 9px;
  font-size: 0.7rem;
  color: var(--gold-light);
  background: var(--maroon);
  border: 1px solid var(--gold-dark);
  text-decoration: none;
}

/* Sizes: the newest article is the biggest */
.size-hero { grid-column: span 6; }
.size-hero .card-link { flex-direction: row; }
.size-hero .card-media { flex: 0 0 58%; aspect-ratio: auto; min-height: 380px; }
.size-hero .card-body { justify-content: center; padding: 36px 40px; border-left: 1px solid var(--gold-faint); }
.size-hero .card-title { font-size: 2.6rem; line-height: 1.08; }
.size-hero .card-summary { font-size: 1.1rem; }
.size-hero .card-meta { margin-top: 14px; }

.size-medium { grid-column: span 3; }
.size-medium .card-title { font-size: 1.6rem; }

.size-small { grid-column: span 2; }

/* ---------- Pagination ---------- */
.pagination {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 36px;
}
.page-indicator { color: var(--ink-soft); font-size: 0.78rem; }

/* ---------- Article page ---------- */
.article { max-width: 780px; margin: 0 auto; }
.article-header { text-align: center; margin-bottom: 28px; }
.article-header .badge { align-self: center; }
.article h1 { font-size: clamp(2.2rem, 4.5vw, 3.3rem); margin: 14px 0 10px; }
.article-meta { color: var(--gold-text); font-size: 0.78rem; }
.article-summary { margin-top: 14px; font-size: 1.2rem; color: var(--ink-soft); font-style: italic; }
.article-cover { margin: 0 0 28px; padding: 6px; border: 1px solid var(--gold-dark); background: var(--card-bg); }
.article-cover img { width: 100%; display: block; }

.article-body { font-size: 1.1rem; line-height: 1.75; }
.article-body > * + * { margin-top: 1.1em; }
.article-body h2 { font-size: 1.8rem; margin-top: 1.6em; }
.article-body h3 { font-size: 1.35rem; margin-top: 1.4em; }
.article-body img { height: auto; border: 1px solid var(--gold-dark); padding: 5px; background: var(--card-bg); }
.article-body blockquote {
  border-left: 3px solid var(--gold);
  padding: 4px 0 4px 18px;
  color: var(--ink-soft);
  font-style: italic;
}
.article-body ol { padding-left: 1.4em; }
/* Bullet lists use the gold hammer-and-sickle mark (bullet.png is a 64px copy of bullepoint.png) */
.article-body ul { list-style: none; padding-left: 0; }
.article-body ul li { position: relative; padding-left: 1.7em; }
.article-body ul li + li { margin-top: 0.35em; }
.article-body ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.32em;
  width: 1.05em;
  height: 1.05em;
  background: url("/resources/bullet.png") center / contain no-repeat;
}
.article-body ul ul { margin-top: 0.35em; }
.article-body code { background: #f3ede0; padding: 2px 5px; border-radius: 4px; font-size: 0.9em; }
.article-body pre { background: #f3ede0; padding: 14px; border-radius: 4px; overflow-x: auto; }
.article-body pre code { background: none; padding: 0; }
.article-body hr { border: 0; border-top: 1px solid var(--gold-faint); }
.article-body table { border-collapse: collapse; width: 100%; }
.article-body th, .article-body td { border: 1px solid var(--line); padding: 6px 10px; }

/* Embedded media */
.embed { margin: 28px auto; }
.embed-youtube {
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--gold-dark);
  padding: 5px;
  box-shadow: var(--shadow);
}
.embed-youtube iframe { width: 100%; height: 100%; border: 0; display: block; }
.embed-instagram { display: flex; justify-content: center; }
/* Fallback card shown until Instagram's script swaps the blockquote for its own iframe
   (the script renames the class, so this is scoped by the wrapper, not the class) */
.embed-instagram blockquote {
  width: 100%;
  max-width: 540px;
  margin: 0 auto;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: inherit;
  font-style: normal;
  text-align: center;
}
.embed-instagram iframe { margin-left: auto !important; margin-right: auto !important; }

/* ---------- Comments ---------- */
.comments { max-width: 780px; margin: 56px auto 0; padding-top: 28px; border-top: 2px solid var(--gold); position: relative; }
.comments::before { content: ""; position: absolute; top: 3px; left: 0; right: 0; height: 1px; background: var(--gold-light); opacity: 0.6; }
.comments h2 { font-size: 1.7rem; margin-bottom: 18px; }
.comment {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold-dark);
  padding: 14px 18px;
  margin-bottom: 12px;
}
.comment-pending { border-style: dashed; border-left-style: solid; }
.comment-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; font-size: 0.85rem; color: var(--ink-soft); font-family: var(--font-sans); }
.comment-head strong { font-family: var(--font-ui); text-transform: uppercase; letter-spacing: 0.08em; color: var(--maroon); font-weight: 400; font-size: 0.9rem; }
.comment-head .inline-form { margin-left: auto; }
.comment-head .link-button { padding: 4px 2px; }
.comment-body { margin-top: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-form { margin-top: 24px; }
.comment-login { padding: 16px; background: var(--card-bg); border: 1px dashed var(--gold-faint); }

.tag {
  display: inline-block;
  padding: 1px 8px;
  font-size: 0.68rem;
  background: #fff6d6;
  color: var(--gold-text);
  border: 1px solid var(--gold);
}
.tag-approved { background: #eaf3e4; color: #2f5f1f; border-color: #b9d4a8; }
.tag-rejected { background: #fbe9e7; color: #7a1c1c; border-color: #e3b4ad; }

/* ---------- Forms and buttons ---------- */
.form label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--maroon);
}
.form label .help { display: inline; text-transform: none; letter-spacing: 0; }
.form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), .form select, .form textarea {
  display: block;
  width: 100%;
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--ink);
}
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.25);
}
.form textarea { resize: vertical; }
.form .checkbox { display: flex; align-items: center; gap: 8px; margin: 30px 0 16px; }
.form .checkbox input { width: auto; margin: 0; }
.form-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.input-row { display: flex; gap: 8px; align-items: center; margin: 0 0 6px; }
.input-row input { margin: 0 !important; }

.btn {
  display: inline-block;
  padding: 9px 20px;
  background: var(--maroon);
  color: var(--gold-light);
  border: 1px solid var(--gold-dark);
  box-shadow: inset 0 0 0 1px rgba(232, 199, 102, 0.25);
  font-size: 0.82rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}
.btn:hover { background: var(--maroon-light); box-shadow: inset 0 0 0 1px rgba(232, 199, 102, 0.6); }
.btn-outline { background: transparent; color: var(--maroon); border-color: var(--maroon); box-shadow: none; }
.btn-outline:hover { background: var(--maroon); color: var(--gold-light); }
.btn-danger { background: #7a1c1c; border-color: #7a1c1c; color: #fff; }
.btn-danger:hover { background: #5e1212; }
.btn-small { padding: 5px 12px; font-size: 0.74rem; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--gold-text); cursor: pointer; text-decoration: underline; }

.errors { background: #fbe9e7; border: 1px solid #e3b4ad; color: #7a1c1c; padding: 10px 14px; border-radius: var(--radius); margin-bottom: 16px; font-family: var(--font-sans); font-size: 0.95rem; }
.errors ul { padding-left: 18px; }

/* Sign in / register / error boxes */
.auth-card {
  max-width: 460px;
  margin: 0 auto;
  background: var(--card-bg);
  border: 1px solid var(--gold-dark);
  outline: 1px solid var(--gold-faint);
  outline-offset: -6px;
  box-shadow: var(--shadow);
  padding: 34px 38px;
}
.auth-card h1 { font-size: 2rem; margin-bottom: 6px; }
.auth-card .lead { margin-bottom: 20px; }
.auth-card .btn { width: 100%; margin-top: 4px; }
.auth-switch { margin-top: 18px; text-align: center; font-size: 0.95rem; color: var(--ink-soft); }
.error-card { text-align: center; }
.error-card p { margin: 10px 0 18px; }
.error-card .btn { width: auto; }

/* Captcha: image (or text question) above the answer field */
.captcha { margin-bottom: 18px; padding: 14px; border: 1px solid var(--line); background: #faf7f0; }
.captcha-image { margin-bottom: 10px; }
.captcha-image svg { display: block; border: 1px solid var(--line); background: #f3ede0; }
.captcha-question { font-size: 1.1rem; margin-bottom: 10px; }
.captcha input { margin-bottom: 10px !important; max-width: 220px; }
.captcha .link-button, .captcha-switch { display: inline-block; padding: 4px 0; margin-right: 16px; font-family: var(--font-sans); font-size: 0.9rem; }

/* Account page */
.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; max-width: 900px; margin: 0 auto; }
.panel { background: var(--card-bg); border: 1px solid var(--gold-dark); padding: 22px 24px; box-shadow: var(--shadow); }
.panel h2 { font-size: 1.4rem; margin-bottom: 12px; }
.panel-wide { grid-column: span 2; }

/* ---------- Bottom bar ---------- */
.bottombar {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 20px 32px;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, #4a0505 0%, var(--maroon) 60%, var(--maroon-dark) 100%);
  border-top: 4px solid var(--gold);
  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.3);
  color: var(--cream-text);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

/* Thin second gold line just below the border */
.bottombar::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 6px;
  height: 1px;
  background: var(--gold-light);
  opacity: 0.6;
}

.footer-links { display: flex; flex-wrap: wrap; gap: 22px; }
.footer-links a { position: relative; display: inline-block; color: var(--gold); text-decoration: none; padding: 7px 0; font-size: 0.74rem; transition: color 0.2s; }
.footer-links a::after {                 /* animated gold underline on hover */
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--gold-light);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.footer-links a:hover { color: var(--gold-light); }
.footer-links a:hover::after { transform: scaleX(1); }

/* ---------- Responsive ---------- */
@media (max-width: 1240px) {
  .size-small { grid-column: span 3; }
}

/* Narrow desktops: smaller relief and tighter menu so both fit */
@media (max-width: 1199px) {
  .topbar-ornament { height: 94px; left: 12px; }
  .main-nav { padding: 0 190px; }
  .nav-side a { font-size: 0.85rem; letter-spacing: 0.12em; }
  .nav-side li + li::before { margin: 0 12px; }
}

/* Mobile and tablet: slim bar, hamburger button, dropdown menu */
@media (max-width: 1024px) {
  :root { --topbar-height: 76px; --medal-size: 74px; }

  .topbar-ornament, .account-strip { display: none; }

  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    position: absolute;
    top: 50%; left: 14px;
    transform: translateY(-50%);
    z-index: 3;
    width: 44px; height: 44px;
    padding: 0 11px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid var(--gold);
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--maroon), 0 0 0 3px var(--gold-dark);
    cursor: pointer;
  }
  .nav-toggle span { display: block; width: 100%; height: 2px; background: var(--gold-light); transition: transform 0.25s, opacity 0.2s; }
  /* The three dashes become a cross while the menu is open */
  .topbar.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .topbar.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .topbar.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .account-compact {
    display: block;
    position: absolute;
    top: 50%; right: 16px;
    transform: translateY(-50%);
    z-index: 3;
    font-family: var(--font-ui);
    font-size: 0.74rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold-light);
    text-decoration: none;
  }

  .medal { top: 4px; border-width: 4px; box-shadow: 0 0 0 3px var(--maroon), 0 0 0 4px var(--gold-dark), 0 6px 14px rgba(0, 0, 0, 0.45); }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    z-index: 1;
    height: auto;
    flex-direction: column;
    align-items: stretch;
    padding: 24px 0 8px;               /* leaves room for the hanging medal */
    background:
      repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 4px),
      var(--maroon-dark);
    border-bottom: 4px solid var(--gold);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  }
  .topbar.nav-open .main-nav { display: flex; }
  .nav-side { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-side li + li::before { display: none; }
  .nav-side a { display: block; padding: 13px 24px; text-align: center; border-top: 1px solid rgba(201, 162, 39, 0.18); font-size: 0.92rem; }
  .nav-side a::after { display: none; }
  .nav-right li:first-child a { border-top: 1px solid rgba(201, 162, 39, 0.18); }
  .medal-spacer { display: none; }

  .nav-account {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 22px;
    list-style: none;
    margin-top: 6px;
    padding: 12px 24px 8px;
    border-top: 1px solid var(--gold-faint);
    font-size: 0.74rem;
  }
  .nav-account a, .nav-account .link-button { color: var(--gold-light); text-decoration: none; font: inherit; letter-spacing: inherit; text-transform: inherit; }
  .nav-account-name { width: 100%; text-align: center; color: var(--cream-text); opacity: 0.75; letter-spacing: 0.06em; }

  .content { padding-top: 40px; }
}

@media (max-width: 760px) {
  .content { padding: 36px 16px 40px; }
  .size-hero .card-link { flex-direction: column; }
  .size-hero .card-media { flex: none; aspect-ratio: 16 / 9; min-height: 0; }
  .size-hero .card-body { padding: 22px 24px; border-left: 0; border-top: 1px solid var(--gold-faint); }
  .size-hero .card-title { font-size: 1.9rem; }
  .size-medium, .size-small { grid-column: span 6; }
  .account-grid { grid-template-columns: 1fr; }
  .panel-wide { grid-column: auto; }
  .auth-card { padding: 24px 20px; }
  .bottombar { flex-direction: column; text-align: center; }
}

/* ---------- Donation page ---------- */
.donate-card { max-width: 520px; }
.donate-form fieldset { border: 0; margin-bottom: 20px; }
.donate-form legend { font-family: var(--font-ui); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--maroon); margin-bottom: 8px; }
.frequency { display: flex; flex-wrap: wrap; gap: 10px; }
.frequency legend { width: 100%; }
.choice, .preset { display: flex; align-items: center; gap: 8px; margin: 0; font-family: var(--font-body); font-size: 1rem; text-transform: none; letter-spacing: 0; cursor: pointer; }
.choice input, .preset input { width: auto; margin: 0; accent-color: var(--maroon); }
.preset-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.preset { position: relative; justify-content: center; padding: 12px 8px; border: 1px solid var(--gold-dark); background: #fff; font-family: var(--font-ui); font-size: 1.05rem; }
.preset input { position: absolute; opacity: 0; pointer-events: none; }
.preset:has(input:checked) { background: var(--maroon); color: var(--gold-light); }
.preset:hover { border-color: var(--gold); }
.embed-twitter { display: flex; justify-content: center; }
.embed-twitter blockquote { width: 100%; max-width: 550px; margin: 0 auto; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 6px; color: inherit; font-style: normal; text-align: center; }
