/*
Theme Name: CAWOS
Theme URI: https://www.cawos.org
Author: CAWOS
Description: Theme for the Cheshire and Wirral Ornithological Society. Classic editor, ACF Pro flexible content blocks, accessible and privacy-friendly (no external fonts or trackers).
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 8.1
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cawos
*/

/* ---------- Tokens ---------- */
:root {
	--c-ink: #14231f;
	--c-muted: #4a5b55;
	--c-primary: #0f5c4d;
	--c-primary-dark: #0a3d33;
	--c-accent: #a95a0b;
	--c-accent-dark: #8b4a08;
	--c-tint: #eef4f1;
	--c-line: #d3dfda;
	--c-bg: #fff;
	--font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-head: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
	--radius: .75rem;
	--shadow: 0 1px 2px rgb(10 40 30 / .08), 0 8px 24px rgb(10 40 30 / .08);
	--container: 72rem;
	--gutter: clamp(1rem, 4vw, 2rem);
	--space: clamp(2.5rem, 6vw, 4.5rem);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 1rem/1.65 var(--font); color: var(--c-ink); background: var(--c-bg); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-primary); text-underline-offset: .15em; }
a:hover { color: var(--c-primary-dark); }
:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; color: var(--c-primary-dark); margin: 0 0 .6em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.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; width: 1px; word-wrap: normal; }
.skip-link { position: absolute; left: .5rem; top: -4rem; z-index: 100; background: var(--c-primary-dark); color: #fff; padding: .6rem 1rem; border-radius: .4rem; }
.skip-link:focus { top: .5rem; color: #fff; }
.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }

/* ---------- Buttons ---------- */
.btn { display: inline-block; padding: .7em 1.3em; border-radius: 999px; font-weight: 600; text-decoration: none; border: 2px solid var(--c-accent); background: var(--c-accent); color: #fff; line-height: 1.2; }
.btn:hover { background: var(--c-accent-dark); border-color: var(--c-accent-dark); color: #fff; }
.btn--secondary { background: transparent; color: var(--c-primary); border-color: currentColor; }
.btn--secondary:hover { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.hero .btn--secondary, .block--bg-dark .btn--secondary { color: #fff; }
.hero .btn--secondary:hover, .block--bg-dark .btn--secondary:hover { background: #fff; border-color: #fff; color: var(--c-primary-dark); }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }

/* ---------- Header & navigation ---------- */
.site-header { background: #fff; border-bottom: 1px solid var(--c-line); position: relative; z-index: 20; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .75rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: var(--c-primary-dark); }
.brand img { max-height: 3.5rem; width: auto; }
.brand__name { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; line-height: 1.2; max-width: 16rem; }
.brand__sub { display: block; font: 400 .8rem/1.3 var(--font); color: var(--c-muted); }
.nav-toggle { display: none; background: none; border: 2px solid var(--c-primary); color: var(--c-primary); border-radius: .5rem; padding: .45rem .8rem; font: 600 .95rem var(--font); cursor: pointer; }
.js .nav-toggle { display: inline-block; }
.primary-nav ul { list-style: none; margin: 0; padding: 0; }
.primary-nav .menu > li { position: relative; display: flex; flex-wrap: wrap; align-items: center; }
.primary-nav a { display: block; padding: .6rem .75rem; color: var(--c-ink); text-decoration: none; font-weight: 600; font-size: .93rem; white-space: nowrap; }
.primary-nav .menu-cta > a { color: #fff; }
.primary-nav a:hover, .primary-nav .current-menu-item > a, .primary-nav .current-menu-ancestor > a, .primary-nav .current-page-ancestor > a { color: var(--c-primary); text-decoration: underline; text-decoration-thickness: 2px; }
.submenu-toggle { background: none; border: 0; padding: .5rem; cursor: pointer; color: var(--c-ink); }
.submenu-toggle::before { content: ""; display: block; width: .5rem; height: .5rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s; }
.is-open > .submenu-toggle::before { transform: rotate(-135deg); }
.primary-nav .sub-menu { display: none; width: 100%; }
.primary-nav .is-open > .sub-menu { display: block; }
.primary-nav .sub-menu a { font-weight: 500; padding-left: 1.5rem; }

@media (max-width: 63.99em) {
	.js .primary-nav { display: none; width: 100%; }
	.js .primary-nav.is-open { display: block; }
	.primary-nav { width: 100%; }
	.primary-nav .menu > li { border-top: 1px solid var(--c-line); }
	.primary-nav .menu > li > a { flex: 1; white-space: normal; }
	.primary-nav .menu-cta > a { background: var(--c-accent); border-radius: .5rem; margin: .5rem 0; text-align: center; }
}
@media (min-width: 64em) {
	.js .nav-toggle { display: none; }
	.site-header__inner { flex-wrap: nowrap; }
	.primary-nav { margin-left: auto; }
	.primary-nav .menu { display: flex; flex-wrap: nowrap; align-items: center; gap: .1rem; }
	.primary-nav .menu-cta { margin-left: .5rem; }
	.primary-nav .menu-cta > a { background: var(--c-accent); color: #fff; border-radius: 999px; padding: .55rem 1.1rem; text-decoration: none; }
	.primary-nav .menu-cta > a:hover { background: var(--c-accent-dark); color: #fff; text-decoration: none; }
	.primary-nav .menu > li { flex-wrap: nowrap; }
	.primary-nav a { padding: .6rem .55rem; }
	.primary-nav .sub-menu { position: absolute; top: 100%; left: 0; min-width: 16rem; background: #fff; border: 1px solid var(--c-line); border-radius: .5rem; box-shadow: var(--shadow); padding: .4rem 0; z-index: 30; width: auto; }
	.primary-nav .menu > li:hover > .sub-menu, .primary-nav .menu > li:focus-within > .sub-menu { display: block; }
	.primary-nav .sub-menu a { padding-left: 1rem; }
	.submenu-toggle { padding: .5rem .3rem; margin-left: -.6rem; }
}

.site-banner { height: clamp(7rem, 20vw, 14rem); background: var(--c-primary-dark); position: relative; overflow: hidden; }
.site-banner img { width: 100%; height: 100%; object-fit: cover; }
.site-banner__credit { position: absolute; right: .75rem; bottom: .5rem; background: rgb(0 0 0 / .55); color: #fff; font-size: .75rem; padding: .15rem .5rem; border-radius: .3rem; }

/* ---------- Page header & breadcrumbs ---------- */
.page-header { padding-block: clamp(1.5rem, 4vw, 2.75rem) 0; }
.page-header h1 { margin-bottom: .3em; }
.page-header__lead { font-size: 1.15rem; color: var(--c-muted); max-width: 60ch; }
.breadcrumbs { font-size: .85rem; color: var(--c-muted); margin-bottom: .75rem; }
.breadcrumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .25rem .5rem; }
.breadcrumbs li + li::before { content: "›"; margin-right: .5rem; }
.breadcrumbs a { color: var(--c-muted); }

/* ---------- Prose (classic editor content) ---------- */
.prose { max-width: 70ch; }
.prose > :last-child { margin-bottom: 0; }
.prose ul, .prose ol { padding-left: 1.4rem; margin: 0 0 1em; }
.prose li { margin-bottom: .35em; }
.prose img, .prose figure { border-radius: .5rem; }
.prose table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--c-line); padding: .5rem .7rem; text-align: left; }
.prose th { background: var(--c-tint); }
.prose blockquote { margin: 1.5rem 0; padding: .25rem 1.25rem; border-left: 4px solid var(--c-accent); color: var(--c-muted); }
.alignleft { float: left; margin: .25rem 1.25rem 1rem 0; }
.alignright { float: right; margin: .25rem 0 1rem 1.25rem; }
.aligncenter { margin-inline: auto; }
.wp-caption-text, figcaption { font-size: .85rem; color: var(--c-muted); }

/* ---------- Blocks ---------- */
.block { padding-block: var(--space); }
.block--bg-tint { background: var(--c-tint); }
.block--bg-dark { background: var(--c-primary-dark); color: #fff; }
.block--bg-dark h1, .block--bg-dark h2, .block--bg-dark h3 { color: #fff; }
.block--bg-dark a:not(.btn) { color: #cfeadf; }
.block__intro { max-width: 62ch; color: var(--c-muted); margin-bottom: 1.5rem; font-size: 1.05rem; }
.block--bg-dark .block__intro { color: #d6e6df; }
.block__footnote { margin-top: 1.25rem; color: var(--c-muted); font-size: .92rem; max-width: 70ch; }
.block--text-wide .prose { max-width: none; }

/* Hero */
.hero { position: relative; isolation: isolate; color: #fff; background: linear-gradient(135deg, var(--c-primary-dark), var(--c-primary)); min-height: clamp(18rem, 34vw, 26rem); display: grid; align-items: end; }
.hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 45%; z-index: -2; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgb(5 30 24 / .8), rgb(5 30 24 / .35) 55%, rgb(5 30 24 / .05)), linear-gradient(to top, rgb(5 30 24 / .5), transparent 50%); }
.hero__inner { padding-block: clamp(2rem, 6vw, 4rem); }
.hero h1 { color: #fff; max-width: 20ch; }
.hero__text { font-size: 1.2rem; max-width: 52ch; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; font-weight: 700; margin-bottom: .6rem; opacity: .9; }

/* Text + image */
.split { display: grid; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
@media (min-width: 48em) { .split { grid-template-columns: 1fr 1fr; } .split--right .split__media { order: 2; } }
.split__media img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; }

/* Cards */
.cards { display: grid; gap: 1.25rem; --min: 16rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--min)), 1fr)); }
.cards--cols-2 { --min: 24rem; }
.cards--cols-4 { --min: 12.5rem; }
.card { position: relative; background: #fff; color: var(--c-ink); border: 1px solid var(--c-line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 2px rgb(10 40 30 / .05); transition: box-shadow .2s, transform .2s; display: flex; flex-direction: column; }
.card:hover, .card:focus-within { box-shadow: var(--shadow); transform: translateY(-2px); }
.card__img { aspect-ratio: 8 / 5; object-fit: cover; width: 100%; }
.card__body { padding: 1.1rem 1.25rem 1.3rem; }
.card__title { font-size: 1.15rem; margin-bottom: .35em; }
.card__link { color: inherit; text-decoration: none; }
.card__link::after { content: ""; position: absolute; inset: 0; }
.card__link:hover { color: var(--c-primary); text-decoration: underline; }
.card__text { color: var(--c-muted); margin: 0; font-size: .97rem; }

/* Callout */
.callout { border-left: 6px solid var(--c-primary); background: var(--c-tint); padding: 1.25rem 1.5rem; border-radius: 0 var(--radius) var(--radius) 0; max-width: 70ch; }
.callout--warning { border-color: var(--c-accent); background: #fbf1e3; }
.callout--highlight { border-color: var(--c-primary-dark); background: #fff; box-shadow: var(--shadow); }
.callout h2, .callout h3 { font-size: 1.3rem; }
.callout > :last-child { margin-bottom: 0; }
.block--bg-dark .callout { color: var(--c-ink); }
.block--bg-dark .callout h2, .block--bg-dark .callout h3 { color: var(--c-primary-dark); }
.block--bg-dark .callout a:not(.btn) { color: var(--c-primary); }

/* Events */
.events { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.event { display: grid; grid-template-columns: 5.5rem 1fr; gap: 1.25rem; background: #fff; color: var(--c-ink); border: 1px solid var(--c-line); border-radius: var(--radius); padding: 1rem 1.25rem; align-items: center; }
.event__date { text-align: center; background: var(--c-primary); color: #fff; border-radius: .6rem; padding: .5rem .25rem; line-height: 1.1; }
.event__day { display: block; font-size: 1.9rem; font-weight: 700; font-family: var(--font-head); }
.event__month { display: block; text-transform: uppercase; letter-spacing: .06em; font-size: .8rem; }
.event__year { display: block; font-size: .75rem; opacity: .85; }
.event__title { font-size: 1.2rem; margin: 0 0 .15em; }
.event__meta { margin: 0; color: var(--c-muted); font-size: .95rem; }
.event a:not(.btn) { color: var(--c-primary); }

/* People */
.people-group { margin-bottom: 2rem; }
.people-group h3 { border-bottom: 2px solid var(--c-line); padding-bottom: .4rem; }
.people { display: grid; margin: 0; gap: .1rem 2rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); }
.people__item { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--c-line); }
.people dt { color: var(--c-muted); }
.people dd { margin: 0; font-weight: 600; text-align: right; }
.people .is-vacant { color: var(--c-muted); font-style: italic; font-weight: 400; }

/* Pricing */
.price-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); }
.price-card { background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius); padding: 1.25rem; text-align: center; color: var(--c-ink); }
.price-card__label { font-weight: 600; color: var(--c-muted); margin: 0; }
.price-card__price { font: 700 2.2rem/1.2 var(--font-head); color: var(--c-primary-dark); margin: .2rem 0; }
.price-card__note { font-size: .88rem; color: var(--c-muted); margin: 0; }

/* Downloads */
.downloads { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; max-width: 52rem; }
.downloads li { display: flex; gap: 1rem; align-items: center; background: #fff; border: 1px solid var(--c-line); border-radius: .6rem; padding: .75rem 1rem; color: var(--c-ink); }
.downloads__title { font-weight: 600; flex: 1; }
.downloads__meta { color: var(--c-muted); font-size: .85rem; white-space: nowrap; }
.downloads__thumb { width: 3.5rem; flex: none; border-radius: .3rem; }
.covers { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); }
.cover a { display: block; text-decoration: none; color: var(--c-ink); }
.cover img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: .4rem; box-shadow: var(--shadow); margin-bottom: .5rem; background: var(--c-line); }
.cover__title { font-weight: 600; display: block; }
.cover__meta { font-size: .85rem; color: var(--c-muted); }
.cover a:hover .cover__title { text-decoration: underline; }

/* Gallery */
.gallery { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: .5rem; }
.gallery figcaption { padding-top: .4rem; }

/* Link list / contacts / key facts */
.link-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; max-width: 52rem; }
.link-list li { border: 1px solid var(--c-line); border-radius: .6rem; padding: .85rem 1.1rem; background: #fff; color: var(--c-ink); }
.link-list a { font-weight: 600; }
.link-list p { margin: .25rem 0 0; color: var(--c-muted); font-size: .95rem; }
.contacts { display: grid; gap: .1rem 2rem; margin: 0; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); }
.contacts__item { padding: .8rem 0; border-bottom: 1px solid var(--c-line); }
.contacts dt { font-weight: 700; }
.contacts dd { margin: 0; color: var(--c-muted); }
.keyfacts { margin: 0; max-width: 52rem; border-top: 1px solid var(--c-line); }
.keyfacts__row { display: grid; grid-template-columns: minmax(8rem, 1fr) 2fr; gap: 1rem; padding: .65rem .25rem; border-bottom: 1px solid var(--c-line); }
.keyfacts dt { font-weight: 600; }
.keyfacts dd { margin: 0; }
.keyfacts--table .keyfacts__row:nth-child(odd) { background: var(--c-tint); }

/* Stats */
.stats { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); text-align: center; }
.stats__number { display: block; font: 700 clamp(2rem, 1.4rem + 2vw, 3rem)/1.1 var(--font-head); color: var(--c-primary); }
.block--bg-dark .stats__number { color: #fff; }
.stats__label { color: var(--c-muted); font-size: .95rem; }
.block--bg-dark .stats__label { color: #d6e6df; }

/* Accordion */
.accordion { max-width: 52rem; display: grid; gap: .6rem; }
.accordion details { border: 1px solid var(--c-line); border-radius: .6rem; background: #fff; color: var(--c-ink); }
.accordion summary { cursor: pointer; padding: .9rem 1.1rem; font-weight: 600; }
.accordion__body { padding: 0 1.1rem 1rem; }

/* Bird sites */
.site-layout { display: grid; gap: 2rem; padding-block: 1.5rem var(--space); }
@media (min-width: 60em) { .site-layout { grid-template-columns: 1fr 20rem; align-items: start; } }
.site-details { background: var(--c-tint); border-radius: var(--radius); padding: 1.25rem; position: sticky; top: 1rem; }
.site-details h2 { font-size: 1.15rem; }
.site-details dl { margin: 0 0 1rem; }
.site-details dt { font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--c-muted); }
.site-details dd { margin: 0 0 .75rem; }
.site-layout .block { padding-block: 1.5rem; }
.site-layout .block .container { width: 100%; }

/* Lists of posts / search */
.post-list { padding-block: 2rem var(--space); }
.pagination { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 2rem; }
.pagination .page-numbers { padding: .4rem .8rem; border: 1px solid var(--c-line); border-radius: .4rem; text-decoration: none; }
.pagination .current { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.search-form { display: flex; gap: .5rem; max-width: 30rem; }
.search-form input[type="search"] { flex: 1; padding: .6rem .8rem; border: 2px solid var(--c-line); border-radius: .5rem; font: inherit; }

/* ---------- Footer ---------- */
.site-footer { background: var(--c-primary-dark); color: #d6e6df; padding-block: 2.5rem 1.5rem; margin-top: var(--space); font-size: .95rem; }
.site-footer a { color: #fff; }
.site-footer__grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.site-footer h2 { color: #fff; font-size: 1.1rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.social { display: flex; gap: .75rem; }
.social a { display: inline-flex; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: rgb(255 255 255 / .12); align-items: center; justify-content: center; }
.social a:hover { background: rgb(255 255 255 / .25); }
.social svg { width: 1.2rem; height: 1.2rem; fill: currentColor; }
.site-footer__legal { border-top: 1px solid rgb(255 255 255 / .2); margin-top: 2rem; padding-top: 1rem; font-size: .85rem; }

@media print {
	.site-header, .site-banner, .site-footer, .skip-link, .btn-row { display: none !important; }
	body { color: #000; }
	a { color: #000; }
}
