/*
Theme Name: Read Together
Theme URI: https://ppelf.org/
Author: Pikes Peak Early Literacy Foundation
Author URI: https://ppelf.org/
Description: A block theme for local Dolly Parton's Imagination Library affiliates, built on the structure of Twenty Twenty-Five. Every template, header, footer, color and pattern is editable in the Site Editor. Includes sponsors with a header sponsor strip, events, a contact form, an optional enrollment interest form, a private Submissions screen, animated SVG blocks with safe SVG uploads, and a block for the Imagination Library's official online registration form.
Requires at least: 6.7
Tested up to: 6.9
Requires PHP: 7.4
Version: 2.11.31
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: read-together
Update URI: https://updates.ppelf.org/read-together/
Tags: one-column, custom-colors, custom-menu, custom-logo, editor-style, featured-images, full-site-editing, block-patterns, block-styles, style-variations, wide-blocks, accessibility-ready
*/

/* ------------------------------------------------------------------
 * Carried over from Twenty Twenty-Five (style.css, v1.5).
 * ------------------------------------------------------------------ */
a {
	text-decoration-thickness: 1px !important;
	text-underline-offset: .1em;
}
:where(.wp-site-blocks *:focus) {
	outline-width: 2px;
	outline-style: solid;
}
.wp-block-navigation .wp-block-navigation-submenu .wp-block-navigation-item:not(:last-child) {
	margin-bottom: 3px;
}
.wp-block-navigation .wp-block-navigation-item .wp-block-navigation-item__content {
	outline-offset: 4px;
}
.wp-block-navigation .wp-block-navigation-item ul.wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	outline-offset: 0;
}
h1, h2, h3, h4, h5, h6, blockquote, caption, figcaption, p {
	text-wrap: pretty;
}
.more-link {
	display: block;
}
:where(pre) {
	overflow-x: auto;
}

/* ------------------------------------------------------------------
 * Header: stays visible while scrolling on tablets and desktops.
 * On phones it scrolls away so it never covers the content.
 * ------------------------------------------------------------------ */
.rt-site-header {
	border-bottom: 1px solid var(--wp--preset--color--accent-6);
}
@media (min-width: 783px) {
	.wp-site-blocks > header.wp-block-template-part {
		position: sticky;
		top: 0;
		z-index: 100;
	}
	.admin-bar .wp-site-blocks > header.wp-block-template-part {
		top: var(--wp-admin--admin-bar--height, 32px);
	}
}
/* Phones: keep the logo, menu button and Enroll button on one row. */
@media (max-width: 600px) {
	.rt-site-header .wp-block-site-title {
		font-size: var(--wp--preset--font-size--medium);
	}
	.rt-site-header .wp-block-site-logo img {
		width: 36px;
		height: auto;
	}
}

.rt-header-cta .wp-block-button__link {
	white-space: nowrap;
}

/*
 * Pages that start or end with ordinary content (text, an
 * image) rather than a full-width section get breathing room from the header
 * and footer. Full-width heroes still sit flush against the header.
 */
.rt-page-main > .wp-block-post-content > :first-child:not(.alignfull) {
	margin-block-start: var(--wp--preset--spacing--60);
}
.rt-page-main > .wp-block-post-content > :last-child:not(.alignfull) {
	margin-block-end: var(--wp--preset--spacing--60);
}

.rt-page-main > .wp-block-post-title {
	margin-block-start: var(--wp--preset--spacing--50);
}

/*
 * Enroll link vs. Enroll button. 600px is where the menu collapses to the
 * menu button. Larger screens: the button shows, a duplicate menu link
 * doesn't. Phones: if the menu has the enroll link, it appears inside the
 * menu as a button and the header button steps aside to make room.
 */
@media (min-width: 600px) {
	.rt-site-header .wp-block-navigation .rt-enroll-link {
		display: none;
	}
}
@media (max-width: 599px) {
	.rt-site-header:has(.rt-enroll-link) .rt-header-cta {
		display: none;
	}
	.rt-site-header .rt-enroll-link > .wp-block-navigation-item__content {
		display: inline-block;
		padding: .6rem 1.2rem !important;
		border-radius: 9999px;
		background: var(--wp--preset--color--coral);
		color: var(--wp--preset--color--contrast) !important;
		font-weight: 700;
		text-decoration: none;
	}
}

/* The header's Donate button gives way to the menu on phones. */
@media (max-width: 599px) {
	.rt-site-header .wp-block-buttons > .rt-header-donate {
		display: none;
	}
}

/* Footer contact details. */
.rt-footer-contact {
	font-size: var(--wp--preset--font-size--small);
	font-style: normal;
}
.rt-footer-contact a {
	color: inherit;
}

/* Footer link lists without bullets. */
.rt-plain-list {
	list-style: none;
	padding-left: 0;
}
.rt-plain-list li + li {
	margin-top: .4em;
}

/* ------------------------------------------------------------------
 * Optional block styles (Block sidebar → Styles). Saved block colors,
 * borders and padding always win over these defaults.
 * ------------------------------------------------------------------ */

/* Details: "Card" and "Tinted card" — for FAQs. */
:where(.wp-block-details.is-style-faq-card, .wp-block-details.is-style-faq-tinted) {
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--accent-6);
	border-radius: 14px;
	padding: 1.1rem 1.4rem;
}
:where(.wp-block-details.is-style-faq-card, .wp-block-details.is-style-faq-tinted) > summary {
	font-weight: 700;
	cursor: pointer;
}
.wp-block-details.is-style-faq-tinted:not(.has-background) {
	background: var(--wp--preset--color--accent-2);
}
.wp-block-details.is-style-faq-tinted:not(.has-border-color) {
	border-color: var(--wp--preset--color--accent-3);
}

/* Image: "Soft corners". */
.wp-block-image.is-style-soft-corners img {
	border-radius: 28px;
}

/*
 * Cover: "Fill" (default) crops the background image or video to fill the
 * block. "Fit" shows the whole image; the focal point sets where it sits and
 * any space around it shows the page background.
 */
.wp-block-cover.is-style-fit .wp-block-cover__image-background,
.wp-block-cover.is-style-fit .wp-block-cover__video-background {
	object-fit: contain;
}
.wp-block-cover.is-style-fit .wp-block-cover__image-background.has-parallax,
.wp-block-cover.is-style-fit.has-parallax {
	background-size: contain;
	background-repeat: no-repeat;
}

/* Column: "Card". */
.wp-block-column.is-style-feature-card {
	border: 1px solid var(--wp--preset--color--accent-6);
	border-top: 6px solid var(--wp--preset--color--accent-1);
	border-radius: 20px;
	padding: clamp(18px, 3vw, 32px);
}
.wp-block-column.is-style-feature-card:not(.has-background) {
	background: var(--wp--preset--color--base);
}

/* Notice pattern: a highlighted message. */
.rt-notice {
	border-left: 6px solid var(--wp--preset--color--accent-1);
	border-radius: 8px;
}

/* Self-animating SVGs: without JavaScript, the <noscript> copy replaces the blank stand-in. */
html:not(.rt-animation-js) [data-rt-native-svg] { display: none !important; }
/* Until it starts, the image has no src: keep its space, hide the browser's broken-image icon. */
img[data-rt-svg-src]:not([src]) { opacity: 0; }

/* Replay button, added by entrance-view.js. Space is kept so the page doesn't jump when it appears. */
.rt-svg-replay {
	display: flex;
	align-items: center;
	gap: .4em;
	margin: .75em auto 0;
	padding: .4em 1em;
	border: 1px solid currentColor;
	border-radius: 999px;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: var(--wp--preset--font-size--small, .875rem);
	cursor: pointer;
	visibility: hidden;
	opacity: 0;
	transition: opacity .3s ease, visibility 0s linear .3s;
}
.rt-svg-replay::before { content: "\21BB"; content: "\21BB" / ""; font-size: 1.15em; line-height: 1; }
.rt-svg-replay.is-shown { visibility: visible; opacity: 1; transition-delay: 0s; }
.rt-svg-replay:hover { background: color-mix(in srgb, currentColor 8%, transparent); }
.rt-svg-replay:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* Optional scroll-triggered entrance animations on Image, Group and Cover blocks.
 * JS only enables the hidden state when an IntersectionObserver is available.
 * Editors, disabled JavaScript, and reduced-motion users see the final state.
 */
@media (prefers-reduced-motion: no-preference) {
    html.rt-entrance-enabled [data-rt-entrance] {
        opacity: 0;
        transition-property: opacity, transform;
        transition-duration: var(--rt-entrance-duration, 800ms);
        transition-delay: var(--rt-entrance-delay, 0ms);
        transition-timing-function: cubic-bezier(.2, .65, .25, 1);
    }
    html.rt-entrance-enabled [data-rt-entrance="fade-up"] {
        transform: translate3d(0, 24px, 0);
    }
    html.rt-entrance-enabled [data-rt-entrance="fade-left"] { transform: translate3d(24px, 0, 0); }
    html.rt-entrance-enabled [data-rt-entrance="fade-right"] { transform: translate3d(-24px, 0, 0); }
    html.rt-entrance-enabled [data-rt-entrance="zoom"] {
        transform: scale(.96);
    }
    html.rt-entrance-enabled [data-rt-entrance].rt-entrance-visible {
        opacity: 1;
        transform: none;
    }
}

/* Modern homepage pattern — scoped to its own sections, including the editor. */
.rt-modern-home .rt-modern-photo img { width:100%; height:auto; border-radius:24px; display:block; }
.rt-modern-home .rt-modern-hero { gap:clamp(24px,5vw,72px); }
.rt-modern-home .rt-modern-hero h1 { max-width: 16ch; }
.rt-modern-home .rt-modern-illustrations .rt-svg-anim { max-width:132px; margin-inline:auto; }
.rt-modern-home.rt-modern-illustrations .rt-svg-anim { max-width:320px; margin-inline:auto; }
.rt-modern-home .rt-modern-gifts > .wp-block-column { display:flex; flex-direction:column; }
.rt-modern-home .rt-modern-gifts > .wp-block-column > .wp-block-buttons { margin-top:auto; }

/* Photo-led homepage pattern (2.10.0). */
.rt-photo-home.is-style-section-1 { background:#fcf5e8; color:#203d56; }
.rt-photo-home .rt-photo-hero h1 { color:#203d56; font-size:clamp(2.25rem,4.6vw,4rem); line-height:1.08; }
.rt-photo-home .rt-photo-hero .wp-block-column:first-child > p:first-child { color:#98501b; }
.rt-photo-hero .wp-block-buttons { flex-direction:column; align-items:stretch; gap:12px; }
.rt-photo-hero .wp-block-button { width:100%; }
.rt-photo-hero .wp-block-button__link { display:block; border-radius:10px; text-align:center; }
.rt-photo-hero .wp-block-button:not(.is-style-outline) .wp-block-button__link { background:#a95312 !important; color:white !important; }
.rt-photo-hero .is-style-outline .wp-block-button__link { color:#203d56; border:1px solid #203d56; }
.rt-photo-hero .rt-modern-photo img { aspect-ratio:3/4; object-fit:cover; }
.rt-photo-cards { gap:clamp(16px,3vw,32px); margin-block:2rem; }
.rt-photo-cards .rt-photo-card { background:#fcf5e8; color:#203d56; border-radius:18px; overflow:hidden; padding-bottom:1.25rem; }
.rt-photo-card .rt-photo-card-image { margin:0; }
.rt-photo-card-image img { display:block; width:100%; aspect-ratio:3/2; object-fit:cover; }
.rt-photo-card > h3, .rt-photo-card > p { margin-inline:1.25rem; }
.rt-photo-card > h3 { margin-top:1rem; margin-bottom:.5rem; color:#203d56; }
.rt-photo-card > p { margin-top:0; margin-bottom:0; }
