/*
 * Artiklene (single.php, og kortene og skjemaene i inc/blogg.php og
 * hh_artikkel_cta() i inc/innlegg.php).
 *
 * Brødteksten beholder typografien fra Astro-bygget (.article-content).
 * Rundt den: toppen med tittelen og omslaget, innholdsfortegnelsen til
 * venstre, kortet med vekstplanen til høyre, kortet «Snakk med Kristian»
 * midt i teksten og skjemaet for tilbud etter teksten. --flate og --aksent
 * er fargene til temaet (hh_blogg_farger()).
 *
 * Bredt: innhold | tekst | kort. Under 1200 px forsvinner
 * innholdsfortegnelsen til en lukket liste over teksten, og under 1024 px
 * står alt i en kolonne, uten kortet til høyre.
 */

.ar {
	--ar-blekk: #0a0f1f;
	--ar-gra: #6e6e7c;
	--ar-linje: #ecebf3;
	--ar-lilla: #7c3aed;
	--ar-myk: cubic-bezier(.2, .7, .2, 1);
	--pf-blekk: var(--ar-blekk);
	--pf-gra: var(--ar-gra);
	--pf-myk: var(--ar-myk);
	background: #fff;
	color: var(--ar-blekk);
	font-family: var(--font-sans, 'Nunito'), system-ui, sans-serif;
}

.ar :where(p, h1, h2, h3, ul, ol) { margin: 0; }
.ar :where(ul, ol):not(.article-content *) { padding: 0; list-style: none; }

.ar-skjult {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.ar-merke { color: var(--ar-gra); font-size: 15px; font-weight: 600; }

.ar-h2 {
	--hh-fs: clamp(1.9rem, 1.3rem + 1.8vw, 2.75rem);
	--hh-lh: 1.1;
	margin-top: 10px;
	color: var(--ar-blekk);
	font-weight: 600;
	text-wrap: balance;
}

.ar-uthevet {
	padding-bottom: .12em;
	background: linear-gradient(90deg, #7c3aed 0%, #c026d3 55%, #ec4899 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.ar-bredde { width: 100%; max-width: 1228px; margin-inline: auto; padding-inline: 24px; }
.ar-smal { width: 100%; max-width: 820px; margin-inline: auto; padding-inline: 24px; }

/* ---------- Toppen ---------- */

.ar-topp {
	padding-top: clamp(36px, 5vw, 76px);
	background:
		radial-gradient(46% 70% at 88% 0%, color-mix(in srgb, var(--flate) 90%, transparent) 0%, transparent 70%),
		radial-gradient(40% 60% at 4% 30%, #f6f0ff 0%, transparent 70%),
		linear-gradient(180deg, #fafcf9 0%, #fff 100%);
}

.ar-topp-inn { max-width: 880px; margin-inline: auto; padding-inline: 24px; text-align: center; }

.ar-smuler ol { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; color: var(--ar-gra); font-size: 13px; }
.ar-smuler a { color: inherit; text-decoration: none; }
.ar-smuler a:hover { color: var(--ar-blekk); }

.ar-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 16px; margin-top: 22px; color: var(--ar-gra); font-size: 14px; }
.ar-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.ar-meta svg { width: 15px; height: 15px; }
.ar-tema { padding: 5px 12px; border-radius: 999px; background: var(--flate); color: var(--aksent); font-weight: 600; }
.ar-oppdatert { color: #6d28d9; font-weight: 600; }

.ar .ar-h1 {
	--hh-fs: clamp(2.2rem, 1.3rem + 2.7vw, 3.6rem);
	--hh-lh: 1.08;
	margin-top: 18px;
	padding-bottom: .06em;
	color: var(--ar-blekk);
	font-weight: 600;
	text-wrap: balance;
}

.ar-ingress { max-width: 44rem; margin: 20px auto 0; color: #4a4a62; font-size: clamp(1.1rem, 1rem + .35vw, 1.3rem); line-height: 1.55; text-wrap: pretty; }

.ar-forfatter-linje { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 14px; margin-top: 28px; }
.ar-forfatter-linje img { width: 44px; height: 44px; padding: 4px; border-radius: 50%; background: #f3f1fa; object-fit: contain; }
.ar-forfatter-linje p { display: flex; flex-direction: column; text-align: left; }
.ar-forfatter-linje b { color: var(--ar-blekk); font-size: 15px; font-weight: 600; }
.ar-forfatter-linje p span { color: var(--ar-gra); font-size: 13px; }

.ar-hopp {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-left: 10px;
	padding: 10px 16px;
	border-radius: 999px;
	background: var(--ar-blekk);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: transform .25s var(--ar-myk);
}

.ar-hopp:hover { transform: translateY(-1px); }
.ar-hopp svg { width: 15px; height: 15px; }

.ar-omslag { max-width: 1140px; margin: clamp(32px, 4vw, 56px) auto 0; padding-inline: 24px; }
.ar-omslag-bilde { display: block; width: 100%; height: auto; aspect-ratio: 16 / 7; object-fit: cover; border-radius: 28px; }

/* ---------- Tre kolonner: innholdet, teksten og kortet ---------- */

.ar-rad {
	display: grid;
	grid-template-columns: 210px minmax(0, 700px) 300px;
	justify-content: center;
	align-items: start;
	gap: clamp(32px, 3.4vw, 56px);
	max-width: 1360px;
	margin: clamp(44px, 5vw, 76px) auto 0;
	padding-inline: 24px;
}

.ar-rad--uten-innhold { grid-template-columns: minmax(0, 700px) 300px; }

.ar-venstre,
.ar-hoyre { position: sticky; top: 110px; }

.ar-venstre { max-height: calc(100vh - 130px); overflow-y: auto; scrollbar-width: thin; }
.ar-rail-merke { color: var(--ar-gra); font-size: 13px; font-weight: 600; }

.ar-toc ul { display: grid; gap: 2px; margin-top: 12px; border-left: 1px solid var(--ar-linje); }

.ar .toc-link {
	display: block;
	margin-left: -1px;
	padding: 6px 0 6px 14px;
	border-left: 2px solid transparent;
	color: var(--ar-gra);
	font-size: 14px;
	line-height: 1.35;
	text-decoration: none;
	transition: color .2s, border-color .2s;
}

.ar .toc-link:hover { color: var(--ar-blekk); }
.ar .toc-link--h3 { padding-left: 26px; font-size: 13px; }
.ar .toc-link.is-active { border-color: var(--aksent); color: var(--ar-blekk); font-weight: 600; }

.ar-del { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--ar-linje); }
.ar-del > div { display: flex; gap: 8px; margin-top: 10px; }

.ar-del a,
.ar-del button {
	position: relative;
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border: 1px solid var(--ar-linje);
	border-radius: 50%;
	background: #fff;
	color: var(--ar-blekk);
	cursor: pointer;
}

.ar-del svg { width: 16px; height: 16px; }
.ar-del a:hover,
.ar-del button:hover { border-color: #cfc8e6; }
.ar-kopiert { position: absolute; left: calc(100% + 8px); padding: 4px 8px; border-radius: 6px; background: var(--ar-blekk); color: #fff; font-size: 12px; white-space: nowrap; opacity: 0; transition: opacity .2s; pointer-events: none; }
.ar-del .copied .ar-kopiert { opacity: 1; }

.ar-hoved { min-width: 0; }

.ar-kortsvar {
	margin-bottom: 40px;
	padding: 22px 26px;
	border: 1px solid color-mix(in srgb, var(--aksent) 16%, transparent);
	border-radius: 22px;
	background: color-mix(in srgb, var(--flate) 65%, #fff);
}

.ar-kortsvar-merke { display: inline-flex; align-items: center; gap: 6px; color: var(--aksent); font-size: 14px; font-weight: 600; }
.ar-kortsvar-merke svg { width: 15px; height: 15px; }
.ar-kortsvar-tekst { margin-top: 8px; color: var(--ar-blekk); font-size: 18px; line-height: 1.6; }

.ar-toc-mobil { display: none; margin-bottom: 32px; border: 1px solid var(--ar-linje); border-radius: 18px; background: #fbfaff; }
.ar-toc-mobil summary { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; color: var(--ar-blekk); font-size: 15px; font-weight: 600; list-style: none; cursor: pointer; }
.ar-toc-mobil summary::-webkit-details-marker { display: none; }
.ar-toc-mobil summary svg { width: 18px; height: 18px; transition: transform .25s; }
.ar-toc-mobil[open] summary svg { transform: rotate(180deg); }
.ar-toc-mobil ul { display: grid; gap: 8px; padding: 0 18px 18px; }
.ar-toc-mobil a { color: #4a4a62; font-size: 15px; text-decoration: none; }
.ar-toc-mobil .ar-toc-h3 { padding-left: 14px; font-size: 14px; }

/* ---------- Kortet ved siden av teksten ---------- */

.ar-sidekort { overflow: hidden; border: 1px solid var(--ar-linje); border-radius: 26px; background: #fff; }

.ar-sidekort-topp {
	display: flex;
	align-items: flex-end;
	justify-content: center;
	height: 150px;
	overflow: hidden;
	background:
		radial-gradient(60% 80% at 50% 100%, color-mix(in srgb, var(--aksent) 22%, transparent) 0%, transparent 70%),
		var(--flate);
}

.ar-sidekort-helt { width: auto; height: 136px; margin-bottom: -10px; filter: drop-shadow(0 14px 18px color-mix(in srgb, var(--aksent) 25%, transparent)); transition: transform .5s var(--ar-myk); }
.ar-sidekort:hover .ar-sidekort-helt { transform: translateY(-6px) rotate(-3deg); }

.ar-sidekort-inn { padding: 22px; }
.ar-sidekort-tittel { color: var(--ar-blekk); font-size: 21px; font-weight: 600; line-height: 1.25; text-wrap: balance; }
.ar-sidekort-tekst { margin-top: 8px; color: var(--ar-gra); font-size: 14.5px; line-height: 1.5; }

.ar-adresse { display: grid; gap: 8px; margin-top: 16px; }
.ar-sidekort-knapp { width: 100%; margin-top: 16px; text-decoration: none; }

.ar-adresse input,
.ar-felt input,
.ar-felt textarea {
	width: 100%;
	height: 48px;
	padding: 0 14px;
	border: 1px solid #e4e1ef;
	border-radius: 12px;
	background: #fff;
	color: var(--ar-blekk);
	font: inherit;
	font-size: 16px;
	transition: border-color .2s, box-shadow .2s;
}

.ar-felt textarea { height: auto; min-height: 92px; padding: 12px 14px; resize: vertical; line-height: 1.5; }

.ar-adresse input:focus,
.ar-felt input:focus,
.ar-felt textarea:focus { outline: none; border-color: #a78bfa; box-shadow: 0 0 0 4px rgba(124, 58, 237, .14); }

.ar-adresse button,
.ar-send {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 48px;
	padding: 0 20px;
	border: 0;
	border-radius: 12px;
	background: var(--ar-lilla);
	color: #fff;
	font: inherit;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color .2s, transform .25s var(--ar-myk);
}

.ar-adresse button:hover,
.ar-send:hover { background: var(--knapp-hover); transform: translateY(-1px); }
.ar-adresse button svg,
.ar-send svg { width: 16px; height: 16px; }
.ar-send:disabled { opacity: .7; cursor: wait; transform: none; }
.ar-send > span { display: inline-flex; align-items: center; gap: 8px; }

.ar-adresse button:focus-visible,
.ar-send:focus-visible,
.ar-hopp:focus-visible { outline: 3px solid #a020f0; outline-offset: 3px; }

.ar-sidekort-person { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--ar-linje); }
.ar-sidekort-person img { flex: none; width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.ar-sidekort-person p { color: var(--ar-gra); font-size: 13.5px; line-height: 1.4; }
.ar-sidekort-person a { color: #6d28d9; font-weight: 600; text-decoration: none; }
.ar-sidekort-person a:hover { text-decoration: underline; }

/* ---------- Skjemaene ---------- */

.ar-honning { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ar-turnstile:empty { display: none; }
.ar-turnstile { grid-column: 1 / -1; }

.ar-felt { display: grid; gap: 6px; }
.ar-felt > span { color: var(--ar-blekk); font-size: 14px; font-weight: 600; }
.ar-felt i { color: var(--ar-gra); font-style: normal; font-weight: 400; }
.ar-felt.is-bad input { border-color: #e11d48; box-shadow: 0 0 0 4px rgba(225, 29, 72, .1); }

.ar-skjema-status { grid-column: 1 / -1; color: #be123c; font-size: 14px; }
.ar-skjema-status a { color: inherit; font-weight: 600; }

/* Kortet «Snakk med Kristian» midt i teksten. Brødteksten har egne regler
   for avsnitt, lenker og bilder, så de nullstilles her. */
.article-content .ar-midt {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 20px;
	margin: 2.75rem 0;
	padding: 24px;
	border: 1px solid color-mix(in srgb, var(--aksent) 18%, transparent);
	border-radius: 24px;
	background:
		radial-gradient(60% 90% at 100% 0%, color-mix(in srgb, var(--flate) 80%, transparent) 0%, transparent 70%),
		#fbfaff;
}

.article-content .ar-midt p { margin: 0; }
.article-content .ar-midt a { background: none; color: #6d28d9; }
.ar-midt-person { position: relative; width: 64px; height: 64px; }
.article-content .ar-midt-person img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.ar-midt-prikk { position: absolute; right: 2px; bottom: 2px; width: 14px; height: 14px; border: 3px solid #fbfaff; border-radius: 50%; background: #10b981; }
.article-content .ar-midt-tittel { color: var(--ar-blekk); font-size: 19px; font-weight: 600; line-height: 1.3; }
.ar-midt-tittel span { margin-left: 6px; color: var(--ar-gra); font-size: 14px; font-weight: 500; }
.article-content .ar-midt-tekst { margin-top: 4px; color: #4a4a62; font-size: 15.5px; line-height: 1.5; }
.ar-midt-skjema { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; margin-top: 14px; }
.ar-midt-skjema .ar-felt { gap: 0; }

/* Skjemaet etter teksten */
.ar-slutt {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
	gap: clamp(28px, 4vw, 64px);
	margin-top: clamp(64px, 7vw, 104px);
	padding: clamp(28px, 4vw, 56px);
	border-radius: 36px;
	background:
		radial-gradient(50% 70% at 0% 0%, color-mix(in srgb, var(--flate) 95%, transparent) 0%, transparent 70%),
		radial-gradient(40% 60% at 100% 100%, #fdeef6 0%, transparent 70%),
		#f8f6ff;
	scroll-margin-top: 100px;
}

.ar-slutt .ar-slutt-tittel {
	--hh-fs: clamp(2rem, 1.3rem + 2vw, 3rem);
	--hh-lh: 1.08;
	margin-top: 10px;
	color: var(--ar-blekk);
	font-weight: 600;
	text-wrap: balance;
}

.ar-slutt-ingress { margin-top: 16px; color: #4a4a62; font-size: 17px; line-height: 1.55; }
.ar-lofter { display: grid; gap: 10px; margin-top: 24px; }
.ar-lofter li { display: flex; align-items: center; gap: 10px; color: var(--ar-blekk); font-size: 15.5px; font-weight: 500; }
.ar-lofter span { display: grid; flex: none; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ar-lilla); color: #fff; }
.ar-lofter svg { width: 14px; height: 14px; }

.ar-folk { display: flex; align-items: center; gap: 14px; margin-top: 28px; padding-top: 24px; border-top: 1px solid rgba(124, 58, 237, .14); }
.ar-ansikter { display: flex; flex: none; padding-left: 10px; }
.ar-ansikter img { width: 40px; height: 40px; margin-left: -10px; border: 2px solid #f8f6ff; border-radius: 50%; object-fit: cover; }
.ar-folk p { color: #4a4a62; font-size: 14px; line-height: 1.45; }
.ar-folk a { color: #6d28d9; font-weight: 600; text-decoration: none; white-space: nowrap; }

.ar-skjema { align-self: start; padding: clamp(20px, 2.4vw, 32px); border: 1px solid #ebe7f6; border-radius: 26px; background: #fff; }
.ar-felter { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ar-felt--bred { grid-column: 1 / -1; }
.ar-skjema .ar-send { width: 100%; margin-top: 18px; height: 54px; font-size: 17px; }
.ar-fint { margin-top: 12px; color: var(--ar-gra); font-size: 13px; text-align: center; }
.ar-fint a { color: inherit; text-decoration: underline; }

/* ---------- Spørsmålene ---------- */

.ar-faq { margin-top: clamp(72px, 8vw, 120px); }
.ar-faq-liste { display: grid; gap: 10px; margin-top: 28px; }
.ar-faq-rad { border: 1px solid var(--ar-linje); border-radius: 18px; background: #fff; transition: border-color .2s; }
.ar-faq-rad[open] { border-color: color-mix(in srgb, var(--aksent) 30%, var(--ar-linje)); }

.ar-faq-rad summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px; list-style: none; cursor: pointer; }
.ar-faq-rad summary::-webkit-details-marker { display: none; }
.ar-faq-rad summary h3 { --hh-fs: 1.08rem; --hh-lh: 1.4; color: var(--ar-blekk); font-weight: 600; }

.ar-faq-pluss { position: relative; flex: none; width: 30px; height: 30px; border-radius: 50%; background: #f5f3fb; transition: background-color .2s; }
.ar-faq-pluss::before,
.ar-faq-pluss::after { content: ''; position: absolute; top: 50%; left: 50%; width: 12px; height: 2px; border-radius: 2px; background: var(--ar-blekk); transform: translate(-50%, -50%); transition: transform .25s var(--ar-myk); }
.ar-faq-pluss::after { transform: translate(-50%, -50%) rotate(90deg); }
.ar-faq-rad[open] .ar-faq-pluss { background: var(--flate); }
.ar-faq-rad[open] .ar-faq-pluss::after { transform: translate(-50%, -50%) rotate(0); }

.ar-faq-svar { padding: 0 22px 20px; color: #4a4a62; font-size: 16px; line-height: 1.65; }
.ar-faq-svar a { color: #6d28d9; }

/* ---------- Forfatteren ---------- */

.ar-skribent { display: flex; align-items: flex-start; gap: 20px; margin-top: clamp(56px, 6vw, 88px); padding-top: 32px; border-top: 1px solid var(--ar-linje); }
.ar-skribent > img { flex: none; width: 80px; height: 80px; padding: 6px; border-radius: 22px; background: #f3f1fa; object-fit: contain; }
.ar-skribent-navn { margin-top: 4px; color: var(--ar-blekk); font-size: 20px; font-weight: 600; }
.ar-skribent-rolle { margin-top: 2px; color: var(--ar-gra); font-size: 14px; }
.ar-skribent-bio { margin-top: 10px; color: #4a4a62; font-size: 15px; line-height: 1.55; }
.ar-skribent-lenke { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; color: #6d28d9; font-size: 14px; font-weight: 600; text-decoration: none; }
.ar-skribent-lenke svg { width: 15px; height: 15px; }

/* ---------- Les videre ---------- */

.ar-videre { margin-top: clamp(72px, 8vw, 120px); padding-block: clamp(64px, 7vw, 104px); background: #fbfaff; }
.ar-videre-hode { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 32px; }
.ar-alle { display: inline-flex; align-items: center; gap: 6px; color: #6d28d9; font-size: 16px; font-weight: 600; text-decoration: none; }
.ar-alle svg { width: 16px; height: 16px; transition: transform .25s var(--ar-myk); }
.ar-alle:hover svg { transform: translateX(3px); }
.ar-videre-liste { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2vw, 26px); }

/* ---------- Mindre skjermer ---------- */

@media (max-width: 1199px) {
	.ar-rad { grid-template-columns: minmax(0, 700px) 290px; }
	.ar-venstre { display: none; }
	.ar-toc-mobil { display: block; }
}

@media (max-width: 1023px) {
	.ar-rad,
	.ar-rad--uten-innhold { grid-template-columns: minmax(0, 720px); }
	.ar-hoyre { display: none; }
	.ar-slutt { grid-template-columns: minmax(0, 1fr); }
	.ar-videre-liste { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 639px) {
	.ar-hopp { margin-left: 0; }
	.ar-omslag-bilde { aspect-ratio: 4 / 3; border-radius: 22px; }
	.ar-kortsvar { padding: 18px 20px; }
	.ar-kortsvar-tekst { font-size: 17px; }
	.article-content .ar-midt { grid-template-columns: minmax(0, 1fr); padding: 20px; }
	.ar-midt-skjema { grid-template-columns: minmax(0, 1fr); }
	.ar-slutt { margin-inline: -8px; border-radius: 28px; }
	.ar-felter { grid-template-columns: minmax(0, 1fr); }
	.ar-videre-liste { grid-template-columns: minmax(0, 1fr); }
	.ar-skribent { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
	.ar-hopp,
	.ar-send,
	.ar-adresse button,
	.ar-sidekort-helt,
	.ar-faq-pluss::after { transition: none; }
}
