/*
Theme Name: Exotic Pet Laws by State
Theme URI: https://exoticpetlaws.com/
Author: Exotic Pet Laws by State
Description: Custom block theme for exoticpetlaws.com — a statute-cited, state-by-state lookup database for exotic pet legality. Field-guide-meets-legal-ledger design: warm sand paper, forest-green panels, serif headings, and a tri-state legal/permit/banned status badge system. Place-Atlas homepage with dual state×species entry; statute-dossier entry pages. No page builders, no external fonts.
Version: 1.2.0
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: exoticpetlaws
*/

/* ---- Forest-green panel header / footer ---- */
.epl-panel { background: var(--wp--preset--color--forest); }
.epl-panel a { color: #eaf2ea; }
.epl-panel, .epl-panel :where(p, h1, h2, h3, .wp-block-site-title a) { color: #f6f3ea; }
.epl-wordmark a { font-family: var(--wp--preset--font-family--serif); font-weight: 600; letter-spacing: -0.01em; color: #fbfaf4; text-decoration: none; }

/* Field-guide leaf mark in the header wordmark */
.epl-mark { display: block; flex: 0 0 auto; }

/* ---- Search-first hero ---- */
.epl-hero { background: var(--wp--preset--color--forest); }
.epl-hero, .epl-hero :where(h1, h2, p) { color: #f6f3ea; }
.epl-hero .wp-block-search__input {
	border: 1px solid #234f34;
	border-radius: 6px 0 0 6px;
	padding: 0.85rem 1rem;
	font-size: 1.05rem;
	background: #fff;
	color: #1e2a22;
}
.epl-hero .wp-block-search__button,
.epl-search .wp-block-search__button {
	background: var(--wp--preset--color--permit);
	color: #1e2a22;
	border: 0;
	border-radius: 0 6px 6px 0;
	font-weight: 700;
	padding: 0 1.4rem;
}
.epl-search .wp-block-search__input {
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 6px 0 0 6px;
	padding: 0.75rem 1rem;
	background: #fff;
	color: #1e2a22;
}

/* ---- Tri-state status badges (the signature element) ---- */
/* Each carries an icon AND a word (never colour alone); backgrounds tuned for WCAG-AA text contrast. */
.epl-status {
	display: inline-flex;
	align-items: baseline;
	gap: 0.3em;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	border-radius: 999px;
	padding: 0.18em 0.7em;
	line-height: 1.4;
	color: #fff;
	white-space: nowrap;
}
.epl-status::before { font-size: 0.9em; font-weight: 700; }
.epl-legal   { background: #237a48; }               /* darkened green — AA on white text */
.epl-legal::before   { content: "\2713"; }          /* check */
.epl-permit  { background: var(--wp--preset--color--permit); color: #1e2a22; } /* dark text on gold — AA */
.epl-permit::before  { content: "\26A0"; }          /* warning triangle */
.epl-banned  { background: var(--wp--preset--color--banned); }
.epl-banned::before  { content: "\2715"; }          /* cross */
.epl-unclear { background: #5f6a63; }                /* darkened grey — AA */
.epl-unclear::before { content: "?"; }

/* Large verdict badge for above-the-fold entry blocks */
.epl-status--lg { font-size: 0.95rem; padding: 0.28em 0.9em; }

/* ---- Status legend ---- */
.epl-legend { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; font-size: 0.85rem; align-items: center; }
.epl-legend .epl-status { margin-right: 0.35rem; }

/* ---- Data tables (species x state, state x species) ---- */
.epl-table { overflow-x: auto; }
.epl-table table { border-collapse: collapse; width: 100%; background: var(--wp--preset--color--surface); }
.epl-table th, .epl-table td {
	border: 1px solid var(--wp--preset--color--border);
	padding: 0.6rem 0.75rem;
	text-align: left;
	vertical-align: top;
}
.epl-table thead th {
	background: var(--wp--preset--color--forest);
	color: #f6f3ea;
	font-size: 0.9rem;
	letter-spacing: 0.02em;
	position: sticky;
	top: 0;
}
.epl-table tbody tr:nth-child(even) td { background: var(--wp--preset--color--muted); }
.epl-table td code, .epl-cite { font-family: var(--wp--preset--font-family--mono); font-size: 0.85rem; }

/* ---- Statute citation chip (the trust core — display it proudly) ---- */
.epl-cite {
	display: inline-block;
	background: var(--wp--preset--color--muted);
	border: 1px solid var(--wp--preset--color--border);
	border-left: 3px solid var(--wp--preset--color--permit);
	border-radius: 4px;
	padding: 0.1em 0.5em;
	color: #3c4a40;
	font-weight: 600;
}

/* ---- Verdict block (above the fold: badge + one-line answer + statute) ---- */
.epl-verdict {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-left: 6px solid var(--wp--preset--color--forest);
	border-radius: 10px;
	padding: 1.1rem 1.25rem;
}
.epl-verdict .epl-verdict-answer { font-family: var(--wp--preset--font-family--serif); font-size: 1.2rem; margin: 0.5rem 0 0; }

/* ---- Trust masthead (byline + published/updated/verified + sources) ---- */
.epl-masthead {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 1.2rem;
	font-size: 0.85rem;
	color: #5f6b62;
	border-top: 1px solid var(--wp--preset--color--border);
	border-bottom: 1px solid var(--wp--preset--color--border);
	padding: 0.6rem 0;
}
.epl-masthead .epl-date { font-family: var(--wp--preset--font-family--mono); color: var(--wp--preset--color--ink); }

/* ---- Sources / primary-source citations (display proudly, not tiny grey) ---- */
.epl-sources { background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--border); border-radius: 10px; padding: 1rem 1.25rem 1rem 1.5rem; }
.epl-sources h2, .epl-sources h3 { margin-top: 0; }
.epl-sources ol { margin: 0; padding-left: 1.25rem; }
.epl-sources li { margin: 0.4rem 0; font-size: 0.92rem; }

/* ---- Safety callout (reserved for genuine hazards) ---- */
.epl-safety {
	border: 1px solid var(--wp--preset--color--border);
	border-left: 6px solid var(--wp--preset--color--banned);
	background: #fbeceb;
	border-radius: 8px;
	padding: 1rem 1.15rem;
}
.epl-safety strong { color: #8f2b21; }

/* ---- Disclaimer / last-verified callout (YMYL trust) ---- */
.epl-disclaimer {
	border: 1px solid var(--wp--preset--color--border);
	border-left: 5px solid var(--wp--preset--color--permit);
	background: #fbf7ec;
	border-radius: 6px;
	padding: 1rem 1.15rem;
	font-size: 0.92rem;
}
.epl-disclaimer strong { color: #8a5d13; }

/* ---- Entry / state / species cards ---- */
.epl-card {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 8px;
	padding: 1.1rem 1.15rem;
	height: 100%;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.epl-card:hover { box-shadow: 0 6px 18px rgba(30, 42, 34, 0.10); transform: translateY(-2px); }
.epl-card h3 { margin-top: 0; }
.epl-card h3 a { text-decoration: none; }

/* ---- Breadcrumbs ---- */
.epl-crumbs { font-size: 0.85rem; color: #5f6b62; }
.epl-crumbs a { color: #5f6b62; }

/* ---- Content surface ---- */
.epl-surface { background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--border); border-radius: 10px; }

/* ---- Form controls (contact / correction forms, search) ---- */
input[type="text"], input[type="email"], input[type="url"], input[type="tel"], input[type="number"], textarea, select {
	font: inherit;
	color: #1e2a22;
	background: #fff;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 6px;
	padding: 0.6rem 0.75rem;
	max-width: 100%;
}
textarea { line-height: 1.5; }
input[type="text"]:focus, input[type="email"]:focus, input[type="url"]:focus, input[type="tel"]:focus, textarea:focus, select:focus {
	border-color: var(--wp--preset--color--forest);
	box-shadow: 0 0 0 2px rgba(47, 107, 70, 0.25);
	outline: none;
}
input[type="submit"], button[type="submit"]:not(.wp-block-search__button), form button:not(.wp-block-search__button) {
	font: inherit;
	font-weight: 700;
	background: var(--wp--preset--color--forest);
	color: #f6f3ea;
	border: 0;
	border-radius: 6px;
	padding: 0.6rem 1.3rem;
	cursor: pointer;
	min-height: 44px;
}
input[type="submit"]:hover, button[type="submit"]:not(.wp-block-search__button):hover, form button:not(.wp-block-search__button):hover { background: #26543a; }

/* ---- Visible keyboard focus (accessibility / trust) ---- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.wp-block-search__button:focus-visible,
.wp-block-navigation-item__content:focus-visible {
	outline: 3px solid var(--wp--preset--color--permit);
	outline-offset: 2px;
	border-radius: 3px;
}

/* ---- Dark mode (prefers-color-scheme) — keep hues, lift luminance to AA ---- */
@media (prefers-color-scheme: dark) {
	:root {
		--wp--preset--color--canvas: #101512;
		--wp--preset--color--surface: #18201b;
		--wp--preset--color--ink: #eaf0ea;
		--wp--preset--color--muted: #212a20;
		--wp--preset--color--border: #2f3a2e;
	}
	main a:not(.wp-element-button) { color: #6bb389; }
	.epl-crumbs, .epl-crumbs a, .epl-masthead { color: #9aa89e; }
	.epl-cite { color: #cdd8cf; }
	.epl-disclaimer { background: #1c2419; border-color: #3a4a2c; }
	.epl-disclaimer strong { color: #e0b34e; }
	.epl-safety { background: #241615; border-color: #4a2c2a; }
	.epl-safety strong { color: #e88b80; }
	.epl-card:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45); }
	/* forest panels/hero/thead stay deep-green with cream text in both modes */
}

/* ============================================================
   LAYOUT v2 — Place-Atlas homepage (dual state × species entry)
   + statute-dossier entry. Architecture rebuild (wave 2).
   Palette and type are unchanged; this is a new floor plan only.
   ============================================================ */

/* --- Atlas intro: a calm index masthead, NOT a search console.
       Search is demoted to a slim inline field; the two browse
       indexes below own the fold. --- */
.epl-atlas-intro { text-align: center; }
.epl-atlas-intro .epl-eyebrow {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.72rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--wp--preset--color--permit);
	margin: 0 0 0.4rem;
}
.epl-atlas-search { max-width: 520px; margin-left: auto; margin-right: auto; }
.epl-atlas-search .wp-block-search__input {
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 6px 0 0 6px;
	padding: 0.7rem 0.9rem;
	background: #fff;
	color: #1e2a22;
}
.epl-atlas-search .wp-block-search__button {
	background: var(--wp--preset--color--forest);
	color: #f6f3ea;
	border: 0;
	border-radius: 0 6px 6px 0;
	font-weight: 700;
	padding: 0 1.2rem;
}

/* --- Stat band (B-calibration furniture: the "complete institution" signal) --- */
.epl-statband {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1px;
	background: var(--wp--preset--color--border);
	border: 1px solid var(--wp--preset--color--border);
	border-top: 3px solid var(--wp--preset--color--permit);
	border-radius: 10px;
	overflow: hidden;
}
.epl-statband > div {
	background: var(--wp--preset--color--surface);
	padding: 0.85rem 0.9rem;
	text-align: center;
}
.epl-statnum {
	display: block;
	font-family: var(--wp--preset--font-family--serif);
	font-size: 1.5rem;
	line-height: 1.1;
	color: var(--wp--preset--color--forest);
}
.epl-statlabel { display: block; font-size: 0.78rem; color: #5f6b62; margin-top: 0.15rem; }
.epl-statband code { font-family: var(--wp--preset--font-family--mono); }

/* --- Dual entry: two symmetrical browse indexes (the differentiator) --- */
.epl-dual {
	display: grid;
	grid-template-columns: 1.35fr 1fr;
	gap: var(--wp--preset--spacing--50);
	align-items: start;
}
@media (max-width: 900px) { .epl-dual { grid-template-columns: 1fr; } }

/* The two "ways in" panels share one plate treatment (specimen ochre top-rule) */
.epl-browse {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-top: 3px solid var(--wp--preset--color--permit);
	border-radius: 10px;
	padding: 1.1rem 1.25rem 1.35rem;
	height: 100%;
}
.epl-browse .epl-kicker {
	font-family: var(--wp--preset--font-family--mono);
	font-size: 0.72rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #8a5d13;
	margin: 0 0 0.15rem;
}
.epl-browse h2 { margin: 0 0 0.15rem; font-size: 1.4rem; }
.epl-browse .epl-browse-note { font-size: 0.85rem; color: #5f6b62; margin: 0 0 0.35rem; }
.epl-browse .epl-browse-all { display: inline-block; margin-top: 0.9rem; font-size: 0.9rem; font-weight: 600; }

/* State atlas — the geography spine: a dense tile index of all 50 states */
.epl-atlas {
	list-style: none;
	margin: 0.5rem 0 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
	gap: 0.4rem;
}
.epl-atlas a {
	display: flex;
	align-items: center;
	min-height: 44px;
	padding: 0.35rem 0.55rem;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 6px;
	background: var(--wp--preset--color--canvas);
	color: var(--wp--preset--color--ink);
	text-decoration: none;
	font-size: 0.85rem;
	line-height: 1.2;
}
.epl-atlas a:hover { border-color: var(--wp--preset--color--forest); background: var(--wp--preset--color--muted); }

/* Species index — the taxonomy spine: a field-guide specimen list */
.epl-index { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.epl-index li { border-bottom: 1px solid var(--wp--preset--color--border); }
.epl-index li:last-child { border-bottom: 0; }
.epl-index a { display: block; padding: 0.6rem 0.2rem; text-decoration: none; }
.epl-sp-common { font-family: var(--wp--preset--font-family--serif); font-weight: 600; font-size: 1.02rem; color: var(--wp--preset--color--forest); }
.epl-index a:hover .epl-sp-common { text-decoration: underline; }
.epl-sp-sci { font-style: italic; color: #5f6b62; font-size: 0.85rem; margin-left: 0.4rem; }
.epl-sp-note { display: block; font-size: 0.82rem; color: #5f6b62; margin-top: 0.1rem; }

/* --- Statute dossier (entry page): two-column reading + sticky rail --- */
.epl-dossier {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 290px;
	gap: var(--wp--preset--spacing--60);
	align-items: start;
}
@media (max-width: 860px) { .epl-dossier { grid-template-columns: 1fr; } }
.epl-rail { position: sticky; top: 1rem; display: grid; gap: var(--wp--preset--spacing--40); }
@media (max-width: 860px) { .epl-rail { position: static; } }
.epl-rail-card {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-top: 3px solid var(--wp--preset--color--permit);
	border-radius: 10px;
	padding: 0.95rem 1.05rem;
	font-size: 0.88rem;
}
.epl-rail-card h2 { font-size: 0.72rem; font-family: var(--wp--preset--font-family--mono); letter-spacing: 0.1em; text-transform: uppercase; color: #8a5d13; margin: 0 0 0.6rem; }
.epl-rail-card .epl-legend { flex-direction: column; align-items: flex-start; gap: 0.5rem; }

/* Specimen dossier plate — the per-entry fielded data panel (statute dossier heart).
   A field-guide label: ochre top-rule, mono field names, the statute cited. */
.epl-specimen {
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-top: 4px solid var(--wp--preset--color--permit);
	border-radius: 10px;
	padding: 1rem 1.2rem 1.15rem;
	margin: 0 0 var(--wp--preset--spacing--40);
}
.epl-specimen .epl-specimen-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 0.75rem; margin-bottom: 0.6rem; }
.epl-specimen .epl-specimen-title { font-family: var(--wp--preset--font-family--serif); font-size: 1.15rem; margin: 0; }
.epl-specimen dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 0.9rem; margin: 0; }
.epl-specimen dt { font-family: var(--wp--preset--font-family--mono); font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: #6f7a72; padding-top: 0.15rem; }
.epl-specimen dd { margin: 0; }
@media (max-width: 480px) { .epl-specimen dl { grid-template-columns: 1fr; gap: 0.1rem 0; } .epl-specimen dt { padding-top: 0.5rem; } }

/* ---- Dark-mode overrides for the v2 layout components ---- */
@media (prefers-color-scheme: dark) {
	.epl-statlabel, .epl-browse .epl-browse-note, .epl-sp-sci, .epl-sp-note { color: #9aa89e; }
	.epl-browse .epl-kicker, .epl-rail-card h2, .epl-specimen dt { color: #d6a93e; }
	.epl-browse .epl-kicker { color: #d6a93e; }
	.epl-sp-common { color: #6bb389; }
	.epl-atlas-search .wp-block-search__input { background: #0c110d; color: #eaf0ea; border-color: #2f3a2e; }
}
