/* Artemis Seiten-Baukasten - Frontend-Editor-Styles.
   Wird nur für eingeloggte, berechtigte Nutzer geladen (siehe
   inc/section-builder.php). Besucher sehen niemals diese Klassen. */

/* ---------- Sektions-Layouts (auch ohne Edit-Modus sichtbar) ---------- */
.asec-hero{
	display:flex; align-items:center; gap:clamp(28px, 4vw, 48px); padding:var(--section-y) 0;
}
.asec-hero__text{ flex:1 1 520px; max-width:600px; min-width:0; }
.asec-hero__text h1{ font-size:clamp(32px, 4.6vw, 52px); letter-spacing:-0.02em; }
.asec-hero__lead{ font-size:17.5px; color:var(--c-text-muted); line-height:1.65; margin:16px 0 24px; }
.asec-hero__media{ position:relative; flex:0 0 auto; width:clamp(220px, 30vw, 380px); aspect-ratio:4/3; border-radius:var(--radius-lg); overflow:hidden; background:var(--c-bg-alt); }
.asec-hero__media img{ width:100%; height:100%; object-fit:cover; }
.asec-cta-row{ display:flex; flex-wrap:wrap; gap:12px; }

.asec-text{ max-width:760px; padding:var(--section-y-tight) 0; }
.asec-text h2{ margin-bottom:14px; }

.asec-imgtext{ display:flex; align-items:center; gap:clamp(28px, 4vw, 48px); padding:var(--section-y) 0; }
/* Reihenfolge über order statt row-reverse: row-reverse haengt an der
   Reihenfolge im Quelltext (dort steht das Bild vorn) und hat die
   Einstellung "Text zuerst" ausgehebelt. */
.asec-imgtext--left .asec-imgtext__media{ order:1; }
.asec-imgtext--left .asec-imgtext__text{ order:2; }
.asec-imgtext--right .asec-imgtext__text{ order:1; }
.asec-imgtext--right .asec-imgtext__media{ order:2; }
.asec-imgtext__media{ position:relative; flex:0 0 auto; width:clamp(220px, 34vw, 420px); aspect-ratio:4/3; border-radius:var(--radius-lg); overflow:hidden; background:var(--c-bg-alt); }
.asec-imgtext__media img{ width:100%; height:100%; object-fit:cover; }
.asec-imgtext__text{ flex:1 1 400px; min-width:0; }

.asec-image-placeholder-photo{ width:100%; height:100%; object-fit:cover; display:block; }

/* ---------- Sektions-Stile (Panel: Hintergrund, Breite, Ausrichtung) ----------
   Die eigentlichen Farb-/Verlaufswerte kommen als geprueftes Inline-CSS
   vom Server (siehe artemis_section_style_attrs). Hier nur die Klassen
   fuer Breite, Ausrichtung und die Textfarben-Vererbung. */
.asec-style{ position:relative; }
.asec-style.asec-has-bg{ overflow:hidden; }

/* Textfarbe: --sec-ink wird nur gesetzt, wenn im Panel gewaehlt oder der
   Hintergrund dunkel ist. Sonst greifen die normalen Theme-Farben. */
.asec-style h1, .asec-style h2, .asec-style h3, .asec-style h4{ color:var(--sec-ink, var(--c-text)); }
.asec-style p, .asec-style li{ color:var(--sec-ink-soft, var(--c-text-muted)); }
.asec-style .eyebrow{ color:var(--sec-ink, var(--c-text)); }

/* Inhaltsbreite je Sektion */
.asec-w-narrow > .wrap{ max-width:820px; }
.asec-w-normal > .wrap{ max-width:var(--maxw); }
.asec-w-wide   > .wrap{ max-width:1480px; }
.asec-w-full   > .wrap{ max-width:none; }

/* Ausrichtung */
.asec-al-center{ text-align:center; }
.asec-al-center .asec-text,
.asec-al-center .asec-faq{ margin-left:auto; margin-right:auto; }
.asec-al-center .asec-cta-row,
.asec-al-center .asec-steps__grid{ justify-content:center; }
/* Karten-Inhalte bleiben auch in zentrierten Sektionen linksbuendig,
   sonst wird der Fliesstext in den Karten schlecht lesbar. */
.asec-al-center .asec-steps__card,
.asec-al-center .asec-faq__list{ text-align:left; }

.asec-cta-banner{ text-align:center; background:var(--c-bg-alt); border-radius:var(--radius-lg); padding:clamp(36px, 5vw, 56px) var(--gutter); margin:var(--section-y-tight) 0; }
.asec-cta-banner h2{ margin-bottom:20px; }

.asec-gallery{ padding:var(--section-y) 0; }
.asec-gallery h2{ margin-bottom:20px; }
.asec-gallery__grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(160px, 1fr)); gap:14px; }
.asec-gallery__item{ position:relative; aspect-ratio:1/1; border-radius:var(--radius-md); overflow:hidden; background:var(--c-bg-alt); }
.asec-gallery__item img{ width:100%; height:100%; object-fit:cover; display:block; }
.asec-gallery__remove{
	display:none; position:absolute; top:6px; right:6px; width:24px; height:24px; border-radius:6px; border:none;
	background:rgba(18,24,31,.7); color:#fff; font-size:12px; cursor:pointer; align-items:center; justify-content:center;
}
body.asec-edit-mode .asec-gallery__item:hover .asec-gallery__remove{ display:flex; }
.asec-gallery__add{
	aspect-ratio:1/1; border-radius:var(--radius-md); border:1.5px dashed var(--c-border); background:transparent;
	color:var(--c-text-muted); font-size:12.5px; font-weight:600; cursor:pointer; line-height:1.4;
}
.asec-gallery__add:hover{ border-color:var(--c-red); color:var(--c-red); }

/* ---------- Baukasten: 3-Schritte-Prozess ---------- */
.asec-steps{ padding:var(--section-y) 0; }
.asec-steps{ text-align:center; }
.asec-steps h2{ margin-bottom:28px; }
.asec-steps .eyebrow{ margin-bottom:10px; }
.asec-steps__grid{ display:grid; grid-template-columns:repeat(3, 1fr); gap:20px; }
.asec-steps__card{ background:var(--c-bg-alt); border-radius:var(--radius-lg); padding:28px; text-align:left; }
.asec-steps__card--red{ background:linear-gradient(135deg, var(--c-red), var(--c-red-dark)); color:#fff; }
.asec-steps__card--red p{ color:rgba(255,255,255,.85); }
.asec-steps__num{
	display:inline-flex; align-items:center; justify-content:center; width:34px; height:34px; border-radius:var(--radius-xs);
	background:var(--c-surface); color:var(--c-red); font-weight:800; font-family:var(--font-display); margin-bottom:14px;
}
.asec-steps__card--red .asec-steps__num{ background:rgba(255,255,255,.2); color:#fff; }
.asec-steps__card h3{ font-size:17px; margin-bottom:6px; }
@media (max-width:900px){ .asec-steps__grid{ grid-template-columns:1fr 1fr; } }
@media (max-width:600px){ .asec-steps__grid{ grid-template-columns:1fr; } }

/* ---------- Baukasten: Trust-Leiste ---------- */
.asec-trust{ display:grid; grid-template-columns:repeat(4, 1fr); gap:24px; padding:var(--section-y-tight) 0; border-top:1px solid var(--c-border); border-bottom:1px solid var(--c-border); }
.asec-trust__item{ display:flex; align-items:flex-start; gap:12px; }
.asec-trust__icon{ flex-shrink:0; width:36px; height:36px; border-radius:var(--radius-sm); background:var(--c-red-tint); color:var(--c-red); display:flex; align-items:center; justify-content:center; }
.asec-trust__icon svg{ width:19px; height:19px; }
.asec-trust__body{ display:flex; flex-direction:column; gap:2px; }
.asec-trust__title{ font-weight:700; font-size:14px; }
.asec-trust__text{ font-size:12.5px; color:var(--c-text-muted); }
@media (max-width:860px){ .asec-trust{ grid-template-columns:1fr 1fr; row-gap:24px; } }
@media (max-width:480px){ .asec-trust{ grid-template-columns:1fr; } }

/* ---------- Baukasten: FAQ-Akkordeon (natives <details>, kein JS nötig) ---------- */
.asec-faq{ max-width:760px; margin:0 auto; padding:var(--section-y) 0; }
.asec-faq{ text-align:center; }
.asec-faq h2{ margin-bottom:28px; }
.asec-faq .eyebrow{ margin-bottom:10px; }
.asec-faq__list{ display:flex; flex-direction:column; gap:10px; text-align:left; }
.asec-faq__item{ background:var(--c-surface); border:1px solid var(--c-border); border-radius:var(--radius-md); padding:4px 20px; }
.asec-faq__item summary{
	display:flex; align-items:center; justify-content:space-between; gap:16px; cursor:pointer;
	padding:16px 0; font-weight:700; font-size:15px; list-style:none;
}
.asec-faq__item summary::-webkit-details-marker{ display:none; }
.asec-faq__chevron{ flex-shrink:0; color:var(--c-red); font-size:18px; font-weight:400; transition:transform .2s ease; }
.asec-faq__item[open] .asec-faq__chevron{ transform:rotate(45deg); }
.asec-faq__item p{ padding-bottom:18px; margin:0; font-size:14.5px; }

/* Referenz-Blöcke (Bento-Grid, Kennzahlen, Galerie): Inhalt wird über
   ein anderes Werkzeug gepflegt, hier nur Position/Sichtbarkeit steuerbar. */
.asec-refblock-label{
	display:none; text-align:center; font-size:11.5px; font-weight:600; color:var(--c-text-muted);
	background:var(--c-bg-alt); border:1px dashed var(--c-border); border-radius:var(--radius-xs);
	padding:8px 14px; margin:0 24px 4px;
}
body.asec-edit-mode .asec-refblock-label{ display:block; }

.asec-spacer--small{ height:24px; }
.asec-spacer--medium{ height:56px; }
.asec-spacer--large{ height:104px; }

@media (max-width:760px){
	.asec-hero, .asec-imgtext{ flex-direction:column; align-items:flex-start; gap:24px; }
	/* Gestapelt steht immer der Text oben. */
	.asec-imgtext--right, .asec-imgtext--left{ flex-direction:column; }
	.asec-imgtext--right .asec-imgtext__text,
	.asec-imgtext--left .asec-imgtext__text{ order:1; }
	.asec-imgtext--right .asec-imgtext__media,
	.asec-imgtext--left .asec-imgtext__media{ order:2; }
	.asec-hero__media, .asec-imgtext__media{ width:100%; }
	.asec-hero__text, .asec-imgtext__text{ flex:0 0 auto; width:100%; max-width:none; }
	.asec-hero--compact, .asec-hero--band, .asec-hero--center{ gap:0; }
}

/* ---------- Editbar (oben rechts fix) ---------- */
/* Liegt unterhalb des Headers. --header-offset enthaelt bereits die Hoehe
   der Adminleiste, sodass die Leiste im eingeloggten Zustand nicht
   verdeckt wird. */
/* Kompakte Werkzeugleiste rechts, vertikal mittig - sie liegt am
   Bildschirmrand und verdeckt weder Menü noch Inhalt. */
.asec-editbar{
	position:fixed; right:12px; top:50%; transform:translateY(-50%); z-index:1000;
	display:flex; flex-direction:column; align-items:stretch; gap:8px;
	width:52px;
}
.asec-editbar__toggle, .asec-editbar__save, .asec-editbar__exit{
	font-family:var(--font-body); font-weight:700; cursor:pointer;
	border:1px solid var(--c-border); border-radius:14px;
	background:var(--c-surface); color:var(--c-text);
	box-shadow:var(--shadow-md);
	width:52px; height:52px;
	display:flex; align-items:center; justify-content:center;
	font-size:20px; line-height:1;
	transition:background .15s ease, color .15s ease, transform .12s ease;
}
.asec-editbar__toggle:hover, .asec-editbar__save:hover, .asec-editbar__exit:hover{ transform:translateY(-1px); }
.asec-editbar__toggle{ background:var(--c-red); color:#fff; border-color:var(--c-red); }
.asec-editbar__save{ background:var(--c-red); color:#fff; border-color:var(--c-red); }
/* Beschriftung als kleiner Tooltip links neben dem Knopf. */
.asec-editbar [data-tip]{ position:relative; }
.asec-editbar [data-tip]::after{
	content:attr(data-tip);
	position:absolute; right:calc(100% + 8px); top:50%; transform:translateY(-50%);
	background:rgba(18,24,31,.9); color:#fff;
	font-size:12px; font-weight:600; white-space:nowrap;
	padding:5px 9px; border-radius:8px;
	opacity:0; pointer-events:none; transition:opacity .15s ease;
}
.asec-editbar [data-tip]:hover::after{ opacity:1; }
/* Aktionen als eigene, kompakte Spalte (nur bei aktivem Bearbeiten). */
.asec-editbar__actions{ display:flex; flex-direction:column; gap:8px; }
/* Der lange Hinweistext wird zu einem dezenten Info-Knopf mit Tooltip. */
.asec-editbar__hint{
	display:flex; align-items:center; justify-content:center;
	width:52px; height:36px;
	font-size:11px; color:var(--c-text-muted);
	background:var(--c-surface); border:1px solid var(--c-border);
	border-radius:12px; box-shadow:var(--shadow-sm);
	cursor:help; text-align:center;
}
@media (max-width:760px){
	/* Auf dem Handy unten rechts, damit der Daumen sie erreicht. */
	.asec-editbar{ right:10px; top:auto; bottom:10px; transform:none; }
	.asec-editbar__hint{ display:none; }
}

/* ---------- Edit-Modus: Sektionen ---------- */
body.asec-edit-mode .artemis-section{
	position:relative;
	outline:1.5px dashed color-mix(in srgb, var(--c-red) 45%, transparent);
	outline-offset:6px;
	transition:outline-color .15s ease;
}
body.asec-edit-mode .artemis-section:hover{ outline-color:var(--c-red); }
body.asec-edit-mode .artemis-section [contenteditable="true"]{
	border-radius:6px; transition:box-shadow .15s ease;
	cursor:text;
}
body.asec-edit-mode .artemis-section [contenteditable="true"]:hover{ box-shadow:0 0 0 2px color-mix(in srgb, var(--c-red) 25%, transparent); }
body.asec-edit-mode .artemis-section [contenteditable="true"]:focus{
	outline:none; box-shadow:0 0 0 2px var(--c-red);
}

/* Toolbar pro Sektion (oben links am Rahmen) */
.asec-toolbar{
	display:none; position:absolute; top:-14px; left:6px; z-index:20;
	align-items:center; gap:4px; background:var(--c-text); border-radius:8px; padding:4px 6px; box-shadow:var(--shadow-soft-1);
}
body.asec-edit-mode .artemis-section:hover .asec-toolbar,
body.asec-edit-mode .artemis-section.is-toolbar-pinned .asec-toolbar{ display:flex; }
.asec-toolbar__label{ color:rgba(255,255,255,.6); font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; padding:0 6px; }
.asec-btn{
	width:24px; height:24px; border-radius:5px; border:none; background:rgba(255,255,255,.12); color:#fff;
	font-size:12px; cursor:pointer; display:flex; align-items:center; justify-content:center;
}
.asec-btn:hover{ background:rgba(255,255,255,.24); }
.asec-btn--danger:hover{ background:var(--c-red); }

/* Bild-Wechsel-Button */
.asec-image-btn{
	display:none; position:absolute; bottom:10px; right:10px; z-index:10;
	font-size:12px; font-weight:600; padding:8px 12px; border-radius:var(--radius-xs);
	background:rgba(18,24,31,.72); color:#fff; border:none; cursor:pointer;
}
body.asec-edit-mode .asec-hero__media:hover .asec-image-btn,
body.asec-edit-mode .asec-imgtext__media:hover .asec-image-btn{ display:block; }

/* Link-Ziel-Feld für Buttons im Edit-Modus */
.asec-cta{ position:relative; }
body.asec-edit-mode .asec-cta::after{ content:'🔗 Link bearbeiten'; position:absolute; bottom:-26px; left:0; font-size:11px; color:var(--c-text-muted); white-space:nowrap; opacity:0; transition:opacity .15s ease; pointer-events:none; }
body.asec-edit-mode .asec-cta:hover::after{ opacity:1; }

/* Sektion einfügen ("+") */
.asec-inserter{ display:none; justify-content:center; padding:6px 0; position:relative; z-index:15; }
body.asec-edit-mode .asec-inserter{ display:flex; }
.asec-inserter__btn{
	font-size:12px; font-weight:700; padding:6px 14px; border-radius:var(--radius-sm);
	background:var(--c-bg-alt); color:var(--c-text-muted); border:1px dashed var(--c-border); cursor:pointer;
	opacity:.5; transition:opacity .15s ease, background .15s ease, color .15s ease;
}
.asec-inserter:hover .asec-inserter__btn, .asec-inserter__btn:focus-visible{
	opacity:1; background:var(--c-red); color:#fff; border-style:solid; border-color:var(--c-red);
}

/* Sektionstyp-Auswahl-Popover */
.asec-type-picker{
	position:absolute; z-index:250; background:var(--c-surface); border:1px solid var(--c-border);
	border-radius:var(--radius-md); box-shadow:var(--shadow-soft-2); padding:8px; display:flex; flex-direction:column; gap:2px;
	min-width:200px;
}
.asec-type-picker button{
	text-align:left; padding:9px 12px; border-radius:8px; border:none; background:transparent; font-size:13.5px; cursor:pointer;
}
.asec-type-picker button:hover{ background:var(--c-bg-alt); }

/* Drag & Drop */
body.asec-edit-mode .artemis-section{ cursor:grab; }
body.asec-edit-mode .artemis-section.is-dragging{ opacity:.4; cursor:grabbing; }
body.asec-edit-mode .artemis-section.is-dragover{ outline-color:var(--c-red); outline-style:solid; }

/* Speicher-Toast */
.asec-toast{
	position:fixed; bottom:20px; left:50%; transform:translateX(-50%) translateY(20px);
	background:var(--c-text); color:#fff; padding:12px 20px; border-radius:var(--radius); font-size:13.5px;
	box-shadow:var(--shadow-soft-2); z-index:300; opacity:0; pointer-events:none; transition:opacity .2s ease, transform .2s ease;
}
.asec-toast.is-visible{ opacity:1; transform:translateX(-50%) translateY(0); }
.asec-toast--error{ background:var(--c-red); max-width:min(440px, calc(100vw - 40px)); text-align:center; line-height:1.45; }

/* ---------- Einstellungs-Panel (Darstellung je Sektion) ---------- */
.asec-panel{
	position:fixed; top:50%; right:20px; transform:translateY(-50%);
	width:min(300px, calc(100vw - 32px)); z-index:400;
	background:var(--c-surface); border:1px solid var(--c-border);
	border-radius:var(--radius-lg); box-shadow:var(--shadow-soft-2);
	font-family:var(--font-body); max-height:min(86vh, 700px); display:flex; flex-direction:column;
}
.asec-panel[hidden]{ display:none; }
.asec-panel__head{
	display:flex; align-items:center; gap:8px; padding:14px 16px;
	border-bottom:1px solid var(--c-border);
}
.asec-panel__head strong{ font-size:14px; }
.asec-panel__type{ font-size:11.5px; color:var(--c-text-muted); text-transform:uppercase; letter-spacing:.04em; }
.asec-panel__close{
	margin-left:auto; width:28px; height:28px; border-radius:8px; border:none;
	background:var(--c-bg-alt); color:var(--c-text-muted); cursor:pointer; font-size:13px;
}
.asec-panel__close:hover{ background:var(--c-red); color:#fff; }
.asec-panel__body{ padding:16px; overflow-y:auto; display:flex; flex-direction:column; gap:14px; }
.asec-panel__field{ display:flex; flex-direction:column; gap:6px; font-size:12.5px; font-weight:600; color:var(--c-text); }
.asec-panel__field select,
.asec-panel__field input[type="color"]{
	font-family:inherit; font-size:13.5px; font-weight:400;
	border:1px solid var(--c-border); border-radius:var(--radius-sm); padding:8px 10px; background:var(--c-surface);
}
.asec-panel__field input[type="color"]{ padding:4px; height:38px; cursor:pointer; }
.asec-panel__row{ display:flex; gap:10px; }
.asec-panel__row .asec-panel__field{ flex:1; }
.asec-panel__hint{ font-size:11.5px; color:var(--c-text-muted); margin:0; line-height:1.5; }
@media (max-width:760px){
	.asec-panel{
		top:auto; bottom:0; right:0; left:0; transform:none;
		width:100%; max-height:70vh;
		border-radius:var(--radius-lg) var(--radius-lg) 0 0;
	}
}

.asec-item-remove{ display:none; position:absolute; top:8px; right:8px; z-index:12; width:28px; height:28px; border:0; border-radius:8px; background:rgba(18,24,31,.86); color:#fff; font-size:13px; line-height:1; cursor:pointer; align-items:center; justify-content:center; }
.asec-item-remove:hover{ background:var(--c-red); }
.asec-item-add{ display:none; margin-top:12px; padding:9px 16px; border:2px dashed var(--c-red); border-radius:12px; background:transparent; color:var(--c-red); font:700 .8125rem/1 var(--font-body); cursor:pointer; }
.asec-item-add:hover{ background:var(--c-red); color:#fff; }
body.asec-edit-mode .asec-item-remove{ display:flex; }
body.asec-edit-mode .asec-item-add{ display:inline-flex; }
body.asec-edit-mode .asec-itemlist > *{ position:relative; }
.asec-faq__item > .asec-item-remove{ top:14px; right:48px; }
.asec-panel__replay{ align-self:flex-start; padding:7px 12px; border:1px solid var(--c-border); border-radius:var(--radius-xs); background:var(--c-surface); color:var(--c-text); font:600 12.5px/1 var(--font-body); cursor:pointer; }
.asec-panel__replay:hover{ border-color:var(--c-red); color:var(--c-red); }

.asec-animchip{ display:none; }
body.asec-edit-mode .asec-animchip{ display:flex; align-items:center; gap:8px; position:absolute; right:14px; top:-14px; z-index:30; padding:6px 10px; border-radius:10px; background:#fff; border:1px solid var(--c-border); box-shadow:var(--shadow-sm); font:600 12px/1 var(--font-body); color:var(--c-text); }
body.asec-edit-mode .asec-animchip select{ font:inherit; padding:3px 6px; border:1px solid var(--c-border); border-radius:6px; background:var(--c-surface); color:var(--c-text); cursor:pointer; }

body.asec-edit-mode .asec-icspick{ opacity:.55; font-size:12px; }
body.asec-edit-mode .asec-icspick:hover{ opacity:1; }
.asec-facts--empty:not(.is-open){ display:none !important; }

.asec-zoomgrip{ display:none; }
@media (min-width:901px){
	body.asec-edit-mode .asec-zoomgrip{ display:block; position:absolute; right:-14px; bottom:-14px; width:22px; height:22px; border-radius:6px; background:var(--c-red); box-shadow:0 2px 8px rgba(0,0,0,.25); cursor:nwse-resize; z-index:20; }
	body.asec-edit-mode .hero__inner, body.asec-edit-mode .asec-hero__text{ position:relative; outline:1px dashed color-mix(in srgb, var(--c-red) 40%, transparent); outline-offset:8px; }
}
