/* =========================================================================
   Seglora – formgivning
   1. Tokens          6. Startsidan
   2. Grund           7. Innehåll
   3. Layout          8. Sidopanel, kort, evenemang
   4. Knappar         9. Sidfot
   5. Sidhuvud, meny 10. Kalendern, övrigt
   ========================================================================= */

/* ---------- 1. Tokens ---------- */

:root {
	/* Falu rödfärg från gårdarna, skogsgrönt från ängarna längs Viskan,
	   sand och linne som bakgrund. Den röda är mörkad så att den når 4,5:1
	   mot vitt även som länkfärg. */
	--red-800: #82271f;
	--red-700: #a5352b;
	--red-500: #d0533f;
	--red-50:  #f9ecea;

	--green-900: #1c3328;
	--green-800: #23402f;
	--green-700: #2f5a45;
	--green-100: #dbe7df;
	--green-50:  #eef4f0;

	--sand-200: #ecdfd1;
	--sand-100: #f5efe6;
	--linen:    #fbf8f3;

	--ink:       #1f2723;
	--ink-muted: #5d6661;
	--ink-faint: #8a928d;
	--line:      #e6ddd2;
	--white:     #ffffff;

	--brand:       var(--red-700);
	--brand-dark:  var(--red-800);

	--r-sm: 8px;
	--r-md: 12px;
	--r-lg: 18px;
	--r-xl: 26px;
	--r-full: 999px;

	--shadow-sm: 0 1px 2px rgba(31, 39, 35, .06), 0 2px 8px -4px rgba(31, 39, 35, .12);
	--shadow-md: 0 2px 4px rgba(31, 39, 35, .05), 0 14px 32px -16px rgba(31, 39, 35, .28);
	--shadow-lg: 0 4px 10px rgba(31, 39, 35, .06), 0 28px 60px -28px rgba(31, 39, 35, .45);

	--content: 720px;
	--wide: 1200px;
	--gutter: clamp(1.15rem, 4vw, 2.5rem);

	--font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-display: 'Newsreader', Georgia, 'Times New Roman', serif;

	--step--1: .9375rem;
	--step-0:  1.0625rem;
	--step-1:  clamp(1.15rem, .3vw + 1.08rem, 1.3rem);
	--step-2:  clamp(1.4rem, .8vw + 1.2rem, 1.75rem);
	--step-3:  clamp(1.75rem, 1.5vw + 1.35rem, 2.4rem);
	--step-4:  clamp(2.2rem, 3vw + 1.4rem, 3.5rem);
	--step-5:  clamp(2.6rem, 4.5vw + 1.3rem, 4.75rem);

	--ease: cubic-bezier(.2, .7, .3, 1);
	--speed: 180ms;
	--header-h: 76px;
}

/* ---------- 2. Grund ---------- */

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

html {
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--header-h) + 1rem);
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--linen);
	color: var(--ink);
	font-family: var(--font-sans);
	font-size: var(--step-0);
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-display);
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -.012em;
	margin: 0 0 .5em;
	text-wrap: balance;
	color: var(--ink);
}
h3, h4, h5, h6 { font-weight: 700; letter-spacing: -.005em; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }
h5, h6 { font-size: var(--step-0); }

p { margin: 0 0 1.15em; }

a {
	color: var(--brand);
	text-decoration-thickness: 1px;
	text-underline-offset: .18em;
	transition: color var(--speed) var(--ease);
}
a:hover { color: var(--brand-dark); text-decoration-thickness: 2px; }

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

:focus-visible { outline: 3px solid var(--red-500); outline-offset: 3px; border-radius: 4px; }

::selection { background: var(--red-50); color: var(--ink); }

hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

.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: 1rem; top: -100px; z-index: 1000;
	background: var(--ink); color: #fff; padding: .7rem 1.1rem; border-radius: var(--r-sm);
	font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 1rem; color: #fff; }

.icon { flex: none; display: inline-block; vertical-align: middle; max-width: none; }

/* ---------- 3. Layout ---------- */

.wrap {
	width: 100%;
	max-width: calc(var(--content) + var(--gutter) * 2);
	margin-inline: auto;
	padding-inline: var(--gutter);
}
.wrap--wide { max-width: calc(var(--wide) + var(--gutter) * 2); }

.section { padding-block: clamp(2.5rem, 6vw, 5rem); }
.section--content { padding-top: clamp(2rem, 5vw, 3.75rem); }

.layout { display: grid; gap: clamp(2.5rem, 5vw, 4.5rem); }
.layout__main { min-width: 0; }
.tribe-spacer { height: clamp(1rem, 3vw, 2rem); }

@media (min-width: 64rem) {
	.has-sidebar .layout {
		grid-template-columns: minmax(0, 1fr) 320px;
		align-items: start;
	}
	.has-sidebar .layout__aside { position: sticky; top: calc(var(--header-h) + 1.5rem); }
	.admin-bar.has-sidebar .layout__aside { top: calc(var(--header-h) + 1.5rem + 32px); }
	.has-sidebar .layout--full { grid-template-columns: minmax(0, 1fr); }
}

.eyebrow {
	display: inline-flex; align-items: center; gap: .55rem;
	margin: 0 0 .6rem;
	font-size: .8125rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
	color: var(--brand);
}
.eyebrow::before {
	content: ""; width: 1.75rem; height: 2px; border-radius: 2px; background: currentColor;
}

/* ---------- 4. Knappar ---------- */

.btn,
.wp-block-button__link,
.wp-element-button {
	display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
	min-height: 48px;
	padding: .7rem 1.4rem;
	border-radius: var(--r-full);
	border: 2px solid transparent;
	font-family: var(--font-sans);
	font-size: 1rem; font-weight: 600; line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color var(--speed) var(--ease), color var(--speed) var(--ease), border-color var(--speed) var(--ease), transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.btn:active { transform: translateY(1px); }

.btn--primary,
.wp-block-button__link:not(.has-background),
.wp-element-button:not(.has-background) { background: var(--brand); color: #fff; }
.btn--primary:hover,
.wp-block-button__link:not(.has-background):hover { background: var(--brand-dark); color: #fff; box-shadow: var(--shadow-md); }

.btn--light { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .7); backdrop-filter: blur(6px); }
.btn--light:hover { background: #fff; color: var(--ink); border-color: #fff; }

.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn--ghost .icon { transition: transform var(--speed) var(--ease); }
.btn--ghost:hover .icon { transform: translateX(3px); }

.is-style-outline > .wp-block-button__link:not(.has-background),
.wp-block-button__link.is-style-outline { background: transparent; color: var(--brand); border-color: currentColor; }
.is-style-outline > .wp-block-button__link:hover { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---------- 5. Sidhuvud och meny ---------- */

.site-header {
	position: sticky; top: 0; z-index: 100;
	border-bottom: 1px solid transparent;
	transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.site-header::before {
	/* Suddningen ligger på ett eget lager. På själva sidhuvudet skulle den
	   bli referensram för mobilmenyns position: fixed. */
	content: ""; position: absolute; inset: 0; z-index: -1;
	background: rgba(251, 248, 243, .9);
	backdrop-filter: saturate(1.4) blur(12px);
	-webkit-backdrop-filter: saturate(1.4) blur(12px);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .site-header { top: 0; } }
.site-header.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 10px 30px -24px rgba(31, 39, 35, .5); }

.site-header__inner {
	display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
	min-height: var(--header-h);
}

.brand { flex: none; }
.brand .custom-logo { max-height: 56px; width: auto; }
.brand__link { display: inline-flex; align-items: center; gap: .8rem; color: var(--ink); text-decoration: none; }
.brand__link:hover { color: var(--ink); }
.brand__mark { width: 44px; height: 44px; color: var(--brand); flex: none; transition: transform .4s var(--ease); }
.brand__link:hover .brand__mark { transform: rotate(-4deg) scale(1.04); }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; letter-spacing: -.015em; }
.brand__tagline { font-size: .8125rem; color: var(--ink-muted); margin-top: .2rem; }

/* Menyknapp (mobil) */
.nav-toggle {
	display: inline-flex; align-items: center; gap: .5rem;
	min-height: 46px; padding: .5rem 1rem;
	border: 1px solid var(--line); border-radius: var(--r-full);
	background: var(--white); color: var(--ink);
	font: 600 .95rem var(--font-sans); cursor: pointer;
}
.nav-toggle__icon { display: inline-grid; width: 22px; height: 22px; }
.nav-toggle__icon .icon { grid-area: 1 / 1; transition: opacity var(--speed), transform var(--speed); }
.nav-toggle .icon--close { opacity: 0; transform: rotate(-45deg); }
.nav-toggle[aria-expanded="true"] .icon--menu { opacity: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .icon--close { opacity: 1; transform: none; }

.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav a { text-decoration: none; color: var(--ink); }
.submenu-toggle {
	display: inline-grid; place-items: center;
	width: 40px; height: 40px; padding: 0;
	border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink-muted); cursor: pointer;
}
.submenu-toggle .icon { transition: transform var(--speed) var(--ease); }
.submenu-toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }
.submenu-toggle:hover { background: var(--sand-100); color: var(--ink); }

/* Mobilmeny: en panel under sidhuvudet. */
@media (max-width: 68.74rem) {
	.site-nav {
		display: none;
		position: fixed; inset: var(--header-h) 0 0 0;
		background: var(--linen);
		overflow-y: auto; overscroll-behavior: contain;
		padding: 1rem var(--gutter) 3rem;
		border-top: 1px solid var(--line);
	}
	.admin-bar .site-nav { top: calc(var(--header-h) + 46px); }
	.site-nav.is-open { display: block; animation: nav-in .22s var(--ease); }
	html.nav-open { overflow: hidden; }

	.site-nav .menu-item { position: relative; }
	.site-nav .menu > li { border-bottom: 1px solid var(--line); }
	.site-nav .menu-item__row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
	.site-nav a { display: block; flex: 1; padding: .85rem 0; font-size: 1.125rem; font-weight: 600; }
	.site-nav .sub-menu { display: none; padding: 0 0 .75rem .9rem; border-left: 2px solid var(--sand-200); margin-left: .25rem; }
	.site-nav .sub-menu a { padding: .55rem 0; font-size: 1rem; font-weight: 500; color: var(--ink-muted); }
	.site-nav .is-expanded > .sub-menu { display: block; }
	.site-nav .current-menu-item > .menu-item__row > a,
	.site-nav .current-menu-item > a { color: var(--brand); }
}

@keyframes nav-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* Skrivbordsmeny */
@media (min-width: 68.75rem) {
	.nav-toggle { display: none; }
	.site-nav .menu { display: flex; align-items: center; gap: .15rem; }
	.site-nav .menu > li { position: relative; }
	.site-nav .menu > li > .menu-item__row { display: flex; align-items: center; }
	.site-nav .menu > li > .menu-item__row > a,
	.site-nav .menu > li > a {
		display: block; padding: .55rem .8rem; border-radius: var(--r-full);
		font-size: .9375rem; font-weight: 600; white-space: nowrap;
		transition: background-color var(--speed), color var(--speed);
	}
	.site-nav .menu > li.menu-item-has-children > .menu-item__row > a { padding-right: .2rem; }
	.site-nav .menu > li > .menu-item__row > a:hover,
	.site-nav .menu > li > a:hover { background: var(--sand-100); color: var(--brand); }
	.site-nav .menu > .current-menu-item > .menu-item__row > a,
	.site-nav .menu > .current-menu-item > a,
	.site-nav .menu > .current-menu-ancestor > .menu-item__row > a,
	.site-nav .menu > .current-menu-parent > .menu-item__row > a { color: var(--brand); }
	.site-nav .menu > li > .menu-item__row > .submenu-toggle { width: 30px; height: 30px; margin-left: -.15rem; }

	/* Utfällbar panel. Djupare nivåer listas indragna i samma panel i stället
	   för att fälla ut åt sidan – lättare att träffa och läsa. */
	.site-nav .menu > li > .sub-menu {
		position: absolute; top: calc(100% + .5rem); left: 0;
		min-width: 270px; max-width: min(640px, 90vw);
		padding: .75rem;
		background: var(--white);
		border: 1px solid var(--line); border-radius: var(--r-lg);
		box-shadow: var(--shadow-lg);
		opacity: 0; visibility: hidden; transform: translateY(6px);
		transition: opacity var(--speed) var(--ease), transform var(--speed) var(--ease), visibility 0s linear var(--speed);
	}
	.site-nav .menu > li:last-child > .sub-menu,
	.site-nav .menu > li:nth-last-child(2) > .sub-menu { left: auto; right: 0; }
	.site-nav .menu > li > .sub-menu::before { content: ""; position: absolute; inset: -.6rem 0 auto; height: .6rem; }
	.site-nav .menu > li.is-expanded > .sub-menu,
	.site-nav .menu > li:hover > .sub-menu {
		opacity: 1; visibility: visible; transform: none;
		transition: opacity var(--speed) var(--ease), transform var(--speed) var(--ease), visibility 0s;
	}
	.site-nav .menu > li > .sub-menu.is-mega { width: 600px; column-count: 2; column-gap: .75rem; }
	.site-nav .sub-menu > li { break-inside: avoid; }
	.site-nav .sub-menu .submenu-toggle { display: none; }
	.site-nav .sub-menu a {
		display: block; padding: .5rem .75rem; border-radius: var(--r-sm);
		font-size: .9375rem; font-weight: 600; line-height: 1.35;
	}
	.site-nav .sub-menu a:hover { background: var(--sand-100); color: var(--brand); }
	.site-nav .sub-menu .sub-menu { margin: 0 0 .35rem .75rem; padding-left: .5rem; border-left: 2px solid var(--sand-100); }
	.site-nav .sub-menu .sub-menu a { font-weight: 500; color: var(--ink-muted); padding-block: .35rem; font-size: .9rem; }
	.site-nav .sub-menu .current-menu-item > .menu-item__row > a,
	.site-nav .sub-menu .current-menu-item > a { color: var(--brand); background: var(--red-50); }
	.site-nav .menu-item__row { display: block; }
}

/* ---------- 6. Startsidan ---------- */

.hero {
	position: relative; isolation: isolate;
	display: flex; align-items: flex-end;
	min-height: clamp(460px, 74vh, 780px);
	padding-block: clamp(3rem, 8vw, 6rem);
	background: var(--green-800);
	color: #fff;
	overflow: hidden;
}
.hero--has-quick { padding-bottom: calc(clamp(3rem, 8vw, 6rem) + 3.5rem); }
.hero__media { position: absolute; inset: 0; z-index: -1; }
.hero__img { width: 100%; height: 100%; object-fit: cover; animation: hero-in 1.6s var(--ease) both; }
.hero__media::after {
	content: ""; position: absolute; inset: 0;
	background:
		linear-gradient(180deg, rgba(20, 30, 25, .25) 0%, rgba(20, 30, 25, 0) 30%),
		linear-gradient(15deg, rgba(20, 30, 25, .78) 0%, rgba(20, 30, 25, .35) 45%, rgba(20, 30, 25, 0) 75%);
}
@keyframes hero-in { from { transform: scale(1.06); opacity: .6; } to { transform: none; opacity: 1; } }

.hero__body { position: relative; }
.hero__eyebrow {
	display: inline-flex; align-items: center; gap: .6rem; margin: 0 0 1rem;
	font-size: .875rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
	color: rgba(255, 255, 255, .92);
}
.hero__eyebrow::before { content: ""; width: 2.25rem; height: 2px; background: var(--red-500); border-radius: 2px; }
.hero__title {
	max-width: 15ch; margin: 0 0 1.25rem;
	font-size: var(--step-5); font-weight: 600; line-height: 1.03; letter-spacing: -.025em;
	color: #fff; text-shadow: 0 2px 30px rgba(0, 0, 0, .25);
}
.hero__text { max-width: 46ch; font-size: var(--step-1); color: rgba(255, 255, 255, .92); margin-bottom: 1.75rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 0; }

.quicklinks { position: relative; z-index: 2; margin-top: -3.5rem; }
.quicklinks__list {
	list-style: none; margin: 0; padding: 0;
	display: grid; gap: .75rem;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}
.quicklink {
	display: flex; align-items: center; gap: .9rem;
	height: 100%; padding: 1.1rem 1.15rem;
	background: var(--white); color: var(--ink);
	border: 1px solid var(--line); border-radius: var(--r-lg);
	box-shadow: var(--shadow-md);
	text-decoration: none; font-weight: 600; line-height: 1.3;
	transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease), border-color var(--speed);
}
.quicklink:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--sand-200); color: var(--ink); }
.quicklink__icon {
	display: grid; place-items: center; flex: none;
	width: 46px; height: 46px; border-radius: 14px;
	background: var(--red-50); color: var(--brand);
	transition: background-color var(--speed), color var(--speed);
}
.quicklink:hover .quicklink__icon { background: var(--brand); color: #fff; }
.quicklink__label { flex: 1; }
.quicklink__arrow { color: var(--ink-faint); transition: transform var(--speed) var(--ease), color var(--speed); }
.quicklink:hover .quicklink__arrow { transform: translateX(3px); color: var(--brand); }

@media (max-width: 24rem) { .brand__tagline { display: none; } }
@media (max-width: 40rem) {
	.quicklinks { margin-top: -2.5rem; }
	.hero--has-quick { padding-bottom: calc(3rem + 2.5rem); }
	.quicklinks__list { grid-template-columns: 1fr 1fr; gap: .6rem; }
	.quicklink { flex-direction: column; align-items: flex-start; gap: .65rem; padding: 1rem; font-size: .975rem; }
	.quicklink__arrow { display: none; }
	.hero__actions .btn { flex: 1 1 auto; }
}

.section__head {
	display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem;
	margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}
.section__title { margin: 0; font-size: var(--step-4); }

.section--events { padding-top: clamp(3rem, 7vw, 5rem); }
.section--events + .section--content { background: var(--white); border-top: 1px solid var(--line); padding-top: clamp(2.5rem, 6vw, 4.5rem); }

/* ---------- 7. Innehåll ---------- */

.page-head { position: relative; isolation: isolate; background: var(--sand-100); border-bottom: 1px solid var(--line); }
.page-head__body { position: relative; padding-block: clamp(2.25rem, 6vw, 4rem) clamp(1.75rem, 4vw, 2.75rem); max-width: calc(var(--wide) + var(--gutter) * 2); }
.page-head__title { margin: 0; font-size: var(--step-4); max-width: 22ch; }
.page-head__sub { margin: .6rem 0 0; color: var(--ink-muted); }

.page-head--image { display: flex; align-items: flex-end; min-height: clamp(300px, 46vh, 520px); color: #fff; border-bottom: 0; background: var(--green-800); overflow: hidden; }
.page-head--image .page-head__body { width: 100%; }
.page-head__media { position: absolute; inset: 0; z-index: -1; }
.page-head__img { width: 100%; height: 100%; object-fit: cover; }
.page-head__media::after {
	content: ""; position: absolute; inset: 0;
	background: linear-gradient(0deg, rgba(20, 30, 25, .78) 0%, rgba(20, 30, 25, .25) 55%, rgba(20, 30, 25, .1) 100%);
}
.page-head--image .page-head__title { color: #fff; text-shadow: 0 2px 24px rgba(0, 0, 0, .3); }
.page-head--image .page-head__sub { color: rgba(255, 255, 255, .85); }

.crumbs ol { list-style: none; margin: 0 0 .9rem; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem .5rem; font-size: .875rem; color: var(--ink-muted); }
.crumbs li { display: inline-flex; align-items: center; gap: .5rem; }
.crumbs li + li::before { content: "/"; opacity: .5; }
.crumbs a { color: inherit; text-decoration: none; }
.crumbs a:hover { color: var(--brand); text-decoration: underline; }
.page-head--image .crumbs ol { color: rgba(255, 255, 255, .85); }
.page-head--image .crumbs a:hover { color: #fff; }

/* Brödtext */
.entry-content { font-size: var(--step-0); }
.entry-content > * { margin-top: 0; margin-bottom: 1.25rem; }
.entry-content > *:last-child { margin-bottom: 0; }
.entry-content h2 { margin-top: 2.75rem; }
.entry-content h3 { margin-top: 2.25rem; }
.entry-content h4 { margin-top: 1.75rem; }
.entry-content > h2:first-child,
.entry-content > h3:first-child { margin-top: 0; }
.entry-content ul, .entry-content ol { padding-left: 1.3rem; }
.entry-content li { margin-bottom: .35rem; }
.entry-content li::marker { color: var(--brand); }
.entry-content strong { font-weight: 650; }

/* Text som klistrats in från andra program bär ofta egna typsnitt och
   storlekar. Låt temats typografi gälla – utan att röra det som är sparat. */
.entry-content span[style*="font-family"],
.entry-content span[style*="font-size"],
.entry-content p[style*="font-family"] { font-family: inherit !important; font-size: inherit !important; }
.entry-content span[style*="background-color: #ffffff"],
.entry-content span[style*="background-color:#ffffff"] { background-color: transparent !important; }

/* Bilder */
.entry-content img { border-radius: var(--r-md); }
.entry-content figure { margin-inline: 0; }
.entry-content .wp-block-image { margin-block: 2rem; }
.entry-content .wp-block-image.aligncenter,
.entry-content .aligncenter { margin-inline: auto; text-align: center; }
.entry-content .aligncenter img { margin-inline: auto; }
.entry-content .alignleft { float: left; clear: both; margin: .3rem 1.75rem 1rem 0; max-width: 50%; }
.entry-content .alignright { float: right; clear: both; margin: .3rem 0 1rem 1.75rem; max-width: 50%; }
/* Rubriker, gallerier och kolumner börjar alltid under en flytande bild. */
.entry-content :is(h1, h2, h3, h4, .wp-block-gallery, .wp-block-columns, .wp-block-group, hr, .wp-block-separator) { clear: both; }
.entry-content .wp-block-image.alignleft,
.entry-content .wp-block-image.alignright { margin-top: .3rem; margin-bottom: 1rem; }
.entry-content::after { content: ""; display: table; clear: both; }
@media (max-width: 40rem) {
	.entry-content .alignleft, .entry-content .alignright { float: none; margin: 1.5rem 0; max-width: 100%; }
}
.entry-content figcaption,
.wp-element-caption {
	margin-top: .6rem; font-size: .875rem; line-height: 1.5; color: var(--ink-muted); text-align: left;
}
.entry-content .aligncenter figcaption { text-align: center; }
.entry-content .alignwide { margin-inline: calc(var(--gutter) * -0); }

/* Gallerier */
.entry-content .wp-block-gallery { margin-block: 2rem; }
.entry-content .wp-block-gallery.has-nested-images figure.wp-block-image { margin: 0; min-width: 0; }
.entry-content .wp-block-gallery img { border-radius: var(--r-sm); }
.entry-content .wp-block-gallery.has-nested-images figure.wp-block-image figcaption {
	border-radius: 0 0 var(--r-sm) var(--r-sm); font-size: .8125rem;
}
.entry-content .blocks-gallery-caption { text-align: center; }

/* Grupper med bakgrund får luft och runda hörn. */
.entry-content .wp-block-group.has-background,
.entry-content .wp-block-columns.has-background { padding: clamp(1.25rem, 3vw, 2rem); border-radius: var(--r-lg); }
.entry-content .wp-block-columns { gap: 1.5rem 2rem; margin-block: 2rem; }

.entry-content blockquote,
.entry-content .wp-block-quote {
	margin: 2rem 0; padding: .25rem 0 .25rem 1.5rem;
	border-left: 3px solid var(--brand);
	font-family: var(--font-display); font-size: var(--step-1); line-height: 1.5;
}
.entry-content blockquote cite { display: block; margin-top: .5rem; font-family: var(--font-sans); font-size: .875rem; font-style: normal; color: var(--ink-muted); }

.entry-content .wp-block-table table,
.entry-content > table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.entry-content .wp-block-table :is(th, td),
.entry-content > table :is(th, td) { padding: .65rem .8rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.entry-content .wp-block-table th,
.entry-content > table th { font-weight: 650; background: var(--sand-100); }
.entry-content .wp-block-table { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md); }
.entry-content .wp-block-table table { margin: 0; border: 0; }
.entry-content .wp-block-table :is(th, td) { border: 0; border-bottom: 1px solid var(--line); }
.entry-content .wp-block-table tr:last-child td { border-bottom: 0; }
.entry-content .wp-block-table tr:nth-child(even) td { background: var(--linen); }
.entry-content .wp-block-table td:last-child:not(:first-child) { white-space: nowrap; text-align: right; font-weight: 650; }
/* Kolumner med bild + text: bilden fyller sin kolumn. */
.entry-content .wp-block-columns + .wp-block-columns { margin-top: -.25rem; }
.entry-content :is(.wp-block-group, .wp-block-column) > :last-child { margin-bottom: 0; }
.entry-content :is(.wp-block-group, .wp-block-column) > :first-child { margin-top: 0; }
.entry-content .wp-block-column > .wp-block-image:first-child { margin-top: 0; }
.entry-content .wp-block-column > .wp-block-image { margin-bottom: 1rem; }
.entry-content .wp-block-column > .wp-block-image a { display: block; }
.entry-content .wp-block-column > .wp-block-image img { width: 100%; height: auto; }
.entry-content .has-large-font-size { line-height: 1.5; }
.entry-content .wp-block-column > .wp-block-image + .wp-block-heading { margin-top: 0; }
.entry-content .wp-block-column h3 a { color: inherit; text-decoration: none; }
.entry-content .wp-block-column h3 a:hover { color: var(--brand); text-decoration: underline; }

.entry-content .wp-block-file { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; padding: 1rem 1.15rem; background: var(--sand-100); border-radius: var(--r-md); }
.entry-content .wp-block-file__button { margin: 0 !important; border-radius: var(--r-full); padding: .5rem 1rem; background: var(--brand); color: #fff; text-decoration: none; font-size: .9rem; font-weight: 600; }
.entry-content .wp-block-separator { border: 0; border-top: 1px solid var(--line); margin-block: 2.5rem; }
.entry-content .wp-block-buttons { margin-block: 1.75rem; }
.entry-content iframe { max-width: 100%; border-radius: var(--r-md); }

/* Färgklasser från paletten. */
.has-falurod-color { color: var(--red-700) !important; }
.has-skog-color { color: var(--green-700) !important; }
.has-sand-background-color { background-color: var(--sand-100) !important; }
.has-ljusgron-background-color { background-color: var(--green-50) !important; }

/* Undersidor */
.subpages { margin-top: clamp(2.5rem, 6vw, 4rem); padding-top: 2rem; border-top: 1px solid var(--line); }
.subpages__title { font-size: var(--step-2); margin-bottom: 1.25rem; }

/* ---------- 8. Sidopanel, kort, evenemang ---------- */

.sidebar { display: grid; gap: 1.25rem; }
.sidebar .widget:empty { display: none; }
.sidebar .widget {
	padding: 1.4rem 1.4rem 1.5rem;
	background: var(--white);
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	font-size: .9375rem;
}
.home .sidebar .widget { background: var(--linen); }
.widget__title,
.sidebar .widget h2 {
	margin: 0 0 1rem;
	font-family: var(--font-display); font-size: 1.3rem; font-weight: 700;
}
.widget__more { margin: 1rem 0 0; }
.widget__more a { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; text-decoration: none; }
.widget__more a:hover .icon { transform: translateX(3px); }
.widget__more .icon { transition: transform var(--speed) var(--ease); }

/* Bildwidgetar (broschyrer, Kyrknytt): bilden som en liten trycksak, texten bredvid. */
.sidebar .widget_block > .wp-block-image,
.sidebar .widget_block .wp-block-image { margin: 0; display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 1rem; }
.sidebar .widget_block .wp-block-image img {
	width: 96px !important; height: auto !important;
	border-radius: 4px; box-shadow: var(--shadow-md);
	transition: transform var(--speed) var(--ease);
}
.sidebar .widget_block .wp-block-image a:hover img { transform: rotate(-2deg) scale(1.03); }
.sidebar .widget_block .wp-block-image figcaption { margin: 0; font-size: 1rem; font-weight: 600; color: var(--ink); line-height: 1.35; }
.sidebar .widget_block .wp-block-image figcaption a { text-decoration: none; }
.sidebar .widget_block .wp-block-image figcaption a:hover { text-decoration: underline; }
.sidebar .widget_block .wp-block-image > a { display: block; }

/* Kort */
.cards {
	list-style: none; margin: 0; padding: 0;
	display: grid; gap: 1rem;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
}
.cards--wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 1.5rem; }
.card { margin: 0; }
.card__link {
	display: flex; flex-direction: column; height: 100%;
	background: var(--white); color: var(--ink); text-decoration: none;
	border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
	transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.card__link:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); color: var(--ink); }
.card__media { display: block; aspect-ratio: 3 / 2; background: var(--sand-100); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; transition: transform .5s var(--ease); }
.card__link:hover .card__media img { transform: scale(1.04); }
.card__placeholder { display: grid; place-items: center; height: 100%; color: var(--brand); opacity: .7; }
.card__body { display: flex; flex-direction: column; gap: .35rem; flex: 1; padding: 1rem 1.15rem 1.15rem; }
.card__meta { font-size: .8125rem; color: var(--ink-muted); }
.card__title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; line-height: 1.25; }
.card__excerpt { font-size: .925rem; color: var(--ink-muted); }
.card__more { margin-top: auto; padding-top: .35rem; display: inline-flex; align-items: center; gap: .35rem; font-size: .875rem; font-weight: 600; color: var(--brand); }

/* Evenemang */
.events { list-style: none; margin: 0; padding: 0; }
.events--cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }
.events--compact { display: grid; gap: .25rem; }
.event__link { display: flex; gap: 1rem; align-items: flex-start; color: var(--ink); text-decoration: none; }
.event__date {
	flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
	width: 58px; height: 62px; border-radius: var(--r-md);
	background: var(--red-50); color: var(--brand);
	line-height: 1;
}
.event__day { font-family: var(--font-display); font-size: 1.65rem; font-weight: 700; }
.event__month { margin-top: .2rem; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.event__body { display: flex; flex-direction: column; gap: .3rem; min-width: 0; flex: 1; }
.event__title { font-weight: 650; line-height: 1.3; }
.event__meta { display: flex; flex-wrap: wrap; gap: .2rem .9rem; font-size: .875rem; color: var(--ink-muted); }
.event__meta > span { display: inline-flex; align-items: center; gap: .3rem; }
.event__weekday { font-weight: 600; color: var(--ink); }
.event__thumb { flex: none; width: 64px; height: 64px; border-radius: var(--r-sm); overflow: hidden; }
.event__thumb img { width: 100%; height: 100%; object-fit: cover; }

.events--cards .event__link {
	height: 100%; padding: 1.15rem; background: var(--white);
	border: 1px solid var(--line); border-radius: var(--r-lg);
	transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease), border-color var(--speed);
}
.events--cards .event__link:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--sand-200); }
.events--cards .event__title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; }
.events--cards .event__link:hover .event__title { color: var(--brand); }
.events--cards .event__date { background: var(--brand); color: #fff; }

.events--compact .event__link { padding: .6rem; margin-inline: -.6rem; border-radius: var(--r-md); transition: background-color var(--speed); }
.events--compact .event__link:hover { background: var(--sand-100); }
.events--compact .event__link:hover .event__title { color: var(--brand); }
.events--compact .event__date { width: 50px; height: 54px; }
.events--compact .event__day { font-size: 1.4rem; }
.events--compact .event__title { font-size: .975rem; }
.events--compact .event__meta { font-size: .8125rem; }
.events-empty { color: var(--ink-muted); }

/* ---------- 9. Sidfot ---------- */

.site-footer {
	margin-top: 0;
	background: var(--green-900);
	color: rgba(255, 255, 255, .82);
	font-size: .95rem;
	padding-top: clamp(3rem, 7vw, 4.5rem);
}
.site-footer a { color: #fff; }
.site-footer a:hover { color: #f3c9c1; }
.site-footer__grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); padding-bottom: 2.5rem; }
.site-footer__brand .brand__link { color: #fff; }
.site-footer__brand .brand__mark { color: var(--red-700); }
.site-footer__tagline { margin: .9rem 0 0; color: rgba(255, 255, 255, .7); max-width: 28ch; }
.site-footer .widget { margin: 0; }
.site-footer .widget + .widget { margin-top: .75rem; }
.site-footer .widget p { margin: 0 0 .4rem; }
.site-footer .widget__title { color: #fff; font-size: 1.1rem; margin-bottom: .6rem; }
.site-footer__col { padding-top: .35rem; }
.site-footer__base {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.5rem;
	padding-block: 1.25rem 1.5rem; border-top: 1px solid rgba(255, 255, 255, .12);
	font-size: .85rem; color: rgba(255, 255, 255, .6);
}
.site-footer__base p { margin: 0; }
.site-footer__base a { color: rgba(255, 255, 255, .75); }
.site-footer__menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }

/* ---------- 10. Kalendern, övrigt ---------- */

/* The Events Calendars egna sidor (kalender och enskilda evenemang). */
.tribe-events-pg-template,
#tribe-events-pg-template {
	max-width: calc(var(--wide) + var(--gutter) * 2) !important;
	margin: 0 auto !important;
	padding: clamp(2rem, 5vw, 3.5rem) var(--gutter) clamp(3rem, 6vw, 4.5rem) !important;
}
.tribe-events-pg-template .tribe-events,
.tribe-common.tribe-events { font-family: var(--font-sans); }
.tribe-events .tribe-events-l-container { padding-top: 0 !important; }
.tribe-common .tribe-common-h1, .tribe-common .tribe-common-h2, .tribe-common .tribe-common-h3,
.tribe-events-single-event-title,
.tribe-events .tribe-events-calendar-list__event-title { font-family: var(--font-display) !important; }
.layout__main .tribe-common-l-container { padding-inline: 0 !important; }
.tribe-events-single-event-title { font-size: var(--step-4) !important; line-height: 1.1 !important; }
.tribe-events-single .tribe-events-event-image img { border-radius: var(--r-md); }
.tribe-events-single .tribe-events-single-event-description { font-size: var(--step-0); line-height: 1.7; }
.tribe-events .tribe-events-c-top-bar__datepicker-button,
.tribe-events .tribe-events-header { font-family: var(--font-sans); }
.tribe-events-c-subscribe-dropdown__container, .tribe-events-c-ical { display: none !important; }

/* Sök */
.search-form { display: flex; max-width: 520px; }
.search-form__input {
	flex: 1; min-width: 0; min-height: 48px; padding: .6rem 1rem;
	border: 1px solid var(--line); border-right: 0; border-radius: var(--r-full) 0 0 var(--r-full);
	background: var(--white); font: inherit; color: var(--ink);
}
.search-form__input:focus { outline: none; border-color: var(--brand); }
.search-form__btn {
	display: grid; place-items: center; width: 56px; border: 0; border-radius: 0 var(--r-full) var(--r-full) 0;
	background: var(--brand); color: #fff; cursor: pointer;
}
.search-again { margin-bottom: 2rem; }

/* Sidnumrering */
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 2.5rem; }
.pagination .page-numbers {
	display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 .9rem;
	border: 1px solid var(--line); border-radius: var(--r-full); background: var(--white);
	color: var(--ink); text-decoration: none; font-weight: 600;
}
.pagination .page-numbers.current { background: var(--brand); border-color: var(--brand); color: #fff; }
.post-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-weight: 600; }

/* "Redigera den här sidan" – syns bara för inloggade. */
.edit-fab {
	position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 90;
	display: inline-flex; align-items: center; gap: .5rem;
	padding: .8rem 1.2rem; border-radius: var(--r-full);
	background: var(--brand); color: #fff; text-decoration: none;
	font-weight: 600; font-size: .95rem;
	box-shadow: 0 10px 30px -10px rgba(130, 39, 31, .6);
	transition: transform var(--speed) var(--ease), background-color var(--speed);
}
.edit-fab:hover { background: var(--brand-dark); color: #fff; transform: translateY(-2px); }
.nav-open .edit-fab { display: none; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media print {
	.site-header, .site-footer, .sidebar, .quicklinks, .edit-fab, .hero__actions { display: none !important; }
	.hero, .page-head--image { min-height: 0; color: #000; }
	.hero__media, .page-head__media { display: none; }
	.hero__title, .page-head--image .page-head__title { color: #000; text-shadow: none; }
	body { background: #fff; }
}
