﻿/* ==========================================================================
   OFSA â€” shared base: design tokens, header, footer, buttons.
   Apothecary character after the approved Officina Sanitatis layout:
   warm paper canvas, ink serif typography, burgundy accent used only
   for the primary CTA, walnut wood on the dark surfaces and thin
   stained-glass red / green / gold rules as the only loud accents.
   ========================================================================== */

:root {
	/* Surfaces â€” warm apothecary paper */
	--ofsa-paper: #f4f1eb;   /* page background */
	--ofsa-paper-2: #f8f5ef; /* cards, tiles */
	--ofsa-cream: #f5f2ec;   /* navigation bar, hero veil */
	--ofsa-sand: #efe9dc;    /* botanical plates, tinted surfaces */
	--ofsa-white: #ffffff;   /* inputs, elevated surfaces */

	/* Walnut wood structure (footer, stat band) */
	--ofsa-brown: #33200f;
	--ofsa-brown-2: #4a2c18;
	--ofsa-brown-3: #65401f;

	/* Ink / text (reference palette, all above 4.5:1) */
	--ofsa-ink: #1c1613;      /* headings            16.4:1 */
	--ofsa-ink-soft: #4a423c; /* running text         8.9:1 */
	--ofsa-ink-muted: #67574e;/* lead, captions       6.3:1 */

	/* Burgundy accent â€” primary CTA only */
	--ofsa-accent: #4e1516;       /* 13.4:1 on paper-2 */
	--ofsa-accent-hover: #3c1011;

	/* Olive â€” icons, small caps, quiet links */
	--ofsa-olive: #46461c;      /* 8.2:1 */
	--ofsa-olive-soft: #6e6e45; /* borders and hover only */

	/* Amber brown glass â€” notes, quiet highlights */
	--ofsa-glass: #6b3f14;      /* 7.2:1 */
	--ofsa-glass-soft: #f1e7d2; /* tint surfaces */

	/* Vibrant stained-glass accents â€” thin rules and small marks only */
	--ofsa-red: #c4291f;
	--ofsa-red-2: #e2402f;
	--ofsa-red-deep: #8f1710;
	--ofsa-green: #0e7a49;
	--ofsa-green-2: #16a05e;
	--ofsa-green-deep: #08482c;
	--ofsa-gold: #c69a33;
	--ofsa-gold-2: #e7c46a;
	--ofsa-gold-soft: #f1e1b8;

	/* Status tints (forms, panels) */
	--ofsa-tint-red: #f3e2dc;
	--ofsa-tint-green: #e5eddd;
	--ofsa-tint-gold: #f5eed7;

	/* Lines, shadows, focus */
	--ofsa-line: #e2dccf;
	--ofsa-line-strong: #d0c6ae;
	--ofsa-focus: 0 0 0 3px rgba(78, 21, 22, 0.35);
	--ofsa-shadow: 0 14px 34px rgba(28, 22, 19, 0.14);
	--ofsa-shadow-sm: 0 6px 16px rgba(28, 22, 19, 0.07);
	--ofsa-shadow-lift: 0 12px 26px rgba(28, 22, 19, 0.12);

	/* Type */
	--ofsa-font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
	--ofsa-font-body: 'Source Serif 4', Georgia, 'Times New Roman', serif;
	--ofsa-font-ui: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

	--ofsa-h1: clamp(2.25rem, 1.3rem + 2.9vw, 3.75rem);   /* 36 -> 60 px */
	--ofsa-h2: clamp(1.85rem, 1.25rem + 1.9vw, 2.75rem);  /* 30 -> 44 px */
	--ofsa-h3: 1.375rem;                                  /* 22 px       */
	--ofsa-lead: clamp(1.125rem, 1rem + 0.4vw, 1.375rem); /* 18 -> 22 px */
	--ofsa-base: 1.0625rem;                               /* 17 px       */
	--ofsa-small: 0.9375rem;                              /* 15 px       */
	--ofsa-caps: 0.75rem;                                 /* 12 px       */

	--ofsa-lh-tight: 1.15;
	--ofsa-lh-head: 1.25;
	--ofsa-lh-body: 1.65;
	--ofsa-caps-ls: 0.16em;

	/* Rhythm */
	--ofsa-section-y: clamp(64px, 5vw, 104px);
	--ofsa-container: 1200px;
	--ofsa-gutter: 24px;
	--ofsa-gap: 28px;
	--ofsa-measure: 68ch;
	--ofsa-radius: 2px;
	--ofsa-ring: 76px;

	/* The one stained-glass nod: a thin red/green/gold bar */
	--ofsa-tribar: linear-gradient(90deg, var(--ofsa-red) 0 33.33%, var(--ofsa-green) 33.33% 66.66%, var(--ofsa-gold) 66.66% 100%);

	/* Legacy aliases kept working for the sub-page stylesheets */
	--ofsa-parchment: var(--ofsa-paper);
	--ofsa-parchment-2: var(--ofsa-paper-2);
	--ofsa-cream-2: var(--ofsa-paper-2);
	--ofsa-oak-950: var(--ofsa-brown);
	--ofsa-oak: var(--ofsa-brown);
	--ofsa-oak-2: var(--ofsa-brown-2);
	--ofsa-oak-3: var(--ofsa-brown-3);
	--ofsa-oak-4: var(--ofsa-brown-3);
	--ofsa-gold-bright: var(--ofsa-gold-2);
	--ofsa-gold-deep: #8a6a1f;
	--ofsa-red-bright: var(--ofsa-red-2);
	--ofsa-green-bright: var(--ofsa-green-2);
	--ofsa-paper-noise: none;
	--ofsa-wood-img: none;
}

::selection {
	background: var(--ofsa-gold-soft);
	color: var(--ofsa-ink);
}

/* ---------- Page shells ---------- */

.ofsa-landing,
.ofsa-auth,
.ofsa-panel {
	font-family: var(--ofsa-font-body);
	color: var(--ofsa-ink-soft);
	background-color: var(--ofsa-paper);
}

.ofsa-landing h1,
.ofsa-landing h2,
.ofsa-landing h3,
.ofsa-landing h4,
.ofsa-auth h1,
.ofsa-auth h2,
.ofsa-auth h3,
.ofsa-panel h1,
.ofsa-panel h2,
.ofsa-panel h3 {
	font-family: var(--ofsa-font-display);
	color: var(--ofsa-ink);
	font-weight: 500;
}

/* ---------- Header ---------- */

.ofsa-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background-color: var(--ofsa-cream);
	border-bottom: 1px solid var(--ofsa-line);
	padding: 12px 0;
	box-sizing: border-box;
	font-family: var(--ofsa-font-body);
}

.ofsa-header::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: -2px;
	height: 2px;
	background: linear-gradient(90deg, rgba(196, 41, 31, 0.6) 0 33.33%, rgba(14, 122, 73, 0.6) 33.33% 66.66%, rgba(198, 154, 51, 0.6) 66.66% 100%);
	opacity: 0.5;
}

body.admin-bar .ofsa-header {
	top: var(--wp-admin--admin-bar--height, 32px);
}

.ofsa-container {
	max-width: var(--ofsa-container);
	margin: 0 auto;
	padding: 0 var(--ofsa-gutter);
	box-sizing: border-box;
}

.ofsa-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	min-height: 64px;
	flex-wrap: wrap;
}

.ofsa-header-brand {
	display: flex;
	align-items: center;
	gap: 14px;
	text-decoration: none;
	margin-right: auto;
	flex-shrink: 0;
}

.ofsa-header-mark {
	flex: none;
	display: block;
	line-height: 0;
}

.ofsa-header-mark img {
	display: block;
	height: 58px;
	width: auto;
}


.ofsa-header-actions {
	display: flex;
	align-items: center;
	gap: 28px;
	flex-wrap: wrap;
}

.ofsa-header-menu {
	display: flex;
	align-items: center;
	gap: 28px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.ofsa-header-menu a,
.ofsa-login-link {
	font-family: var(--ofsa-font-body);
	color: var(--ofsa-ink-soft);
	text-decoration: none;
	font-size: var(--ofsa-small);
	white-space: nowrap;
	display: inline-block;
	padding: 8px 0;
	border-bottom: 1px solid transparent;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.ofsa-header-menu a:hover,
.ofsa-login-link:hover {
	color: var(--ofsa-ink);
	border-bottom-color: var(--ofsa-olive-soft);
	text-decoration: none;
}

.ofsa-nav-motto {
	display: none;
	padding-left: 24px;
	border-left: 1px solid var(--ofsa-line);
	font-size: 0.6875rem;
	letter-spacing: var(--ofsa-caps-ls);
	text-transform: uppercase;
	line-height: 1.9;
	color: var(--ofsa-olive);
	margin: 0;
}

.ofsa-user-nav {
	display: inline-flex;
	align-items: center;
	gap: 14px;
}

.ofsa-logout-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--ofsa-olive);
	text-decoration: none;
	padding: 8px 0;
	transition: color 0.15s ease;
}

.ofsa-logout-link svg {
	display: block;
	width: 20px;
	height: 20px;
}

.ofsa-logout-link:hover,
.ofsa-logout-link:focus {
	color: var(--ofsa-accent);
	text-decoration: none;
}

@media (min-width: 1100px) {
	.ofsa-header-inner {
		flex-wrap: nowrap;
		min-height: 76px;
	}

	.ofsa-nav-motto {
		display: block;
	}
}

.ofsa-header-tagline {
	display: block;
	font-size: 0.6875rem; /* 11 px */
	letter-spacing: 0.055em;
	color: var(--ofsa-ink-muted);
	margin-top: 2px;
}

/* ---------- Buttons ---------- */

.ofsa-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	min-height: 52px;
	padding: 12px 28px;
	border-radius: var(--ofsa-radius);
	border: 1px solid var(--ofsa-line-strong);
	background-color: var(--ofsa-paper-2);
	color: var(--ofsa-ink);
	font-family: var(--ofsa-font-body);
	font-size: var(--ofsa-base);
	line-height: 1.2;
	text-decoration: none;
	box-sizing: border-box;
	white-space: nowrap;
	transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease,
		box-shadow 0.18s ease;
}

.ofsa-btn:hover {
	background-color: var(--ofsa-cream);
	border-color: var(--ofsa-olive-soft);
	color: var(--ofsa-ink);
}

.ofsa-btn:focus-visible {
	outline: 2px solid var(--ofsa-accent);
	outline-offset: 3px;
}

/* Primary CTA â€” the one burgundy surface */
.ofsa-btn-blue {
	background-color: var(--ofsa-accent);
	border-color: var(--ofsa-accent);
	color: #f8f5ef;
}

.ofsa-btn-blue:hover {
	background-color: var(--ofsa-accent-hover);
	border-color: var(--ofsa-accent-hover);
	color: #f8f5ef;
}

.ofsa-btn .ofsa-arrow {
	width: 20px;
	height: 11px;
	flex: none;
}

/* ---------- Footer (site-wide) ---------- */

.ofsa-footer {
	position: relative;
	background-color: var(--ofsa-brown);
	padding: 64px 0 56px;
	color: #efe6d4;
	font-family: var(--ofsa-font-body);
}

.ofsa-footer::before {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	height: 2px;
	background: linear-gradient(90deg, rgba(196, 41, 31, 0.6) 0 33.33%, rgba(14, 122, 73, 0.6) 33.33% 66.66%, rgba(198, 154, 51, 0.6) 66.66% 100%);
	opacity: 0.6;
}

.ofsa-footer-grid {
	display: grid;
	grid-template-columns: 1.4fr 1.1fr 1fr;
	gap: 48px;
}

.ofsa-footer-brand strong {
	display: block;
	font-family: var(--ofsa-font-display);
	font-size: 24px;
	font-weight: 500;
	letter-spacing: 0.06em;
	color: #f1e5c9;
}

.ofsa-footer-brand > span {
	display: block;
	font-size: 16px;
	color: #cdbfa6;
	margin: 6px 0 28px;
}

.ofsa-footer ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ofsa-footer li {
	margin-bottom: 14px;
}

.ofsa-footer a {
	color: #e8dcc4;
	text-decoration: none;
	font-size: 16px;
	display: inline-block;
	padding: 4px 0;
}

.ofsa-footer a:hover {
	color: var(--ofsa-gold-2);
	text-decoration: underline;
	text-underline-offset: 4px;
	text-decoration-color: var(--ofsa-gold);
}

.ofsa-footer-col h3 {
	font-family: var(--ofsa-font-display);
	color: #f1e5c9;
	font-size: 22px;
	font-weight: 500;
	letter-spacing: 0.03em;
	margin-bottom: 18px;
}

.ofsa-footer-contact li {
	display: flex;
	align-items: center;
	gap: 12px;
}

.ofsa-footer-contact svg {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	color: var(--ofsa-gold);
	opacity: 0.95;
}

@media (max-width: 768px) {
	.ofsa-footer {
		padding: 48px 0 44px;
	}

	.ofsa-footer-grid {
		grid-template-columns: 1fr;
		gap: 36px;
	}
}

@media (max-width: 719px) {
	.ofsa-header {
		padding: 12px 0;
	}

	.ofsa-header-inner {
		gap: 12px;
	}

	.ofsa-header-mark img {
		height: 44px;
	}

	.ofsa-header-tagline {
		display: none;
	}

	.ofsa-header-actions {
		width: 100%;
		gap: 12px 20px;
	}

	.ofsa-header-menu {
		flex-wrap: wrap;
		gap: 0 24px;
	}

	.ofsa-header-menu a,
	.ofsa-login-link {
		padding: 10px 0;
		font-size: 16px;
	}

	.ofsa-header .ofsa-btn {
		min-height: 46px;
		padding: 10px 16px;
		font-size: var(--ofsa-small);
	}
}
