/* SShK Theme – bas, typografi, layout, kort, footer. Mobile first.
   Färger och fontstorlekar kommer från theme.json; spacing-tokens definieras här. */

:root {
	--sshk-red: var(--wp--preset--color--sshk-red, #ab192d);
	--sshk-yellow: var(--wp--preset--color--sshk-yellow, #f5c65d);
	--sshk-green: var(--wp--preset--color--sshk-green, #1b5633);
	--sshk-blue: var(--wp--preset--color--sshk-blue, #002f87);
	--sshk-ink: var(--wp--preset--color--ink-black, #212122);
	--sshk-white: var(--wp--preset--color--sennen-white, #fdfbf3);
	--sshk-line: rgba(33, 33, 34, 0.14);

	/* Spacing-skala (xs–2xl). Används överallt i stället för lösa värden. */
	--sshk-space-xs: 0.25rem;
	--sshk-space-sm: 0.5rem;
	--sshk-space-md: 1rem;
	--sshk-space-lg: 1.5rem;
	--sshk-space-xl: 2.5rem;
	--sshk-space-2xl: 4rem;

	--sshk-content: 46rem;
	--sshk-wide: 75rem;
	--sshk-gutter: var(--sshk-space-md);
	--sshk-radius: 8px;
	--sshk-focus: 3px solid var(--sshk-blue);
	--sshk-measure: 70ch;
}

@media (min-width: 48em) {
	:root {
		--sshk-gutter: var(--sshk-space-xl);
		--sshk-space-xl: 3rem;
		--sshk-space-2xl: 5rem;
	}
}

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

html { -webkit-text-size-adjust: 100%; }
body { margin: 0; overflow-wrap: break-word; overflow-x: clip; }

img, video, iframe, svg { max-width: 100%; height: auto; }
table { width: 100%; max-width: 100%; border-collapse: collapse; }
.entry-content table { display: block; overflow-x: auto; }

a { text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: var(--sshk-focus); outline-offset: 2px; }

.screen-reader-text {
	position: absolute;
	width: 1px; height: 1px;
	margin: -1px; padding: 0; border: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}
.skip-link:focus {
	position: fixed; top: var(--sshk-space-sm); left: var(--sshk-space-sm); z-index: 100000;
	width: auto; height: auto; margin: 0; padding: 0.75rem var(--sshk-space-md);
	clip-path: none;
	background: var(--sshk-yellow); color: var(--sshk-ink);
	font-weight: 600;
}

/* Typografi: gäller temats egna mallar (.entry-content, .entry__*), inte Elementor. */
.entry__title, .archive-header__title { margin: 0 0 var(--sshk-space-md); text-wrap: balance; }
.entry-content > * + * { margin-top: var(--sshk-space-md); }
.entry-content > :is(h2, h3, h4, h5, h6) { margin-top: var(--sshk-space-xl); margin-bottom: calc(-1 * var(--sshk-space-xs)); }
.entry-content p, .entry-content li { max-width: var(--sshk-measure); }
.entry-content :is(ul, ol) { padding-left: 1.25em; }
.entry-content li + li { margin-top: var(--sshk-space-xs); }
.entry-content .lead, .entry-content .has-large-font-size { font-weight: 600; line-height: 1.5; }
.entry-content a { text-decoration-color: var(--sshk-red); }
.entry-content blockquote { margin-inline: 0; padding-left: var(--sshk-space-lg); border-left: 4px solid var(--sshk-yellow); }

/* Layout */
.container {
	width: 100%;
	max-width: calc(var(--sshk-content) + 2 * var(--sshk-gutter));
	margin-inline: auto;
	padding: var(--sshk-space-xl) var(--sshk-gutter) var(--sshk-space-2xl);
}
.site-main:focus { outline: none; }
.entry__content .alignwide,
.entry-content .alignwide { max-width: min(var(--sshk-wide), 100vw - 2 * var(--sshk-gutter)); }

/* Poster i listor */
.entry { margin-bottom: var(--sshk-space-xl); padding-bottom: var(--sshk-space-xl); border-bottom: 1px solid var(--sshk-line); }
.single .entry, .page .entry { border-bottom: 0; padding-bottom: 0; }
.entry__title a { color: inherit; text-decoration: none; }
.entry__title a:hover { text-decoration: underline; }
.entry__meta { margin: calc(-1 * var(--sshk-space-sm)) 0 var(--sshk-space-md); font-size: 0.9375rem; color: rgba(33, 33, 34, 0.75); }
.entry__thumbnail { margin-bottom: var(--sshk-space-lg); }
.entry__thumbnail img { border-radius: var(--sshk-radius); display: block; }
.archive-header { margin-bottom: var(--sshk-space-xl); }

/* Kort. Klass .sshk-card eller blockstilen "Kort" på Grupp-blocket.
   Elementor-widgets rörs inte; lägg klassen på en widget/sektion vid behov. */
.sshk-card,
.wp-block-group.is-style-sshk-card {
	padding: var(--sshk-space-lg);
	background: #fff;
	border: 1px solid var(--sshk-line);
	border-radius: var(--sshk-radius);
}
.sshk-card > :first-child { margin-top: 0; }
.sshk-card > :last-child { margin-bottom: 0; }
.sshk-card :is(h2, h3, h4) { margin-bottom: var(--sshk-space-sm); font-size: 1.25rem; }
a.sshk-card { display: block; color: inherit; text-decoration: none; transition: border-color 0.15s; }
a.sshk-card:hover { border-color: var(--sshk-red); }

/* Rutnät för bildrutor (t.ex. raserna): jämna bilder. Lägg .sshk-grid på en grupp/kolumner. */
.sshk-grid { display: grid; gap: var(--sshk-space-lg); grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.sshk-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--sshk-radius); }

/* Formulär */
.search-form { display: flex; gap: var(--sshk-space-sm); flex-wrap: wrap; }
.search-form label { flex: 1 1 12rem; }
.search-field, input[type="text"], input[type="email"], input[type="search"], input[type="tel"], input[type="url"], textarea, select {
	width: 100%; min-height: 44px; padding: var(--sshk-space-sm) 0.75rem;
	font: inherit; color: var(--sshk-ink); background: #fff;
	border: 1px solid rgba(33, 33, 34, 0.5); border-radius: 4px;
}
.search-submit, .wp-block-button__link, button[type="submit"]:not(.menu-toggle) {
	min-height: 44px; padding: var(--sshk-space-sm) var(--sshk-space-lg);
	font: inherit; font-weight: 600;
	color: var(--sshk-white); background: var(--sshk-red);
	border: 0; border-radius: 4px; cursor: pointer;
}
.search-submit:hover, .wp-block-button__link:hover { background: var(--sshk-ink); }

/* Paginering */
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: var(--sshk-space-sm); }
.pagination .page-numbers { min-width: 44px; min-height: 44px; padding: var(--sshk-space-sm) 0.75rem; text-align: center; border: 1px solid var(--sshk-red); border-radius: 4px; text-decoration: none; }
.pagination .current { background: var(--sshk-red); color: var(--sshk-white); }

/* Footer */
.site-footer { margin-top: var(--sshk-space-2xl); background: var(--sshk-ink); color: var(--sshk-white); border-top: 4px solid var(--sshk-red); }
.site-footer a { color: var(--sshk-white); text-decoration-color: var(--sshk-yellow); }
.site-footer a:hover { color: var(--sshk-yellow); }
.site-footer__inner { max-width: var(--sshk-wide); margin-inline: auto; padding: var(--sshk-space-xl) var(--sshk-gutter); }
.footer-navigation ul { list-style: none; margin: 0 0 var(--sshk-space-lg); padding: 0; display: flex; flex-wrap: wrap; gap: var(--sshk-space-xs) var(--sshk-space-lg); }
.footer-navigation a { display: inline-block; padding: var(--sshk-space-sm) 0; min-height: 44px; }
.site-footer__meta { margin: 0; font-size: 0.9375rem; opacity: 0.85; display: flex; flex-wrap: wrap; gap: 0 var(--sshk-space-md); }

/* Elementor: begränsa inte och stila inte om dess output */
.sshk-elementor .site-main { max-width: none; padding: 0; }
.sshk-elementor .site-footer, .home .site-footer { margin-top: 0; }

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