/*
 * Chapter templates (Kapitel – översikt / övningssida / genomgång / innehåll): helper classes the templates
 * reference through Advanced → CSS Classes. Ported from src/styles.css (chapter-*, review-*, grammar-*).
 */
:root {
	--tvc-shadow-soft: 0 12px 32px color-mix(in oklab, var(--e-global-color-primary, #051644) 8%, transparent);
	--tvc-shadow-layered: 0 20px 58px color-mix(in oklab, var(--e-global-color-primary, #051644) 10%, transparent), 0 3px 10px color-mix(in oklab, var(--e-global-color-primary, #051644) 5%, transparent);
}

/* ---------------------------------------------------------------- shared */
.tv-no-shrink { flex-shrink: 0; }
.tv-btn-min48 .elementor-button { display: inline-flex; min-height: 3rem; align-items: center; justify-content: center; }
.tv-btn-min48 .elementor-button:hover { transform: none; }
.tv-text-link .elementor-button { gap: 0; padding: 0; background: transparent; }
.tv-text-link .elementor-button .elementor-button-icon svg { width: 1em; height: 1em; }
.tv-back-link .elementor-button-icon svg { width: .9em; }
/* The Lovable back links are inline-flex inside a 17px / 1.7 line box. */
.elementor-widget.tv-back-link, .tv-back-link .elementor-button-wrapper { font-size: 17px; line-height: 1.7; }
.tv-back-link .elementor-button { display: inline-flex; vertical-align: baseline; }
/* Status pill ("Kapitel klart"): an Icon List item without a link, so it is plain text, not a button. */
.tv-status-pill .elementor-icon-list-item { display: inline-flex; align-items: center; border-radius: 999px; padding: .5rem 1rem; background: var(--e-global-color-secondary, #2d6ca9); }
.tv-anchor { scroll-margin-top: 7rem; }
/* 62ch of the paragraph's own font (Open Sans 17px ≈ 603px); beats Elementor's ".elementor.elementor .e-con > .elementor-widget" max-width: 100%. */
.elementor.elementor .e-con > .elementor-widget.tv-maxw-62ch { max-width: 62ch; font-family: "Open Sans", sans-serif; font-size: 17px; }
.tv-cover-img, .tv-cover-img .elementor-widget-container { height: 100%; }
.tv-cover-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* LegalFooter: "© 2026 talasvenska.se · Integritet · Villkor" as one centred line of text (Icon List, inline). */
.tv-legal-footer .elementor-icon-list-items { justify-content: center; }
.tv-legal-footer .elementor-icon-list-items .elementor-icon-list-item { margin: 0; padding: 0; }
.tv-legal-footer .elementor-icon-list-item:not(:last-child) .elementor-icon-list-text::after { content: " · "; white-space: pre; color: rgba(14, 35, 56, .45); }
.tv-legal-footer .elementor-icon-list-text { padding: 0; }
.tv-legal-footer a, .tv-legal-footer a:visited { color: inherit; text-decoration: none; transition: color .15s ease; }
.tv-legal-footer a:hover, .tv-legal-footer a:hover .elementor-icon-list-text { color: var(--e-global-color-secondary, #2d6ca9); }

/* ---------------------------------------------------------------- chapter overview hero */
.tv-ch-hero-text { position: relative; max-width: 42rem; }
.tv-level-chip .elementor-heading-title { display: inline-grid; min-width: 3.75rem; height: 2.6rem; place-items: center; border-radius: 999px; padding-inline: .8rem; background: var(--e-global-color-722ed5d, #efd686); color: var(--e-global-color-primary, #051644); }
.tv-niva-a2 .tv-level-chip .elementor-heading-title { background: var(--e-global-color-b1a8e7f, #44a8e7); }
.tv-niva-b1 .tv-level-chip .elementor-heading-title { background: var(--e-global-color-secondary, #2d6ca9); color: var(--e-global-color-e33c8be, #fcfaf6); }
.tv-niva-b2 .tv-level-chip .elementor-heading-title { background: var(--e-global-color-1924f1e, #1c2b54); color: var(--e-global-color-e33c8be, #fcfaf6); }
.tv-niva-c1 .tv-level-chip .elementor-heading-title { border: 1px solid color-mix(in oklab, var(--e-global-color-accent, #e2b42c) 55%, transparent); background: var(--e-global-color-f4d3a01, #fff4d3); }

.e-con.tv-ch-visual { --position: relative; position: relative; min-height: 28rem; isolation: isolate; }
.e-con.tv-ch-visual > .tv-ch-visual-shape { --position: absolute; position: absolute; inset: 2rem 0 0 2rem; z-index: -1; width: auto; min-height: 0; }
.tv-ch-visual > .tv-ch-visual-photo { position: absolute; inset: 0 0 1rem; z-index: 0; width: auto !important; height: auto; max-width: none; margin: 0; }
.tv-ch-visual-photo .elementor-widget-container { height: 100%; }
.tv-ch-visual-photo img { display: block; width: 100%; height: 100%; border-radius: 20px; background: var(--e-global-color-secondary, #2d6ca9); box-shadow: var(--tvc-shadow-layered); object-fit: cover; object-position: center; }
.tv-lock-chip { position: absolute !important; top: .8rem; right: .8rem; z-index: 2; width: auto !important; }
.tv-lock-chip .elementor-heading-title { display: inline-flex; align-items: center; gap: .35rem; border-radius: 999px; padding: .35rem .65rem; background: color-mix(in oklab, var(--e-global-color-primary, #051644) 86%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.tv-lock-chip .elementor-heading-title::before, .tv-lock-line p::before { content: ""; display: inline-block; width: 14px; height: 14px; flex: 0 0 auto; background: currentColor; -webkit-mask: var(--tv-lock-icon) center / contain no-repeat; mask: var(--tv-lock-icon) center / contain no-repeat; }
.tv-lock-line p { display: inline-flex; align-items: center; gap: .5rem; }
:root { --tv-lock-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='16' r='1'/%3E%3Crect x='3' y='10' width='18' height='12' rx='2'/%3E%3Cpath d='M7 10V7a5 5 0 0 1 10 0v3'/%3E%3C/svg%3E"); }
.tv-ch-visual-locked .tv-ch-visual-photo img { opacity: .82; }

.tv-ch-next-card .tv-cover-img img { min-height: 16rem; }

@media (min-width: 1025px) {
	.e-con.tv-ch-visual { width: calc(100% + max(2.5rem, (100vw - 80rem) / 2)); max-width: none; margin-right: calc(-1 * max(2.5rem, (100vw - 80rem) / 2)); }
}
@media (max-width: 640px) {
	.e-con.tv-ch-visual { min-height: 21rem; }
	.e-con.tv-ch-visual > .tv-ch-visual-shape { inset: 1.5rem .5rem 0 1.25rem; }
}

/* ---------------------------------------------------------------- exercise and review pages */
.e-con.tv-ex-shell { min-height: calc(100vh - 4rem); }
body.tv-ex-locked-page .e-con.tv-ex-shell { --padding-top: 0px; --padding-bottom: 0px; min-height: 0; }
body.tv-ex-locked-page .tv-ex-head { display: none; }
.tv-reward-icon .elementor-icon { display: grid; width: 2.75rem; height: 2.75rem; place-items: center; padding: 0; }
.tv-review-photo img { display: block; width: 100%; min-height: 20rem; border-radius: 20px; background: var(--e-global-color-secondary, #2d6ca9); box-shadow: var(--tvc-shadow-layered); object-fit: cover; }
@media (max-width: 640px) {
	.tv-review-photo img { min-height: 16rem; }
}

/* ---------------------------------------------------------------- grammar */
.e-con.tv-grammar-toc { position: sticky; top: 7rem; align-self: start; }
.admin-bar .e-con.tv-grammar-toc { top: calc(7rem + 32px); }
.tv-grammar-toc .elementor-icon-list-item > a { display: block; padding-block: .38rem; }
.e-con.tv-grammar-article { max-width: 65ch; font-family: "Open Sans", sans-serif; font-size: 17px; }
.tv-strut-line { box-sizing: border-box; min-height: 28.9px; padding-top: 2px; }
.tv-grammar-h2 em { color: var(--e-global-color-secondary, #2d6ca9); font-style: normal; }
.tv-grammar-text mark { border-radius: 5px; padding: .1rem .35rem; background: var(--e-global-color-722ed5d, #efd686); color: var(--e-global-color-primary, #051644); }
.tv-grammar-text strong { color: inherit; }
.tv-grammar-photo img { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 20px; background: var(--e-global-color-secondary, #2d6ca9); box-shadow: var(--tvc-shadow-soft); object-fit: cover; }
.e-con.tv-grammar-row { display: grid; grid-template-columns: auto 8rem 1fr; align-items: center; }
.tv-grammar-row .tv-fragment { width: .65rem; height: .65rem; }
@media (max-width: 1024px) {
	.e-con.tv-grammar-article { margin-inline: auto; }
}
@media (max-width: 640px) {
	.e-con.tv-grammar-row { grid-template-columns: auto 6.5rem 1fr; gap: .65rem; }
	.tv-grammar-row .elementor-heading-title, .tv-grammar-row .elementor-widget-text-editor { font-size: .9rem; }
}

/* ---------------------------------------------------------------- video page */
.tv-underline-bright .elementor-icon-list-text { border-bottom: 2px solid var(--e-global-color-b1a8e7f, #44a8e7); }

/* ---------------------------------------------------------------- chapter test: result-only sections */
body:not(.tv-test-mode-result):not(.elementor-editor-active) .tv-test-result-only,
body:not(.tv-test-low):not(.elementor-editor-active) .tv-test-low-only { display: none !important; }
.tv-complete-photo img { min-height: 34rem; }
.tv-next-chapter-card .tv-cover-img img { min-height: 10rem; }
@media (max-width: 640px) {
	.tv-complete-photo img { min-height: 20rem; }
}
