/*
Theme Name:        Stoic Order
Theme URI:         https://stoicorder.com
Author:            The Stoic Order
Author URI:        https://stoicorder.com
Description:       Hand-built classic theme for The Stoic Order — Engine 1, the digital monastery. No page builder, no framework lock-in. Built for WordPress + bbPress + The Events Calendar on Kinsta.
Version:           0.8.2
Requires at least: 6.4
Tested up to:      7.0
Requires PHP:      8.2
License:           GNU General Public License v2 or later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:       stoic-order
Tags:              custom-theme, classic, accessibility-ready, translation-ready
*/

/* ==========================================================================
   Stoic Order — base + foundation (v0.3.1)
   Tokens from theme.json surface as --wp--preset--*. Shield Protocol §4.2:
   no !important on global IDs; use specificity + parent-scoped rules.
   Mobile-first throughout.
   ========================================================================== */

/* --- The Order's own hand (custom font, alternates auto-rotate via calt) --- */
@font-face {
	font-family: "Stoic Order Hand";
	src: url("assets/fonts/stoic-order.woff2") format("woff2"),
	     url("assets/fonts/stoic-order.woff") format("woff");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

/* --- Reset-ish --- */
*, *::before, *::after { box-sizing: border-box; }

body {
	margin: 0;
	font-family: var(--wp--preset--font-family--body, Georgia, "Times New Roman", serif);
	line-height: 1.6;
	color: var(--wp--preset--color--ink, #444444);
	background-color: var(--wp--preset--color--paper, #F5F2E9);
	background-image: url("assets/img/paper-texture.jpg");
	background-repeat: repeat;
	background-size: 480px;
}

img, svg { max-width: 100%; height: auto; }
a { color: var(--wp--preset--color--accent, #8B0000); }
a:hover, a:focus { text-decoration: none; }

/* --- Layout ---
   Wider than a reading column so the page doesn't feel boxed into the center;
   reading sections keep their own 42rem cap below. */
.site-container { width: min(94%, 92rem); margin-inline: auto; }
.site-main { padding-block: 0 2.5rem; }
.site-main .entry-content,
.page-intro { max-width: 42rem; }

/* --- Typography --- */
h1, h2, h3, h4 {
	font-family: var(--wp--preset--font-family--body);
	line-height: 1.2;
	color: var(--wp--preset--color--charcoal, #1E1E24);
}
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
p { margin-block: 0 1.25rem; }

/* The "hand" voice — handwritten moments; alternates + ligatures on. */
.hand {
	font-family: var(--wp--preset--font-family--hand, "Stoic Order Hand", cursive);
	font-feature-settings: "calt" 1, "dlig" 1;
	font-variant-ligatures: contextual discretionary-ligatures;
	line-height: 1.25;
}

/* --- Header + primary nav --- */
.site-header { padding-block: 0.6rem; }
.site-header .site-container {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: .5rem 1.75rem;
}
.custom-logo { max-height: 56px; width: auto; }
.site-title { margin: 0; font-size: 1.25rem; }
.site-title a { color: var(--wp--preset--color--charcoal, #1E1E24); text-decoration: none; }
#primary-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1.75rem; }
#primary-menu li { margin: 0; }
#primary-menu a { color: var(--wp--preset--color--ink); text-decoration: none; font-size: 0.95rem; letter-spacing: 0.01em; }
#primary-menu a:hover, #primary-menu a:focus { color: var(--wp--preset--color--accent); }
.site-header .site-container > nav { margin-inline-start: auto; } /* pin the menu to the right */

/* --- Hero (front page): a single layered "stamp" + calendar, bottom-aligned ---
   The wordmark, acropolis and tagline are ONE art piece — transparent PNGs that
   overlap (the wordmark intrudes onto the acropolis roof; the tagline signs its
   base). The acropolis PNG carries ~20% transparent sky top + bottom, so the
   overlap has to exceed that to actually merge. Both overlaps are tunable knobs
   below. Mobile-first single column; two columns at >=48rem. */
.stoic-hero { padding-block: 0 clamp(1.25rem, 4vw, 2.5rem); }
.stoic-hero__inner { display: grid; gap: 1.5rem 2.5rem; }

.stoic-stamp {
	--stamp-w: clamp(300px, 32vw, 400px);   /* the art-piece width */
	--overlap-art: 0.12;                    /* acropolis rises up under the wordmark (x width) */
	--overlap-tag: 0.12;                    /* tagline signs up into the acropolis base (x width) */
	--mark-shift: 0.05;                     /* nudge wordmark right so the roof peak nests in the O-R gap (x width) */
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}
.stoic-stamp__mark { width: min(100%, var(--stamp-w)); position: relative; z-index: 2; transform: translateX(calc(var(--stamp-w) * var(--mark-shift))); }
.stoic-stamp__mark img { display: block; width: 100%; height: auto; aspect-ratio: 2078 / 679; }
.stoic-stamp__art { width: min(100%, var(--stamp-w)); margin-top: calc(var(--stamp-w) * var(--overlap-art) * -1); position: relative; z-index: 1; }
.stoic-stamp__art img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }
.stoic-stamp__tagline {
	width: min(100%, var(--stamp-w));
	margin: calc(var(--stamp-w) * var(--overlap-tag) * -1) 0 0;
	position: relative;
	z-index: 3;
	text-align: center;
	font-size: clamp(1.2rem, 2.4vw, 1.6rem);
	color: var(--wp--preset--color--accent, #8B0000);
	line-height: 1.2;
}

.stoic-hero__video { margin-top: 1.25rem; width: min(100%, var(--stamp-w)); }
.stoic-hero__video-ph,
.stoic-hero__video iframe,
.stoic-hero__video video {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	border: 0;
	border-radius: 6px;
}
.stoic-hero__video-ph {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: .6rem;
	background: #ECE7DA;
	border: 1.5px dashed rgba(139, 0, 0, .5);
	color: var(--wp--preset--color--accent, #8B0000);
}
.stoic-hero__video-play {
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 13px 0 13px 21px;
	border-color: transparent transparent transparent currentColor;
}
.stoic-hero__video-label { font-size: .95rem; letter-spacing: .03em; }

.stoic-hero__calendar { min-width: 0; }
.stoic-cal-ph {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 180px;
	padding: 1.5rem;
	text-align: center;
	color: #7a7468;
}
.stoic-cal-ph__title { margin: 0 0 .35rem; font-size: 1.2rem; color: var(--wp--preset--color--charcoal, #1E1E24); }
.stoic-cal-ph__note { margin: 0; font-size: .95rem; color: #7a7468; max-width: 22rem; }
.stoic-cal-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.stoic-cal-list li { display: flex; justify-content: space-between; gap: 1rem; padding-block-end: .6rem; border-bottom: 1px solid rgba(68, 68, 68, .12); }
.stoic-cal-list a { text-decoration: none; }
.stoic-cal-list__date { color: #7a7468; white-space: nowrap; }

/* --- Page (prose) template ---
   Standard content pages: block-editor prose in a comfortable reading column,
   styled by the base typography + tokens. Bespoke layouts get their own template. */
.page-article { max-width: 44rem; margin-inline: auto; }
.page-title { margin-block: 0 1.5rem; }
.entry-content > :first-child { margin-top: 0; }
.entry-content :is(h2, h3) { margin-block-start: 2rem; }

/* Block image alignments — doodles sit beside the prose on desktop, stack on mobile */
.entry-content .alignleft,
.entry-content .alignright { display: block; margin: 0 auto 1.25rem; max-width: 320px; }
.entry-content .aligncenter { margin-inline: auto; }
.entry-content::after { content: ""; display: block; clear: both; }

@media (min-width: 48rem) {
	.entry-content .alignleft { float: left; margin: 0.25rem 1.75rem 1rem 0; max-width: 300px; }
	.entry-content .alignright { float: right; margin: 0.25rem 0 1rem 1.75rem; max-width: 300px; }
}

/* --- Page with a featured doodle: BIG image left column, prose right --- */
.page-article--has-art { max-width: 74rem; }
.page-layout { display: grid; gap: 2rem; }
.page-art { margin: 0; }
.page-art img { display: block; width: 100%; height: auto; }
/* Portrait doodles (the pillar): cap the height so tall art doesn't tower past the prose. */
.page-art img { max-height: 78vh; width: auto; max-width: 100%; margin-inline: auto; object-fit: contain; }
.page-layout .entry-content { max-width: 42rem; }

@media (min-width: 48rem) {
	.page-layout { grid-template-columns: minmax(0, 28rem) minmax(0, 1fr); gap: 3rem; align-items: start; }
}

/* --- Blog archive list --- */
.blog-archive { max-width: 44rem; margin-inline: auto; }
.post-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2.5rem; }
.post-list__item { padding-block-end: 1.5rem; border-bottom: 1px solid rgba(68, 68, 68, .12); }
.post-list__title { margin: 0 0 .25rem; }
.post-list__title a { color: var(--wp--preset--color--charcoal, #1E1E24); text-decoration: none; }
.post-list__title a:hover, .post-list__title a:focus { color: var(--wp--preset--color--accent); }
.post-list__meta { font-size: .875rem; color: #7a7468; margin: 0 0 .5rem; }
.read-more { color: var(--wp--preset--color--accent, #8B0000); text-decoration: none; }
.read-more:hover, .read-more:focus { text-decoration: underline; }

/* --- Single post --- */
.post-single { max-width: 50rem; margin-inline: auto; }
.post-single .entry-title { margin-bottom: .25rem; }
.post-single .entry-meta { font-size: .875rem; color: #7a7468; margin: 0 0 1.5rem; }
.post-nav { max-width: 50rem; margin: 2.5rem auto 0; display: flex; justify-content: space-between; gap: 1.5rem; }
.post-nav a { color: var(--wp--preset--color--accent, #8B0000); text-decoration: none; }

/* --- About hub (page-about.php): left local-nav + mission content --- */
.about-hub { display: grid; gap: 2rem; }
.about-hub__art { max-width: 100%; margin-top: 2rem; }
.about-hub__art img { display: block; width: 100%; height: auto; aspect-ratio: 519 / 559; }
.about-local-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .65rem; }
.about-local-nav a { color: var(--wp--preset--color--charcoal, #1E1E24); text-decoration: none; font-size: 1.05rem; }
.about-local-nav a:hover, .about-local-nav a:focus { color: var(--wp--preset--color--accent); }
.about-hub__content { max-width: 42rem; }
.about-hub__content > :first-child { margin-top: 0; }

@media (min-width: 48rem) {
	.about-hub { grid-template-columns: minmax(0, 18rem) minmax(0, 1fr); gap: 3rem; }
}

/* --- Buttons / CTAs --- */
.button {
	display: inline-block;
	padding: .65rem 1.4rem;
	background: var(--wp--preset--color--accent, #8B0000);
	color: #fff;
	text-decoration: none;
	border-radius: 4px;
}
.button:hover, .button:focus { background: var(--wp--preset--color--charcoal, #1E1E24); color: #fff; }

/* --- Forms (contact + Seeker sign-up; inc/forms.php) --- */
.stoic-form { margin-block-start: 2rem; max-width: 34rem; position: relative; }
.stoic-form p { margin: 0 0 1.1rem; }
.stoic-form label { display: block; margin-block-end: .3rem; font-weight: 600; }
.stoic-form input[type="text"],
.stoic-form input[type="email"],
.stoic-form textarea {
	width: 100%;
	padding: .55rem .7rem;
	border: 1px solid rgba(68, 68, 68, .35);
	border-radius: 4px;
	background: #fff;
	color: var(--wp--preset--color--ink, #444444);
	font: inherit;
}
.stoic-form input[type="text"]:focus,
.stoic-form input[type="email"]:focus,
.stoic-form textarea:focus {
	outline: 2px solid var(--wp--preset--color--accent, #8B0000);
	outline-offset: 1px;
	border-color: var(--wp--preset--color--accent, #8B0000);
}
.stoic-form .stoic-form__hp { position: absolute; left: -9999px; height: 0; margin: 0; overflow: hidden; }
.form-notice { padding: .75rem 1rem; border-radius: 4px; max-width: 34rem; }
.form-notice--ok { background: rgba(34, 102, 51, .12); border: 1px solid rgba(34, 102, 51, .4); }
.form-notice--err { background: rgba(139, 0, 0, .08); border: 1px solid rgba(139, 0, 0, .4); }

/* --- Mini month calendar (inc/calendar.php) --- */
.stoic-minical { max-width: 26rem; }
.stoic-minical__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-block-end: .5rem; }
.stoic-minical__month { font-weight: 600; color: var(--wp--preset--color--charcoal, #1E1E24); }
.stoic-minical__all { font-size: .85rem; text-decoration: none; }
.stoic-minical__all:hover, .stoic-minical__all:focus { text-decoration: underline; }
.stoic-minical__grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.stoic-minical__grid th { font-size: .75rem; font-weight: 600; color: #7a7468; padding: .3rem 0; text-align: center; }
.stoic-minical__grid td { text-align: center; padding: .35rem 0; font-size: .9rem; border: 1px solid rgba(68, 68, 68, .08); }
.stoic-minical__grid td.is-empty { border-color: transparent; }
.stoic-minical__grid td.is-today { background: rgba(139, 0, 0, .1); font-weight: 700; color: var(--wp--preset--color--accent, #8B0000); }
.stoic-minical__grid td.has-event a { display: block; color: var(--wp--preset--color--accent, #8B0000); font-weight: 600; text-decoration: underline; }
.stoic-minical__note { margin-block-start: .6rem; font-size: .85rem; color: #7a7468; }

/* --- Members beta door (page-members.php) --- */
.members-login { margin-block-start: 2.5rem; padding: 1.5rem; max-width: 26rem; background: rgba(30, 30, 36, .04); border: 1px solid rgba(68, 68, 68, .15); border-radius: 6px; }
.members-login__title { margin: 0 0 .5rem; font-size: 1.05rem; letter-spacing: .12em; color: var(--wp--preset--color--accent, #8B0000); }
.members-login__note { font-size: .92rem; color: #5d574c; }
.members-login form p { margin: 0 0 1rem; }
.members-login label { display: block; margin-block-end: .3rem; font-weight: 600; }
.members-login input[type="text"],
.members-login input[type="password"] { width: 100%; padding: .55rem .7rem; border: 1px solid rgba(68, 68, 68, .35); border-radius: 4px; font: inherit; }
.members-login input[type="submit"] {
	display: inline-block;
	padding: .65rem 1.4rem;
	background: var(--wp--preset--color--accent, #8B0000);
	color: #fff;
	border: 0;
	border-radius: 4px;
	font: inherit;
	cursor: pointer;
}
.members-login input[type="submit"]:hover,
.members-login input[type="submit"]:focus { background: var(--wp--preset--color--charcoal, #1E1E24); }

.members-welcome { font-size: 1.05rem; }
.members-rooms { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 1rem; }
.members-rooms__item { display: grid; gap: .15rem; padding: 1rem 1.2rem; border: 1px solid rgba(68, 68, 68, .15); border-radius: 6px; background: rgba(255, 255, 255, .45); }
.members-rooms__name { font-weight: 700; color: var(--wp--preset--color--charcoal, #1E1E24); }
.members-rooms__desc { font-size: .92rem; }
.members-rooms__status { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--wp--preset--color--accent, #8B0000); }
.members-signout { margin-block-start: 2rem; font-size: .9rem; }

/* --- Donate (page-donate.php): case-for-giving prose, then the Give Online panel.
   The GiveWP form is skinned to the Notebook here, scoped under .donate-give so we
   never style GiveWP globally (Shield §4.2: specificity over !important; these are
   plugin classes, not global IDs). Authored against GiveWP's documented stable
   markup — gets a live-tuning pass once the plugin is installed. --- */
.donate-give { margin-block-start: 2.5rem; padding-block-start: 1.5rem; border-top: 1px solid rgba(68, 68, 68, .12); }
.donate-give > h2 { margin-block: 0 1.25rem; }

/* Honest build-in-public panel, shown until GiveWP + Stripe are wired. */
.donate-give__pending {
	padding: 1.5rem;
	max-width: 34rem;
	background: rgba(255, 255, 255, .5);
	border: 1px solid rgba(68, 68, 68, .15);
	border-radius: 6px;
	box-shadow: 0 1px 2px rgba(30, 30, 36, .05);
}
.donate-give__pending .donate-give__lede { font-weight: 600; color: var(--wp--preset--color--charcoal, #1E1E24); }
.donate-give__pending p:last-child { margin-bottom: 0; }

/* GiveWP form skin (scoped). */
.donate-give .give-form {
	max-width: 34rem;
	padding: 1.5rem;
	background: rgba(255, 255, 255, .5);
	border: 1px solid rgba(68, 68, 68, .15);
	border-radius: 6px;
	box-shadow: 0 1px 2px rgba(30, 30, 36, .05);
}
.donate-give .give-form .give-form-title { margin-block: 0 1rem; font-size: 1.25rem; color: var(--wp--preset--color--charcoal, #1E1E24); }

/* Preset amount buttons — paper tiles with an ink hairline; accent on hover/selected. */
.donate-give .give-donation-levels-wrap { display: flex; flex-wrap: wrap; gap: .6rem; margin-block-end: 1.25rem; }
.donate-give .give-donation-levels-wrap .give-btn,
.donate-give .give-donation-level-btn {
	padding: .55rem 1.1rem;
	background: var(--wp--preset--color--paper, #F5F2E9);
	color: var(--wp--preset--color--ink, #444444);
	border: 1px solid rgba(68, 68, 68, .35);
	border-radius: 4px;
	font: inherit;
	cursor: pointer;
	transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}
.donate-give .give-donation-levels-wrap .give-btn:hover,
.donate-give .give-donation-levels-wrap .give-btn:focus,
.donate-give .give-donation-level-btn:hover,
.donate-give .give-donation-level-btn:focus,
.donate-give .give-donation-level-btn.give-default-level {
	background: var(--wp--preset--color--accent, #8B0000);
	color: #fff;
	border-color: var(--wp--preset--color--accent, #8B0000);
}

/* Custom amount + text inputs — match the native .stoic-form inputs. */
.donate-give .give-form .give-text-input,
.donate-give .give-form input[type="text"],
.donate-give .give-form input[type="email"],
.donate-give .give-form input[type="tel"],
.donate-give .give-form input[type="number"] {
	width: 100%;
	padding: .55rem .7rem;
	border: 1px solid rgba(68, 68, 68, .35);
	border-radius: 4px;
	background: #fff;
	color: var(--wp--preset--color--ink, #444444);
	font: inherit;
}
.donate-give .give-form .give-text-input:focus,
.donate-give .give-form input[type="text"]:focus,
.donate-give .give-form input[type="email"]:focus,
.donate-give .give-form input[type="tel"]:focus,
.donate-give .give-form input[type="number"]:focus {
	outline: 2px solid var(--wp--preset--color--accent, #8B0000);
	outline-offset: 1px;
	border-color: var(--wp--preset--color--accent, #8B0000);
}
.donate-give .give-form label,
.donate-give .give-form .give-label { display: block; margin-block-end: .3rem; font-weight: 600; }
.donate-give .give-form .give-total-wrap { margin-block: 1rem; font-weight: 600; color: var(--wp--preset--color--charcoal, #1E1E24); }

/* The donate button — matches .button (accent → charcoal on hover). */
.donate-give .give-form .give-submit,
.donate-give .give-form #give-purchase-button,
.donate-give .give-form [id^="give-purchase-button"] {
	display: inline-block;
	width: auto;
	padding: .7rem 1.6rem;
	background: var(--wp--preset--color--accent, #8B0000);
	color: #fff;
	border: 0;
	border-radius: 4px;
	font: inherit;
	cursor: pointer;
	transition: background 150ms ease;
}
.donate-give .give-form .give-submit:hover,
.donate-give .give-form .give-submit:focus,
.donate-give .give-form #give-purchase-button:hover,
.donate-give .give-form #give-purchase-button:focus {
	background: var(--wp--preset--color--charcoal, #1E1E24);
}

/* --- Home: latest from the blog --- */
.home-latest { margin-block-start: 3rem; max-width: 42rem; }
.home-latest__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.5rem; }
.home-latest__item { padding-block-end: 1.25rem; border-bottom: 1px solid rgba(68, 68, 68, .12); }
.home-latest__item h3 { margin: 0 0 .25rem; }
.home-latest__meta { font-size: .875rem; color: #7a7468; margin: 0 0 .5rem; }

/* --- Footer --- */
.site-footer {
	padding-block: 2rem;
	margin-block-start: 3rem;
	border-top: 1px solid rgba(68, 68, 68, .12);
	background: var(--wp--preset--color--charcoal, #1E1E24);
	color: #cfcbc2;
}
.site-footer a { color: #fff; }
.site-footer .site-tagline { display: block; margin-block-start: .35rem; color: #fff; }
.site-footer .footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.25rem; margin-block-end: .75rem; font-size: .9rem; }
.site-footer .footer-nav a { text-decoration: none; opacity: .85; }
.site-footer .footer-nav a:hover, .site-footer .footer-nav a:focus { text-decoration: underline; opacity: 1; }

/* --- Accessibility: skip link + screen-reader text --- */
.skip-link { position: absolute; left: -9999px; top: 0; padding: .5rem 1rem; background: var(--wp--preset--color--charcoal, #1E1E24); color: #fff; z-index: 100000; }
.skip-link:focus { left: 0; }
.screen-reader-text { border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; }
.screen-reader-text:focus { clip: auto; clip-path: none; height: auto; width: auto; margin: 0; }

/* ==========================================================================
   Desktop breakpoint layer (v0.3.1)
   Two-column hero once there's room: the stamp (left, sized to the art piece)
   beside the calendar; the intro video grows to bottom-align with the calendar.
   Shield §4.2: specificity + parent-scoped, no !important.
   ========================================================================== */
@media (min-width: 48rem) {
	.stoic-hero__inner {
		grid-template-columns: minmax(0, 26rem) minmax(0, 1fr);
		align-items: stretch;
	}
	.stoic-hero__calendar { max-width: 46rem; }
	.stoic-hero__video { margin-top: 1.5rem; flex: 1 1 auto; display: flex; }
	.stoic-hero__video-ph,
	.stoic-hero__video iframe,
	.stoic-hero__video video { aspect-ratio: auto; height: 100%; width: 100%; min-height: 180px; }
	.stoic-cal-ph { min-height: 240px; }
	.home-latest { margin-block-start: 4rem; }
}

@media (min-width: 64rem) {
	.stoic-stamp { --stamp-w: clamp(340px, 30vw, 420px); }
}
