/*
Theme Name: TorahRooted
Theme URI: https://torahrooted.com/
Author: Eduardo Silva (EdSilvaWorld)
Author URI: https://edsilvaworld.com/esw-go/wpp/
Description: A calm, fast, bilingual (English/Spanish) block theme for TorahRooted.com, designed around the ESW First Century Biblical Understanding study app. Light and dark modes that follow the study app, English and Spanish headers and footers, a full-width study app page template and readable pages for About and legal text. No page builder, no outside fonts, nothing extra to install.
Version: 1.2.0
Requires at least: 6.6
Tested up to: 6.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: torahrooted
Tags: blog, one-column, block-patterns, full-site-editing, wide-blocks, translation-ready, accessibility-ready
*/

/* ---------- Dark mode: same storage key and colors as the study app ---------- */
html[data-tr-theme="dark"] {
	--wp--preset--color--base: #121416;
	--wp--preset--color--surface: #1b1e22;
	--wp--preset--color--tint: #1f2731;
	--wp--preset--color--contrast: #ecebe7;
	--wp--preset--color--muted: #a9acb1;
	--wp--preset--color--border: #4a5058;
	--wp--preset--color--accent: #8fbbe3;
	--wp--preset--color--on-accent: #0f1419;
	color-scheme: dark;
}
html { color-scheme: light; }
body { background: var(--wp--preset--color--base); -webkit-text-size-adjust: 100%; overflow-x: hidden; }

/* ---------- Header ---------- */
.tr-header {
	position: sticky; top: var(--wp-admin--admin-bar--height, 0px); z-index: 50;
	background: color-mix(in srgb, var(--wp--preset--color--base) 92%, transparent);
	-webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
	border-bottom: 1px solid var(--wp--preset--color--border);
}
@media (max-width: 599px) { .tr-header { position: relative; top: 0; background: var(--wp--preset--color--base); -webkit-backdrop-filter: none; backdrop-filter: none; } }
.tr-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content { align-items: flex-start; gap: 18px; padding-top: 56px; }
.tr-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container { align-items: flex-start; gap: 18px; }
.tr-brand { gap: 10px !important; min-width: 0; }
.tr-brand .wp-block-site-title { margin: 0; white-space: nowrap; }
.tr-brand .wp-block-site-title a { text-decoration: none; color: inherit; }
.tr-brand .wp-block-site-logo img { border-radius: 10px; }
.tr-tools { gap: 6px !important; }
.tr-header .wp-block-navigation a { text-decoration: none; }
.tr-header .wp-block-navigation a:hover, .tr-header .wp-block-navigation a:focus-visible { text-decoration: underline; text-underline-offset: .25em; }
.tr-header .wp-block-navigation__responsive-container-open,
.tr-header .wp-block-navigation__responsive-container-close { width: 44px; height: 44px; align-items: center; justify-content: center; border: 1px solid var(--wp--preset--color--border); border-radius: 12px; }
@media (max-width: 599px) { .tr-header .wp-block-navigation__responsive-container-open { display: inline-flex; } }
.tr-header .wp-block-navigation__responsive-container-close { border: 0; }
.tr-header .wp-block-navigation__responsive-container.is-menu-open { background: var(--wp--preset--color--base) !important; color: var(--wp--preset--color--contrast) !important; padding: 24px; }
.tr-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item { font-size: 1.2rem; }

/* Keyboard focus */
a:focus-visible, button:focus-visible { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 2px; }

/* ---------- Content ---------- */
.tr-main { min-height: 60vh; }
.wp-site-blocks > .tr-main { margin-block-start: 0; }
.tr-page-head { border-bottom: 1px solid var(--wp--preset--color--border); }
.entry-content > * + * { margin-block-start: 1.1em; }
.entry-content a { text-underline-offset: .2em; }
.entry-content img { border-radius: 14px; height: auto; }
.wp-block-separator { border-color: var(--wp--preset--color--border); opacity: 1; }
.tr-card {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 18px;
}
.wp-block-post-template.is-layout-grid { gap: 18px; }
.tr-card .wp-block-post-title a { text-decoration: none; color: inherit; }
.tr-card .wp-block-post-featured-image img { border-radius: 12px; }

/* The study app page: give the app the room and let it handle its own header */
.tr-app-main { padding-top: clamp(12px, 3vw, 28px); padding-bottom: clamp(24px, 5vw, 56px); }
.tr-app-main .entry-content > .esw-fcbu { margin-top: 0; }

/* ---------- Footer ---------- */
.tr-footer { border-top: 1px solid var(--wp--preset--color--border); }
.tr-footer a { text-decoration: none; }
.tr-footer a:hover, .tr-footer a:focus-visible { text-decoration: underline; }
.tr-credit, .tr-credit a { color: var(--wp--preset--color--muted); }

/* Buttons: sized to the text, centered, at least 44px tall */
.wp-block-button__link { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.wp-block-buttons { justify-content: center; }

/* 404 / search */
.tr-search .wp-block-search__input { min-height: 44px; border-radius: 12px; border: 1px solid var(--wp--preset--color--border); background: var(--wp--preset--color--surface); color: var(--wp--preset--color--contrast); padding: 0 14px; font-size: 16px; }
.tr-search .wp-block-search__button { min-height: 44px; border-radius: 12px; margin-left: 8px; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
.tr-foot-links, .tr-foot-links .wp-block-navigation__container { flex-wrap: wrap; gap: 8px 20px !important; }
.tr-foot-links { font-size: var(--wp--preset--font-size--small); }
.tr-foot-links a { display: inline-flex; align-items: center; min-height: 32px; }

