/* ==========================================================================
   Michael Haug – Architekturfotograf
   Prototyp für die CMS-Umsetzung (Strichpunkt CMS)

   Struktur:
   1. Fonts
   2. Design-Tokens
   3. Basis
   4. Header (Logo + Menü-Toggle)
   5. Menü-Panel (Desktop und Mobile)
   6. Inhalt (Sektionen, Bild, Slider, Text)
   7. Footer
   8. Breakpoints

   Schriftgrössen sind bewusst auf drei Werte beschränkt (Vorgabe Kundin):
   14px Footer/kleine Kapitelüberschriften, 18px Lauftext/Navigation, 24px Titel.
   Mobile behält eigene, freigegebene Grössen (siehe Breakpoint 767px).
   ========================================================================== */


/* 2. Design-Tokens --------------------------------------------------------- */

:root {
    /* Farben */
    --ink: #373737;
    --flaeche: #e7e7e7;

    /* Schriftgrössen – nur diese drei verwenden */
    --fs-klein: 14px;
    --fs-text: 18px;
    --fs-titel: 24px;

    /* Schriftschnitte (Flexo liegt nur in Light und Demi vor) */
    --fw-light: 300;
    --fw-demi: 600;

    /* Layout */
    --content-width: 776px;
    /* Logo ragt links über die Inhaltsspalte hinaus; das kleine "h" von "haug"
       liegt bei 200px Logobreite 128px hinter der Logo-Vorderkante und soll
       maximal bis zur Bildkante rutschen (optischer Punkt von Michael Haug). */
    --logo-width: 200px;
    --logo-overhang: 128px;
    --page-width: calc(var(--content-width) + 2 * var(--logo-overhang));

    /* Vertikale Abstände (Vorgaben aus dem Figma) */
    --abstand-logo-bild: 65px;
    --abstand-bild-titel: 100px;
    --abstand-text-bild: 200px;
    --abstand-text-footer: 200px;
    /* engerer Rhythmus auf Startseite, Projekt- und Werkliste (Layouts Grafikbüro) */
    --abstand-bild-text: 55px;
}


/* 3. Basis ----------------------------------------------------------------- */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: #fff;
    color: var(--ink);
    font-family: 'flexo', Arial, Helvetica, sans-serif;
    font-weight: var(--fw-light);
    font-size: var(--fs-text);
    line-height: 1.48;
}

a {
    color: inherit;
    text-decoration: none;
}

p {
    margin: 0;
    font-size: var(--fs-text);
}

h1,
h2,
h3 {
    margin: 0;
    font-weight: var(--fw-demi);
}

h1,
h2 {
    font-size: var(--fs-titel);
    letter-spacing: -.045em;
}

h3 {
    font-size: var(--fs-text);
    margin-bottom: 5px;
}

strong,
b {
    font-weight: var(--fw-demi);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Inhaltscontainer */
.page-shell {
    width: min(calc(100% - 48px), var(--page-width));
    margin: 0 auto;
}


/* 4. Header ---------------------------------------------------------------- */

.site-top {
    position: relative;
    z-index: 501;
}

.site-header {
    padding: 40px 0 var(--abstand-logo-bild);
    padding-bottom: 20px;
}

.header-inner {
    width: min(calc(100% - 48px), var(--page-width));
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: block;
    line-height: 0;
}

.brand img {
    display: block;
    width: var(--logo-width);
    height: auto;
}

/* Menü-Toggle: drei Striche, drehen sich im offenen Zustand nach unten */
.menu-toggle {
    border: 0;
    background: transparent;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    transition: transform .25s ease;
}

.menu-toggle span:not(.visually-hidden) {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--ink);
}

.menu-toggle[aria-expanded="true"] {
    transform: rotate(90deg);
}


/* 5. Menü-Panel ------------------------------------------------------------ */

/* Graues Band unter dem Header, behält links/rechts einen weissen Rand */
.menu-panel {
    position: absolute;
    top: calc(100% - 35px);
    left: 24px;
    right: 24px;
    background: var(--flaeche);
}

.menu-panel[hidden] {
    display: none;
}

.menu-panel-inner {
    width: min(calc(100% - 48px), var(--page-width));
    margin: 0 auto;
    padding: 52px 0 58px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0 30px;
}

/* Hauptnavigation: verschachtelte Liste (entspricht show_menu() im CMS).
   Erster Punkt "Projekte" trägt die Subnavigation, immer sichtbar. */
.menu ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.menu {
    font-size: var(--fs-text);
    line-height: 1.65;
}

/* Zwei Spalten: links die Hauptpunkte, rechts daneben die immer sichtbare
   Subnavigation von "Projekte", oben bündig. display:contents löst das
   li auf, damit Link und Subliste einzeln im Grid platzierbar sind. */
.menu-list {
    display: grid;
    grid-template-columns: auto auto;
    column-gap: 70px;
    align-items: start;
    justify-content: start;
}

.menu-list > li.has-sub {
    display: contents;
}

.menu-list > li.has-sub > a {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
}

/* Spannt eine Reihe mehr als die Hauptpunkte, damit die überschüssige Höhe
   der fünfzeiligen Subnavigation in die leere fünfte Reihe fliesst statt
   die Hauptpunkte auseinanderzudehnen */
.menu ul.menu-sub {
    grid-column: 2;
    grid-row: 1 / span 5;
}

.menu-list > li:not(.has-sub) {
    grid-column: 1;
}

.menu-list > li.has-sub > ul.menu-sub {
    display: none;
}

.menu-list > li.has-sub.is-open > ul.menu-sub {
    display: block;
}

.menu a {
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 0.25em;
    text-decoration-thickness: 1px;
    /* padding-bottom: 5px;
    border-bottom: 1px solid transparent; */
}

/* Hover: oberer Strich */
.menu a:hover,
.menu a:focus-visible {
    text-decoration-color: var(--ink);
}

/* .menu-list > li.has-sub > a {
    padding-bottom: 1px;
    margin-bottom: -2px;
} */

/* Aktiv: unterer Strich */
.menu li.active > a {
    /* border-bottom-color: var(--ink); */
    text-decoration-color: var(--ink);

}

/* Kontaktblock rechts, unten bündig mit der Subnavigation
   (3px gleichen den Halbzeilen-Durchschuss der Navigation aus) */
.menu-contact {
    display: grid;
    align-content: end;
    justify-self: end;
    gap: 2px;
    margin-bottom: 3px;
    font-size: var(--fs-text);
    line-height: 1.5;
}


/* 6. Inhalt ---------------------------------------------------------------- */

main {
    padding-bottom: var(--abstand-text-footer);
}

section {
    width: min(100%, var(--content-width));
    margin: 0 auto;
}

section:not(:first-child) {
    margin-top: var(--abstand-text-bild);
}

.image-wrap {
    aspect-ratio: 1.55;
    overflow: hidden;
    margin: 0 0 var(--abstand-bild-titel);
    background: #171717;
}

.image-wrap img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

.project-swiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-swiper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Kleine Kapitelüberschrift über dem Titel */
.eyebrow {
    margin: 0 0 5px;
    font-size: var(--fs-klein);
}

.text-section {
    max-width: 90%;
    margin-top: 15px;
    font-size: var(--fs-text);
}

/* Slider */
.slider-frame {
    position: relative;
    width: 100%;
    margin: 0 auto var(--abstand-bild-titel);
}

.project-swiper {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.swiper-button-prev,
.swiper-button-next {
    position: absolute;
    top: 50%;
    padding: 0;
    color: var(--ink);
    border: 0;
    background: 0;
}

.swiper-button-prev {
    left: -44px;
}

.swiper-button-next {
    right: -44px;
}

.swiper-button-prev:after,
.swiper-button-next:after {
    font-size: 18px;
    font-weight: 700;
}

/* Punkt-Pager, gleiche Optik wie .cycle-pager (Startseite/Projektliste) */
.project-swiper .swiper-pagination {
    --swiper-pagination-bullet-size: 8px;
    --swiper-pagination-bullet-horizontal-gap: 5px;
    --swiper-pagination-bullet-inactive-color: #ddd;
    --swiper-pagination-bullet-inactive-opacity: .8;
    --swiper-pagination-color: #fff;
}


/* Medien auf Startseite, Projekt- und Werkliste-Seite (Bild → Text: 55px).
   .media--frame beschneidet auf 1.55, ohne Modifier behält das Bild sein
   natürliches Format; .media--hoch für Hochformate in reduzierter Breite. */
.media {
    display: block;
    margin: 0 0 var(--abstand-bild-text);
    background: #171717;
}

.media img {
    width: 100%;
    height: 100%;
    display: block;
}

.media--frame {
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.media--frame img {
    height: 100%;
    object-fit: cover;
}

.media--hoch {
    width: 78%;
}

/* Teaser (Startseite): Lead-Satz und Pfeil-Link zum Projekt */
.lead {
    font-weight: var(--fw-demi);
}

.arrow-link {
    display: inline-block;
    margin-top: 25px;
    font-size: 24px;
    line-height: 1;
}

/* Links im Lauftext (z.B. zum Architekturbüro auf der Projektseite) */
.text-section a:not(.arrow-link) {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Slider auf der Projektseite folgt dem engeren Rhythmus */
.slider-frame--kompakt {
    margin-bottom: var(--abstand-bild-text);
}

/* Werkliste: Gruppen mit dreispaltiger Liste, Trennlinien pro Eintrag */
.werkliste-gruppe {
    margin-top: var(--abstand-bild-text);
}

.werkliste-gruppe h3 {
    margin-bottom: 14px;
}

.werkliste ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 30px;
}

.werkliste li {
    padding: 9px 0;
    border-bottom: 1px solid #dcdcdc;
    font-size: var(--fs-klein);
    line-height: 1.35;
}

.werkliste-inline {
    margin-top: 14px;
    font-size: var(--fs-klein);
}


/* 7. Footer ---------------------------------------------------------------- */

/* Graue Fläche randlos, Inhalt in der Inhaltsspalte */
.site-footer {
    background: var(--flaeche);
}

.footer-inner {
    width: min(calc(100% - 48px), var(--content-width));
    margin: 0 auto;
    padding: 40px 0;
    display: grid;
    /* letzte Spalte auto: nimmt die Breite der einzeiligen Adresse */
    grid-template-columns: 1.7fr 1.2fr auto;
    grid-template-rows: 1fr auto;
    align-content: start;
    gap: 20px 30px;
    font-size: var(--fs-klein);
    line-height: 1.35;
}

.footer-brand {
    display: block;
    align-self: start;
}

.footer-brand img {
    display: block;
    width: var(--logo-width);
    height: auto;
}

.footer-navigation,
.footer-contact {
    display: grid;
    align-content: start;
}

.footer-contact {
    gap: 1px;
}

.footer-contact address {
    margin-top: 17px;
    font-style: normal;
}

/* Adresse: auf Desktop zweizeilig mit Komma, auf Mobile alles untereinander.
   Die Kommas kommen aus dem CSS, damit derselbe Inhalt beide Layouts bedient. */
.address-row {
    display: block;
    white-space: nowrap;
}

.address-row span + span::before {
    content: ", ";
}

.social-links {
    display: flex;
    gap: 16px;
    margin-top: 20px;
    line-height: 0;
}

.footer-meta {
    grid-column: 3;
    display: flex;
    gap: 5px;
    font-size: var(--fs-klein);
}


/* 8. Breakpoints ----------------------------------------------------------- */

@media (max-width: 1000px) {

    .swiper-button-prev,
    .swiper-button-next {
        display: none;
    }
}

/* Mobile: behält die in Runde 1 freigegebenen Grössen und Abstände */
@media (max-width: 767px) {

    .page-shell,
    .header-inner {
        width: min(calc(100% - 40px), 690px);
    }

    .site-header {
        padding: 22px 0 41px;
    }

    .header-inner {
        align-items: flex-start;
    }

    .brand img {
        width: 145px;
    }

    /* Menü-Panel klappt auch mobil unter dem Header auf,
       zeigt aber nur die zentrierte Mobile-Liste */
    .menu-panel {
        top: calc(100% - 24px);
        left: 20px;
        right: 20px;
    }

    .menu-panel-inner {
        width: 100%;
        padding: 40px 0;
        grid-template-columns: 1fr;
    }

    /* Dasselbe Menü-Markup wird mobil zur zentrierten Liste:
       alle Zwischenboxen auflösen, die Links selbst werden Grid-Items.
       Reihenfolge = DOM: Projekte, dessen Unterpunkte, About, Werkliste, Kontakt. */
    .menu {
        display: grid;
        /* justify-items: center; */
        padding-left: 10px;
        gap: 17px;
        font-size: 20px;
        line-height: 1.1;
    }

    .menu-list,
    .menu-list > li,
    .menu ul.menu-sub {
        display: contents;
    }

    /* Hierarchie ohne Einzug: Hauptpunkte im Demi, Unterpunkte bleiben Light */
    .menu-list > li > a {
        font-weight: var(--fw-text);
    }

    /* Desktop-Platzierung von "Projekte" neutralisieren */
    .menu-list > li.has-sub > a {
        grid-area: auto;
        /* justify-self: center; */
    }

    .menu-contact {
        display: none;
    }

    main {
        padding-bottom: 86px;
    }

    section {
        width: 100%;
    }

    section:not(:first-child) {
        margin-top: 65px;
    }

    .image-wrap {
        margin: 0 0 61px;
    }

    .slider-frame {
        margin-bottom: 61px;
    }

    .text-section {
        max-width: 100%;
    }

    p,
    .text-section {
        font-size: 15px;
    }

    .eyebrow {
        font-size: 12px;
    }

    h1,
    h2 {
        font-size: 28px;
    }

    h3 {
        font-size: 15px;
    }

    .project-swiper {
        margin-inline: 0;
    }

    .media {
        margin-bottom: 40px;
    }

    .media--hoch {
        width: 100%;
    }

    ul.werkliste {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        width: min(calc(100% - 40px), 690px);
        padding: 28px 0 20px;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
        gap: 28px 18px;
        font-size: 11px;
    }

    .footer-brand img {
        width: 145px;
    }

    .footer-contact {
        grid-column: 2;
        grid-row: 1 / span 2;
    }

    /* Adresse untereinander */
    .address-row span {
        display: block;
    }

    .address-row span + span::before {
        content: none;
    }

    .footer-meta {
        grid-column: 1 / -1;
        grid-row: auto;
        justify-content: flex-start;
        font-size: 11px;
    }
}

.footer-navigation li,
.footer-navigation ul {
    list-style: none;
}

@media (max-width: 410px) {

    .page-shell,
    .header-inner,
    .footer-inner {
        width: calc(100% - 32px);
    }

    .menu-panel {
        left: 16px;
        right: 16px;
    }
}

.slide-info {
    margin-bottom: 20px;
    padding-top: .8em;
    text-align: left;
}

.cycle-pager {
    text-align: center;
    width: 100%;
    z-index: 500;
    position: absolute;
    bottom: -5px;
    overflow: hidden;
     display: block;
}
.cycle-pager span {
    font-family: arial;
    font-size: 40px;
    width: 16px;
    height: 16px;
    display: inline-block;
    color: #ddd;
    cursor: pointer;
    opacity: 0.8;
}
.cycle-pager .cycle-pager-active {
    color: #fff;
    opacity: 1;
}

.no_umfliessend {
    display: flow-root;
}

/* ==========================================================================
   9. Übernahmen aus dem alten CSS
   ========================================================================== */


/* 9.1 Reset-Reste ---------------------------------------------------------- */

*::before,
*::after {
    box-sizing: border-box;
}

img {
    display: block;
}

ul,
ol {
    margin: 0;
    padding: 0;
}

li {
    list-style: none;
}

table {
    border-collapse: collapse;
    width: 100%;
}

hr {
    border: 0;
    border-top: 1px solid var(--ink);
    margin: 20px 0;
}

input,
select,
textarea {
    border: 1px solid #999;
    color: var(--ink);
    font: var(--fw-light) var(--fs-klein)/1.4 'flexo', Arial, Helvetica, sans-serif;
    padding: 8px;
}


/* ==========================================================================
   10. Formular (Kontaktformular)
   ========================================================================== */

.formular {
    max-width: 50%;
    margin-top: 80px;
}

/* Überschrift "Kontaktformular" */
.formular .headline_cms h4 {
    margin: 0 0 18px;
    font-size: var(--fs-klein);
    font-weight: var(--fw-demi);
    letter-spacing: 0;
}

/* Abstand zwischen den Feldern kommt vom cms_item (10px) –
   hier nur der Innenabstand der Gruppe */
.formular .formular-element {
    margin: 0;
}

/* Labels verstecken: die Feldbezeichnung steht als Platzhalter im Feld.
   (Platzhalter im CMS pro Feld hinterlegen, siehe Hinweis unten.) */
.formular .formular-element > label.frage {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Wörterbuch-Link "°" im Frontend ausblenden */
.formular .formular-element > label.frage a.various {
    display: none;
}

/* Felder */
.formular input[type="text"],
.formular input[type="email"],
.formular input[type="tel"],
.formular input[type="number"],
.formular input[type="date"],
.formular select,
.formular textarea {
    width: 100%;
    display: block;
    padding: 12px 14px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    font: var(--fw-light) var(--fs-klein)/1.4 'flexo', Arial, Helvetica, sans-serif;
    -webkit-appearance: none;
    appearance: none;
}

.formular textarea {
    min-height: 96px;
    resize: vertical;
}

.formular input::placeholder,
.formular textarea::placeholder {
    color: #9a9a9a;
    opacity: 1;
}

.formular input:focus,
.formular select:focus,
.formular textarea:focus {
    outline: 0;
    border-color: var(--ink);
}

/* Fehlerzustand (Validierung) */
.formular .error,
.formular input.error,
.formular textarea.error {
    border-color: #c0392b;
}

/* Senden-Button */
.formular .formular-element.submit {
    margin-top: 5px;
}

.formular .form-submit-btn {
    display: inline-block;
    padding: 11px 26px;
    border: 0;
    border-radius: 6px;
    background: #1a1a1a;
    color: #fff;
    font: var(--fw-demi) var(--fs-klein)/1.2 'flexo', Arial, Helvetica, sans-serif;
    cursor: pointer;
    transition: background .2s ease;
}

.formular .form-submit-btn:hover,
.formular .form-submit-btn:focus-visible {
    background: var(--ink);
}

/* Honeypot bleibt unsichtbar – vorhandene Inline-Styles genügen,
   zur Sicherheit hier nochmals */
.formular #formular_hp_homepage {
    display: none !important;
}

@media (max-width: 767px) {
    .formular input[type="text"],
    .formular input[type="email"],
    .formular select,
    .formular textarea {
        font-size: 16px; /* verhindert Zoom beim Fokus auf iOS */
    }
}

/* ==========================================================================
   11. Dankesseite
   ========================================================================== */

.danke-titel {
    margin: 20px 0 5px;
    font-size: var(--fs-titel);
    font-weight: var(--fw-demi);
    letter-spacing: -.045em;
}

.danke-text {
    margin-top: 0;
    font-size: var(--fs-text);
    line-height: 1;
}

#werkliste-titel {
    margin-bottom: 40px;
}

.project-slider:not(:first-child) {
    margin-top: var(--abstand-bild-text);
}


/* Breadcrumb */

/* Breadcrumb */
.breadcrumb {
    padding-top: 102px;
    font-size: 0.875rem;
    color: var(--muted, #8a8a8a);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  row-gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumb li {
  display: inline-flex;
  align-items: center;
}

.breadcrumb li:not(:last-child)::after {
  content: "\203A" / "";      /* leerer Alt-Text: Screenreader lesen das Zeichen nicht vor */
  margin: 0 0.5rem;
  font-size: 1.25em;
  line-height: 1;
  opacity: 0.6;
  transform: translateY(-0.05em); /* optischer Ausgleich, da › etwas tief sitzt */
}

.breadcrumb a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.25em;
  text-decoration-thickness: 1px;
  transition: color 0.2s, text-decoration-color 0.2s;
}

.breadcrumb a:hover,
.breadcrumb a:focus-visible {
  color: var(--ink);
  text-decoration-color: var(--ink);
}

/* Aktuelle Seite hervorheben */
.breadcrumb [aria-current="page"] {
  color: var(--ink);
}

.frame-liste {
    margin-bottom: 10px !important;
}

.frame-liste .slide-liste {
    justify-content: flex-start !important;
}

.frame-liste .slide-liste img {
    margin-left: 0;
    margin-right: auto;
    object-position: left center; 
}

.info-liste {
    margin-bottom: 10px !important;
    margin-top: 0 !important;
}

.slider-liste {
    margin-bottom: 245px;
}

/* .is-portrait {
    max-height: 582px;
} */

/* Werkliste/Projektliste: erstes Bild statt Slider */
.liste-bild {
    display: block;
    container-type: inline-size;  /* 100cqw = Breite der Section (776px) */
    margin-bottom: 10px;          /* wie .frame-liste */
}

.liste-bild img {
    display: block;
}

/* Querformat: 776px breit, Höhe passt sich an */
.liste-bild--quer img {
    width: 100%;
    height: auto;
}

/* Quadrat: 776 × 776px */
.liste-bild--quadrat img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
}

/* Hochformat: immer 776px hoch, Breite passt sich an, linksbündig */
.liste-bild--hoch img {
    width: auto;
    height: min(776px, 100cqw);
}
