/* ─────────────────────────────────────────────────────────────
   THE TOMA GROUP — shared theme tokens (light / dark)
   Palette: neutral charcoal #1C1B19, champagne gold #C9A660,
   ivory #F8F7F3, white #FFFFFF. Typeface: Lato.
   theme.js sets data-theme on <html> from the saved choice or
   the device preference; without JS the dark values apply.
───────────────────────────────────────────────────────────── */
/* ── Lato, self-hosted (fonts/, SIL Open Font License). The pages preload
   300/400/700; font-display: block avoids the fallback-font flash. ── */
@font-face { font-family: 'Lato'; font-style: normal; font-weight: 300; font-display: block; src: url('fonts/Lato-Light.ttf') format('truetype'); }
@font-face { font-family: 'Lato'; font-style: normal; font-weight: 400; font-display: block; src: url('fonts/Lato-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Lato'; font-style: normal; font-weight: 700; font-display: block; src: url('fonts/Lato-Bold.ttf') format('truetype'); }
@font-face { font-family: 'Lato'; font-style: italic; font-weight: 400; font-display: swap; src: url('fonts/Lato-Italic.ttf') format('truetype'); }

:root {
  color-scheme: dark;
  --bg: #1C1B19;
  --bg-rgb: 28, 27, 25;
  --text: #F8F7F3;
  --text-2: #E6E4DE;
  --muted: #A5A29B;
  --faint: #86837D;
  --surface-a: #272623;   /* card top */
  --surface-b: #201F1D;   /* card bottom */
  --surface-c: #2E2D29;   /* card hover top */
  --surface-d: #242320;   /* card hover bottom */
  --surface-e: #1A1917;   /* panel bottom */
  --gold: #C9A660;        /* accent */
  --gold-hi: #E2CB94;     /* hover / highlight */
  --gold-lo: #8A6F3E;     /* gradient ends */
  --gold-mid: #A8894D;
  --shine: #F8F7F3;       /* brightest point of gold sheens */
  --input-bg: rgba(255, 255, 255, 0.04);
  --input-bg-focus: rgba(255, 255, 255, 0.07);
  --shadow: rgba(0, 0, 0, 0.65);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #F8F7F3;
  --bg-rgb: 248, 247, 243;
  --text: #1C1B19;
  --text-2: #34322E;
  --muted: #5E5B55;
  --faint: #6D6A64;
  --surface-a: #FFFFFF;
  --surface-b: #FBFAF7;
  --surface-c: #FFFFFF;
  --surface-d: #FFFFFF;
  --surface-e: #F3F1EB;
  --gold: #8A6F3E;        /* darker champagne so accent text stays readable on ivory */
  --gold-hi: #6F5A30;
  --gold-lo: #C9A660;
  --gold-mid: #A8894D;
  --shine: #E2CB94;
  --input-bg: #FFFFFF;
  --input-bg-focus: #FFFFFF;
  --shadow: rgba(28, 27, 25, 0.14);
}

/* Softer elevation in light mode */
:root[data-theme="light"] .card:hover,
:root[data-theme="light"] .feat-card:hover,
:root[data-theme="light"] .svc-card:hover,
:root[data-theme="light"] .focus-card:hover,
:root[data-theme="light"] .event-card:hover { box-shadow: 0 18px 48px var(--shadow); }
:root[data-theme="light"] .hero,
:root[data-theme="light"] header { border-bottom: 1px solid rgba(201, 166, 96, 0.45); }

/* Logo swap: white artwork on dark, charcoal artwork on light */
.logo-on-light { display: none !important; }
:root[data-theme="light"] .logo-on-dark { display: none !important; }
:root[data-theme="light"] .logo-on-light { display: block !important; }

/* ── Theme toggle ── */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; flex-shrink: 0;
  background: transparent; color: var(--gold);
  border: 1px solid rgba(201, 166, 96, 0.45); border-radius: 50%;
  cursor: pointer; transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.theme-toggle:hover { color: var(--gold-hi); border-color: var(--gold); }
.theme-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
:root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
:root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }

/* Homepage: toggle floats over the ivory header band */
.header-toggle { position: absolute; top: 20px; right: 24px; z-index: 5; color: #8A6F3E; background: rgba(248, 247, 243, 0.7); }
.header-toggle:hover { color: #6F5A30; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

/* Nav cluster (history link, theme toggle, logo) */
.nav-right { display: flex; align-items: center; gap: 24px; }
@media (max-width: 700px) { .nav-right { gap: 14px; } }

/* ─────────────────────────────────────────────────────────────
   SITE HEADER (sub pages) — logo centred, businesses on the left,
   History / Contact / theme toggle on the right. Same markup on
   every sub page; the current page carries aria-current="page".
───────────────────────────────────────────────────────────── */
.site-nav {
  position: relative; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px;
  padding: 16px 40px;
  background: var(--bg);
  border-bottom: 1px solid rgba(201, 166, 96, 0.18);
}
.site-nav-links { display: flex; align-items: center; gap: 30px; list-style: none; margin: 0; padding: 0; }
.site-nav-left { justify-self: start; }
.site-nav-end { justify-self: end; display: flex; align-items: center; gap: 30px; }
.site-nav-links a {
  position: relative; display: inline-block; padding: 8px 0;
  font-family: 'Lato', sans-serif; font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase; white-space: nowrap;
  color: var(--muted); text-decoration: none; transition: color 0.2s;
}
.site-nav-links a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--gold); transform: scaleX(0); transition: transform 0.25s ease;
}
.site-nav-links a:hover { color: var(--text); }
.site-nav-links a:hover::after { transform: scaleX(1); }
.site-nav-links a[aria-current="page"] { color: var(--gold); }
.site-nav-links a[aria-current="page"]::after { transform: scaleX(1); }
.site-nav-links a:focus-visible, .site-nav-logo:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }

.site-nav-logo { justify-self: center; display: block; line-height: 0; }
.site-nav-logo-img { height: 54px; width: auto; display: block; }

.site-nav-menu-btn {
  display: none; justify-self: start;
  width: 40px; height: 40px; align-items: center; justify-content: center;
  background: transparent; color: var(--gold); cursor: pointer;
  border: 1px solid rgba(201, 166, 96, 0.45); border-radius: 50%;
}
.site-nav-menu-btn svg { width: 18px; height: 18px; }
.site-nav-menu-btn .icon-close { display: none; }
.site-nav.is-open .site-nav-menu-btn .icon-open { display: none; }
.site-nav.is-open .site-nav-menu-btn .icon-close { display: block; }

.site-nav-menu {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--bg); border-bottom: 1px solid rgba(201, 166, 96, 0.3);
  box-shadow: 0 18px 40px var(--shadow);
  list-style: none; margin: 0; padding: 8px 24px 16px;
}
.site-nav-menu a {
  display: block; padding: 14px 0; border-bottom: 1px solid rgba(201, 166, 96, 0.12);
  font-family: 'Lato', sans-serif; font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--text); text-decoration: none;
}
.site-nav-menu li:last-child a { border-bottom: none; }
.site-nav-menu a[aria-current="page"] { color: var(--gold); }

@media (max-width: 1020px) {
  .site-nav-links a { letter-spacing: 0.16em; }
  .site-nav-links, .site-nav-end { gap: 20px; }
  .site-nav { padding: 14px 24px; }
}
@media (max-width: 900px) {
  .site-nav { grid-template-columns: 1fr auto 1fr; padding: 12px 18px; }
  .site-nav-left, .site-nav-end .site-nav-links { display: none; }
  .site-nav-menu-btn { display: inline-flex; }
  .site-nav-logo-img { height: 46px; }
}
@media (min-width: 901px) { .site-nav-menu { display: none !important; } }

/* ─────────────────────────────────────────────────────────────
   SITE FOOTER — identical on every page. The editor sign-in lock is
   placed in [data-edit-lock] by functions/_middleware.js.
───────────────────────────────────────────────────────────── */
.site-footer {
  margin-top: 48px; padding: 36px 24px 28px;
  border-top: 1px solid rgba(201, 166, 96, 0.18);
  background: var(--bg); color: var(--faint);
  font-family: 'Lato', sans-serif;
}
.site-footer-inner { max-width: 1100px; margin: 0 auto; display: grid; gap: 22px; justify-items: center; text-align: center; }
.site-footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 28px; }
.site-footer-links a {
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; padding: 4px 0; transition: color 0.2s;
}
.site-footer-links a:hover, .site-footer-links a[aria-current="page"] { color: var(--gold); }
.site-footer-bottom { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.site-footer-copy { margin: 0; font-size: 0.74rem; letter-spacing: 0.08em; color: var(--faint); }
.site-footer-lock:empty { display: none; }

/* Editor sign-in lock (sits at the end of the footer's copyright line) */
.edit-unlock {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  color: var(--faint); border: 1px solid rgba(201, 166, 96, 0.25);
  opacity: 0.6; transition: opacity 0.2s, color 0.2s, border-color 0.2s;
}
.edit-unlock:hover, .edit-unlock:focus-visible { opacity: 1; color: var(--gold); border-color: var(--gold); }
/* fallback for a page without a footer slot */
.edit-unlock.is-floating { position: fixed; left: 14px; bottom: 14px; z-index: 50; background: rgba(var(--bg-rgb), 0.6); }
@media (max-width: 700px) { .site-footer-links { gap: 6px 18px; } .site-footer { padding: 28px 16px 24px; } }
@media print { .edit-unlock { display: none; } }
