/*
Theme Name: 214 Peaks
Description: Theme for 214 Peaks – charting the Wainwrights and every other adventure. Works with the 214 Peaks plugin (map, progress, photos).
Version: 0.3.1
Author: AHS Digital
Requires PHP: 8.0
Text Domain: peaks214
*/

:root {
	--gold: #d4a876;
	--gold-dark: #b98a55;
	--slate: #1d2a30;
	--slate-2: #26363d;
	--ink: #1f2a30;
	--muted: #61707a;
	--sky: #93bdef;
	--fern: #a6d1ab;
	--paper: #f6f3ee;
	--line: #e3e0da;
	--radius: 12px;
	--wrap: 1180px;
	--p214-done: #2e9e4f;
	--p214-todo: #d64541;
	--p214-trip: #3660f4;
	--p214-ink: var(--ink);
	--p214-muted: var(--muted);
	--p214-line: var(--line);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 17px; line-height: 1.65; color: var(--ink); background: #fff; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
a { color: var(--gold-dark); text-underline-offset: 3px; }
a:hover { color: var(--slate); }
h1, h2, h3, h4 { font-family: "Roboto Slab", Georgia, serif; font-weight: 600; line-height: 1.2; color: var(--slate); margin: 0 0 .6em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }
.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.narrow { width: min(100% - 32px, 760px); margin-inline: auto; }
.screen-reader-text { position: absolute !important; clip: rect(1px, 1px, 1px, 1px); width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus { clip: auto; width: auto; height: auto; z-index: 1000; background: #fff; padding: .5rem 1rem; left: 1rem; top: 1rem; }

/* Header */
.site-header { background: var(--slate); color: #fff; position: sticky; top: 0; z-index: 50; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 72px; }
.site-header .nav { margin-left: auto; }
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: #fff; }
.brand img { height: 48px; width: auto; }
.brand span { font-family: "Roboto Slab", serif; font-size: .95rem; letter-spacing: .02em; color: #cfd8dc; }
.nav ul { list-style: none; display: flex; gap: .25rem; margin: 0; padding: 0; }
.nav a { display: block; padding: .5rem .8rem; color: #fff; text-decoration: none; font-weight: 500; border-radius: 8px; }
.nav a:hover, .nav .current-menu-item > a, .nav .current-menu-ancestor > a, .nav .current_page_item > a { background: var(--slate-2); color: var(--gold); }
.nav-toggle { display: none; background: none; border: 1px solid #50626a; color: #fff; border-radius: 8px; padding: .45rem .7rem; font: inherit; }

/* Search */
.head-actions { display: flex; align-items: center; gap: .5rem; order: 3; }
.search-toggle { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid #50626a; background: none; color: #fff; cursor: pointer; }
.search-toggle:hover, .search-toggle[aria-expanded="true"] { color: var(--gold); border-color: var(--gold); }
.site-search { background: var(--slate-2); border-top: 1px solid #33464e; padding: .9rem 0; }
.site-search form { display: flex; gap: .5rem; position: relative; }
.site-search input[type="search"] { flex: 1; min-width: 0; padding: .75rem 1rem; border-radius: 999px; border: 0; font: inherit; font-size: 1.05rem; }
.site-search input[type="search"]:focus { outline: 3px solid var(--gold); }
.search-results { position: absolute; left: 0; right: 0; top: calc(100% + .5rem); background: #fff; color: var(--ink); border-radius: var(--radius); box-shadow: 0 18px 40px rgba(0,0,0,.25); max-height: 70vh; overflow: auto; padding: .4rem; z-index: 60; }
.search-results a { display: flex; align-items: center; gap: .75rem; padding: .5rem .6rem; border-radius: 8px; color: inherit; text-decoration: none; }
.search-results a:hover, .search-results a:focus { background: var(--paper); outline: none; }
.search-results img, .sr-noimg { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; }
.sr-noimg { display: grid; place-items: center; background: var(--slate); color: var(--gold); font-size: .9rem; }
.search-results a > span:not(.sr-badge):not(.sr-noimg) { display: grid; flex: 1; min-width: 0; }
.search-results strong { font-weight: 600; }
.search-results small, .fell-results small { color: var(--muted); }
.sr-head { margin: .5rem .6rem .2rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.sr-none { margin: .75rem; color: var(--muted); }
.sr-badge { font-size: .72rem; font-weight: 700; padding: .15rem .55rem; border-radius: 99px; white-space: nowrap; }
.sr-badge.is-done { background: #e3f4e8; color: var(--p214-done); }
.sr-badge.is-todo { background: #fbe6e5; color: var(--p214-todo); }
.fell-results { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .5rem; }
.fell-results a { display: grid; grid-template-columns: auto 1fr; column-gap: .6rem; align-items: center; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: inherit; }
.fell-results a:hover { border-color: var(--gold); }
.fell-results small { grid-column: 2; }

/* Hero */
.hero { position: relative; color: #fff; background: var(--slate) center / cover no-repeat; min-height: min(78vh, 680px); display: flex; align-items: flex-end; }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,30,34,.15) 0%, rgba(20,30,34,.35) 45%, rgba(20,30,34,.88) 100%); }
.hero .wrap { position: relative; padding: 5rem 0 3rem; }
.hero h1 { color: #fff; max-width: 18ch; margin-bottom: .4em; text-shadow: 0 2px 18px rgba(0,0,0,.35); }
.hero p { font-size: 1.2rem; max-width: 46ch; color: #eef2f3; margin: 0 0 1.5rem; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 1rem 2rem; margin-top: 1.5rem; }
.hero-stats div { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: #cfd8dc; }
.hero-stats b { display: block; font-family: "Roboto Slab", serif; font-size: 2.2rem; letter-spacing: 0; color: var(--gold); text-transform: none; }
.btn { display: inline-block; padding: .8rem 1.3rem; border-radius: 999px; background: var(--gold); color: var(--slate); font-weight: 700; text-decoration: none; border: 0; cursor: pointer; }
.btn:hover { background: #fff; color: var(--slate); }
.btn--ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.7); margin-left: .5rem; }

/* Sections */
.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section--paper { background: var(--paper); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.section-head p { margin: 0; color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; font-weight: 700; color: var(--gold-dark); margin: 0 0 .5rem; }
.intro { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.intro .entry p:first-child { font-size: 1.2rem; }
.progress-card { background: #fff; border-radius: var(--radius); padding: 1.5rem; box-shadow: 0 10px 30px rgba(29,42,48,.08); }

/* Tiles (front page) */
.tiles { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(2, 1fr); } .tiles .tile:first-child { grid-column: span 2; } }
@media (min-width: 1000px) { .tiles { grid-template-columns: repeat(3, 1fr); } .tiles .tile:last-child { grid-column: span 2; } }
.tile { position: relative; display: flex; align-items: flex-end; min-height: 220px; border-radius: var(--radius); overflow: hidden; text-decoration: none; color: #fff; background: linear-gradient(135deg, var(--slate-2), #4b6670) center / cover no-repeat; box-shadow: 0 6px 22px rgba(29,42,48,.14); transition: transform .25s, box-shadow .25s; }
.tile::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,30,34,0) 35%, rgba(20,30,34,.85)); transition: background .25s; }
.tile:hover { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(29,42,48,.22); color: #fff; }
.tile:hover::before { background: linear-gradient(180deg, rgba(20,30,34,.05) 20%, rgba(20,30,34,.9)); }
.tile-body { position: relative; padding: 1.1rem 1.25rem; display: grid; gap: .15rem; }
.tile strong { font-family: "Roboto Slab", serif; font-size: 1.45rem; font-weight: 600; }
.tile small { color: var(--gold); font-weight: 700; letter-spacing: .03em; }
.section-map { background: var(--slate); padding: .25rem 0 2rem; display: flow-root; }
.section-map .p214-mapwrap { margin-top: 0; }
.section-map .p214-maptools { color: #fff; }
.section-map .p214-chip { background: var(--slate-2); border-color: #3b4f57; }
.section-map .p214-chip b { color: #fff; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
.card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: 0 4px 18px rgba(29,42,48,.08); display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(29,42,48,.14); color: inherit; }
.card-img { aspect-ratio: 4 / 3; background: linear-gradient(135deg, var(--slate-2), #415a63); position: relative; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-img .noimg { position: absolute; inset: 0; display: grid; place-items: center; }
.card-img .noimg img { width: 45%; height: auto; opacity: .55; object-fit: contain; }
.card-tag { position: absolute; left: .75rem; top: .75rem; padding: .2rem .6rem; border-radius: 99px; font-size: .75rem; font-weight: 700; background: rgba(255,255,255,.92); color: var(--slate); }
.card-tag--fell { color: var(--p214-done); }
.card-tag--trip { color: var(--p214-trip); }
.card-body { padding: 1rem 1.1rem 1.2rem; display: grid; gap: .25rem; }
.card-body h3 { margin: 0; font-size: 1.15rem; }
.card-meta { font-size: .88rem; color: var(--muted); }

/* Single */
.post-hero { position: relative; background: var(--slate) center / cover no-repeat; color: #fff; min-height: 52vh; display: flex; align-items: flex-end; }
.post-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,30,34,.1), rgba(20,30,34,.85)); }
.post-hero .wrap { position: relative; padding: 4rem 0 2rem; }
.post-hero h1 { color: #fff; margin: 0; }
.post-hero .crumbs { color: #dfe6e8; font-size: .9rem; margin-bottom: .5rem; }
.post-hero .crumbs a { color: var(--gold); text-decoration: none; }
.post-plain { background: var(--slate); color: #fff; padding: 3rem 0 2rem; }
.post-plain h1 { color: #fff; margin: 0; }
.entry { font-size: 1.05rem; }
.entry > * + * { margin-top: 1.1em; }
.entry blockquote { margin: 1.5rem 0; padding: .5rem 1.25rem; border-left: 4px solid var(--gold); color: var(--muted); font-style: italic; }
.entry img { border-radius: 8px; }
.entry .wp-block-gallery img, .entry .gallery img { border-radius: 6px; }
.single-body { padding: 2.5rem 0 4rem; }
.post-nav { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 1.5rem; margin-top: 3rem; }
.post-nav a { text-decoration: none; font-weight: 600; }

/* Archive */
.archive-head { background: var(--slate); color: #fff; padding: 3rem 0 2.5rem; }
.archive-head h1 { color: #fff; margin: 0 0 .25rem; }
.archive-head p { color: #cfd8dc; margin: 0; }
.subnav { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1.25rem; }
.subnav a { padding: .3rem .8rem; border-radius: 99px; background: var(--slate-2); color: #fff; text-decoration: none; font-size: .9rem; }
.subnav a.is-on, .subnav a:hover { background: var(--gold); color: var(--slate); }
.pagination { margin-top: 2rem; display: flex; gap: .4rem; flex-wrap: wrap; }
.pagination .page-numbers { padding: .4rem .8rem; border-radius: 8px; border: 1px solid var(--line); text-decoration: none; }
.pagination .current { background: var(--slate); color: #fff; border-color: var(--slate); }

/* Footer */
.site-footer { background: var(--slate); color: #b8c4c8; padding: 3rem 0 2rem; font-size: .92rem; }
.site-footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; }
.site-footer img { height: 54px; width: auto; }
.site-footer a { color: var(--gold); }
.site-footer .small { font-size: .8rem; color: #8b9aa0; grid-column: 1 / -1; border-top: 1px solid var(--slate-2); padding-top: 1rem; }

/* Map page */
.map-page .p214-map { border-radius: var(--radius); }

@media (max-width: 860px) {
	.intro { grid-template-columns: 1fr; }
	.site-footer .wrap { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
	body { font-size: 16px; }
	.nav-toggle { display: inline-block; }
	.nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--slate); display: none; padding: .5rem 16px 1rem; border-top: 1px solid var(--slate-2); }
	.nav.is-open { display: block; }
	.nav ul { flex-direction: column; }
	.brand span { display: none; }
	.site-search .btn { display: none; }
	.btn--ghost { margin: .5rem 0 0; }
}
