/* ==========================================================================
   Studio44, barntema till Blocksy
   1. Typsnitt
   2. Grundtokens och typografi
   3. Sidhuvud och sidfot
   4. Artikelvy: rubrik, byline, utvald bild
   5. Innehållsförteckning
   6. Profilruta
   7. Artikelkort och startsidans senaste artiklar
   8. Arkiv och relaterade artiklar
   9. Artikelinnehåll: tabeller och s44-rutor (flyttat från Customizer)
   ========================================================================== */

/* 1. Typsnitt (egen server, inga anrop till Google) ------------------------ */

@font-face {
	font-family: "Inter Variable";
	font-style: normal;
	font-display: swap;
	font-weight: 100 900;
	src: url(../fonts/inter-latin-wght-normal.woff2) format("woff2-variations");
}

@font-face {
	font-family: "Inter Variable";
	font-style: italic;
	font-display: swap;
	font-weight: 100 900;
	src: url(../fonts/inter-latin-wght-italic.woff2) format("woff2-variations");
}

@font-face {
	font-family: "Fraunces Variable";
	font-style: normal;
	font-display: swap;
	font-weight: 100 900;
	src: url(../fonts/fraunces-latin-wght-normal.woff2) format("woff2-variations");
}

@font-face {
	font-family: "Fraunces Variable";
	font-style: italic;
	font-display: swap;
	font-weight: 100 900;
	src: url(../fonts/fraunces-latin-wght-italic.woff2) format("woff2-variations");
}

/* 2. Grundtokens och typografi --------------------------------------------- */

:root {
	--s44-blue: #1e9bd7;
	--s44-blue-ink: #1478a8;
	--s44-blue-deep: #0e5a80;
	--s44-blue-soft: #e8f6fc;
	--s44-ink: #14202b;
	--s44-text: #2c3640;
	--s44-muted: #5f6b76;
	--s44-line: #e2e8ed;
	--s44-soft: #f4f8fa;
	--s44-radius: 14px;
	--s44-sans: "Inter Variable", Inter, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--s44-serif: "Fraunces Variable", Fraunces, Georgia, "Times New Roman", serif;

	--theme-font-family: var(--s44-sans);
}

html {
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

body {
	--theme-font-family: var(--s44-sans);
	font-family: var(--s44-sans);
	font-feature-settings: "cv11", "ss01";
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
.page-title,
.entry-title,
.s44-latest__title,
.ct-module-title {
	--theme-font-family: var(--s44-serif);
	font-family: var(--s44-serif);
	font-optical-sizing: auto;
	letter-spacing: -0.01em;
}

h4,
h5,
h6 {
	--theme-font-family: var(--s44-sans);
	font-family: var(--s44-sans);
}

.entry-content :is(h2, h3, h4)[id] {
	scroll-margin-top: 96px;
}

body .entry-content h2 {
	--theme-font-size: clamp(1.55rem, 1.2rem + 1.3vw, 2.05rem);
	--theme-line-height: 1.25;
}

body .entry-content h3 {
	--theme-font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
	--theme-line-height: 1.3;
}

.entry-content a:not(.wp-block-button__link):not(.s44-card__link):not(.s44-latest__all) {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.entry-content a:not(.wp-block-button__link):not(.s44-card__link):not(.s44-latest__all):hover {
	text-decoration-thickness: 2px;
}

::selection {
	background: var(--s44-blue-soft);
	color: var(--s44-ink);
}

/* Inga versaler någonstans i temat. Blocksy styr versaler via en variabel
   som sätts på många ställen (meny, metarader, brödsmulor), därför !important
   på variabeln. Inline-CSS i artiklar påverkas inte. */
body,
body * {
	--theme-text-transform: none !important;
}

/* 3. Sidhuvud och sidfot --------------------------------------------------- */

#header {
	border-top: 4px solid var(--s44-blue);
	box-shadow: 0 1px 0 var(--s44-line);
}

#header .site-logo-container {
	--logo-max-height: 52px;
}

#header .site-title-container {
	display: none;
}

#header [data-id="menu"] > ul > li > a {
	--theme-font-size: 15px;
	--theme-font-weight: 550;
	--theme-letter-spacing: 0;
}

@media (max-width: 999.98px) {
	#header .site-logo-container {
		--logo-max-height: 40px;
	}
}

#header [data-id="menu"] > ul > li > a {
	position: relative;
}

#header [data-id="menu"] > ul > li > a::after {
	content: "";
	position: absolute;
	left: var(--menu-items-spacing, 12px);
	right: var(--menu-items-spacing, 12px);
	bottom: 18px;
	height: 2px;
	background: var(--s44-blue);
	transform: scaleX(0);
	transition: transform 0.2s ease;
}

#header [data-id="menu"] > ul > li:hover > a::after,
#header [data-id="menu"] > ul > li.current-menu-item > a::after {
	transform: scaleX(1);
}

.ct-footer {
	border-top: 1px solid var(--s44-line);
}

.ct-footer-copyright {
	font-size: 14px;
	color: var(--s44-muted);
}

.ct-footer-copyright a {
	margin-left: 14px;
	color: var(--s44-text);
	text-decoration: none;
}

.ct-footer-copyright a:hover {
	color: var(--s44-blue-ink);
	text-decoration: underline;
}

/* 4. Artikelvy: rubrik, byline, utvald bild -------------------------------- */

.single .hero-section .page-title,
.page .hero-section .page-title {
	font-weight: 600;
	line-height: 1.15;
	font-size: clamp(2rem, 1.35rem + 2.4vw, 3.1rem);
	color: var(--s44-ink);
	text-wrap: balance;
}

.s44-byline {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-top: 22px;
	color: var(--s44-muted);
	font-size: 15px;
	line-height: 1.5;
}

.s44-byline-wrap .s44-byline {
	margin: 0 0 28px;
}

.s44-byline__avatar {
	flex: 0 0 auto;
	display: block;
	line-height: 0;
}

.s44-byline__img {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	object-fit: cover;
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--s44-blue-soft);
}

.s44-byline__text {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.s44-byline__author {
	color: var(--s44-text);
}

.s44-byline__author a {
	color: var(--s44-ink);
	font-weight: 600;
	text-decoration: none;
}

.s44-byline__author a:hover {
	color: var(--s44-blue-ink);
}

.s44-byline__dates {
	display: flex;
	flex-wrap: wrap;
	column-gap: 14px;
	row-gap: 2px;
}

.s44-byline__date + .s44-byline__date::before {
	content: "";
	display: inline-block;
	width: 4px;
	height: 4px;
	margin: 0 14px 3px 0;
	border-radius: 50%;
	background: currentColor;
	opacity: 0.5;
	vertical-align: middle;
}

@media (max-width: 520px) {
	.s44-byline__dates {
		flex-direction: column;
	}

	.s44-byline__date + .s44-byline__date::before {
		display: none;
	}
}

.single .ct-featured-image,
.page .ct-featured-image {
	margin-top: 32px;
}

@media (min-width: 1000px) {
	.single .ct-featured-image,
	.page .ct-featured-image {
		padding-bottom: 40px;
	}
}

.single .ct-featured-image .ct-media-container,
.page .ct-featured-image .ct-media-container {
	border-radius: var(--s44-radius);
}

/* 5. Innehållsförteckning -------------------------------------------------- */

.entry-content .s44-toc {
	margin: 32px 0 36px;
	padding: 0;
	background: var(--s44-soft);
	border: 1px solid var(--s44-line);
	border-left: 4px solid var(--s44-blue);
	border-radius: 10px;
}

.s44-toc details > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 22px;
	cursor: pointer;
	list-style: none;
}

.s44-toc details > summary::-webkit-details-marker {
	display: none;
}

.s44-toc__title {
	font-family: var(--s44-serif);
	font-size: 19px;
	font-weight: 600;
	color: var(--s44-ink);
}

.s44-toc__count {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--s44-muted);
}

.s44-toc__count::after {
	content: "";
	width: 8px;
	height: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg) translateY(-3px);
	transition: transform 0.2s ease;
}

.s44-toc details:not([open]) .s44-toc__count::after {
	transform: rotate(-45deg);
}

.entry-content .s44-toc__list {
	margin: 0;
	padding: 0 22px 18px 22px;
	list-style: none;
	counter-reset: s44toc;
}

.entry-content .s44-toc__list li {
	counter-increment: s44toc;
	display: flex;
	gap: 12px;
	margin: 0;
	padding: 7px 0;
	border-top: 1px solid var(--s44-line);
	font-size: 15.5px;
	line-height: 1.45;
}

.entry-content .s44-toc__list li::before {
	content: counter(s44toc);
	flex: 0 0 22px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	color: var(--s44-blue-ink);
}

.entry-content .s44-toc .s44-toc__list a {
	color: var(--s44-text);
	text-decoration: none;
}

.entry-content .s44-toc .s44-toc__list a:hover {
	color: var(--s44-blue-ink);
	text-decoration: underline;
}

/* 6. Profilruta ------------------------------------------------------------ */

.s44-author {
	display: flex;
	gap: 22px;
	align-items: flex-start;
	margin-top: 56px;
	margin-bottom: 8px;
	padding: 26px 28px;
	background: var(--s44-soft);
	border: 1px solid var(--s44-line);
	border-radius: var(--s44-radius);
}

.s44-author__avatar {
	flex: 0 0 auto;
	line-height: 0;
}

.s44-author__img {
	width: 88px;
	height: 88px;
	border-radius: 50%;
	object-fit: cover;
	box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--s44-blue-soft);
}

.s44-author__eyebrow {
	margin: 0 0 2px;
	font-size: 13px;
	font-weight: 600;
	color: var(--s44-blue-ink);
}

.s44-author__name {
	margin: 0 0 8px;
	font-family: var(--s44-serif);
	font-size: 22px;
	font-weight: 600;
	line-height: 1.25;
}

.s44-author__name a {
	color: var(--s44-ink);
	text-decoration: none;
}

.s44-author__bio {
	font-size: 15px;
	line-height: 1.65;
	color: var(--s44-text);
}

.s44-author__bio p {
	margin: 0 0 10px;
}

.s44-author__more {
	display: inline-block;
	margin-top: 4px;
	font-size: 15px;
	font-weight: 600;
	color: var(--s44-blue-ink);
	text-decoration: none;
}

.s44-author__more::after {
	content: " →";
}

.s44-author__more:hover {
	text-decoration: underline;
}

@media (max-width: 600px) {
	.s44-author {
		flex-direction: column;
		gap: 14px;
		padding: 22px 20px;
	}

	.s44-author__img {
		width: 72px;
		height: 72px;
	}
}

/* 7. Artikelkort och startsidans senaste artiklar --------------------------
   Rutnätet ligger i startsidans artikeltext, direkt efter ingressen. */

.entry-content .s44-latest {
	margin-top: 36px;
	margin-bottom: 40px;
	padding: 24px 0 28px;
	border-top: 1px solid var(--s44-line);
	border-bottom: 1px solid var(--s44-line);
}

.s44-latest__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 18px;
}

.entry-content .s44-latest__title {
	margin: 0;
	font-size: 1.35rem;
	font-weight: 600;
	line-height: 1.3;
	color: var(--s44-ink);
}

.entry-content .s44-latest__all {
	font-weight: 600;
	font-size: 15px;
	color: var(--s44-blue-ink);
	text-decoration: none;
	white-space: nowrap;
}

.entry-content .s44-latest__all:hover {
	text-decoration: underline;
}

.s44-latest__all::after {
	content: " →";
}

.s44-latest__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
}

.s44-card {
	margin: 0;
}

.s44-card__link {
	display: block;
	height: 100%;
	color: inherit;
	text-decoration: none;
}

.s44-card__media {
	aspect-ratio: 16 / 10;
	overflow: hidden;
	border-radius: 10px;
	background: var(--s44-soft);
}

.entry-content .s44-card__img {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: cover;
	transition: transform 0.35s ease;
}

.s44-card__link:hover .s44-card__img {
	transform: scale(1.03);
}

.s44-card__body {
	padding-top: 12px;
}

.s44-card__cat {
	display: block;
	margin-bottom: 4px;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--s44-blue-ink);
}

.s44-card__title {
	display: block;
	margin: 0 0 6px;
	font-family: var(--s44-serif);
	font-size: 17px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--s44-ink);
}

.s44-card__link:hover .s44-card__title {
	color: var(--s44-blue-ink);
}

.s44-card__date {
	font-size: 13px;
	color: var(--s44-muted);
}

/* Mobil och smal surfplatta: kompakt lista med liten bild till vänster */
@media (max-width: 640px) {
	.entry-content .s44-latest {
		padding: 18px 0 8px;
	}

	.s44-latest__head {
		margin-bottom: 4px;
	}

	.s44-latest__grid {
		grid-template-columns: 1fr;
		gap: 0;
	}

	.s44-card + .s44-card {
		border-top: 1px solid var(--s44-line);
	}

	.s44-card__link {
		display: grid;
		grid-template-columns: 88px minmax(0, 1fr);
		gap: 14px;
		align-items: center;
		padding: 12px 0;
	}

	.s44-card__media {
		aspect-ratio: 1 / 1;
	}

	.s44-card__body {
		padding-top: 0;
	}

	.s44-card__title {
		margin-bottom: 4px;
		font-size: 16.5px;
	}

	.s44-card__date {
		font-size: 12.5px;
	}
}

/* 8. Arkiv och relaterade artiklar ----------------------------------------- */

body [data-cards="simple"] .entry-card {
	background: transparent;
	box-shadow: none;
}

.entries .entry-card .ct-media-container,
.ct-related-posts .ct-media-container {
	border-radius: 12px;
	overflow: hidden;
}

.entries .entry-card .ct-media-container img,
.ct-related-posts .ct-media-container img {
	transition: transform 0.35s ease;
}

.entries .entry-card:hover .ct-media-container img,
.ct-related-posts article:hover .ct-media-container img {
	transform: scale(1.03);
}

body .entries .entry-card .entry-title {
	--theme-font-size: 21px;
	--theme-font-weight: 600;
	--theme-line-height: 1.3;
}

.entries .entry-card .entry-title a:hover {
	color: var(--s44-blue-ink);
}

.entries .entry-card .entry-meta .meta-categories a {
	color: var(--s44-blue-ink);
	font-weight: 600;
}

body .entries .entry-card .entry-meta {
	--theme-font-size: 13px;
	--theme-font-weight: 500;
}

.entries .entry-card .entry-excerpt {
	color: var(--s44-text);
	font-size: 15.5px;
	line-height: 1.6;
}

.hero-section .page-title {
	font-weight: 600;
	color: var(--s44-ink);
}

.ct-related-posts-container {
	background: var(--s44-soft);
}

.ct-related-posts .related-entry-title {
	--theme-font-family: var(--s44-serif);
	font-family: var(--s44-serif);
	font-weight: 600;
	line-height: 1.3;
}

/* 9. Artikelinnehåll: tabeller och s44-rutor --------------------------------
   Flyttat från Customizerns Ytterligare CSS i MinimalistBlogger.
   Inga !important: inline-CSS i gamla artiklar vinner naturligt.        */

.entry-content table {
	width: 100%;
	border-collapse: collapse;
	margin: 25px 0;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
	border-radius: 8px;
	overflow: hidden;
	font-size: 0.95em;
}

.entry-content table thead tr {
	background: #1e9bd7;
	color: #fff;
}

.entry-content table th {
	padding: 14px 16px;
	text-align: left;
	font-weight: 600;
	color: inherit;
	border: 0;
}

.entry-content table td {
	padding: 12px 16px;
	border: 0;
	border-bottom: 1px solid #e0eef5;
}

.entry-content table tbody tr:nth-child(odd) {
	background: #f7fbfd;
}

.entry-content table tbody tr:nth-child(even) {
	background: #fff;
}

.entry-content table tbody tr:last-child td {
	border-bottom: none;
}

@media (max-width: 700px) {
	.entry-content table,
	.entry-content table tbody,
	.entry-content table tr,
	.entry-content table td {
		display: block;
		width: 100%;
	}

	.entry-content table thead {
		display: none;
	}

	.entry-content table tr {
		margin: 0 0 16px;
		border: 1px solid #e0eef5;
		border-radius: 8px;
		overflow: hidden;
	}

	.entry-content table td {
		padding: 10px 14px;
		border-bottom: 1px solid #e0eef5;
		text-align: left;
	}

	.entry-content table td:last-child {
		border-bottom: none;
	}

	.entry-content table td:first-child {
		background: #1e9bd7;
		color: #fff;
		font-weight: 600;
	}

	.entry-content table td[data-label]::before {
		content: attr(data-label);
		display: block;
		font-size: 0.8em;
		font-weight: 600;
		letter-spacing: 0.2px;
		color: #1478a8;
		margin-bottom: 3px;
	}

	.entry-content table td:first-child[data-label]::before {
		display: none;
	}
}

.entry-content .s44-info {
	background: #e8f6fc;
	border-left: 5px solid #1e9bd7;
	padding: 18px 22px;
	margin: 25px 0;
	border-radius: 6px;
	box-shadow: 0 2px 6px rgba(30, 155, 215, 0.08);
}

.entry-content .s44-info-rubrik {
	display: block;
	margin-bottom: 8px;
	font-size: 1.05em;
	font-weight: bold;
	color: #1478a8;
}

.entry-content .s44-varning {
	background: #fff4e6;
	border-left: 5px solid #e67e22;
	padding: 18px 22px;
	margin: 25px 0;
	border-radius: 6px;
	box-shadow: 0 2px 6px rgba(230, 126, 34, 0.08);
}

.entry-content .s44-varning-rubrik {
	display: block;
	margin-bottom: 8px;
	font-size: 1.05em;
	font-weight: bold;
	color: #c0561f;
}

.entry-content .s44-snabb {
	background: #f7fbfd;
	border: 1px solid #e0eef5;
	border-radius: 8px;
	padding: 18px 22px;
	margin: 25px 0;
}

.entry-content .s44-snabb-rubrik {
	display: block;
	margin-bottom: 10px;
	font-size: 1.05em;
	font-weight: bold;
	color: #1478a8;
}

.entry-content .s44-steg {
	margin: 20px 0;
}

.entry-content .s44-steg-item {
	background: #f7fbfd;
	border-left: 4px solid #1e9bd7;
	padding: 14px 18px;
	margin-bottom: 10px;
	border-radius: 4px;
}

.entry-content .s44-steg-item strong {
	color: #1478a8;
}

.entry-content .s44-internlankar {
	background: #f7fbfd;
	border: 1px solid #e0eef5;
	border-radius: 8px;
	padding: 16px 22px;
	margin: 25px 0;
}

.entry-content .s44-internlankar-rubrik {
	display: block;
	margin-bottom: 8px;
	font-weight: bold;
	color: #1478a8;
}

.entry-content .s44-internlankar ul {
	margin: 0;
	padding-left: 20px;
}

.entry-content .s44-kallor {
	font-size: 0.9em;
	color: #666;
	border-top: 1px solid #e0eef5;
	margin-top: 30px;
	padding-top: 14px;
}

.entry-content .s44-kallor-rubrik {
	display: block;
	margin-bottom: 6px;
	font-weight: bold;
	color: #333;
}

.entry-content dl {
	margin: 25px 0;
}

.entry-content dt {
	font-weight: bold;
	color: #1478a8;
	margin-top: 16px;
	font-size: 1.05em;
}

.entry-content dd {
	margin: 6px 0 0;
	line-height: 1.7;
}
