/*
 * APG landing pages — ported almost verbatim from the live target's stylesheet
 * (gewerkstark.de /wp-content/themes/werklotse/css/apg-sections.css) so the
 * generated pages match it exactly. werklotse's design tokens (--foreground,
 * --border) are aliased onto ours in style.css :root; everything else uses the
 * tokens both themes share (--background, --card, --second-text, --muted,
 * --accent, --primary, --radius…). Selectors are remapped where our plugin's
 * Section renderers emit different class names than werklotse did (e.g. our
 * steps use .apg-steps__step/.apg-steps__title, our cards use .apg-card).
 *
 * Architecture (matches live): the whole page is ONE centered 960px reading
 * column on the slate body — no full-bleed bands. Each .apg-section is a 960px
 * block; cards (tip/cta/quote/partner) carry their own surfaces.
 * Loaded only on page-apg-city*.php.
 */

/* ── Page column (mirrors live .apg-page inline style) ───────────────────── */
.apg-page { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* ── Base section ────────────────────────────────────────────────────────── */
.apg-section { max-width: 960px; margin: 0 auto 56px; padding: 0 20px; }
.apg-section--cta { background: var(--foreground); color: #fff; border-radius: 1rem; padding: 48px 40px; text-align: center; }
.apg-section--quote_block { max-width: 960px; margin: 0 auto 40px; padding: 0 20px; }

/* ── Hero (theme template-part: apg-templated-hero.php) ──────────────────── */
.apg-section--hero {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(360px, 1fr);
	align-items: center;
	gap: clamp(24px, 4vw, 56px);
	max-width: 960px;
	margin: 0 auto 56px;
	padding: 24px 20px 0;
	background: var(--background);
}
/* Text-only fallback (no site hero image): single column. */
.apg-section--hero.apg-section--hero--no-image { grid-template-columns: 1fr; }
.apg-hero__image-wrap {
	width: 100%;
	max-width: 640px;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	order: 2;
	justify-self: end;
	border-radius: 1.5rem;
	border: 1px solid rgba(148, 163, 184, 0.22);
	box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
	background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
}
.apg-hero__image-wrap img,
.apg-hero__image { width: 100%; height: 100%; object-fit: cover; object-position: left bottom; display: block; }
.apg-hero__content { max-width: 640px; width: 100%; margin: 0; padding: 40px 0 48px; align-self: center; }
/* Live computed: the kicker/subtext render in --second-text (not --accent). */
.apg-hero__kicker { font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--second-text); margin: 0 0 10px; }
.apg-hero__heading { font-size: 2.2rem; font-weight: 700; margin: 0 0 16px; line-height: 1.2; color: var(--foreground); }
.apg-hero__subtext { font-size: 1.15rem; color: var(--second-text); margin: 0 0 28px; }
.apg-hero__bullets { list-style: none; padding: 0; margin: 0 0 28px; display: flex; flex-direction: column; gap: 8px; }
.apg-hero__bullets li { position: relative; padding: 2px 0 2px 16px; font-size: 1rem; color: var(--foreground); line-height: 1.5; border-left: 3px solid var(--accent); }
.apg-hero__cta { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin: 0; }
.apg-hero__note,
.apg-hero__cta-note { font-size: 0.9rem; color: var(--muted); margin: 0; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.apg-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.9rem 1.75rem;
	border-radius: 0.75rem;
	font-weight: 700;
	font-size: 1rem;
	text-decoration: none;
	cursor: pointer;
	border: 1px solid transparent;
	transition: transform .15s ease, box-shadow .15s ease;
}
.apg-btn--primary {
	/* --primary (#0F52BA) not --accent: white-on-accent only hits ~3.2:1 (< AA). */
	background: var(--primary);
	color: #fff;
	box-shadow: 0 10px 15px -3px var(--accent-shadow), 0 4px 6px -4px var(--accent-shadow);
}
.apg-btn--primary:hover {
	color: #fff;
	transform: translateY(-1px);
	box-shadow: 0 20px 25px -5px var(--accent-shadow), 0 10px 15px -3px var(--accent-shadow);
}
.apg-btn--large { padding: 1rem 2rem; font-size: 1.1rem; }
/* Section_Base::cta_button() default class, kept matching the primary button. */
.apg-cta-button { display: inline-flex; align-items: center; justify-content: center; padding: 1rem 2rem; border-radius: 0.75rem; font-weight: 700; font-size: 1.1rem; text-decoration: none; background: var(--primary); color: #fff; box-shadow: 0 10px 15px -3px var(--accent-shadow), 0 4px 6px -4px var(--accent-shadow); transition: transform .15s ease, box-shadow .15s ease; }
.apg-cta-button:hover { color: #fff; transform: translateY(-1px); }

/* ── Typography ──────────────────────────────────────────────────────────── */
.apg-section h2 { font-size: 1.6rem; font-weight: 700; margin: 0 0 20px; color: var(--foreground); }
.apg-section h3 { font-size: 1.2rem; font-weight: 600; margin: 0 0 12px; color: var(--foreground); }
.apg-section h4 { font-size: 1rem; font-weight: 600; margin: 16px 0 8px; color: var(--foreground); }
.apg-section p  { line-height: 1.7; color: var(--second-text); margin: 0 0 16px; }
.apg-section--cta h2 { color: #fff; }
.apg-section--cta p  { color: rgba(255, 255, 255, .85); margin-bottom: 28px; }

/* ── Figures ─────────────────────────────────────────────────────────────── */
.apg-figure { margin: 24px 0; max-width: min(46%, 460px); }
.apg-figure img,
.apg-section-image { width: 100%; border-radius: 0.75rem; display: block; }
.apg-figure--left  { float: left;  margin: 6px 26px 14px 0; }
.apg-figure--right { float: right; margin: 6px 0 14px 26px; }
.apg-section::after { content: ""; display: block; clear: both; }
/* The hero is a grid container — a clearfix pseudo would become a phantom grid
   item and bump the image into a second row. Suppress it there. */
.apg-section--hero::after { content: none; }

/* ── Steps (plugin: <ol.apg-steps><li.apg-steps__step><h3.apg-steps__title><p>) ─ */
.apg-steps { list-style: none; padding: 0; margin: 0; counter-reset: apg-step; }
/* Number on the left, title + text stacked beside it — every line of text
   shares one left edge (no ragged per-step indentation). */
.apg-steps__step {
	position: relative;
	padding: 0 0 0 60px;
	margin-bottom: 28px;
	min-height: 40px;
}
.apg-steps__step:last-child { margin-bottom: 0; }
.apg-steps__step::before {
	counter-increment: apg-step;
	content: counter(apg-step);
	position: absolute;
	left: 0; top: 0;
	width: 40px; height: 40px;
	background: var(--primary);
	color: #fff;
	border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	font-weight: 700; font-size: 1.1rem;
}
/* Specificity must beat `.apg-section h3` (the step title is an <h3>). */
.apg-steps__step .apg-steps__title { font-weight: 600; font-size: 1rem; margin: 0 0 4px; color: var(--foreground); }
.apg-steps__step p { margin: 0; color: var(--muted); line-height: 1.7; }

/* ── Tables (comparison, prices) ─────────────────────────────────────────── */
.apg-table-wrap { overflow-x: auto; margin: 0 0 24px; }
.apg-table { width: 100%; border-collapse: collapse; margin: 0 0 24px; font-size: 0.95rem; }
.apg-table th { background: var(--primary); color: #fff; padding: 12px 16px; text-align: left; }
.apg-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--second-text); }
.apg-table tr:nth-child(even) td { background: var(--background); }
.apg-price-disclaimer { color: var(--muted); font-size: 0.9rem; margin-top: 8px; }

/* ── Cards (product_types, material_options → .apg-card / .apg-card-grid) ── */
.apg-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin: 0 0 16px; padding: 0; list-style: none; }
.apg-card { background: var(--background); border-radius: 0.75rem; padding: 20px 24px; }
.apg-card__title { color: var(--primary); margin: 0 0 8px; font-size: 1.2rem; font-weight: 600; }
.apg-card__suitability { font-size: 0.88rem; color: var(--muted); margin-top: 8px; }

/* ── Partner blocks ──────────────────────────────────────────────────────── */
.apg-partner-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin: 0 0 16px; }
.apg-partner-block { background: var(--background); border-radius: 0.75rem; padding: 20px 24px; margin: 0; }
.apg-partner-block h3 { color: var(--foreground); }

/* ── Cost factors (plugin: <dl.apg-cost-factors><dt><dd>) ────────────────── */
.apg-cost-factors { margin: 0; padding: 0; }
.apg-cost-factors dt { padding: 10px 0 0; font-weight: 700; color: var(--foreground); line-height: 1.4; }
.apg-cost-factors dd { margin: 0; padding: 2px 0 10px; border-bottom: 1px solid var(--border); line-height: 1.5; color: var(--second-text); }
.apg-cost-factors dd:last-child { border-bottom: 0; padding-bottom: 0; }

/* Generic factor list, if used. */
.apg-factors { list-style: none; padding: 0; margin: 0; }
.apg-factor { padding: 14px 0; border-bottom: 1px solid var(--border); line-height: 1.6; color: var(--second-text); }

/* ── Safety considerations ───────────────────────────────────────────────── */
.apg-safety-list { list-style: none; margin: 0 0 20px; padding: 0; }
.apg-safety-list__item { padding: 8px 0 8px 28px; position: relative; color: var(--second-text); border-bottom: 1px solid var(--border); }
.apg-safety-list__item::before { content: "!"; position: absolute; left: 0; top: 8px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; font-size: 0.8rem; display: flex; align-items: center; justify-content: center; }

/* ── Permit guidance ─────────────────────────────────────────────────────── */
.apg-permit-notes { background: var(--background); border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 0.75rem; padding: 20px 24px; margin: 0 0 16px; }

/* ── FAQ — same divider style as the homepage (.gws-faq) ─────────────────── */
/* Plugin markup: <div.apg-faq__item><h3.apg-faq__question><button.apg-faq__toggle>. */
.apg-faq { margin: 0; }
.apg-faq__item { border-bottom: 1px solid var(--line); max-width: 860px; margin: 0 auto; background: transparent; }
.apg-faq__question { margin: 0; }
.apg-faq__toggle,
.apg-faq__question > button {
	width: 100%;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	font: inherit;
	font-weight: 700;
	font-size: 1rem;
	padding: 1.5rem 0;
	cursor: pointer;
	background: none;
	border: 0;
	text-align: left;
	color: var(--text);
}
.apg-faq__toggle:hover { color: var(--primary-safe); }
.apg-faq__toggle::after {
	content: "+";
	font-size: 1.5rem;
	font-weight: 400;
	color: var(--primary-safe);
	line-height: 1;
	flex: 0 0 auto;
	transition: transform 0.25s ease;
}
.apg-faq__toggle[aria-expanded="true"]::after { transform: rotate(45deg); }
.apg-faq__answer { padding: 0 0 1.5rem; color: #475569; font-size: 0.95rem; line-height: 1.7; margin: 0; }
.apg-faq__answer[hidden] { display: none; }
.apg-faq__answer p { margin: 0; color: #475569; }

@media print {
	.apg-faq__answer { display: block !important; }
	.apg-faq__toggle::after { display: none !important; }
	.apg-faq__toggle { cursor: default; }
}

/* ── Tip box (plugin: <section.apg-section--tip_box><div.apg-tip-box><div.apg-tip__content>) ─ */
.apg-tip-box { background: rgba(39, 127, 201, 0.08); border-left: 4px solid var(--accent); border-radius: 0.75rem; padding: 24px; display: flex; gap: 20px; align-items: flex-start; }
.apg-tip__image-wrap img { width: 120px; height: 90px; object-fit: cover; border-radius: 6px; }
.apg-tip__headline,
.apg-tip-box__title { font-size: 1.2rem; font-weight: 600; margin: 0 0 8px; color: var(--foreground); }
.apg-tip__text { margin: 0; font-size: 0.95rem; color: var(--second-text); }

/* ── Quote (plugin: <blockquote.apg-quote><p>…<cite.apg-quote__attribution>) ─ */
.apg-quote { border-left: 4px solid var(--border); margin: 0; padding: 16px 24px; color: var(--muted); font-style: italic; background: var(--background); border-radius: 0 0.75rem 0.75rem 0; }
.apg-quote p { margin: 0; color: var(--muted); }
.apg-quote__attribution { display: block; margin-top: 10px; font-size: 0.9rem; font-style: normal; font-weight: 600; color: var(--muted); }

/* ── Field observation (plugin: <section.apg-section--field_observation>) ── */
.apg-field-observation { background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 0 0.75rem 0.75rem 0; padding: 20px 24px; margin: 18px 0; }

/* ── Utility block ───────────────────────────────────────────────────────── */
.apg-section--utility_block { max-width: 960px; margin: 0 auto 40px; padding: 0 20px; }
.apg-utility-block { background: var(--background); border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 0.75rem; padding: 20px 24px; }
.apg-utility-block__headline { font-size: 1.1rem; font-weight: 700; margin: 0 0 10px; color: var(--foreground); }
.apg-utility-block__text { color: var(--second-text); line-height: 1.65; margin: 0 0 10px; }
.apg-utility-block__bullets { list-style: none; padding: 0; margin: 0; }
.apg-utility-block__bullets li { padding: 4px 0 4px 22px; position: relative; color: var(--second-text); }
.apg-utility-block__bullets li::before { content: "•"; position: absolute; left: 4px; color: var(--primary); font-weight: 700; }
.apg-utility-block--regulatory_note { border-left-color: var(--foreground); }
.apg-utility-block--common_pitfall  { border-left-color: #d27a2a; }
.apg-utility-block--quality_signal  { border-left-color: #2a9d4a; }
.apg-utility-block--cost_transparency { border-left-color: var(--accent); }
.apg-utility-block--trust_builder   { border-left-color: var(--primary); }
.apg-utility-block--decision_helper { border-left-color: #7a4fd2; }

/* ── Progressive disclosure (js/apg-ui.js) ───────────────────────────────── */
.apg-disclose { position: relative; overflow: hidden; }
.apg-disclose[data-collapsed="true"] { max-height: 220px; }
.apg-disclose[data-collapsed="true"]::after {
	content: "";
	position: absolute;
	left: 0; right: 0; bottom: 0;
	height: 60px;
	background: linear-gradient(to bottom, transparent, var(--background) 85%);
	pointer-events: none;
}
.apg-disclose__toggle { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; margin-top: 10px; padding: 6px 10px; border-radius: 6px; }
.apg-disclose__toggle:hover { background: rgba(39, 127, 201, 0.08); }

/* ── Chrome: breadcrumbs (theme: apg-breadcrumbs.php) ────────────────────── */
.apg-breadcrumbs { max-width: 960px; margin: 20px auto 0; padding: 0 20px; color: var(--muted); font-size: 0.9rem; }
.apg-breadcrumbs__list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.apg-breadcrumbs__item { display: inline-flex; align-items: center; gap: 0.35rem; }
.apg-breadcrumbs__item a { color: var(--muted); text-decoration: none; border-bottom: 1px dotted transparent; }
.apg-breadcrumbs__item a:hover { color: var(--foreground); border-bottom-color: currentColor; }
.apg-breadcrumbs__item--current span { color: var(--foreground); font-weight: 600; }
.apg-breadcrumbs__sep { color: var(--border); font-weight: 400; }

/* ── Chrome: trust strip (theme: apg-trust-strip.php) ────────────────────── */
.apg-trust-strip {
	max-width: 960px;
	margin: -20px auto 48px;
	padding: 20px;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 0.75rem;
	box-shadow: 0 4px 10px -6px rgba(0, 0, 0, 0.08);
}
.apg-trust-strip__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px 24px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.apg-trust-strip__item { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }
.apg-trust-strip__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.apg-trust-strip__label { font-weight: 600; color: var(--foreground); font-size: 0.98rem; }
.apg-trust-strip__hint  { color: var(--muted); font-size: 0.86rem; line-height: 1.45; }

@media (max-width: 820px) {
	.apg-trust-strip__list { grid-template-columns: 1fr; }
	.apg-trust-strip { margin-top: -10px; }
}

/* ── Chrome: internal links (theme: apg-internal-links.php) ──────────────── */
.apg-internal-links { max-width: 960px; margin: 0 auto 48px; padding: 0 20px; }
.apg-internal-links h2 { font-size: 1.2rem; font-weight: 600; margin: 0 0 16px; color: var(--foreground); }
.apg-internal-links__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.apg-internal-links__group h3 { font-size: 1rem; font-weight: 600; margin: 0 0 10px; color: var(--foreground); }
.apg-internal-links__group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.apg-internal-links__group a { display: inline-block; padding: 8px 16px; background: var(--background); border: 1px solid var(--border); border-radius: 20px; text-decoration: none; color: var(--second-text); font-size: 0.9rem; }
.apg-internal-links__group a:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
	.apg-section--hero { grid-template-columns: 1fr; gap: 20px; padding: 0; }
	.apg-hero__image-wrap { order: 0; max-width: none; max-height: 320px; margin: 0; justify-self: stretch; }
	.apg-hero__content { padding: 24px 0 8px; }
	.apg-hero__heading { font-size: 1.6rem; }
	.apg-section { margin-bottom: 40px; padding: 0 16px; }
	.apg-section--cta { margin-left: 16px; margin-right: 16px; padding: 32px 20px; }
	.apg-btn, .apg-btn--large, .apg-cta-button { width: 100%; }
	.apg-steps__step { padding-left: 52px; }
	.apg-steps__step::before { width: 36px; height: 36px; font-size: 1rem; }
	.apg-table { display: block; overflow-x: auto; white-space: nowrap; }
	.apg-tip-box { flex-direction: column; padding: 20px; }
	.apg-tip__image-wrap img { width: 100%; height: auto; }
	.apg-figure, .apg-figure--left, .apg-figure--right { float: none; max-width: 100%; margin: 12px 0 16px; }
}
