/*
Theme Name: JEEP
Theme URI: https://jewisheducate.org
Description: Block theme for JEEP! Jewish Education for Every Person. Built around the teaching "the greatest treasures lie hidden in every Jew": plum and gold from JEEP's own painting, gold dots as the one decorative device.
Version: 1.0.0
Requires at least: 6.6
Requires PHP: 8.1
Text Domain: jeep
*/

/* ---------- Basics ---------- */
.screen-reader-text {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
	height: 1px; margin: -1px; overflow: hidden; padding: 0;
	position: absolute !important; width: 1px; word-wrap: normal !important;
}
.screen-reader-text:focus {
	clip: auto !important; clip-path: none; height: auto; width: auto;
	background: var(--wp--preset--color--card); color: var(--wp--preset--color--plum-900);
	padding: 12px 20px; z-index: 100000; top: 8px; left: 8px;
}
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
:where(.wp-site-blocks) > * { margin-block-start: 0; }
img { height: auto; }

/* ---------- Wordmark ---------- */
.jeep-wordmark { display: inline-flex; align-items: flex-end; letter-spacing: -0.01em; }
.jeep-wordmark > span[aria-hidden] { display: inline-block; }
.jeep-wordmark > span:nth-child(1) { transform: translateY(2px); }
.jeep-wordmark > span:nth-child(2) { transform: translateY(-5px) rotate(-6deg); font-size: 0.78em; }
.jeep-wordmark > span:nth-child(3) { transform: translateY(-1px) rotate(4deg); }
.jeep-wordmark > span:nth-child(4) { transform: translateY(-4px); }
.jeep-wordmark > span:nth-child(5) { transform: translateY(-8px) rotate(8deg); color: var(--wp--preset--color--gold); }

/* ---------- Header ---------- */
.jeep-header { position: relative; }
.jeep-tagline {
	border-left: 1px solid var(--wp--preset--color--rule);
	padding-left: 14px; line-height: 1.25;
}
.jeep-bsd {
	position: absolute; top: 6px; right: 24px; margin: 0;
	font-size: 12px; color: var(--wp--preset--color--ink-soft); letter-spacing: 0.04em;
}
.jeep-header .wp-block-navigation a:hover { color: var(--wp--preset--color--plum-500); }
.jeep-header .wp-block-navigation .current-menu-item > a { text-decoration: underline; text-decoration-color: var(--wp--preset--color--gold); text-decoration-thickness: 2px; text-underline-offset: 6px; }
@media (max-width: 780px) {
	.jeep-tagline { display: none; }
}

/* ---------- Block style: gold dots divider (the painting's dots) ---------- */
.wp-block-separator.is-style-dots {
	border: 0 !important; height: 8px; width: 100%; opacity: 1;
	background: radial-gradient(circle, var(--wp--preset--color--gold) 2.2px, transparent 2.6px) 0 50% / 18px 8px space no-repeat !important;
}

/* ---------- Block style: cards ---------- */
.wp-block-group.is-style-card {
	position: relative;
	background: var(--wp--preset--color--card);
	border: 1px solid var(--wp--preset--color--rule);
	border-radius: 10px;
	padding: 28px;
	transition: border-color .2s ease, transform .2s ease;
}
/* Whole card is clickable when its heading holds a link */
.wp-block-group.is-style-card :is(h2, h3, h4) a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.wp-block-group.is-style-card:has(:is(h2, h3, h4) a):hover { border-color: var(--wp--preset--color--gold); transform: translateY(-2px); }
.wp-block-group.is-style-card :is(h2, h3, h4) a { color: inherit; text-decoration: none; }

.wp-block-group.is-style-story {
	background: var(--wp--preset--color--card);
	border-radius: 10px;
	padding: 32px 32px 28px;
	display: flex; flex-direction: column;
}
.wp-block-group.is-style-story::after {
	/* align-self: the card is a flex column that shrinks children to content; an empty row would be 0 wide */
	content: ""; display: block; height: 8px; align-self: stretch; margin-block-start: auto; padding-top: 16px;
	background: radial-gradient(circle, var(--wp--preset--color--gold) 2.2px, transparent 2.6px) 0 calc(100% - 0px) / 18px 8px repeat-x;
	background-clip: content-box; box-sizing: content-box;
}

/* ---------- Block style: images ---------- */
.wp-block-image.is-style-ring img {
	border-radius: 50%; aspect-ratio: 1; object-fit: cover;
	box-shadow: 0 0 0 6px var(--wp--preset--color--plum-700), 0 0 0 8px var(--wp--preset--color--gold);
}
.wp-block-image.is-style-artwork img { border-radius: 6px; box-shadow: var(--wp--preset--shadow--artwork); }
.wp-block-image.is-style-artwork figcaption {
	display: flex; align-items: center; gap: 10px; margin-top: 14px; text-align: left;
}
.wp-block-image.is-style-artwork figcaption::before { content: ""; width: 28px; height: 2px; flex: none; background: var(--wp--preset--color--gold); }

/* ---------- Block style: buttons ---------- */
.wp-block-button.is-style-gold .wp-block-button__link {
	background: var(--wp--preset--color--gold); color: var(--wp--preset--color--plum-900);
}
.wp-block-button.is-style-gold .wp-block-button__link:hover { background: var(--wp--preset--color--gold-300); color: var(--wp--preset--color--plum-900); }
.wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent; color: inherit; border: 2px solid currentColor;
	padding: calc(0.8rem - 2px) calc(1.5rem - 2px);
}
.wp-block-button.is-style-outline .wp-block-button__link:hover { background: rgba(109, 63, 133, .08); color: inherit; }

/* ---------- Block style: eyebrow ---------- */
p.is-style-eyebrow {
	font-size: 0.8125rem; letter-spacing: 0.14em; text-transform: uppercase;
	font-weight: 700; color: var(--wp--preset--color--plum-500);
}
:is(.has-plum-900-background-color, .has-plum-700-background-color, .has-plum-dusk-gradient-background) p.is-style-eyebrow { color: var(--wp--preset--color--gold-300); }

/* ---------- Block style: large quote ---------- */
.wp-block-quote.is-style-treasure { margin: 0; }
/* In running text (stories), a pull quote needs space above and below. */
.wp-block-post-content > .wp-block-quote.is-style-treasure { margin-block: var(--wp--preset--spacing--50); }
.wp-block-quote.is-style-treasure p {
	font-size: clamp(1.625rem, 3.2vw, 2.5rem); font-weight: 500; line-height: 1.25; letter-spacing: -0.01em;
}
.wp-block-quote.is-style-treasure strong { font-weight: 700; color: var(--wp--preset--color--plum-500); }
:is(.has-plum-900-background-color, .has-plum-700-background-color) .wp-block-quote.is-style-treasure strong { color: var(--wp--preset--color--gold-300); }
.wp-block-quote.is-style-treasure cite {
	display: block; margin-top: 18px; font-style: normal; font-size: 1rem; opacity: .8;
}

/* ---------- Block style: schedule list ---------- */
.wp-block-list.is-style-schedule { list-style: none; padding: 0; margin: 0; }
/* Grid, not flex: the text after <strong> is a bare text node, so it must land in its own column */
.wp-block-list.is-style-schedule li {
	display: grid; grid-template-columns: minmax(8.5rem, 38%) 1fr; gap: 4px 16px; align-items: baseline;
	padding: 14px 0; border-top: 1px solid var(--wp--preset--color--rule);
}
.wp-block-list.is-style-schedule li mark { justify-self: start; }
.wp-block-list.is-style-schedule li mark { background: var(--wp--preset--color--gold-100); padding: 2px 8px; border-radius: 4px; }

/* ---------- Components used by patterns ---------- */
/* Dotted field that fades in from the left, like the 2023 campaign banners */
.jeep-dotfield { position: relative; overflow: hidden; isolation: isolate; }
.jeep-dotfield::after {
	content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
	background: radial-gradient(circle, rgba(240, 207, 107, .2) 1.4px, transparent 1.8px) 0 0 / 14px 14px;
	-webkit-mask: linear-gradient(90deg, transparent 40%, #000); mask: linear-gradient(90deg, transparent 40%, #000);
}
.jeep-match .wp-block-group { background: rgba(255, 255, 255, .08); border-radius: 12px; }
.jeep-match p { margin: 0; }

/* Program cards: the small ruby tag line */
.jeep-tag { color: var(--wp--preset--color--ruby); font-weight: 700; font-size: 0.875rem; margin-top: auto !important; }
.jeep-grow { flex: 1; }

/* Page title band: the title keeps the text's left edge; balance breaks long titles evenly. */
.jeep-title-band .wp-block-post-title { text-wrap: balance; }

/* Headlights covers */
.jeep-cover img { box-shadow: var(--wp--preset--shadow--lift); }

/* Story and card grids in query loops: cards stretch to equal height */
.wp-block-post-template.is-layout-grid > li:has(> .is-style-story:only-child, > .is-style-card:only-child) { display: flex; }
.wp-block-post-template.is-layout-grid > li > :is(.is-style-story, .is-style-card):only-child { flex: 1; }

/* Footer */
.jeep-footer a { color: inherit; text-decoration: none; }
.jeep-footer a:hover { color: var(--wp--preset--color--gold-300); text-decoration: underline; }
.jeep-footer .jeep-wordmark { font-size: 2.25rem; }
/* Footer column titles are h2 for the outline, but small. */
.jeep-footer h2 { font-size: var(--wp--preset--font-size--base); letter-spacing: 0; }
/* Taller links, so they are easy to tap (24px or more). */
.jeep-footer a { display: inline-block; padding-block: 0.25rem; }
.jeep-fine { border-top: 1px solid rgba(255, 255, 255, .14); }

/* Motion: respect people who ask for less */
@media (prefers-reduced-motion: reduce) {
	.wp-block-group.is-style-card { transition: none; }
	.wp-block-group.is-style-card:has(:is(h2, h3, h4) a):hover { transform: none; }
}

/* ---------- Page rhythm: full-width sections butt together ---------- */
body .wp-site-blocks > * { margin-block-start: 0; }
body .wp-block-post-content > .alignfull { margin-block-start: 0; }
body .wp-block-post-content > .alignfull + :not(.alignfull) { margin-block-start: var(--wp--preset--spacing--50); }
.jeep-title-band + .wp-block-post-content > :first-child { margin-block-start: 0; }

/* Campaign tiles: numbers must fit three across */
.jeep-match .has-x-large-font-size { font-size: clamp(1.5rem, 2.3vw, 2.125rem) !important; white-space: nowrap; }
.wp-block-image.is-style-artwork img { width: 100%; }

/* ---------- Forms (Fluent Forms) ---------- */
.fluentform .ff-el-group { margin-bottom: 1.25rem; }
.fluentform .ff-el-input--label label {
	color: var(--wp--preset--color--plum-900);
	font-size: 1rem; font-weight: 600;
}
.fluentform .ff-el-form-control {
	border: 1px solid var(--wp--preset--color--rule);
	border-radius: 10px;
	background-color: var(--wp--preset--color--card);
	color: var(--wp--preset--color--plum-900);
	font-family: inherit; font-size: 17px; line-height: 1.5;
	padding: 0.625rem 0.875rem;
}
.fluentform .ff-el-form-control:focus {
	color: var(--wp--preset--color--plum-900);
	border-color: var(--wp--preset--color--plum-500);
	outline: 2px solid var(--wp--preset--color--plum-500); outline-offset: 0;
}
.fluentform .ff-el-form-check-label { color: var(--wp--preset--color--plum-900); font-size: 17px; }
.fluentform input[type="checkbox"] { accent-color: var(--wp--preset--color--plum-700); width: 1.125rem; height: 1.125rem; vertical-align: -0.2em; margin-right: 0.375rem; }
.fluentform .ff-el-turnstile { margin-bottom: 1rem; }
.fluentform .ff-el-is-error .ff-el-form-control { border-color: #b3261e; }
.fluentform .error.text-danger { color: #b3261e; font-size: 0.9375rem; }
.fluentform .ff-btn-submit {
	background-color: var(--wp--preset--color--plum-700) !important;
	color: #fff !important;
	border: 0; border-radius: 999px;
	font-family: inherit; font-size: 16px; font-weight: 600;
	padding: 0.75rem 1.75rem;
}
.fluentform .ff-btn-submit:hover { background-color: var(--wp--preset--color--plum-500) !important; opacity: 1; }
.ff-message-success {
	border: 1px solid var(--wp--preset--color--rule);
	border-radius: 10px; box-shadow: none;
	background: var(--wp--preset--color--card);
}
.ff-message-success p { margin: 0; }
.ff-message-success p + p { margin-top: 0.5rem; }


/* Phone numbers stay on one line (JEEP Core wraps plain-text numbers in .jeep-nowrap). */
a[href^="tel:"], .jeep-nowrap { white-space: nowrap; }

/* ---------- Video ---------- */
.wp-block-video video { border-radius: 10px; background: var(--wp--preset--color--plum-900); }

/* Quotes: plain citations everywhere, no browser indent */
.wp-block-quote { margin-inline: 0; }
.wp-block-quote cite { font-style: normal; }
.wp-block-group.is-style-story > .wp-block-quote { margin-block: 0; }
.wp-block-group.is-style-story > .wp-block-quote > :last-child { margin-bottom: 0; }

/* ---------- Legacy Circle ---------- */
/* Names are plain list blocks, so staff edit them as text: one name per line. */
.jeep-names { list-style: none; padding-left: 0; margin-top: 0.75rem; line-height: 1.8; }
.jeep-names-2col { columns: 2; column-gap: var(--wp--preset--spacing--50); }
.jeep-names-2col li { break-inside: avoid; }
.jeep-legacy-names h3 { font-size: 1.125rem; letter-spacing: 0.01em; }
.jeep-legacy-names h3 ~ h3 { margin-top: var(--wp--preset--spacing--50); }
.jeep-legacy-cta { border: 1px solid var(--wp--preset--color--gold); }
@media (max-width: 600px) {
	.jeep-names-2col { columns: 1; }
}

/* Seven header links do not fit on one line below 1200px. The core
   navigation only switches to the menu button at 600px, so switch earlier. */
/* Give is a small pill at the height of the nav text, not a full button. */
.jeep-header .wp-block-button__link {
	white-space: nowrap; font-size: 1rem; line-height: 1.2;
	padding: 0.375rem 1rem; border-radius: 999px;
}
@media (min-width: 600px) and (max-width: 1199px) {
	.jeep-header .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex; }
	.jeep-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none; }
}

/* Keep the eyebrow above a linked heading (e.g. /contact/#rabbi-karp) in view. */
:where(h2, h3)[id] { scroll-margin-top: 5.5rem; }
