/*
Theme Name: Agam Theme
Theme URI:
Author: Marco Schewa-Karapetyan
Description: Webseite IBA Energieberatung
Version: 1.2
*/

/* ============================================================
   AgamEnergie – Theme-weites Design (1:1 aus der Referenzseite
   übernommen, Klassen von iba- auf agam- umbenannt).
   Startseite + Header/Footer/Navigation. Weitere Unterseiten
   folgen Schritt für Schritt.
   ============================================================ */

/* ---------- Variablen & Grundreset ---------- */
:root {
    --paper: #fafbf8;
    --ink: #172d32;
    --muted: #56656a;
    --line: #d9e2dc;
    --lime: #c4ee96;
    --max: 1240px;
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
    overflow-x: hidden;
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

body {
    margin: 0;
    /* kein overflow-x:hidden hier – das würde auf body einen eigenen
       Scroll-Container erzeugen und dadurch "position: sticky" am
       Header verhindern. Die Begrenzung gegen horizontales Scrollen
       übernimmt bereits html { overflow-x: hidden } oben. */
    background: var(--paper);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 17px;
    line-height: 1.65;
}

a { color: inherit; text-decoration: none; text-underline-offset: 4px; }
img, svg { max-width: 100%; height: auto; }

h1, h2, h3 { font-weight: 600; letter-spacing: -.055em; line-height: 1.12; margin: 0 0 22px; }
h4 { font-weight: 500; letter-spacing: -.045em; line-height: 1.12; margin: 0 0 22px; }
h2 { font-size: clamp(36px, 4.4vw, 64px); }
h3 { font-size: 26px; }
p { margin: 0 0 20px; }

button, input, select, textarea { font: inherit; }
button, a { touch-action: manipulation; }
:focus-visible { outline: 3px solid #627c0f; outline-offset: 5px; }

.agam-skip {
    position: absolute;
    left: 20px;
    top: -100px;
    z-index: 100;
    background: #fff;
    padding: 12px 20px;
}
.agam-skip:focus { top: 15px; }

/* ---------- Layout-Helfer ---------- */
.agam-wrap { width: min(calc(100% - 64px), var(--max)); margin-inline: auto; }
.agam-section { padding-block: 105px; }
.agam-eyebrow { text-transform: uppercase; letter-spacing: .13em; font-size: 11px; font-weight: 700; color: #52616a; margin-bottom: 22px; }
.agam-lead { font-size: 16px; color: var(--muted); max-width: 600px; line-height: 1.65; margin-bottom: 20px; }
.agam-small { font-size: 13px; color: var(--muted); }
.agam-cols { display: flex; gap: 54px; }

/* ---------- Buttons ---------- */
.agam-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--ink);
    color: #fff;
    border: 1px solid var(--ink);
    border-radius: 100px;
    padding: 16px 25px;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 700;
    text-decoration: none;
    transition: background .18s, transform .18s;
}
.agam-button:hover { background: #31434a; transform: translateY(-1px); }
.agam-button-outline {
    color: var(--ink);
    background: transparent;
    border: 1px solid #a8b5a9;
}
.agam-button-outline:hover { background: #eef2f3; }
.agam-buttons { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Platzhalter-Bilder ----------
   TODO (Marco): sobald echte Fotos vorliegen, hier <img>-Tags
   einsetzen statt der CSS-Platzhalter. */
.agam-photo {
    position: relative;
    margin: 0;
    overflow: hidden;
    border-radius: 6px;
    background: linear-gradient(135deg, #e8eddf, #d7e3d0);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 260px;
}
.agam-photo svg { width: 64px; height: 64px; opacity: .45; }
.agam-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.agam-photo figcaption {
    position: absolute;
    bottom: 12px;
    right: 12px;
    color: #fff;
    background: rgba(20, 40, 30, .8);
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 10px;
    line-height: 1.5;
    letter-spacing: .02em;
}
.agam-hero-photo { border-radius: 6px; height: 440px; }
.agam-funding-photo { margin-bottom: 25px; border-radius: 12px; min-height: 300px; }
.agam-about-photo { border-radius: 0; min-height: 390px; }
.agam-about-with-photo { padding: 0; overflow: hidden; display: block; }
.agam-about-caption { padding: 28px 32px; }

/* ---------- Kopfzeile / Navigation ---------- */
.agam-header {
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 30;
}
.admin-bar .agam-header { top: 32px; }
.agam-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    min-height: 92px;
}
.agam-brand { display: flex; align-items: center; gap: 13px; text-decoration: none; white-space: nowrap; }
.agam-wordmark { font-size: 28px; font-weight: 800; line-height: 1; letter-spacing: -.07em; color: var(--ink); }
.agam-logo { display: block; height: 84px; width: auto; max-width: none; }
.agam-footer .agam-logo { height: 110px; }
.agam-nav { display: flex; align-items: center; gap: 22px; font-size: 13px; font-weight: 600; }
.agam-nav a { text-decoration: none; }
.agam-nav a:hover { text-decoration: underline; }
.agam-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 7px; }
.agam-nav .agam-button { padding: 13px 20px; font-size: 12px; }
.agam-menu-toggle {
    display: none;
    border: 1px solid var(--line);
    background: transparent;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
}

/* ---------- Hero ---------- */
.agam-hero { padding: 40px 0 28px; }
.agam-hero .agam-eyebrow { display: flex; gap: 9px; align-items: center; }
.agam-hero .agam-eyebrow:before { content: ''; width: 7px; height: 7px; background: #79b747; border-radius: 50%; flex-shrink: 0; }
.agam-modern-heading {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 7%;
    align-items: end;
    margin: 22px 0 34px;
}
.agam-hero h1 {
    font-size: clamp(52px, 6.5vw, 88px);
    font-weight: 500;
    line-height: 1.01;
    letter-spacing: -.065em;
    max-width: 650px;
    margin: 0;
}
.agam-hero h1 em { color: #557544; font-style: normal; }
.agam-hero-subtitle { font-size: 19px; line-height: 1.45; max-width: 350px; font-weight: 600; letter-spacing: -.03em; margin: 0 0 12px; }
.agam-hero .agam-lead { font-size: 16px; margin-bottom: 20px; }
.agam-hero .agam-buttons { margin: 0 0 24px; gap: 10px; }
.agam-hero .agam-button, .agam-hero .agam-button-outline { font-size: 13px; padding: 14px 21px; }
.agam-hero-note { margin: 16px 0 0; font-size: 11px; color: var(--muted); }
.agam-modern-visual { position: relative; }
.agam-hero-floating {
    position: absolute;
    bottom: 28px;
    left: 28px;
    background: var(--lime);
    border-radius: 4px;
    padding: 24px;
    max-width: 280px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .06);
}
.agam-hero-floating h3 { font-size: 28px; line-height: 1.08; margin-bottom: 14px; color: var(--ink); }
.agam-hero-floating p { font-size: 13px; margin-bottom: 14px; color: var(--ink); }
.agam-hero-floating p:last-child { margin-bottom: 0; font-weight: 700; }
.agam-hero-floating .agam-eyebrow { font-size: 10px; color: #273923; margin-bottom: 10px; }

/* ---------- Vertrauensleiste ---------- */
.agam-trust { padding: 20px 0 30px; }
.agam-trust-inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: 12px; }
.agam-trust-inner span { display: flex; gap: 10px; align-items: center; }
.agam-trust-inner span:before { content: '✓'; color: #3c7626; font-weight: 700; }

/* ---------- Finder ("Was haben Sie vor?") ---------- */
.agam-finder { background: #edf1ea; }
.agam-section-intro { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 38px; }
.agam-section-intro h2 { max-width: 680px; margin-bottom: 0; }
.agam-section-intro p { max-width: 360px; margin-bottom: 0; font-size: 15px; color: var(--muted); }

/* zweite Spalte mit Text + Button (z. B. "Jedes Gebäude. Eine eigene Aufgabe.") */
.agam-section-intro .agam-reference-teaser-info { width: 460px; max-width: 460px; flex-shrink: 0; }
.agam-section-intro .agam-reference-teaser-info p { max-width: none; margin-bottom: 20px; font-size: 15px; color: var(--muted); }
.agam-choice-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.agam-choice {
    position: relative;
    text-align: left;
    border: 1px solid #ccd7cb;
    border-radius: 6px;
    background: #fafbf8;
    padding: 25px 22px;
    cursor: pointer;
    color: var(--ink);
    min-height: 145px;
    transition: background .2s, border-color .2s;
}
.agam-choice span { display: block; font-size: 22px; letter-spacing: -.04em; font-weight: 600; padding-right: 20px; line-height: 1.2; }
.agam-choice small { display: block; color: var(--muted); font-size: 13px; margin-top: 15px; line-height: 1.5; }
.agam-choice b { position: absolute; right: 18px; top: 22px; font-weight: 400; }
.agam-choice:hover, .agam-choice[aria-pressed="true"] { background: #dceccf; border-color: #587747; }
.agam-recommendation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 25px;
    margin-top: 24px;
    min-height: 100px;
    padding: 24px 0 0;
    border-top: 1px solid #c9d6c5;
}
.agam-recommendation p { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 15px; }
.agam-recommendation a { font-size: 14px; white-space: nowrap; font-weight: 700; }

/* ---------- Leistungen (Karten) ---------- */
.agam-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.agam-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 28px 22px;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    transition: background .2s;
}
.agam-card:hover { background: #f0f5ec; }
.agam-card h3 { font-size: 25px; margin-bottom: 14px; }
.agam-card p { font-size: 14px; color: var(--muted); }
.agam-card-link { margin-top: auto; padding-top: 8px; color: var(--ink); font-size: 13px; font-weight: 700; }
.agam-card-link a { text-decoration: none; }
.agam-card-link a:hover { text-decoration: underline; }

/* Leistungskarten: aufklappbare "Mehr Details" */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.agam-service-details { margin-top: auto; padding-top: 8px; }
.agam-service-details summary {
    list-style: none;
    cursor: pointer;
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
}
.agam-service-details summary::-webkit-details-marker { display: none; }
.agam-service-details summary:hover { text-decoration: underline; }
.agam-service-details .details-open { display: none; }
.agam-service-details[open] .details-open { display: inline; }
.agam-service-details[open] .details-closed { display: none; }
.agam-service-details p { margin-top: 14px; font-size: 14px; color: var(--muted); }
.agam-service-cta { margin-top: 14px !important; font-weight: 700; }
.agam-service-cta a { color: var(--ink); text-decoration: none; }
.agam-service-cta a:hover { text-decoration: underline; }
.agam-service-icon {
    width: 42px; height: 42px;
    border: 0;
    background: #edf3e9;
    color: #346220;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 28px;
}

/* ---------- Dunkle Abschnitte (Förderung-Teaser) ---------- */
.agam-dark { background: var(--ink); color: #fff; }
.agam-dark h2, .agam-dark h3 { color: #fff; }
.agam-dark .agam-eyebrow { color: var(--lime); }
.agam-dark p, .agam-dark .agam-lead { color: #bac7cd; }
.agam-dark .agam-small { color: #bfcfc6; }
.agam-dark .agam-button { background: var(--lime); color: var(--ink); border-color: var(--lime); }
.agam-dark .agam-button:hover { background: #e7f7ac; }
.agam-funding .agam-cols { gap: 9%; align-items: start; }
.agam-funding-list { border: 0; }
.agam-funding-row { border-bottom: 1px solid #3c4d54; padding: 17px 0; }
.agam-funding-row h3 { font-size: 20px; margin-bottom: 6px; }
.agam-funding-row p { font-size: 13px; margin-bottom: 0; }

/* ---------- Prozess ("So arbeiten wir") ---------- */
.agam-process { background: #f3f5f5; }
.agam-process .agam-cols { gap: 16px; }
.agam-step { background: #fff; border-radius: 12px; padding: 26px; flex: 1 1 0; min-width: 0; }
.agam-step-number { font-size: 12px; letter-spacing: .1em; color: #466439; margin-bottom: 34px; }
.agam-step h3 { font-size: 25px; }
.agam-step p { font-size: 14px; color: var(--muted); }

/* ---------- Über uns ---------- */
.agam-about .agam-cols { align-items: center; gap: 8%; }
.agam-about-card {
    border-radius: 16px;
    background: #f0f3f4;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.agam-about-card h3 { font-size: 23px; margin-bottom: 7px; }
.agam-about-card p { font-size: 14px; margin-bottom: 0; color: var(--muted); }
.agam-about .agam-lead { font-size: 17px; }

/* ---------- Referenzen-Teaser ---------- */
.agam-reference-teaser { background: #e9f5dc; position: relative; }
.agam-reference-teaser .agam-cols { align-items: center; gap: 65px; }
.agam-reference-teaser h2 { font-size: clamp(36px, 4.3vw, 60px); }

/* ---------- FAQ ---------- */
.agam-faq { padding-top: 95px; }
.agam-faq .agam-cols { gap: 70px; }
.agam-faq-item { border-top: 1px solid var(--line); padding: 23px 0; font-size: 16px; }
.agam-faq-item:last-child { border-bottom: 1px solid var(--line); }
.agam-faq-item summary { cursor: pointer; font-weight: 600; line-height: 1.5; padding-right: 10px; }
.agam-faq-item p { color: var(--muted); margin: 14px 0 0; font-size: 15px; }

/* ---------- Kontakt ---------- */
.agam-contact { background: var(--ink); color: #fff; }
.agam-contact .agam-cols { gap: 70px; }
.agam-contact h2 { font-size: clamp(38px, 4.7vw, 68px); }
.agam-contact .agam-eyebrow { color: var(--lime); }
.agam-contact .agam-lead { color: #bdc8cd; }
.agam-contact .agam-button { background: var(--lime); color: var(--ink); border-color: var(--lime); }
.agam-contact-details { border-left: 1px solid #46565d; padding-left: 40px; }
.agam-contact-details a {
    display: block;
    font-size: clamp(20px, 2.2vw, 29px);
    line-height: 1.35;
    text-decoration: none;
    margin-bottom: 14px;
    overflow-wrap: anywhere;
}
.agam-contact-details address { font-style: normal; font-size: 15px; color: #bdc8cd; margin-top: 28px; }

/* ---------- Footer ---------- */
.agam-footer { background: var(--paper); padding: 55px 0 22px; }
.agam-footer .agam-wordmark { font-size: 24px; }
.agam-footer-top { display: flex; justify-content: space-between; align-items: start; gap: 30px; }
.agam-footer-top p { font-size: 13px; color: var(--muted); margin-top: 18px; max-width: 370px; }
.agam-footer-links { display: flex; gap: 24px; flex-wrap: wrap; font-size: 13px; }
.agam-footer-bottom {
    border-top: 1px solid var(--line);
    margin-top: 25px;
    padding-top: 18px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    font-size: 11px;
    color: var(--muted);
}

/* ---------- Mobile Kontaktleiste (nur < 780px) ---------- */
.agam-mobile-contact { display: none; }

/* ---------- Einfacher Unterseiten-Hero (Impressum, Datenschutz, ...) ----------
   Seiten mit eigenem Zwei-Spalten-Hero (z. B. Kontakt) überschreiben das in
   ihrer eigenen CSS-Datei, die nach dieser hier geladen wird. */
.agam-page-hero { padding: 75px 0 50px; border-bottom: 1px solid var(--line); }
.agam-page-hero h1 { font-size: clamp(38px, 4.7vw, 64px); max-width: 950px; }
.agam-breadcrumb { font-size: 12px; margin-bottom: 27px; color: var(--muted); }
.agam-breadcrumb a { text-decoration: underline; }

/* ---------- Lange Fließtext-Artikel (Rechtstexte etc.) ---------- */
.agam-article { max-width: 780px; margin-inline: auto; padding: 58px 32px 80px; }
.agam-article h2 { font-size: 34px; margin-top: 38px; }
.agam-article h2:first-child { margin-top: 0; }
.agam-article h3 { font-size: 24px; margin-top: 30px; }
.agam-article p, .agam-article li { color: var(--muted); font-size: 17px; }
.agam-article li { margin-bottom: 9px; }
.agam-article ul { padding-left: 23px; }

/* ---------- Anker-Navigation innerhalb langer Rechtstexte ---------- */
.agam-legal-toc { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 30px; }
.agam-legal-toc a { font-size: 13px; border: 1px solid var(--line); padding: 8px 12px; border-radius: 30px; }
.agam-legal-article h2 { scroll-margin-top: 120px; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1050px) {
    .agam-nav { gap: 14px; }
    .agam-nav > a[href^="tel:"] { display: none; }
    .agam-modern-heading { gap: 4%; }
    .agam-hero h1 { font-size: 64px; }
    .agam-hero .agam-buttons { gap: 8px; }
    .agam-hero .agam-button, .agam-hero .agam-button-outline { padding: 12px 16px; }
    .agam-section { padding-block: 75px; }
    .agam-hero { padding: 40px 0 20px; }
}

@media (max-width: 1000px) {
    .agam-choice-grid { grid-template-columns: 1fr 1fr; }
    .agam-nav { gap: 13px; font-size: 12px; }
    .agam-hero h1 { font-size: 64px; }
}

@media (max-width: 900px) {
    .agam-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 780px) {
    .agam-wrap { width: calc(100% - 36px); }
    .agam-header-inner { min-height: 80px; }
    .agam-logo { height: 56px; }
    .agam-menu-toggle { display: block; }
    .agam-nav {
        display: none;
        position: absolute;
        top: 80px;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
        padding: 24px;
        background: var(--paper);
        border-bottom: 1px solid var(--line);
        box-shadow: 0 15px 20px rgba(23, 45, 50, .06);
        font-size: 16px;
    }
    .agam-nav.is-open { display: flex; }
    .agam-nav a { padding: 4px; }
    .agam-nav .agam-button { padding: 12px; }

    .agam-cols { flex-direction: column; gap: 28px; }
    .agam-modern-heading { display: block; margin-top: 18px; }
    .agam-hero h1 { font-size: clamp(49px, 11vw, 72px); margin-bottom: 26px; }
    .agam-hero-subtitle { font-size: 18px; max-width: none; }
    .agam-hero-photo { height: auto; aspect-ratio: 1.35; }
    .agam-hero-floating { position: static; max-width: none; margin-top: 12px; padding: 22px; }
    .agam-hero-floating h3 { font-size: 26px; }
    .agam-hero-floating h3 br { display: none; }
    .agam-hero-note { font-size: 11px; }
    .agam-section { padding-block: 60px; }
    .agam-recommendation { align-items: start; flex-direction: column; gap: 16px; }
    .agam-choice { padding: 20px 15px; min-height: 145px; }
    .agam-choice span { font-size: 20px; }
    .agam-choice small { font-size: 12px; }
    .agam-section-intro { flex-direction: column; align-items: start; gap: 20px; }
    .agam-section-intro p { max-width: none; }
    .agam-section-intro .agam-reference-teaser-info { width: auto; max-width: none; }
    .agam-page-hero { padding-top: 45px; }
    .agam-article { padding: 30px 18px 60px; }
    .agam-legal-toc { gap: 8px; margin-bottom: 22px; }
    .agam-cards { grid-template-columns: 1fr; }
    .agam-card { min-height: 210px; }
    .agam-trust-inner { gap: 12px; font-size: 12px; }
    .agam-trust-inner span { width: calc(50% - 12px); }
    .agam-about-card { min-height: 300px; padding: 35px; }
    .agam-contact-details { border-left: 0; border-top: 1px solid #46565d; padding: 26px 0 0; }
    .agam-contact-details a { font-size: 24px; }
    .agam-footer-top { flex-direction: column; }
    .agam-footer-bottom { flex-direction: column; gap: 8px; }
    .agam-faq { padding-top: 60px; }
    .admin-bar .agam-header { top: 46px; }

    .agam-mobile-contact {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 35;
        background: var(--ink);
        padding: 10px 18px;
        gap: 10px;
        box-shadow: 0 -3px 20px rgba(0, 0, 0, .06);
    }
    .agam-mobile-contact a {
        flex: 1;
        text-align: center;
        text-decoration: none;
        border: 1px solid #58716e;
        border-radius: 100px;
        padding: 10px;
        font-size: 13px;
        color: #fff;
    }
    .agam-mobile-contact a:last-child { background: var(--lime); color: var(--ink); border-color: var(--lime); }
    body { padding-bottom: 72px; }
    .agam-footer { padding-bottom: 30px; }
}

@media (max-width: 480px) {
    .agam-hero h1 { font-size: 47px; }
    .agam-buttons { flex-direction: column; align-items: stretch; }
    .agam-hero-floating { max-width: none; }
    .agam-hero-floating h3 { font-size: 26px; }
    .agam-hero-note { font-size: 10px; }
    .agam-section-intro { margin-bottom: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *:before, *:after { transition: none !important; }
}
