/* ==========================================================================
   D12 — polish + responsive pass (impeccable, Stian 2026-11-10). Loaded after site.css.
   Same look (Poppins, petrol/orange, the client's content); the layout is rethought per device
   class instead of Betheme's "scale everything down" (13 px text, a hero shrunk to 6 px type).
   ========================================================================== */
::selection { background: #ffdcc2; color: var(--ak-ink); }
:focus-visible { outline: 2px solid var(--ak-orange); outline-offset: 3px; border-radius: 2px; }
.ak-btn .elementor-button:active, .ak-hero-btn .elementor-button:active { transform: translateY(1px); }
.ak-h .elementor-heading-title { text-wrap: balance; overflow-wrap: break-word; }
.ak-text p { text-wrap: pretty; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

/* --- header: the toggle sits on the content's right edge (it was anchored to a 0-px wrapper and fell off-screen at 768–1239) */
.elementor .ak-togglew { position: static !important; width: auto !important; }
.ak-toggle { right: var(--ak-gut); top: 63px; width: 44px; height: 44px; }
.ak-toggle svg { margin: 5px; }
@media (min-width: 1024px) and (max-width: 1239px) { /* four menu items fit beside the logo down to 1024 px */
	.ak-nav { display: block !important; margin-left: 56px !important; }
	.ak-nav .elementor-nav-menu--main .elementor-item { font-size: 18px; padding: 55px 14px; }
	.ak-toggle { display: none; }
}
@media (max-width: 767px) { .ak-toggle { top: 38px; right: 16px; } }
.ak-side .elementor-nav-menu--layout-vertical .elementor-item { font-size: 15px; line-height: 22px; padding: 12px 24px; } /* 46 px rows */

/* --- first section of a sub page: Betheme's 250–350 px top padding cleared an absolute header on wide screens only */
@media (max-width: 1239px) { .elementor > .e-con.ak-section:first-child { padding-top: min(var(--padding-top, 0px), 200px) !important; } }
@media (max-width: 767px)  { .elementor > .e-con.ak-section:first-child { padding-top: 40px !important; } }

/* --- type scale for tablet and phone (body never below 15 px; h4–h6 keep their own steps) */
@media (max-width: 959px) and (min-width: 768px) {
	.ak-h1 .elementor-heading-title { font-size: 48px; line-height: 56px; }
	.ak-h2 .elementor-heading-title { font-size: 38px; line-height: 46px; }
	.ak-h3 .elementor-heading-title { font-size: 26px; line-height: 34px; }
	.ak-h4 .elementor-heading-title { font-size: 19px; line-height: 28px; }
	.ak-h5 .elementor-heading-title { font-size: 17px; line-height: 26px; }
	.ak-h6 .elementor-heading-title { font-size: 15px; line-height: 24px; }
	body, .ak-text { font-size: 15px; line-height: 25px; }
	.ak-btn .elementor-button { font-size: 15px; line-height: 26px; }
}
@media (max-width: 767px) {
	.ak-h1 .elementor-heading-title { font-size: clamp(32px, 9vw, 40px); line-height: 1.15; }
	.ak-h2 .elementor-heading-title { font-size: clamp(25px, 7.2vw, 30px); line-height: 1.2; }
	.ak-h3 .elementor-heading-title { font-size: 22px; line-height: 30px; }
	.ak-h4 .elementor-heading-title { font-size: 18px; line-height: 27px; }
	.ak-h5 .elementor-heading-title { font-size: 16px; line-height: 24px; }
	.ak-h6 .elementor-heading-title { font-size: 15px; line-height: 23px; }
	body, .ak-text { font-size: 15px; line-height: 24px; }
	.ak-btn .elementor-button { font-size: 15px; line-height: 26px; padding: 11px 22px; }
	.ak-footer h6, .ak-footer .elementor-heading-title, .ak-footer .ak-big p { font-size: 15px; line-height: 24px; }
	.ak-copyright, .ak-copyright p { font-size: 14px; line-height: 22px; }
}

/* --- hero: below 960 px the slide becomes real flowing content (text over the sky, the ridge below) */
@media (max-width: 959px) {
	.elementor .e-con.ak-hero { height: auto; padding: 56px 33px 0; background-position: 74% 100% !important; }
	.elementor .e-con.ak-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,.72) 0%, rgba(255,255,255,.4) 42%, rgba(255,255,255,0) 68%); pointer-events: none; }
	.elementor .e-con.ak-hero__grid { position: relative; z-index: 1; left: auto; top: auto; width: auto; height: auto; margin: 0; transform: none;
		display: flex; flex-flow: row wrap; align-items: center; gap: 0 12px; padding-bottom: max(220px, 52vw); }
	.ak-layer { position: static !important; }
	.ak-layer--kicker, .ak-layer--title, .ak-layer--lead { flex: 0 0 100%; }
	.ak-layer .elementor-heading-title { white-space: normal; }
	.ak-layer--kicker .elementor-heading-title { font-size: 14px; line-height: 18px; letter-spacing: .06em; margin-bottom: 12px; }
	.ak-layer--title .elementor-heading-title { font-size: clamp(38px, 10vw, 64px); line-height: 1.06; letter-spacing: -0.01em; }
	.ak-layer--lead { margin: 18px 0 26px !important; }
	.ak-layer--lead .elementor-heading-title { font-size: 17px; line-height: 26px; max-width: 30ch; }
	.ak-hero-btn .elementor-button { font-size: 15px; line-height: 20px; padding: 14px 24px; min-height: 48px; }
}
@media (max-width: 959px) and (min-width: 768px) { .elementor .e-con.ak-hero { padding-top: 168px; } } /* the tablet header is still transparent over the hero */
@media (max-width: 380px) { .ak-layer--lead .elementor-heading-title br { display: none; } }

/* --- front-page cards: one per row below 960 px, still overlapping the hero edge */
@media (max-width: 959px) {
	.elementor .e-con.ak-card { width: 100% !important; margin: 0 0 20px !important; padding: 32px 28px 22px !important; }
	.elementor .e-con.ak-card > .ak-btn { padding-top: 22px; }
}

/* --- intro + six treatment tiles: the intro stacks above the tiles below 1024 px; two tiles per row on phones */
@media (max-width: 1023px) {
	.elementor .e-con.ak-sw:has(> .ak-wrap > .ak-col--divider) > .ak-wrap { width: 100% !important; padding-right: 0 !important; }
	.ak-sw:has(> .ak-wrap > .ak-col--divider) .ak-wrap--one-third .ak-text { max-width: 62ch; }
}
@media (max-width: 767px) {
	.elementor .e-con.ak-wrap:has(> .ak-col--divider) > .ak-col--column { width: 50% !important; border-width: 0 !important; padding: 18px 6px 4px !important; margin-bottom: 8px; }
	.elementor .e-con.ak-wrap:has(> .ak-col--divider) > .ak-col--divider { display: none; }
	.ak-wrap:has(> .ak-col--divider) .ak-img img { width: 76px; }
}

/* --- Behandlingstilbud page on phones: illustration always above its text, at a sensible size */
@media (max-width: 767px) {
	.elementor > .e-con.ak-section:not(:first-child) .e-con.ak-wrap:has(> .ak-col--image) { order: -1; }
	.ak-wrap > .ak-col--image .ak-img { text-align: center; }
	.ak-wrap > .ak-col--image .ak-img img { max-width: min(280px, 78vw); }
	.elementor > .e-con.ak-section:not(:first-child) { padding-bottom: 28px !important; }
}

/* --- therapists: on narrow phones a compact row (photo beside the name) instead of eight full-width portraits */
@media (max-width: 559px) {
	.elementor .e-con.ak-tp { flex-wrap: nowrap !important; gap: 0 16px; margin-bottom: 28px; }
	.elementor .e-con.ak-tp > .ak-col--image { width: 104px !important; flex: 0 0 104px; margin: 0 !important; }
	.elementor .e-con.ak-tp > .ak-col--column { width: auto !important; flex: 1 1 auto; min-width: 0; margin: 0 !important; }
	.elementor .e-con.ak-tp__photo { margin-bottom: 0; border-radius: 14px; }
	.ak-tp .ak-h4 .elementor-heading-title { font-size: 17px; line-height: 24px; }
}
/* contact links on touch-size screens: 44 px hit area without changing the line spacing (padding + negative margin) */
@media (max-width: 1023px) {
	.ak-tp .ak-text p:last-child a, .ak-footer .ak-big a, .ak-copyright a, .ak-h4 .elementor-heading-title a { display: inline-block; padding: 10px 0; margin: -10px 0; }
}

/* --- footer on phones */
@media (max-width: 767px) {
	.ak-footer__logo img { width: 96px; }
	.elementor .e-con.ak-footer__widgets { padding: 48px 33px 24px !important; }
}


/* ==========================================================================
   D13–D15 (Stian 2026-11-10, round 4)
   ========================================================================== */

/* --- D15 wider content: 1320 px from 1400 px screens (header, sections and footer stay on one edge) */
@media (min-width: 1400px) {
	:root { --ak-gut: 13px; }
	.elementor .e-con.ak-sw, .elementor .e-con.ak-header__bar, .elementor .e-con.ak-footer__widgets { max-width: 1320px; }
	.elementor .e-con.ak-footer__copyin { max-width: calc(1320px - 2 * var(--ak-gut)); }
}

/* --- D15 no broken words anywhere: headings never split a word; they size down to their column instead.
   Each column is a size container; a heading is never wider (in font-size) than its longest word allows
   («Ultralyddiagnostikk» ≈ 10.4 × font-size, «Behandlingstilbud» ≈ 9 ×). */
.elementor .e-con.ak-col, .elementor .e-con.ak-tp > .ak-col--column { container-type: inline-size; }
.ak-h .elementor-heading-title, .ak-text, .ak-text p { overflow-wrap: normal; word-break: normal; hyphens: manual; }
.ak-col .ak-h1 .elementor-heading-title { font-size: min(var(--ak-h1, 65px), 13cqi); }
.ak-col .ak-h2 .elementor-heading-title { font-size: min(var(--ak-h2, 48px), 9.4cqi); }
.ak-col .ak-h3 .elementor-heading-title { font-size: min(30px, 12cqi); }
.ak-col .ak-h4 .elementor-heading-title { font-size: min(var(--ak-h4, 21px), 8.6cqi); }
@media (max-width: 959px) and (min-width: 768px) { :root { --ak-h1: 48px; --ak-h2: 38px; --ak-h4: 19px; } }
@media (max-width: 767px) { :root { --ak-h1: 40px; --ak-h2: 30px; --ak-h4: 18px; } }
/* cards at 960–1239: less side padding so «differensialdiagnostisere» fits on one line */
@media (min-width: 960px) and (max-width: 1239px) { .elementor .e-con.ak-card { padding-left: 24px !important; padding-right: 24px !important; } }

/* --- D15 hero: keep the two hikers in view on every screen.
   Wide screens: the 3.55 : 1 panorama is anchored at 26 % so the crop always holds the people (25–32 % of the image) and the pole. */
.elementor .e-con.ak-hero { background-position: 26% 50% !important; }
@media (max-width: 959px) {
	/* phones/tablets: the photo becomes a band under the text (people sit mid-height in the image, so a full-bleed
	   crop would put them behind the headline); above it the hero continues in the photo's own sky colour */
	.elementor .e-con.ak-hero { background-color: #c5cbd4 !important; background-size: 240% auto !important; background-position: 20% 100% !important; }
	.elementor .e-con.ak-hero::before { background: linear-gradient(180deg, #e7eaef 0%, #dde1e8 38%, rgba(221,225,232,0) 62%); }
	.elementor .e-con.ak-hero__grid { padding-bottom: calc(240vw / 3.556 * .72); }
}

/* --- D13 therapists: missing photo placeholder (Therese) */
.elementor .e-con.ak-tp__photo { position: relative; }
.elementor .e-con.ak-tp__photo:not(:has(img))::before { content: "Bilde kommer"; position: absolute; inset: auto 0 0 0; padding: 14px 16px; font: 500 13px/1.3 "Poppins", Arial, sans-serif; color: #5d6f7a; }

/* --- D14 Kontakt */
.ak-btn--solid .elementor-button { background: var(--ak-ink); color: #fff; border-color: var(--ak-ink); }
.ak-btn--solid .elementor-button:hover, .ak-btn--solid .elementor-button:focus { background: var(--ak-orange); border-color: var(--ak-orange); color: var(--ak-ink); }
.ak-contact-hero .ak-h1 { margin-bottom: 20px; }
.ak-lead, .ak-lead p { font-size: 21px; line-height: 31px; font-weight: 500; color: var(--ak-ink); max-width: 34ch; }
.elementor .e-con.ak-actions { gap: 12px; margin: 14px 0 4px; }
.elementor .e-con.ak-actions > .ak-btn { width: auto !important; margin: 0 !important; }
.ak-actions .elementor-button { min-height: 52px; padding: 12px 26px; display: inline-flex; align-items: center; }
.ak-meta, .ak-meta p { font-size: 14px; line-height: 22px; color: var(--ak-text); margin: 0; }
.ak-contact-main .ak-h2 { margin-bottom: 8px; }
.elementor .e-con.ak-way { gap: 0 32px; padding: 26px 0 12px; border-top: 1px solid #dbe6ec; align-items: baseline; }
.elementor .e-con.ak-way:last-child { border-bottom: 1px solid #dbe6ec; }
.elementor .e-con.ak-way > .ak-way__label { width: 200px !important; flex: 0 0 200px; margin: 0 !important; }
.elementor .e-con.ak-way > .ak-way__text { flex: 1 1 auto; width: auto !important; }
.ak-way__text p { margin: 0 0 14px; max-width: 58ch; }
.ak-way__text a, .ak-facts a { color: var(--ak-ink); text-decoration: underline; text-decoration-color: rgba(42,77,92,.35); text-underline-offset: 3px; }
.ak-way__text a:hover, .ak-facts a:hover { color: var(--ak-ink); text-decoration-color: var(--ak-orange); }
.elementor .e-con.ak-info { align-self: flex-start; }
.ak-info .ak-h3 { margin-bottom: 18px; }
.ak-facts { margin: 0 0 18px; }
.ak-facts > div { display: grid; grid-template-columns: 112px 1fr; gap: 16px; padding: 12px 0; border-top: 1px solid #d5e3ea; }
.ak-facts > div:first-child { border-top: 0; padding-top: 0; }
.ak-facts dt { font-size: 14px; line-height: 26px; font-weight: 500; color: var(--ak-ink); }
.ak-facts dd { margin: 0; font-size: 16px; line-height: 26px; color: var(--ak-ink); }
.ak-note, .ak-note p { font-size: 13px; line-height: 20px; color: #5d6f7a; margin: 0; }
@media (max-width: 1023px) {
	.elementor .e-con.ak-contact-main .ak-wrap { width: 100% !important; }
	.elementor .e-con.ak-info { margin-top: 24px; }
}
@media (max-width: 767px) {
	.ak-lead, .ak-lead p { font-size: 18px; line-height: 27px; }
	.elementor .e-con.ak-way { flex-direction: column !important; padding-top: 20px; }
	.elementor .e-con.ak-way > .ak-way__label { width: 100% !important; flex: none; margin-bottom: 6px !important; }
	.ak-facts > div { grid-template-columns: 96px 1fr; gap: 12px; }
	.elementor .e-con.ak-actions > .ak-btn, .ak-actions .elementor-button { width: 100% !important; justify-content: center; }
}

/* --- QA round 4 fixes */
/* therapist names wrap at spaces – they keep their size instead of shrinking with the column */
.ak-tp .ak-col--column .ak-h4 .elementor-heading-title { font-size: var(--ak-h4, 21px); }
@media (max-width: 559px) { .ak-tp .ak-col--column .ak-h4 .elementor-heading-title { font-size: 17px; line-height: 24px; } }
.ak-note, .ak-note p { font-size: 14px; line-height: 21px; }
/* very small phones: the six treatment tiles become rows (icon + label) so «Ultralyddiagnostikk» never overflows */
@media (max-width: 379px) {
	.elementor .e-con.ak-wrap:has(> .ak-col--divider) > .ak-col--column { width: 100% !important; flex-direction: row !important; align-items: center; gap: 16px; padding: 8px 0 !important; margin: 0 !important; border-bottom: 1px solid #e3edf2 !important; }
	.ak-wrap:has(> .ak-col--divider) .ak-img img { width: 56px; }
	.ak-wrap:has(> .ak-col--divider) > .ak-col--column > .elementor-widget { width: auto !important; }
	.ak-wrap:has(> .ak-col--divider) > .ak-col--column > .ak-hr { display: none; }
	.ak-wrap:has(> .ak-col--divider) .ak-h5 .elementor-heading-title { text-align: left; margin: 0; }
	.ak-wrap:has(> .ak-col--divider) > .ak-col--column > .ak-h5 { margin: 0 !important; }
}
@media (min-width: 1600px) { .elementor .e-con.ak-hero { background-position: 18% 50% !important; } } /* the pole stays clear of the lead text on wide screens */
/* Kontakt: heading spacing (Elementor zeroes widget margins in containers) */
.elementor .ak-contact-hero .ak-h1 { margin-bottom: 18px !important; }
.elementor .ak-contact-hero .ak-lead { margin-bottom: 10px !important; }
.elementor .ak-contact-main .ak-h2 { margin-bottom: 22px !important; }
.elementor .ak-info .ak-h3 { margin-bottom: 22px !important; }
.elementor .ak-info .ak-facts-w { margin-bottom: 4px !important; }
.elementor .e-con.ak-tp__photo:not(:has(img))::before { top: auto !important; bottom: 0 !important; left: 0 !important; right: 0 !important; width: auto !important; height: auto !important; background: none !important; }


/* ==========================================================================
   D18 (Stian 2026-11-10): header menu and hero text on the content's right edge
   ========================================================================== */
/* menu: last item ends exactly on the content's right edge (same line as cards, headings, footer) */
@media (min-width: 1024px) {
	.ak-nav { margin-left: auto !important; margin-right: var(--ak-gut) !important; }
	.ak-nav .elementor-nav-menu--main .menu-item:last-child > .elementor-item { padding-right: 0; }
}

/* hero ≥ 960 px: one text block, one left edge, block right-aligned to the content edge */
@media (min-width: 960px) {
	.elementor .e-con.ak-hero__grid { position: relative !important; left: auto !important; top: auto !important; margin: 0 auto !important; transform: none !important;
		width: 100% !important; max-width: 1220px; height: 100%; display: flex; flex-direction: row; justify-content: flex-end; align-items: flex-start;
		padding: 186px var(--ak-gut) 0; box-sizing: border-box; }
	.elementor .e-con.ak-hero__text { width: auto !important; flex: 0 0 auto; align-items: flex-start; }
	.ak-hero__text .ak-layer { position: static !important; }
	.ak-hero__text .ak-layer--kicker { margin: 0 0 12px !important; }
	.ak-hero__text .ak-layer--title { margin: 0 0 26px !important; }
	.ak-hero__text .ak-layer--lead { margin: 0 0 38px !important; }
	.ak-hero__text .ak-layer--lead .elementor-heading-title { font-size: 22px; line-height: 32px; }
	.elementor .e-con.ak-hero__btns { gap: 14px; width: auto !important; }
	.ak-hero__btns .ak-hero-btn { margin: 0 !important; }
}
@media (min-width: 960px) and (max-width: 1239px) { .elementor .e-con.ak-hero__grid { max-width: 940px; } }
@media (min-width: 1400px) { .elementor .e-con.ak-hero__grid { max-width: 1320px; } }

/* hero < 960 px: the block flows full width (the old per-layer flex-basis would act on height in a column) */
@media (max-width: 959px) {
	.elementor .e-con.ak-hero__text { width: 100% !important; }
	.ak-hero__text > .ak-layer { flex: none !important; }
	.elementor .e-con.ak-hero__btns { gap: 12px; }
	.ak-hero__btns .ak-hero-btn { margin: 0 !important; }
}

/* D21: hero text block vertically centred in the hero; its width/headline size come from js/site.js (edge to edge with the menu) */
@media (min-width: 960px) {
	.elementor .e-con.ak-hero__grid { align-items: center; padding-top: 0; padding-bottom: 0; }
	.ak-hero__text .ak-layer--title .elementor-heading-title { white-space: nowrap; letter-spacing: -0.01em; }
}

/* D22 footer: only the wordmark logo, bottom-left on the content edge */
.elementor .e-con.ak-footer__col--logo { width: auto; }
.ak-footer__logo--wordmark img { width: 176px !important; height: auto; display: block; }
.elementor .e-con.ak-footer__widgets { padding-top: 56px !important; padding-bottom: 40px !important; }
@media (max-width: 767px) {
	.ak-footer__logo--wordmark img { width: 148px !important; }
	.elementor .e-con.ak-footer__widgets { padding: 40px 33px 28px !important; }
	.elementor .e-con.ak-footer__col--logo { margin: 0; }
}

/* D23: header logo = the wordmark (symbol + «aktifys»), same height as the old symbol, centred on the menu text */
.ak-logo img { width: 160px !important; height: auto; }
@media (max-width: 767px) { .ak-logo img { width: 132px !important; } .ak-logo { margin: 21px auto !important; } }
@media (min-width: 768px) { .ak-logo { margin-top: 38px !important; } } /* logo centre = menu text centre (85 px) */
