/* ============================================================================
 * UO Tavern — shared design tokens (single source of truth: DESIGN.md)
 * ----------------------------------------------------------------------------
 * Keep this file BYTE-IDENTICAL across all three sites:
 *   uohub/uo-design.css   uowiki/src/styles/uo-design.css   uotavern/src/app/uo-design.css
 * Each stack consumes it differently (see DESIGN.md "Per-stack wiring"), but the
 * token values and the .uo-globalbar component below must match everywhere.
 * ==========================================================================*/

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700&family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400&display=swap');

:root {
	/* ── Color: LIGHT (default) — warm parchment page, dark ink, deep gold ──── */
	--uo-bg: #f7f3e7;            /* base background (parchment page) */
	--uo-bg-elev: #efe8d6;       /* elevated background band */
	--uo-panel: #fdfbf4;         /* card / panel surface (bright) */
	--uo-panel-translucent: rgba(253, 251, 244, 0.82);
	--uo-line: rgba(150, 110, 40, 0.30);        /* gold hairline border */
	--uo-line-soft: rgba(150, 110, 40, 0.15);
	--uo-line-strong: rgba(150, 110, 40, 0.55);
	--uo-gold: #9c7414;          /* primary gold (links, accents) — deep for contrast */
	--uo-gold-bright: #7c5a0e;   /* hover / active gold (deeper) */
	--uo-gold-dim: #b8954a;
	--uo-ink: #2c2618;           /* primary text (dark ink) */
	--uo-ink-dim: #6b6149;       /* muted text */
	--uo-parch: #4a3f26;         /* strong highlight text */
	--uo-white: #1b1608;         /* strongest text / headings */
	/* Semantic status colours (both themes). *-rgb are the same values as space-separated
	 * channels, for `rgb(var(--uo-ok-rgb) / .1)`-style tints (Tailwind opacity modifiers). */
	--uo-ok: #2e7d32;            /* online, for sale, success */
	--uo-ok-rgb: 46 125 50;
	--uo-danger: #b3261e;        /* offline, errors, delete, live-fight pulse */
	--uo-danger-rgb: 179 38 30;
	--uo-info: #2f5fa8;          /* the other side, WTB, neutral notice */
	--uo-info-rgb: 47 95 168;
	--uo-shadow-color: rgba(60, 45, 15, 0.18);

	/* ── Type ─────────────────────────────────────────────────────────────── */
	--uo-font-display: 'Cinzel', 'EB Garamond', Georgia, 'Times New Roman', serif;
	--uo-font-body: 'EB Garamond', Georgia, 'Times New Roman', serif;
	--uo-font-rune: 'Britannian', 'EB Garamond', serif;   /* @font-face is per-site */
	--uo-font-mono: ui-monospace, 'SF Mono', 'Menlo', monospace;
	--uo-fs-h1: clamp(2rem, 5vw, 3.4rem);
	--uo-fs-h2: clamp(1.6rem, 3.6vw, 2.4rem);
	--uo-fs-h3: 1.3rem;
	--uo-lh: 1.65;

	/* ── Geometry ─────────────────────────────────────────────────────────── */
	--uo-radius: 12px;
	--uo-radius-sm: 7px;
	--uo-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
	--uo-maxw: 1140px;
	--uo-gutter: 24px;
	--uo-navh: 56px;             /* global bar height */
	--uo-space-1: 8px;
	--uo-space-2: 16px;
	--uo-space-3: 24px;
	--uo-space-4: 32px;
	--uo-space-6: 48px;
	--uo-space-8: 64px;
	--uo-space-12: 96px;
	--uo-tap: 44px;
	--uo-bp-sm: 640px;           /* mobile breakpoint */
}

/* ── Color: DARK (opt-in via data-theme="dark") — ink-on-parchment with gold ── */
:root[data-theme='dark'] {
	--uo-bg: #0b0a12;
	--uo-bg-elev: #131120;
	--uo-panel: #16131f;
	--uo-panel-translucent: rgba(22, 19, 34, 0.72);
	--uo-line: rgba(217, 179, 92, 0.22);
	--uo-line-soft: rgba(217, 179, 92, 0.12);
	--uo-line-strong: rgba(217, 179, 92, 0.40);
	--uo-gold: #d9b35c;
	--uo-gold-bright: #f0cd7a;
	--uo-gold-dim: #c7a46b;
	--uo-ink: #ece3cf;
	--uo-ink-dim: #b9ad92;
	--uo-parch: #efe3c4;
	--uo-white: #f6efdc;
	--uo-ok: #6fcf6f;
	--uo-ok-rgb: 111 207 111;
	--uo-danger: #e06b6b;
	--uo-danger-rgb: 224 107 107;
	--uo-info: #6f9fe0;
	--uo-info-rgb: 111 159 224;
	--uo-shadow-color: rgba(0, 0, 0, 0.4);
}

/* Smooth the flip between themes. */
:root {
	color-scheme: light;
}
:root[data-theme='dark'] {
	color-scheme: dark;
}

/* ============================================================================
 * Shared cross-site navigation bar (.uo-globalbar)
 * One markup contract on every site so it reads as a single product. Each stack
 * renders the same structure; this file styles it. See DESIGN.md.
 *
 *   <div class="uo-globalbar">
 *     <div class="uo-globalbar__inner">
 *       <a class="uo-globalbar__brand" href="https://www.uotavern.com/">
 *         UO Tavern <span class="uo-globalbar__rune">Britannia</span>
 *       </a>
 *       <nav class="uo-globalbar__nav">
 *         <a href="https://www.uotavern.com/">Home</a>
 *         <a class="is-active" href="https://www.uotavern.com/wiki/">Wiki</a>
 *         <a href="https://www.uotavern.com/forum/">Forum</a>
 *       </nav>
 *     </div>
 *   </div>
 * ==========================================================================*/

.uo-globalbar {
	background: var(--uo-bg);
	border-bottom: 1px solid var(--uo-line);
}
.uo-globalbar__inner {
	max-width: var(--uo-maxw);
	margin: 0 auto;
	padding: 0 16px;
	height: var(--uo-navh);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.uo-globalbar__brand {
	display: inline-flex;
	align-items: baseline;
	gap: 10px;
	color: var(--uo-gold-bright);
	font-family: var(--uo-font-display);
	font-weight: 600;
	font-size: 1.2rem;
	letter-spacing: 0.03em;
	text-decoration: none;
	white-space: nowrap;
	flex-shrink: 0;
}
.uo-globalbar__rune {
	font-family: var(--uo-font-rune);
	font-size: 1.25rem;
	color: var(--uo-gold);
	opacity: 0.8;
}
.uo-globalbar__nav {
	display: flex;
	align-items: center;
	gap: 4px;
	min-width: 0;
}
.uo-globalbar__nav a {
	padding: 6px 14px;
	min-height: var(--uo-tap);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--uo-radius-sm);
	font-family: var(--uo-font-body);
	font-size: 0.95rem;
	letter-spacing: 0.02em;
	color: var(--uo-ink-dim);
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.12s, background 0.12s;
}
.uo-globalbar__nav a:hover {
	color: var(--uo-gold-bright);
	background: var(--uo-line-soft);
}
.uo-globalbar__nav a.is-active {
	color: var(--uo-bg); /* contrasts against the gold fill in BOTH themes */
	font-weight: 600;
	background: linear-gradient(180deg, var(--uo-gold-bright), var(--uo-gold));
}

/* Theme toggle button (sun/moon) — lives at the end of the nav. */
.uo-theme-toggle {
	margin-inline-start: 6px;
	width: var(--uo-tap);
	height: var(--uo-tap);
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--uo-line);
	border-radius: var(--uo-radius-sm);
	background: transparent;
	color: var(--uo-gold);
	cursor: pointer;
	font-size: 1rem;
	line-height: 1;
	padding: 0;
	transition: color 0.12s, background 0.12s, border-color 0.12s;
}
.uo-theme-toggle:hover {
	color: var(--uo-gold-bright);
	background: var(--uo-line-soft);
	border-color: var(--uo-line-strong);
}
.uo-theme-toggle__sun { display: none; }
.uo-theme-toggle__moon { display: inline; }
:root[data-theme='dark'] .uo-theme-toggle__sun { display: inline; }
:root[data-theme='dark'] .uo-theme-toggle__moon { display: none; }

/* Two rows keep all five destinations visible on small screens. The wiki
   uses --uo-navh for its fixed header offset too. */
@media (max-width: 760px) {
  :root { --uo-navh: 100px; }
  .uo-globalbar__rune { display: none; }
  .uo-globalbar__inner { position: relative; flex-direction: column; align-items: stretch; justify-content: center; gap: 0; padding-inline: var(--uo-space-2); }
  .uo-globalbar__brand { height: var(--uo-tap); font-size: 1.05rem; align-items: center; }
  .uo-globalbar__nav { width: 100%; gap: 0; }
  .uo-globalbar__nav a { flex: 1; padding: 6px 4px; font-size: .9rem; letter-spacing: 0; }
  .uo-globalbar__nav .uo-theme-toggle { position: absolute; right: var(--uo-space-2); top: 4px; margin: 0; }
}
:where(a, button, input, select, summary):focus-visible {
  outline: 2px solid var(--uo-gold-bright);
  outline-offset: 3px;
}
/* ── Section sub-nav (.uo-subnav): a site's OWN navigation, one row under the global bar ──
 * The global bar switches between sites; anything within a site (the forum's boards, the
 * arena's Matches/Rankings, the Anima pages) goes here, never into the bar. Markup:
 *   <nav class="uo-subnav" aria-label="Arena"><div class="uo-subnav__inner">
 *     <a class="is-active" aria-current="page" href="…">Arena</a><a href="…">Matches</a>…
 *   </div></nav>
 * Same 1140px container as the bar, so the first item lines up with the brand. */
.uo-subnav { background: var(--uo-bg-elev); border-bottom: 1px solid var(--uo-line); }
.uo-subnav__inner { max-width: var(--uo-maxw); margin: 0 auto; padding: 0 16px; display: flex; align-items: center;
	gap: var(--uo-space-2); overflow-x: auto; scrollbar-width: none; }
.uo-subnav__inner::-webkit-scrollbar { display: none; }
.uo-subnav a { flex: none; display: inline-flex; align-items: center; min-height: var(--uo-tap); padding: 0 var(--uo-space-1);
	font-family: var(--uo-font-display); font-size: .85rem; font-weight: 600; letter-spacing: .04em; white-space: nowrap;
	color: var(--uo-ink-dim); text-decoration: none; border-bottom: 2px solid transparent; }
.uo-subnav a:hover { color: var(--uo-gold-bright); }
.uo-subnav a.is-active { color: var(--uo-gold-bright); border-bottom-color: var(--uo-gold); }
.uo-subnav a:first-child { margin-inline-start: calc(-1 * var(--uo-space-1)); }

/* ── Footer (.uo-footer): the same closing block on every site, rendered from uo-nav.json ──
 * (see DESIGN.md "The footer"). Six menu links in menu order, up to three site extras,
 * GitHub; one tagline; the disclaimer verbatim; language links only where they exist. */
.uo-footer { padding-block: var(--uo-space-6); background: var(--uo-bg-elev); border-top: 1px solid var(--uo-line-soft);
	color: var(--uo-ink); font-family: var(--uo-font-body); }
.uo-footer__inner { max-width: var(--uo-maxw); margin: 0 auto; padding: 0 16px; }
.uo-footer__nav { display: flex; flex-wrap: wrap; gap: var(--uo-space-1) var(--uo-space-3); margin-bottom: var(--uo-space-3); }
.uo-footer__nav a, .uo-footer__langs a { color: var(--uo-gold-bright); text-decoration: none; text-underline-offset: .2em; }
.uo-footer__nav a:hover, .uo-footer__langs a:hover { text-decoration: underline; }
.uo-footer__tagline { margin: 0 0 var(--uo-space-1); }
.uo-footer__fine { margin: 0 0 var(--uo-space-1); font-size: .9rem; color: var(--uo-ink-dim); }
.uo-footer__langs { margin: 0; display: flex; flex-wrap: wrap; gap: var(--uo-space-1) var(--uo-space-3); font-size: .9rem; }

.uo-skip { position: fixed; top: var(--uo-space-1); left: var(--uo-space-2); transform: translateY(-200%); z-index: 1000; background: var(--uo-panel); color: var(--uo-ink); padding: var(--uo-space-2); border: 1px solid var(--uo-gold); border-radius: var(--uo-radius-sm); }
.uo-skip:focus { transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  .uo-globalbar a, .uo-theme-toggle { transition: none; }
}
