/*
Theme Name: Svågadalen
Description: Tema för Svågadalens webbplats — vandringsleder, sevärdheter, matsedel och evenemang.
Version: 1.0.0
Requires at least: 6.7
Requires PHP: 8.1
Text Domain: svagadalen
*/

/*
 * No build step and no webfonts, on purpose. The whole stylesheet is readable
 * in one file, it loads in one request, and nothing here needs npm to change a
 * colour. Fonts are the system stack, so there are no third-party requests and
 * nothing to consent to.
 */

:root {
	--green-900: #14352a;
	--green-700: #1f4d3a;
	--green-500: #2d6b4f;
	--green-100: #dfeae2;
	--river:     #2e6f8e;
	--river-100: #dceaf1;

	--bg:        #faf8f4;
	--surface:   #ffffff;
	--ink:       #16211c;
	--muted:     #5b6862;
	--line:      #e2ded6;

	--warn-bg:   #fdf3d8;
	--warn-line: #d9a441;
	--warn-ink:  #6b4a05;
	--stop-bg:   #fbe4e3;
	--stop-line: #c0392b;
	--stop-ink:  #7d1f16;
	--ok:        #2d6b4f;

	--radius: 10px;
	--shadow: 0 1px 2px rgb(20 53 42 / 6%), 0 4px 16px rgb(20 53 42 / 6%);

	--sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--serif: Georgia, "Iowan Old Style", "Times New Roman", serif;

	/* Fluid type: readable on a phone in the forest, comfortable on a desktop. */
	--step--1: clamp(0.83rem, 0.80rem + 0.16vw, 0.92rem);
	--step-0:  clamp(1.00rem, 0.95rem + 0.25vw, 1.15rem);
	--step-1:  clamp(1.20rem, 1.10rem + 0.50vw, 1.50rem);
	--step-2:  clamp(1.45rem, 1.25rem + 1.00vw, 2.10rem);
	--step-3:  clamp(1.80rem, 1.45rem + 1.75vw, 3.00rem);

	--wrap: 68rem;
	--wrap-narrow: 44rem;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg:      #101613;
		--surface: #18201c;
		--ink:     #e7ede9;
		--muted:   #9aa9a1;
		--line:    #2a352f;

		--green-100: #1c2f26;
		--green-500: #57a07c;
		--green-700: #7cbb98;
		--green-900: #a9d6bd;
		--river:     #7fb8d4;
		--river-100: #16262e;

		--warn-bg:   #2e2611;
		--warn-ink:  #f0d38a;
		--stop-bg:   #331a17;
		--stop-ink:  #f2b3ab;

		--shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 4px 16px rgb(0 0 0 / 25%);
	}
}

*, *::before, *::after { box-sizing: border-box; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--sans);
	font-size: var(--step-0);
	line-height: 1.65;
	-webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4 {
	font-family: var(--serif);
	line-height: 1.2;
	color: var(--green-900);
	margin: 0 0 .5em;
	text-wrap: balance;
}

h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }

p, ul, ol { margin: 0 0 1rem; }
p { text-wrap: pretty; }

a { color: var(--river); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--green-700); }

img { max-width: 100%; height: auto; display: block; }

/* Visible focus is not optional; several editors and visitors keyboard-navigate. */
:focus-visible {
	outline: 3px solid var(--river);
	outline-offset: 2px;
	border-radius: 3px;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--green-900);
	color: #fff;
	padding: .75rem 1rem;
	z-index: 100;
}
.skip-link:focus { left: 0; }

.wrap {
	width: min(100% - 2.5rem, var(--wrap));
	margin-inline: auto;
}
.wrap--narrow { width: min(100% - 2.5rem, var(--wrap-narrow)); }

.visually-hidden {
	position: absolute;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* ---------- Header ---------- */

.site-header {
	background: var(--green-900);
	color: #fff;
	padding-block: 1rem;
	position: sticky;
	top: 0;
	z-index: 50;
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
}

.site-title {
	font-family: var(--serif);
	font-size: var(--step-1);
	color: #fff;
	margin: 0;
	line-height: 1.1;
}
.site-title a { color: #fff; text-decoration: none; }
.site-title span {
	display: block;
	font-family: var(--sans);
	font-size: var(--step--1);
	font-weight: 400;
	opacity: .75;
	letter-spacing: .04em;
	text-transform: uppercase;
}

.nav-toggle {
	display: none;
	background: transparent;
	border: 1px solid rgb(255 255 255 / 35%);
	color: #fff;
	border-radius: var(--radius);
	padding: .5rem .9rem;
	font: inherit;
	font-size: var(--step--1);
	cursor: pointer;
}

.main-nav ul {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: .25rem 1.25rem;
	margin: 0;
	padding: 0;
}
.main-nav a {
	color: #fff;
	text-decoration: none;
	font-size: var(--step--1);
	padding: .35rem 0;
	display: block;
	border-bottom: 2px solid transparent;
}
.main-nav a:hover,
.main-nav .current-menu-item > a {
	border-bottom-color: #fff;
	color: #fff;
}

@media (max-width: 55rem) {
	.nav-toggle { display: block; }
	.main-nav { flex-basis: 100%; display: none; }
	.main-nav[data-open="true"] { display: block; }
	.main-nav ul { flex-direction: column; gap: 0; }
	.main-nav li + li { border-top: 1px solid rgb(255 255 255 / 12%); }
	.main-nav a { padding: .7rem 0; }
}

/* ---------- Hero ---------- */

.hero {
	position: relative;
	background: var(--green-700);
	color: #fff;
	overflow: hidden;
}
.hero img {
	width: 100%;
	height: clamp(18rem, 45vh, 30rem);
	object-fit: cover;
	opacity: .55;
}
.hero__text {
	position: absolute;
	inset: 0;
	display: grid;
	align-content: center;
	text-align: center;
	padding: 2rem 1.5rem;
	background: linear-gradient(to bottom, rgb(20 53 42 / 25%), rgb(20 53 42 / 70%));
}
.hero__text h1 { color: #fff; margin-bottom: .3em; }
.hero__text p {
	margin: 0 auto;
	max-width: 40rem;
	font-size: var(--step-1);
	color: rgb(255 255 255 / 92%);
}

/* ---------- Sections & cards ---------- */

.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section--tint { background: var(--green-100); }

.section__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	margin-bottom: 1.5rem;
}
.section__head h2 { margin: 0; }

.grid {
	display: grid;
	gap: 1.25rem;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
}

.card {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	overflow: hidden;
	box-shadow: var(--shadow);
	display: flex;
	flex-direction: column;
}
.card[hidden] { display: none; }
.card img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
.card__body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; flex: 1; }
.card__body h3 { margin-bottom: .35rem; }
.card__body h3 a { color: var(--green-900); text-decoration: none; }
.card__body h3 a:hover { text-decoration: underline; }
.card__body p { color: var(--muted); font-size: var(--step--1); }
.card__body > :last-child { margin-bottom: 0; margin-top: auto; }

.meta {
	list-style: none;
	margin: 0 0 .75rem;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: .35rem .75rem;
	font-size: var(--step--1);
	color: var(--muted);
}
.meta li { display: flex; align-items: center; gap: .3rem; }
.meta strong { color: var(--ink); font-weight: 600; }

.pill {
	display: inline-block;
	font-size: var(--step--1);
	padding: .15rem .6rem;
	border-radius: 999px;
	background: var(--green-100);
	color: var(--green-900);
	border: 1px solid transparent;
}
.pill--latt   { background: var(--green-100); color: var(--green-900); }
.pill--medel  { background: var(--warn-bg); color: var(--warn-ink); }
.pill--svar   { background: var(--stop-bg); color: var(--stop-ink); }

.button {
	display: inline-block;
	background: var(--green-700);
	color: #fff;
	text-decoration: none;
	padding: .6rem 1.15rem;
	border-radius: var(--radius);
	font-size: var(--step--1);
	font-weight: 600;
	border: 1px solid var(--green-700);
}
.button:hover { background: var(--green-900); color: #fff; }
.button--ghost {
	background: transparent;
	color: var(--green-700);
}
.button--ghost:hover { background: var(--green-100); color: var(--green-900); }

/* ---------- Varningar ----------
 * Amber and red are reserved for things that can actually affect a visitor's
 * safety or wasted journey: a closed trail, a bridge you cross at your own
 * risk, a charger that is out of order. Nothing else may use these colours,
 * or they stop meaning anything.
 */

.alert {
	border-left: 4px solid var(--warn-line);
	background: var(--warn-bg);
	color: var(--warn-ink);
	padding: .9rem 1.1rem;
	border-radius: 0 var(--radius) var(--radius) 0;
	margin-bottom: 1.25rem;
}
.alert--stop { border-left-color: var(--stop-line); background: var(--stop-bg); color: var(--stop-ink); }
.alert p:last-child { margin-bottom: 0; }
.alert__date { font-size: var(--step--1); opacity: .8; }

/* ---------- Aktuellt ----------
 * News and announcements. Deliberately calm: an election notice or a new
 * parcel service is information, not a hazard, and should not wear the same
 * colour as a broken bridge.
 */

.news { display: grid; gap: 1rem; }

.news__item {
	background: var(--surface);
	border: 1px solid var(--line);
	border-left: 3px solid var(--river);
	border-radius: 0 var(--radius) var(--radius) 0;
	padding: 1.1rem 1.3rem;
	box-shadow: var(--shadow);
}
.news__item h3 {
	margin: 0 0 .3rem;
	font-size: var(--step-1);
}
.news__item h3 a { color: var(--green-900); text-decoration: none; }
.news__item h3 a:hover { text-decoration: underline; }
.news__item p { margin: 0; color: var(--muted); }
.news__date {
	display: block;
	font-size: var(--step--1);
	color: var(--muted);
	margin-bottom: .35rem;
	letter-spacing: .02em;
}

/* ---------- Matsedel ---------- */

.matsedel {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	overflow: hidden;
}
.matsedel__head {
	padding: 1rem 1.25rem;
	background: var(--green-100);
	border-bottom: 1px solid var(--line);
}
.matsedel__head h3 { margin: 0; }
.matsedel__head p { margin: .25rem 0 0; font-size: var(--step--1); color: var(--muted); }

.matsedel__days { list-style: none; margin: 0; padding: 0; }
.matsedel__days li {
	display: grid;
	grid-template-columns: 7.5rem 1fr;
	gap: 1rem;
	padding: .85rem 1.25rem;
	border-bottom: 1px solid var(--line);
}
.matsedel__days li:last-child { border-bottom: 0; }
.matsedel__days li[data-today="true"] { background: var(--river-100); }
.matsedel__days dt, .matsedel__day {
	font-weight: 600;
	color: var(--green-900);
}
.matsedel__closed { color: var(--muted); font-style: italic; }

@media (max-width: 32rem) {
	.matsedel__days li { grid-template-columns: 1fr; gap: .15rem; }
}

.dagens {
	background: var(--surface);
	border: 1px solid var(--line);
	border-left: 4px solid var(--green-500);
	border-radius: 0 var(--radius) var(--radius) 0;
	padding: 1.1rem 1.3rem;
}
.dagens__label {
	font-size: var(--step--1);
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--muted);
	margin: 0 0 .2rem;
}
.dagens__dish { font-size: var(--step-1); font-family: var(--serif); color: var(--green-900); margin: 0; }

/* ---------- Events ---------- */

.event-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.event {
	display: grid;
	grid-template-columns: 4.5rem 1fr;
	gap: 1.25rem;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 1rem 1.25rem;
	box-shadow: var(--shadow);
}
.event__date {
	text-align: center;
	background: var(--green-100);
	border-radius: var(--radius);
	padding: .5rem .25rem;
	align-self: start;
}
.event__day { display: block; font-size: var(--step-2); font-family: var(--serif); line-height: 1; color: var(--green-900); }
.event__month { display: block; font-size: var(--step--1); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.event h3 { margin-bottom: .2rem; }
.event h3 a { color: var(--green-900); text-decoration: none; }
.event__time { font-size: var(--step--1); color: var(--muted); margin: 0 0 .5rem; }
.event--cancelled h3 { text-decoration: line-through; }

/* ---------- Map ---------- */

.map {
	height: clamp(20rem, 55vh, 34rem);
	border-radius: var(--radius);
	border: 1px solid var(--line);
	overflow: hidden;
	background: var(--green-100);
}
.map-fallback {
	padding: 1rem 1.25rem;
	font-size: var(--step--1);
	color: var(--muted);
}

/* ---------- Article body ---------- */

.prose { max-width: 42rem; }
.prose h2 { margin-top: 2rem; }
.prose h3 { margin-top: 1.5rem; }
.prose img { border-radius: var(--radius); margin-block: 1.5rem; }
.prose blockquote {
	margin: 1.5rem 0;
	padding-left: 1.25rem;
	border-left: 3px solid var(--green-500);
	color: var(--muted);
	font-style: italic;
}

.page-header { padding-block: clamp(2rem, 5vw, 3.5rem) 0; }
.page-header p.lede { font-size: var(--step-1); color: var(--muted); max-width: 42rem; }

.breadcrumb {
	font-size: var(--step--1);
	color: var(--muted);
	margin-bottom: .75rem;
}
.breadcrumb a { color: var(--muted); }

.factbox {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 1.1rem 1.3rem;
	box-shadow: var(--shadow);
}
.factbox h2 { font-size: var(--step-1); margin-top: 0; }
.factbox dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; font-size: var(--step--1); }
.factbox dt { color: var(--muted); }
.factbox dd { margin: 0; font-weight: 600; }

.layout-sidebar {
	display: grid;
	gap: 2rem;
	grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
	align-items: start;
}
@media (max-width: 52rem) {
	.layout-sidebar { grid-template-columns: 1fr; }
}

.opening-hours { list-style: none; margin: 0; padding: 0; font-size: var(--step--1); }
.opening-hours li { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0; border-bottom: 1px solid var(--line); }
.opening-hours li:last-child { border-bottom: 0; }

/* ---------- Filters ----------
 * A real radio group behind the pills: one choice at a time, arrow keys work,
 * and screen readers announce it as a group rather than a row of links. The
 * inputs are hidden visually but remain focusable, so the label carries the
 * focus ring.
 */

.filters { margin-bottom: 1rem; }
.filters fieldset {
	border: 0;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .5rem;
}
.filters__options { display: flex; flex-wrap: wrap; gap: .5rem; }

.filters input[type="radio"] {
	position: absolute;
	width: 1px; height: 1px;
	opacity: 0;
	pointer-events: none;
}
.filters label {
	display: inline-block;
	padding: .35rem .9rem;
	border-radius: 999px;
	border: 1px solid var(--line);
	background: var(--surface);
	color: var(--ink);
	font-size: var(--step--1);
	cursor: pointer;
	user-select: none;
	transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.filters label:hover { border-color: var(--green-500); }
.filters input[type="radio"]:checked + label {
	background: var(--green-700);
	border-color: var(--green-700);
	color: #fff;
}
.filters input[type="radio"]:focus-visible + label {
	outline: 3px solid var(--river);
	outline-offset: 2px;
}

.filters__count,
.filters__empty {
	font-size: var(--step--1);
	color: var(--muted);
	margin-bottom: 1.5rem;
}
.filters__empty { margin-top: 1rem; }

/* A short fade so filtering reads as the list changing, not a page jump. */
@keyframes svagadalen-filter-in {
	from { opacity: .35; }
	to   { opacity: 1; }
}
.grid.is-filtering { animation: svagadalen-filter-in .18s ease-out; }

@media (prefers-reduced-motion: reduce) {
	.grid.is-filtering { animation: none; }
	.filters label { transition: none; }
}

/* ---------- Footer ---------- */

.site-footer {
	background: var(--green-900);
	color: rgb(255 255 255 / 85%);
	padding-block: 3rem 2rem;
	margin-top: 4rem;
}
.site-footer a { color: #fff; }
.site-footer h2 { color: #fff; font-size: var(--step-1); }
.site-footer__cols {
	display: grid;
	gap: 2rem;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
}
.site-footer ul { list-style: none; padding: 0; }
.site-footer li { margin-bottom: .35rem; }
.site-footer__legal {
	margin-top: 2.5rem;
	padding-top: 1.25rem;
	border-top: 1px solid rgb(255 255 255 / 15%);
	font-size: var(--step--1);
	opacity: .8;
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: .5rem;
}

/* ---------- Print ---------- */

@media print {
	.site-header, .site-footer, .nav-toggle, .button, .filters, .map { display: none !important; }
	body { background: #fff; color: #000; font-size: 11pt; }
	.matsedel, .card, .factbox { box-shadow: none; border: 1px solid #999; }
	a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; word-break: break-all; }
}
