/*
Theme Name: Sakkavare Natur
Theme URI: https://sakkavare.se
Author: Sakkavare – Sakkaloukta
Author URI: https://sakkavare.se
Description: Modern naturdesign för Sakkavare – djup fjällpalett, serifrubriker, generösa bildgallerier och en tidslinje för byns historia.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
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: sakkavare
Tags: custom-menu, custom-logo, featured-images, translation-ready, one-column
*/

/* ============ Variabler ============ */
:root {
	--fjord-950: #0c2129;
	--fjord-900: #102c37;
	--fjord-800: #17414f;
	--fjord-700: #1f5263;
	--fjord-600: #2a6a7e;
	--fjord-500: #3a8195;
	--fjord-100: #dcebee;
	--moss-600: #5c7a6b;
	--moss-100: #e4ece7;
	--paper: #f7f4ee;
	--card: #ffffff;
	--ink: #24333d;
	--ink-soft: #54646e;
	--line: #e3ddd1;
	--wood-500: #c08a4e;
	--wood-100: #f6ead9;
	--shadow-sm: 0 1px 2px rgba(16, 44, 55, 0.08);
	--shadow-md: 0 10px 28px -10px rgba(16, 44, 55, 0.25);
	--radius: 10px;
	--serif: Georgia, "Times New Roman", "Palatino Linotype", serif;
	--sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--container: 1120px;
}

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	font-family: var(--sans);
	font-size: 17px;
	line-height: 1.7;
	color: var(--ink);
	background: var(--paper);
}

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

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--serif);
	font-weight: 700;
	line-height: 1.25;
	color: var(--fjord-900);
	margin: 0 0 0.6em;
}

p {
	margin: 0 0 1.1em;
}

a {
	color: var(--fjord-600);
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-thickness: 1px;
}

a:hover {
	color: var(--fjord-800);
}

::selection {
	background: var(--fjord-100);
	color: var(--fjord-950);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
	outline: 2px solid var(--fjord-500);
	outline-offset: 2px;
}

.container {
	max-width: var(--container);
	margin: 0 auto;
	padding: 0 24px;
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	width: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	word-wrap: normal !important;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 999;
	background: var(--fjord-900);
	color: #fff;
	padding: 10px 18px;
	text-decoration: none;
}

.skip-link:focus {
	left: 8px;
	top: 8px;
}

/* ============ Sidhuvud ============ */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--fjord-900);
	color: #fff;
	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 14px rgba(12, 33, 41, 0.3);
}

@media screen and (min-width: 783px) {
	body.admin-bar .site-header {
		top: 32px;
	}
}

@media screen and (max-width: 782px) {
	body.admin-bar .site-header {
		top: 46px;
	}
}

.site-header__inner {
	max-width: var(--container);
	margin: 0 auto;
	padding: 0 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	min-height: 68px;
}

.site-brand__link {
	display: inline-flex;
	align-items: center;
	padding: 10px 0;
	text-decoration: none;
}

.site-brand__text {
	display: inline-flex;
	flex-direction: column;
	line-height: 1.15;
}

.site-brand__name {
	font-family: var(--serif);
	font-size: 1.35rem;
	font-weight: 700;
	color: #fff;
	letter-spacing: 0.01em;
}

.site-brand__sub {
	font-size: 0.68rem;
	text-transform: uppercase;
	letter-spacing: 0.26em;
	color: var(--fjord-100);
	opacity: 0.7;
}

.site-brand .custom-logo {
	max-height: 48px;
	width: auto;
}

.main-navigation {
	display: flex;
	align-items: center;
}

.main-navigation .menu {
	display: flex;
	flex-wrap: wrap;
	gap: 2px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.main-navigation .menu a {
	display: block;
	padding: 9px 12px;
	color: #e8f1f4;
	text-decoration: none;
	font-size: 0.95rem;
	font-weight: 500;
	border-radius: 6px;
	transition: background 0.15s ease, color 0.15s ease;
}

.main-navigation .menu a:hover {
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
}

.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a {
	background: var(--fjord-600);
	color: #fff;
}

.nav-toggle {
	display: none;
	background: none;
	border: 0;
	padding: 10px;
	cursor: pointer;
}

.nav-toggle__bar {
	display: block;
	width: 22px;
	height: 2px;
	background: #fff;
	margin: 5px 0;
	border-radius: 2px;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
	opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 900px) {
	.site-header__inner {
		flex-wrap: wrap;
		padding: 0 16px;
		min-height: 60px;
	}

	.nav-toggle {
		display: block;
		margin-left: auto;
	}

	.main-navigation {
		order: 3;
		flex-basis: 100%;
		max-height: 0;
		overflow: hidden;
		transition: max-height 0.25s ease;
	}

	.site-header.is-open .main-navigation {
		max-height: 560px;
	}

	.main-navigation .menu {
		flex-direction: column;
		align-items: stretch;
		padding: 6px 8px 16px;
		gap: 2px;
	}

	.main-navigation .menu a {
		padding: 12px 14px;
		font-size: 1rem;
	}
}

/* ============ Hero ============ */
.page-hero {
	position: relative;
	background: linear-gradient(165deg, var(--fjord-900) 0%, var(--fjord-800) 55%, var(--fjord-600) 130%);
	color: #fff;
	padding: 84px 0 128px;
	overflow: hidden;
}

/* Fjällsilhuett i hero-bottnen */
.page-hero::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1px;
	height: 88px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 96' preserveAspectRatio='none'%3E%3Cpath d='M0 96 L0 58 L150 26 L310 54 L470 12 L640 50 L820 18 L1010 52 L1180 28 L1330 56 L1440 36 L1440 96 Z' fill='%230c2129' fill-opacity='0.35'/%3E%3Cpath d='M0 96 L0 74 L200 44 L400 68 L600 32 L800 64 L1000 38 L1200 66 L1440 46 L1440 96 Z' fill='%230c2129'/%3E%3C/svg%3E") no-repeat bottom / 100% 100%;
	pointer-events: none;
}

.page-hero--photo {
	background-size: cover;
	background-position: center 60%;
}

.page-hero--photo::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(12, 33, 41, 0.5) 0%, rgba(12, 33, 41, 0.78) 100%);
}

.page-hero--photo::after {
	display: none;
}

.page-hero__inner {
	position: relative;
	z-index: 1;
	max-width: var(--container);
	margin: 0 auto;
	padding: 0 24px;
}

.page-hero__eyebrow {
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.28em;
	color: #a9cbd6;
	margin: 0 0 18px;
}

.page-hero__title {
	font-size: clamp(2.3rem, 6vw, 3.8rem);
	margin: 0 0 0.35em;
	color: #fff;
	letter-spacing: -0.01em;
	max-width: 20ch;
}

.page-hero__lede {
	font-size: 1.15rem;
	color: #d5e5ea;
	max-width: 36rem;
	margin: 0;
}

.page-hero--sub {
	padding: 48px 0 92px;
}

.page-hero--sub .page-hero__title {
	font-size: clamp(1.9rem, 4.5vw, 2.7rem);
}

.page-hero--sub::after {
	height: 56px;
}

/* ============ Innehåll ============ */
.site-main {
	padding: 52px 0 76px;
}

.site-main--page {
	padding-top: 0;
}

.entry__container {
	max-width: var(--container);
	margin: 0 auto;
	padding: 0 24px;
}

.entry-content {
	max-width: 64rem;
}

.entry-content p {
	max-width: 72ch;
}

.entry-content ul,
.entry-content ol {
	padding-left: 1.4em;
	margin: 0 0 1.2em;
}

.entry-content li {
	margin-bottom: 0.4em;
	max-width: 72ch;
}

.entry-content li::marker {
	color: var(--fjord-500);
}

.entry-content h2 {
	font-size: 1.9rem;
	margin: 2.4em 0 0.8em;
	padding-bottom: 0.3em;
	position: relative;
}

.entry-content h2::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 44px;
	height: 3px;
	border-radius: 2px;
	background: var(--wood-500);
}

.entry-content h3 {
	font-size: 1.35rem;
	margin-top: 1.9em;
}

.entry-content > h2:first-child {
	margin-top: 0;
}

.entry-meta {
	font-size: 0.85rem;
	color: var(--ink-soft);
}

.page-title {
	font-size: 1.8rem;
	margin: 0 0 1.2em;
}

/* ---- Gallerier ---- */
figure.wp-block-gallery.has-nested-images,
ul.wp-block-gallery.has-nested-images {
	display: grid;
	gap: 14px;
	list-style: none;
	margin: 1.6em 0 2.2em;
	padding: 0;
}

.wp-block-gallery.has-nested-images.columns-1 {
	grid-template-columns: 1fr;
}

.wp-block-gallery.has-nested-images.columns-2 {
	grid-template-columns: repeat(2, 1fr);
}

.wp-block-gallery.has-nested-images.columns-3 {
	grid-template-columns: repeat(3, 1fr);
}

.wp-block-gallery.has-nested-images.columns-4 {
	grid-template-columns: repeat(4, 1fr);
}

.wp-block-gallery.has-nested-images.columns-5 {
	grid-template-columns: repeat(5, 1fr);
}

.wp-block-gallery.has-nested-images.columns-6 {
	grid-template-columns: repeat(6, 1fr);
}

figure.wp-block-gallery.has-nested-images > figure,
ul.wp-block-gallery.has-nested-images > li {
	margin: 0;
	border-radius: 8px;
	overflow: hidden;
}

.wp-block-gallery.has-nested-images a {
	display: block;
}

.wp-block-gallery.has-nested-images img {
	width: 100%;
	display: block;
	transition: transform 0.3s ease;
}

.wp-block-gallery.has-nested-images.is-cropped img {
	aspect-ratio: 1 / 1;
	height: auto;
	object-fit: cover;
	object-position: center;
}

/* Mjuk hover-zoom; overflow:hidden i cellen håller zoomen borta från bildtexten. */
figure.wp-block-gallery.has-nested-images > figure:hover img,
ul.wp-block-gallery.has-nested-images > li:hover img {
	transform: scale(1.04);
}

.wp-block-gallery.has-nested-images figcaption {
	font-size: 0.8rem;
	line-height: 1.45;
	color: var(--ink-soft);
	margin-top: 8px;
	padding: 0 2px;
}

/* Enkelt galleriblock (ett enda bild) får breddare bild */
@media (min-width: 600px) {
	.wp-block-gallery.has-nested-images.columns-3 > figure:only-child,
	.wp-block-gallery.has-nested-images.columns-2 > figure:only-child,
	.wp-block-gallery.has-nested-images.columns-3 > li:only-child,
	.wp-block-gallery.has-nested-images.columns-2 > li:only-child {
		grid-column: span 2;
	}
}

@media (max-width: 700px) {
	.wp-block-gallery.has-nested-images.columns-3,
	.wp-block-gallery.has-nested-images.columns-4,
	.wp-block-gallery.has-nested-images.columns-5,
	.wp-block-gallery.has-nested-images.columns-6 {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 440px) {
	.wp-block-gallery.has-nested-images {
		grid-template-columns: 1fr;
	}
}

/* ---- Enkilda bilder ---- */
.entry-content .wp-block-image {
	margin: 1.6em 0;
}

.entry-content .wp-block-image img {
	border-radius: 8px;
}

.entry-content .wp-block-image figcaption {
	font-size: 0.8rem;
	color: var(--ink-soft);
	margin-top: 8px;
}

@media (min-width: 760px) {
	.entry-content figure.alignright {
		float: right;
		width: 42%;
		margin: 0.4em 0 1.2em 2em;
	}

	.entry-content figure.alignleft {
		float: left;
		width: 42%;
		margin: 0.4em 2em 1.2em 0;
	}
}

.alignwide {
	margin-inline: auto;
	max-width: 72rem;
}

/* ---- Citationer ---- */
.entry-content blockquote,
.entry-content .wp-block-quote {
	margin: 1.8em 0;
	padding: 1.2em 1.5em;
	background: var(--card);
	border-left: 4px solid var(--fjord-600);
	border-radius: 0 8px 8px 0;
	box-shadow: var(--shadow-sm);
	font-family: var(--serif);
	font-size: 0.98rem;
}

.entry-content blockquote p,
.entry-content .wp-block-quote p {
	max-width: none;
}

.entry-content blockquote p:last-child,
.entry-content .wp-block-quote p:last-child {
	margin-bottom: 0;
}

/* ---- Knappar ---- */
.wp-block-button .wp-block-button__link,
a.wp-element-button,
.entry-content a.wp-block-button__link {
	display: inline-block;
	background: var(--fjord-700);
	color: #fff !important;
	text-decoration: none;
	padding: 10px 22px;
	border-radius: 8px;
	font-weight: 600;
	font-size: 0.98rem;
	line-height: 1.4;
	transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.wp-block-button .wp-block-button__link:hover,
a.wp-element-button:hover,
.entry-content a.wp-block-button__link:hover {
	background: var(--fjord-900);
	transform: translateY(-1px);
	box-shadow: var(--shadow-md);
}

.wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent;
	color: var(--fjord-700) !important;
	box-shadow: inset 0 0 0 2px var(--fjord-700);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
	background: rgba(31, 82, 99, 0.07);
	box-shadow: inset 0 0 0 2px var(--fjord-900);
	transform: none;
}

/* ---- Förstasidan: "Utforska Sakkavare" som kort ---- */
.front-page .entry-content ul {
	list-style: none;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 14px;
	margin: 0 0 2.6em;
}

.front-page .entry-content ul li {
	margin: 0;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 18px 16px;
	box-shadow: var(--shadow-sm);
	transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.front-page .entry-content ul li:hover {
	transform: translateY(-3px);
	box-shadow: var(--shadow-md);
	border-color: var(--fjord-100);
}

.front-page .entry-content ul a {
	display: block;
	font-weight: 600;
	text-decoration: none;
	color: var(--fjord-800);
	font-size: 1.02rem;
	line-height: 1.4;
}

.front-page .entry-content ul a::after {
	content: " \2192";
	color: var(--fjord-500);
}

/* ---- Historiasidans egna klasser ---- */

/* Tidslinje */
ul.sakkavare-arslista {
	list-style: none;
	padding: 0;
	margin: 1.6em 0 2.2em;
	border-left: 2px solid var(--fjord-100);
}

ul.sakkavare-arslista li {
	position: relative;
	padding: 0 0 1.15em 1.9em;
	max-width: 60ch;
	margin-bottom: 0;
}

ul.sakkavare-arslista li:last-child {
	padding-bottom: 0.2em;
}

ul.sakkavare-arslista li::before {
	content: "";
	position: absolute;
	left: -8px;
	top: 0.5em;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--paper);
	border: 3px solid var(--fjord-600);
}

ul.sakkavare-arslista li strong {
	color: var(--fjord-800);
}

/* Kapitelskort */
.sakkavare-kapitel {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 22px;
	box-shadow: var(--shadow-sm);
	height: 100%;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sakkavare-kapitel:hover {
	transform: translateY(-3px);
	box-shadow: var(--shadow-md);
}

.sakkavare-kapitel h3 {
	font-size: 1.2rem;
	margin-top: 0;
	margin-bottom: 0.5em;
}

.sakkavare-kapitel p:last-child {
	margin-bottom: 0;
}

/* Inbjudan / callout */
.sakkavare-inbjudan {
	background: linear-gradient(135deg, var(--wood-100) 0%, #fbf7ef 100%);
	border: 1px solid #e8d5bc;
	border-radius: var(--radius);
	padding: 28px 30px;
	margin: 2.2em 0;
}

.sakkavare-inbjudan h3 {
	margin-top: 0;
}

/* Källnotering */
p.sakkavare-kalla,
.sakkavare-kalla {
	font-size: 0.85rem;
	color: var(--ink-soft);
	font-style: italic;
	border-left: 3px solid var(--wood-500);
	padding-left: 12px;
	margin-top: 2em;
}

/* Arkivnotis */
p.sakkavare-notis,
.sakkavare-notis {
	background: #fbf3e0;
	border: 1px solid #ecd9b0;
	color: #6b5322;
	border-radius: 8px;
	padding: 14px 18px;
	margin: 0 0 1.8em;
	font-size: 0.95rem;
}

p.sakkavare-notis {
	max-width: none;
}

/* Breddbegränsad brödtext */
.sakkavare-brodtext {
	max-width: 48rem;
}

/* ---- Inläggslistor (blogg, arkiv, sök) ---- */
.post-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 20px;
	list-style: none;
	padding: 0;
	margin: 0 0 2em;
}

.post-card {
	display: flex;
	flex-direction: column;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	overflow: hidden;
	box-shadow: var(--shadow-sm);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.post-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--shadow-md);
}

.post-card__thumb {
	display: block;
	aspect-ratio: 3 / 2;
	overflow: hidden;
	background: var(--fjord-100);
}

.post-card__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.post-card:hover .post-card__thumb img {
	transform: scale(1.035);
}

.post-card__placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	font-family: var(--serif);
	font-size: 1.3rem;
	color: var(--fjord-500);
}

.post-card__body {
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
	padding: 18px 20px 22px;
}

.post-card__title {
	font-size: 1.25rem;
	margin: 0;
}

.post-card__title a {
	color: var(--fjord-900);
	text-decoration: none;
}

.post-card__title a:hover {
	color: var(--fjord-600);
}

.post-card__meta {
	font-size: 0.85rem;
	color: var(--ink-soft);
	margin: 0;
}

.post-card__body .entry-content,
.post-card__body p {
	max-width: none;
	font-size: 0.95rem;
	color: var(--ink-soft);
	margin: 0;
}

.pagination .page-numbers {
	display: inline-block;
	padding: 8px 14px;
	margin-right: 6px;
	border: 1px solid var(--line);
	border-radius: 6px;
	background: var(--card);
	color: var(--ink);
	text-decoration: none;
	font-size: 0.95rem;
}

.pagination .page-numbers:hover {
	border-color: var(--fjord-500);
	color: var(--fjord-800);
}

.pagination .page-numbers.current {
	background: var(--fjord-700);
	border-color: var(--fjord-700);
	color: #fff;
}

/* ---- Sök ---- */
.search-form {
	display: flex;
	gap: 8px;
	margin: 1.5em 0;
	max-width: 28rem;
}

.search-field {
	flex: 1;
	padding: 10px 14px;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--card);
	font: inherit;
	color: var(--ink);
}

.search-submit {
	padding: 10px 20px;
	border: 0;
	border-radius: 8px;
	background: var(--fjord-700);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease;
}

.search-submit:hover {
	background: var(--fjord-900);
}

/* ============ Sidfot ============ */
.site-footer {
	background: var(--fjord-950);
	color: #b9cdd5;
	margin-top: 24px;
}

.site-footer__inner {
	max-width: var(--container);
	margin: 0 auto;
	padding: 52px 24px 36px;
	display: grid;
	grid-template-columns: 1.4fr 1fr;
	gap: 40px;
}

.site-footer__name {
	font-family: var(--serif);
	font-size: 1.3rem;
	font-weight: 700;
	color: #fff;
	margin: 0 0 10px;
}

.site-footer__about p {
	margin: 0 0 8px;
	font-size: 0.95rem;
	max-width: 34rem;
}

.site-footer__nav .menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 8px 16px;
}

.site-footer__nav a {
	color: #cfe0e6;
	text-decoration: none;
	font-size: 0.95rem;
}

.site-footer__nav a:hover {
	color: #fff;
	text-decoration: underline;
}

.site-footer__bottom {
	border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.site-footer__bottom-inner {
	max-width: var(--container);
	margin: 0 auto;
	padding: 16px 24px;
	display: flex;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	font-size: 0.85rem;
	color: #8fa9b3;
}

.site-footer__bottom p {
	margin: 0;
}

@media (max-width: 700px) {
	.site-footer__inner {
		grid-template-columns: 1fr;
		gap: 28px;
		padding-top: 40px;
	}
}

/* ============ Tillgänglighet / rörelse ============ */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}
