/*
Theme Name: Duty First
Description: Reunion site theme for Charlie Battery, 4th Battalion, 5th Field Artillery. Olive drab, artillery red, stencil headings.
Version: 1.0.0
Requires PHP: 8.1
Text Domain: dutyfirst
*/

/* Tokens -------------------------------------------------------------- */
:root {
	--od-deep: #2f3424;   /* olive drab, shadowed: header, hero, footer */
	--od: #4b5320;        /* olive drab: the crate panel */
	--redleg: #b5121b;    /* field artillery scarlet: the single accent */
	--redleg-dark: #8f0e15;
	--fatigue: #eef0e8;   /* page background */
	--ink: #1a1c16;       /* body text */
	--ink-soft: #4a4e42;  /* secondary text, 7.6:1 on fatigue */
	--rule: #c9cdb8;
	--print: #ffffff;     /* photo print borders */
	--stencil: 'Big Shoulders Stencil', 'Arial Narrow', sans-serif;
	--body: 'Public Sans', system-ui, sans-serif;
	--measure: 40rem;
	--wide: 72rem;
	--gutter: clamp(1rem, 4vw, 2rem);
}

/* Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--fatigue);
	color: var(--ink);
	font: 400 1.1875rem/1.6 var(--body);   /* 19px: the readers are 45 to 80 */
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--redleg-dark); text-underline-offset: 0.18em; }
a:hover { color: var(--redleg); }
:focus-visible { outline: 3px solid var(--redleg); outline-offset: 3px; }

h1, h2, h3 {
	font-family: var(--stencil);
	font-weight: 800;
	line-height: 1.02;
	letter-spacing: 0.01em;
	margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.6rem, 9vw, 5.5rem); }
h2 { font-size: clamp(2rem, 5vw, 3rem); }
h3 { font-size: 1.6rem; }
p, ul, ol, dl { margin: 0 0 1em; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 10; background: var(--print); padding: 0.5rem 1rem; }

.wrap { width: 100%; max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }
.measure { max-width: var(--measure); }

/* Header -------------------------------------------------------------- */
.site-head { background: var(--od-deep); color: var(--fatigue); }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 2rem; padding-block: 0.9rem; }
.brand { color: var(--print); text-decoration: none; font-family: var(--stencil); font-weight: 800; font-size: 1.9rem; line-height: 1; }
.brand:hover { color: var(--print); }
.brand small { display: block; font-family: var(--body); font-weight: 400; font-size: 0.85rem; color: #c9cdb8; letter-spacing: 0; margin-top: 0.25rem; }
.nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.25rem 1.4rem; margin: 0; padding: 0; }
.nav a { display: inline-block; padding: 0.55rem 0; color: var(--fatigue); text-decoration: none; font-weight: 600; font-size: 1.05rem; border-bottom: 3px solid transparent; }
.nav a:hover, .nav .current-menu-item > a, .nav .current_page_item > a { color: var(--print); border-bottom-color: var(--redleg); }

/* Buttons ------------------------------------------------------------- */
.dfb-btn {
	display: inline-block;
	min-height: 3.25rem;
	padding: 0.8rem 1.5rem;
	border: 2px solid currentColor;
	border-radius: 2px;
	background: transparent;
	color: var(--ink);
	font: 700 1.1rem/1.2 var(--body);
	text-decoration: none;
	cursor: pointer;
}
.dfb-btn:hover { background: var(--ink); color: var(--print); }
.dfb-btn--red { background: var(--redleg); border-color: var(--redleg); color: var(--print); }
.dfb-btn--red:hover { background: var(--redleg-dark); border-color: var(--redleg-dark); color: var(--print); }
.dfb-btn--light { color: var(--print); }
.dfb-btn--light:hover { background: var(--print); color: var(--od-deep); }

/* Hero: the one loud moment ------------------------------------------- */
.hero { background: var(--od-deep); color: var(--print); padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(3rem, 8vw, 6rem); position: relative; overflow: hidden; }
.hero .wrap { position: relative; }
.hero__unit { color: #c9cdb8; font-size: 1.05rem; max-width: 34rem; margin-bottom: 1.25rem; }
.hero h1 { text-transform: uppercase; max-width: 12ch; margin-bottom: 0.35em; }
.hero__when { font-size: clamp(1.35rem, 3.6vw, 1.9rem); font-weight: 700; line-height: 1.3; margin-bottom: 1.75rem; }
.hero__when span { display: block; font-weight: 400; color: #dfe2d4; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Days-out stamp: stenciled in red, set like a mark on a crate lid */
.stamp {
	display: inline-flex;
	align-items: baseline;
	gap: 0.4rem;
	margin-bottom: 1.5rem;
	padding: 0.35rem 0.9rem 0.25rem;
	border: 3px solid var(--redleg);
	color: #ff6b6b;
	font-family: var(--stencil);
	font-weight: 800;
	font-size: 1.6rem;
	line-height: 1;
	transform: rotate(-2deg);
	transform-origin: left center;
}
.stamp strong { font-size: 2.6rem; color: #ff8a8a; }
@media (prefers-reduced-motion: no-preference) {
	.stamp { animation: stamp 0.5s cubic-bezier(.2,1.6,.4,1) 0.2s both; }
	@keyframes stamp { from { opacity: 0; transform: rotate(-2deg) scale(1.35); } to { opacity: 1; transform: rotate(-2deg) scale(1); } }
}

/* Crate panel: the reunion details ------------------------------------ */
.crate {
	background: var(--od);
	color: var(--print);
	padding: clamp(1.5rem, 4vw, 2.75rem);
	margin-top: calc(-1 * clamp(2rem, 5vw, 3.5rem));
	position: relative;
	box-shadow: inset 0 0 0 2px rgba(255,255,255,.08), inset 0 0 0 10px var(--od), inset 0 0 0 12px rgba(255,255,255,.18);
}
.crate h2 { color: var(--print); }
.crate a { color: var(--print); }
.crate dl { display: grid; grid-template-columns: 1fr; gap: 0; margin: 0; }
.crate dl > div { padding: 0.9rem 0; border-top: 1px dashed rgba(255,255,255,.35); }
.crate dt { font-family: var(--stencil); font-weight: 800; font-size: 1.45rem; line-height: 1.1; color: #e3e6d6; margin-bottom: 0.2rem; }
.crate dd { margin: 0; }
.crate dd ul { margin: 0; padding-left: 1.2rem; }
.crate .crate__note { font-size: 1rem; color: #dfe2d4; margin: 1rem 0 0; }
@media (min-width: 48rem) {
	.crate dl { grid-template-columns: 1fr 1fr; column-gap: 2.5rem; }
	.crate dl > .span { grid-column: 1 / -1; }
}

/* Sections ------------------------------------------------------------ */
.band { padding: clamp(2.5rem, 7vw, 4.5rem) 0; }
.band + .band { border-top: 1px solid var(--rule); }
.band__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 1.5rem; margin-bottom: 1.5rem; }
.band__head h2 { margin: 0; }
.lede { font-size: 1.3rem; color: var(--ink-soft); }
.welcome { font-size: 1.3rem; line-height: 1.65; }
.welcome p:last-child { margin: 0; }

/* Photo prints --------------------------------------------------------- */
.dfb-prints { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 1.5rem; }
.dfb-prints--strip { grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); }
.dfb-print { margin: 0; background: var(--print); padding: 0.6rem 0.6rem 0.9rem; box-shadow: 0 1px 2px rgba(26,28,22,.18), 0 6px 14px -8px rgba(26,28,22,.35); }
.dfb-print img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--rule); }
.dfb-print figcaption { font-size: 0.95rem; font-style: italic; color: var(--ink-soft); margin-top: 0.6rem; line-height: 1.4; }
.dfb-albums { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.75rem; }
.dfb-albums a { padding: 0.5rem 1rem; border: 2px solid var(--od); color: var(--od-deep); text-decoration: none; font-weight: 600; border-radius: 2px; }
.dfb-albums a span { color: var(--ink-soft); font-weight: 400; }
.dfb-albums a[aria-current] { background: var(--od); color: var(--print); }
.dfb-albums a[aria-current] span { color: #dfe2d4; }

dialog.lightbox { border: 0; padding: 0; background: transparent; max-width: min(96vw, 70rem); }
dialog.lightbox::backdrop { background: rgba(20,22,16,.92); }
dialog.lightbox figure { margin: 0; background: var(--print); padding: 0.75rem 0.75rem 1rem; }
dialog.lightbox img { max-height: 78vh; width: auto; margin: 0 auto; }
dialog.lightbox figcaption { font-size: 1.05rem; padding-top: 0.75rem; max-width: 50rem; }
dialog.lightbox figcaption p { margin: 0.4rem 0 0; color: var(--ink-soft); font-style: normal; }
dialog.lightbox .close { position: absolute; top: 0.5rem; right: 0.5rem; }

/* In Memoriam ---------------------------------------------------------- */
.dfb-roll { list-style: none; margin: 0 0 2rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: 2rem; }
.dfb-roll__item { border-top: 4px solid var(--od); padding-top: 1rem; }
.dfb-roll__item img { width: 100%; aspect-ratio: 1; object-fit: cover; filter: grayscale(1); margin-bottom: 1rem; }
.dfb-roll__item h3 { margin-bottom: 0.2rem; }
.dfb-roll__unit { color: var(--ink-soft); font-size: 1rem; }

/* Forms ---------------------------------------------------------------- */
.dfb-form { max-width: var(--measure); }
.dfb-form label, .dfb-form legend { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.dfb-form fieldset { border: 0; padding: 0; margin: 0 0 1em; }
.dfb-form input[type=text], .dfb-form input:not([type]), .dfb-form input[type=email], .dfb-form input[type=tel],
.dfb-form select, .dfb-form textarea, .dfb-form input[type=file] {
	width: 100%;
	min-height: 3.25rem;
	padding: 0.7rem 0.85rem;
	border: 2px solid #8b907c;
	border-radius: 2px;
	background: var(--print);
	color: var(--ink);
	font: inherit;
}
.dfb-form input:focus, .dfb-form select:focus, .dfb-form textarea:focus { border-color: var(--od-deep); outline: 3px solid var(--redleg); outline-offset: 1px; }
.dfb-form .dfb-choice { display: flex; gap: 0.7rem; align-items: flex-start; font-weight: 400; padding: 0.45rem 0; }
.dfb-form .dfb-choice input { width: 1.5rem; height: 1.5rem; margin-top: 0.1rem; flex: none; accent-color: var(--redleg); }
.dfb-hint { display: block; font-size: 0.95rem; color: var(--ink-soft); margin-top: 0.35rem; }
.dfb-opt { font-weight: 400; color: var(--ink-soft); }
.dfb-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.dfb-pair { display: grid; gap: 0 1.25rem; }
@media (min-width: 40rem) { .dfb-pair { grid-template-columns: 1fr 1fr; } }
.dfb-inline { display: grid; gap: 0 1rem; align-items: end; }
@media (min-width: 48rem) { .dfb-inline { grid-template-columns: 1fr 1.3fr auto; } .dfb-inline p { margin: 0; } }
.dfb-notice { padding: 1rem 1.25rem; margin: 0 0 1.5rem; border-left: 6px solid var(--od); background: var(--print); max-width: var(--measure); }
.dfb-notice--error { border-left-color: var(--redleg); }
.dfb-empty { padding: 2rem; border: 2px dashed #8b907c; max-width: var(--measure); }
.dfb-empty p:last-child { margin: 0; }

/* Pages ---------------------------------------------------------------- */
.page-head { background: var(--od-deep); color: var(--print); padding: clamp(2rem, 6vw, 3.5rem) 0 clamp(1.5rem, 4vw, 2.5rem); }
.page-head h1 { font-size: clamp(2.4rem, 7vw, 4rem); margin: 0; }
.page-body { padding: clamp(2rem, 6vw, 3.5rem) 0 4rem; }
.entry > * { max-width: var(--measure); }
.entry > .dfb-prints, .entry > .dfb-roll, .entry > .dfb-albums, .entry > .crate, .entry > .alignwide { max-width: none; }
.entry .crate { margin-top: 0; margin-bottom: 2.5rem; }
.entry h2 { margin-top: 1.5em; }
.schedule { list-style: none; padding: 0; }
.schedule li { padding: 0.75rem 0; border-top: 1px solid var(--rule); }

/* Signup band ---------------------------------------------------------- */
.signup { background: #e1e4d8; }
.signup .dfb-form { max-width: none; }

/* Footer --------------------------------------------------------------- */
.site-foot { background: var(--od-deep); color: #dfe2d4; padding: 3rem 0 2.5rem; font-size: 1rem; }
.site-foot a { color: var(--print); }
.motto { font-family: var(--stencil); font-weight: 800; font-size: clamp(1.5rem, 4vw, 2.1rem); line-height: 1.1; color: var(--print); max-width: 30ch; margin-bottom: 1.5rem; }
.foot-grid { display: grid; gap: 1.5rem; }
@media (min-width: 48rem) { .foot-grid { grid-template-columns: 2fr 1fr; } }
.foot-links { list-style: none; padding: 0; }
.foot-links li { margin-bottom: 0.4rem; }
.disclaimer { color: #b9bea8; font-size: 0.9rem; margin: 2rem 0 0; }
