/* alteo/view-switcher — frontend CSS.
 *
 * A switcher itself is Tailwind-only; this stylesheet carries the page-wide
 * view-visibility rules that apply to OTHER blocks via their customClassName
 * (e.g. `alteo-view-electricity`, `alteo-view-gas`).
 *
 * Mechanism: the switcher JS sets `data-alteo-view="<slug>"` on <body>. Any
 * element with class `alteo-view-<otherSlug>` is then hidden. Elements without
 * any `alteo-view-*` class are treated as common content (always visible).
 *
 * Authored as plain CSS (not Tailwind utilities) because the
 * body[data-alteo-view] selector lives OUTSIDE .alteo-scope — Tailwind's
 * `important: '.alteo-scope'` scoping would otherwise break these rules.
 */

/* Active button state — primary-tinted prominence chip.
 * Per UAT 2026-06-22 Sor 11: "Legyen sokkal nagyobb, eltérő szín,
 * látványosabb" — the switcher must read as a brand-coloured selector,
 * not a neutral pill. Primary green (#6BA43A) replaces the prior inverse
 * surface so the active state pops against the white page background. */
.alteo-scope .alteo-view-switcher__btn[aria-selected="true"] {
	background-color: rgb(107 164 58);
	color: #fff;
	box-shadow: 0 4px 12px rgba(107, 164, 58, 0.35);
}

.alteo-scope .alteo-view-switcher__btn:not([aria-selected="true"]):hover {
	background-color: rgba(107, 164, 58, 0.08);
	color: rgb(107 164 58);
}

.alteo-scope .alteo-view-switcher__btn:focus-visible {
	outline: 2px solid rgb(107 164 58);
	outline-offset: 2px;
}

/* Sticky-bottom variant — center as a floating pill. */
.alteo-scope .alteo-view-switcher--bottom {
	margin-top: 1rem;
	margin-bottom: 1rem;
}

/* Page-level view-visibility rules. Each slug has its OWN hide rule that fires
 * only when the active view is anything other than that slug. This avoids the
 * specificity war between a generic hide + a more-specific reveal — the
 * matching slug never has a `display: none` rule applied in the first place.
 *
 * New slug? Add one line:
 *   body[data-alteo-view]:not([data-alteo-view="<slug>"]) .alteo-view-<slug> { display: none; } */
body[data-alteo-view]:not([data-alteo-view="electricity"]) .alteo-view-electricity,
body[data-alteo-view]:not([data-alteo-view="gas"])         .alteo-view-gas,
body[data-alteo-view]:not([data-alteo-view="telephelyi"])  .alteo-view-telephelyi,
body[data-alteo-view]:not([data-alteo-view="heat"])        .alteo-view-heat,
body[data-alteo-view]:not([data-alteo-view="water"])       .alteo-view-water,
body[data-alteo-view]:not([data-alteo-view="residential"]) .alteo-view-residential,
body[data-alteo-view]:not([data-alteo-view="business"])    .alteo-view-business {
	display: none;
}

/* Scoped views (AWP-54) — a switcher with `data-scope="<name>"` writes
 * body[data-alteo-view-<name>] instead of the global slot, so two switchers on
 * one page no longer fight over the same state. Each scope needs its own hide
 * rules, exactly like the global ones above.
 *
 * scope="report" — /energetika/termelesmenedzsment/ Power BI riportjai. Saját
 * slugok (kat / tarolo), mert amíg a riport-csoportok a szolgáltatás-fülek
 * slugjait (electricity / gas) használták, a riport a szolgáltatás-fül
 * függvénye volt, és a „Villamosenergia-tároló menedzsment" fülön egyetlen
 * riport sem látszott.
 *
 * New scope? Add one line per slug:
 *   body[data-alteo-view-<scope>]:not([data-alteo-view-<scope>="<slug>"]) .alteo-view-<slug> { display: none; } */
body[data-alteo-view-report]:not([data-alteo-view-report="kat"])    .alteo-view-kat,
body[data-alteo-view-report]:not([data-alteo-view-report="tarolo"]) .alteo-view-tarolo {
	display: none;
}

/* scope="info" — Kisker „Egyéb tájékoztatók” (AWP-100): hat szekción belüli fül
 * az Áram letölthető anyagai alatt, `position: inline` switcherrel. */
body[data-alteo-view-info]:not([data-alteo-view-info="info-okosmero"])         .alteo-view-info-okosmero,
body[data-alteo-view-info]:not([data-alteo-view-info="info-zonaidos"])         .alteo-view-info-zonaidos,
body[data-alteo-view-info]:not([data-alteo-view-info="info-jogszabalyok"])     .alteo-view-info-jogszabalyok,
body[data-alteo-view-info]:not([data-alteo-view-info="info-erdekkepviselet"])  .alteo-view-info-erdekkepviselet,
body[data-alteo-view-info]:not([data-alteo-view-info="info-ugyfelszolgalat"])  .alteo-view-info-ugyfelszolgalat,
body[data-alteo-view-info]:not([data-alteo-view-info="info-egyeb"])            .alteo-view-info-egyeb {
	display: none;
}

/* scope="docsaram" / "docsgaz" — Kisker letölthető anyagok (AWP-122): Működési
 * engedély / Üzletszabályzat / Archívum / Egyéb tájékoztatók fülek az Áram és a
 * Földgáz letöltések alatt (inline switcher). A gáz „Egyéb” csoportja saját
 * scope-ot kap (infogaz), hogy a két Egyéb-fülsor állapota ne keveredjen. */
body[data-alteo-view-docsaram]:not([data-alteo-view-docsaram="docsaram-engedely"]) .alteo-view-docsaram-engedely,
body[data-alteo-view-docsaram]:not([data-alteo-view-docsaram="docsaram-usz"])      .alteo-view-docsaram-usz,
body[data-alteo-view-docsaram]:not([data-alteo-view-docsaram="docsaram-archivum"]) .alteo-view-docsaram-archivum,
body[data-alteo-view-docsaram]:not([data-alteo-view-docsaram="docsaram-egyeb"])    .alteo-view-docsaram-egyeb,
body[data-alteo-view-docsgaz]:not([data-alteo-view-docsgaz="docsgaz-engedely"])    .alteo-view-docsgaz-engedely,
body[data-alteo-view-docsgaz]:not([data-alteo-view-docsgaz="docsgaz-usz"])         .alteo-view-docsgaz-usz,
body[data-alteo-view-docsgaz]:not([data-alteo-view-docsgaz="docsgaz-archivum"])    .alteo-view-docsgaz-archivum,
body[data-alteo-view-docsgaz]:not([data-alteo-view-docsgaz="docsgaz-egyeb"])       .alteo-view-docsgaz-egyeb,
body[data-alteo-view-infogaz]:not([data-alteo-view-infogaz="infogaz-okosmero"])         .alteo-view-infogaz-okosmero,
body[data-alteo-view-infogaz]:not([data-alteo-view-infogaz="infogaz-zonaidos"])         .alteo-view-infogaz-zonaidos,
body[data-alteo-view-infogaz]:not([data-alteo-view-infogaz="infogaz-jogszabalyok"])     .alteo-view-infogaz-jogszabalyok,
body[data-alteo-view-infogaz]:not([data-alteo-view-infogaz="infogaz-erdekkepviselet"])  .alteo-view-infogaz-erdekkepviselet,
body[data-alteo-view-infogaz]:not([data-alteo-view-infogaz="infogaz-ugyfelszolgalat"])  .alteo-view-infogaz-ugyfelszolgalat,
body[data-alteo-view-infogaz]:not([data-alteo-view-infogaz="infogaz-egyeb"])            .alteo-view-infogaz-egyeb {
	display: none;
}

/* Negative ("everywhere EXCEPT") rules — `alteo-view-not-<slug>`.
 *
 * The positive classes above are single-slug by construction: an element
 * tagged `alteo-view-electricity alteo-view-gas` matches BOTH hide rules and
 * therefore disappears in every view. That makes "shared content, but not in
 * one particular view" impossible to express without duplicating the block
 * into each view group — which also duplicates its anchor id and its TOC row.
 *
 * Client feedback 2026-08-08 (Kisker r11/r12) needs exactly that: the
 * "Miért érdemes velünk szerződnie?", "Energetikai tanúsítók" and "Kapcsolat"
 * sections stay common for Áram + Földgáz but must not appear under
 * Telephelyi optimum. One negative class per section solves it with no
 * duplication.
 *
 * New slug? Add one line:
 *   body[data-alteo-view="<slug>"] .alteo-view-not-<slug> { display: none; } */
body[data-alteo-view="electricity"] .alteo-view-not-electricity,
body[data-alteo-view="gas"]         .alteo-view-not-gas,
body[data-alteo-view="telephelyi"]  .alteo-view-not-telephelyi,
body[data-alteo-view="heat"]        .alteo-view-not-heat,
body[data-alteo-view="water"]       .alteo-view-not-water,
body[data-alteo-view="residential"] .alteo-view-not-residential,
body[data-alteo-view="business"]    .alteo-view-not-business {
	display: none;
}

/* Smooth crossfade when switching views. */
[class*="alteo-view-"]:not(.alteo-view-switcher):not([class*="alteo-view-switcher__"]) {
	transition: opacity 200ms ease-out;
}

/* Floating-TOC integration — hide TOC entries whose target section is hidden
 * by the active view. The data-view-hidden attribute is set by view-switcher.js
 * on the closest <li> (or anchor parent) when the linked element's
 * offsetParent is null (i.e. an alteo-view-* ancestor hides it). */
[data-alteo-floating-toc] [data-view-hidden="true"] {
	display: none;
}

/* scope="csr" / "edu" — /esg/tarsadalmi-felelossegvallalas/csr/ (AWP-135, AWP-140):
 * `csr` = the four programme areas (cards tab row, reveal_on_anchor), `edu` = the
 * four Edukáció topics nested inside the csr-edukacio panel. */
body[data-alteo-view-csr]:not([data-alteo-view-csr="csr-adomanyozas"])  .alteo-view-csr-adomanyozas,
body[data-alteo-view-csr]:not([data-alteo-view-csr="csr-onkentesseg"])  .alteo-view-csr-onkentesseg,
body[data-alteo-view-csr]:not([data-alteo-view-csr="csr-edukacio"])     .alteo-view-csr-edukacio,
body[data-alteo-view-csr]:not([data-alteo-view-csr="csr-egeszseg"])     .alteo-view-csr-egeszseg,
body[data-alteo-view-edu]:not([data-alteo-view-edu="edu-hirlevel"])         .alteo-view-edu-hirlevel,
body[data-alteo-view-edu]:not([data-alteo-view-edu="edu-nagykovet"])        .alteo-view-edu-nagykovet,
body[data-alteo-view-edu]:not([data-alteo-view-edu="edu-piknik"])           .alteo-view-edu-piknik,
body[data-alteo-view-edu]:not([data-alteo-view-edu="edu-egyuttmukodesek"])  .alteo-view-edu-egyuttmukodesek {
	display: none;
}

/* ---------------------------------------------------------------------------
 * `tab_style = cards` (AWP-135 / AWP-140; kit: EsgCsrTabs.jsx, CSR_EDUKACIO.html)
 * Numbered card tabs — auto-fit grid, 4px brand-green top border, "01…" meta +
 * semibold title. Active = dark inverse-surface card with white text; inactive =
 * light green tint. 2 columns on narrow viewports so four tabs do not push the
 * panel 400px down.
 * ------------------------------------------------------------------------- */
.alteo-scope .alteo-view-switcher__shell {
	display: block;
}
.alteo-scope .alteo-view-switcher__cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
	gap: 1rem;
}
.alteo-scope .alteo-view-switcher__btn--card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: flex-start;
	gap: 0.5rem;
	min-height: 96px;
	min-width: 0;
	padding: 1.25rem;
	margin: 0;
	border: 0;
	border-top: 4px solid #6DA63A;
	border-radius: 0;
	background: rgba(109, 166, 58, 0.2);
	color: #1C242B;
	font-family: inherit;
	text-align: left;
	cursor: pointer;
	box-shadow: none;
	transition: background-color 0.15s ease, color 0.15s ease;
}
.alteo-scope .alteo-view-switcher__btn--card:not([aria-selected="true"]):hover {
	background: rgba(109, 166, 58, 0.32);
	color: #1C242B;
}
.alteo-scope .alteo-view-switcher__btn--card[aria-selected="true"] {
	background: #1C242B;
	color: #fff;
	box-shadow: none;
}
.alteo-scope .alteo-view-switcher__btn--card:focus-visible {
	outline: 2px solid #1C242B;
	outline-offset: 3px;
}
.alteo-scope .alteo-view-switcher__btn--card[aria-selected="true"]:focus-visible {
	outline-color: #6DA63A;
}
.alteo-scope .alteo-view-switcher__card-meta {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.05em;
	color: #575E66;
}
.alteo-scope .alteo-view-switcher__btn--card[aria-selected="true"] .alteo-view-switcher__card-meta {
	color: #C4DAAE;
}
.alteo-scope .alteo-view-switcher__card-title {
	font-size: 18px;
	line-height: 1.25;
	font-weight: 600;
	overflow-wrap: break-word;
	hyphens: manual;
}
@media (max-width: 639px) {
	.alteo-scope .alteo-view-switcher__cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 0.5rem;
	}
	.alteo-scope .alteo-view-switcher__btn--card {
		min-height: 88px;
		padding: 0.875rem;
	}
	.alteo-scope .alteo-view-switcher__card-title {
		font-size: 15px;
	}
}

/* Tinted panel for a cards-switcher view (core/group carrying the extra class
 * `alteo-tab-panel` next to its `alteo-view-<slug>`). Light green tint = primary
 * at 20% (kit token bamboo-green-20). Direct children get a prose rhythm because
 * the theme zeroes block margins globally. */
.alteo-scope .alteo-tab-panel,
.wp-block-post-content .alteo-tab-panel {
	background: rgba(109, 166, 58, 0.2);
	padding: 1.5rem;
	min-width: 0;
}
@media (min-width: 768px) {
	.alteo-scope .alteo-tab-panel,
	.wp-block-post-content .alteo-tab-panel {
		padding: 2.5rem;
	}
}
.alteo-tab-panel > * + * { margin-top: 1.25rem; }
.alteo-tab-panel > * + :is(h3, h4, .wp-block-heading) { margin-top: 2rem; }
.alteo-tab-panel > :is(h3) { margin-top: 0; }
.alteo-tab-panel :is(h3, h4) { color: #1C242B; font-weight: 600; line-height: 1.2; }
.alteo-tab-panel h3 { font-size: 1.625rem; }
.alteo-tab-panel h4 { font-size: 1.125rem; }
.alteo-tab-panel > p { line-height: 1.65; max-width: 72ch; }
.alteo-tab-panel > p.alteo-tab-panel__lead-strong { font-weight: 600; }
.alteo-tab-panel > p.alteo-tab-panel__label {
	font-size: 13px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: #575E66;
}
.alteo-tab-panel .alteo-tag-cloud,
.alteo-tab-panel [class*="alteo-tag-cloud"] { margin-top: 0.75rem; }

/* CSR pillar panels (core/group carrying `alteo-tab-flow`): the tab row sits right
 * above the panel, so drop the tartalom-template 80px inter-section gap — the
 * switcher's own bottom margin gives the rhythm. */
.alteo-tartalom-main .wp-block-post-content > .alteo-tab-flow.alteo-tab-flow { margin-top: 0; }

/* Blocks nested in a tinted tab panel follow the panel typography (AWP-137):
 * compact-timeline body and info-callout body are 14px muted by default. */
.alteo-tab-panel .alteo-scope .alteo-timeline__compact-body,
.alteo-tab-panel .alteo-info-callout.alteo-scope div { font-size: 1rem; line-height: 1.65; }
.alteo-tab-panel .alteo-scope .alteo-timeline__compact-body { color: #1C242B; }

/* scope="demo" — /komponens-demo/ cards-style switcher showcase. */
body[data-alteo-view-demo]:not([data-alteo-view-demo="demo-a"]) .alteo-view-demo-a,
body[data-alteo-view-demo]:not([data-alteo-view-demo="demo-b"]) .alteo-view-demo-b {
	display: none;
}
