@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@200;400;600&display=swap');

/* =========================================================
   Arklinea static website
   Main stylesheet
   ========================================================= */

/* -----------------------------
   Variables
   ----------------------------- */

:root {
  --bg: #FFFFFF;
  --text: #111;
  --muted: #6f6b64;

  --left: 200px;
  --right: 290px;
  --pad: 34px;

  --mobile-header: 86px;
  --mobile-side: 72px;
  --project-info-h: 152px;

  /* ------------------------------------------------------------
     Typografie-System
     ------------------------------------------------------------
     --fs-1 :  groß  → Hauptmenü, Stellen/Kontakt-Inhalt,
                       Impressum-Titel, Projektdetail-Titel
     --fs-2 :  mittel→ Hero, Footer, Lauftext im Impressum,
                       Projekt-Info-Sidebar, Project-Card-Caption,
                       Team-Name, Projekt-Beschreibungs-Titel
     --fs-3 :  klein → Team-Funktion, Mail/Tel auf Team-Karten

     --fw-light : 200 (Outfit ExtraLight)  — sämtlicher Lauftext
     --fw-bold  : 600 (Outfit Semibold)    — fette Stellen
     ------------------------------------------------------------ */
  --fs-1: 21px;
  --fs-2: 17px;
  --fs-3: 14px;

  --fw-light: 200;
  --fw-bold:  600;
}


/* -----------------------------
   Base
   ----------------------------- */

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Outfit, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 400;
}

body {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}


/* -----------------------------
   Desktop shell / fixed sidebars
   ----------------------------- */

.site-shell {
  display: grid;
  grid-template-columns: var(--left) minmax(0, 1fr) var(--right);
  height: 100vh;
}

.left-sidebar,
.right-sidebar {
  height: 100vh;
  padding: var(--pad);
  background: var(--bg);
  z-index: 20;
}

.left-sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
}

.right-sidebar {
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.right-sidebar > a,
.right-sidebar .project-info {
  pointer-events: auto;
}

.right-sidebar > a {
  display: inline-block;
  height: max-content;
}


/* -----------------------------
   Desktop navigation
   ----------------------------- */

.desktop-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: var(--fs-1);
  font-weight: var(--fw-light);
  line-height: 1.08;
}

.desktop-nav a:hover,
.desktop-nav a.active,
body.home .desktop-nav a {
  font-weight: var(--fw-bold);
}

.sidebar-icons {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-link {
  display: inline-flex;
  width: 21px;
  height: 21px;
}

.icon-link svg {
  width: 100%;
  height: 100%;
}


/* -----------------------------
   Logos
   ----------------------------- */

.logo-wordmark {
  /* width: min(210px, 100%); */
  width: 100%;
}

.logo-mark {
  width: 38px;
}

.sidebar-square-logo {
  position: absolute;
  top: 50%;
  /* Horizontal: gleiche x-Position wie das Menü und die Social-Icons,
     nämlich var(--pad) vom linken Rand der .left-sidebar. */
  left: var(--pad);
  /* Originalgröße wiederherstellen: 50 % der Sidebar-Breite (= 100 px
     bei --left: 200 px). Vorher kam dieser Wert IMPLIZIT aus dem
     Shrink-to-Fit zwischen left: 50 % und der rechten Container-Kante.
     Mit der neuen Position bei var(--pad) wäre der verfügbare Raum
     bis 200 px gewachsen — daher müssen wir die Breite jetzt
     explizit festlegen. */
  width: calc(var(--left) / 2);
  transform: translateY(-50%);
}

.sidebar-square-logo img {
  width: 100%;
  height: auto;
}


/* -----------------------------
   Scrollable content area
   ----------------------------- */

.content-scroll {
  height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  padding: var(--pad) 0 0;
  scrollbar-width: none;
}

.content-scroll::-webkit-scrollbar {
  display: none;
}

.page {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.page-main {
  flex: 1;
}


/* -----------------------------
   Homepage
   ----------------------------- */

.hero-image {
  width: 100%;
  height: calc(100vh - 68px);
  min-height: 520px;
  object-fit: cover;
  background: #d6d2c8;
}

.hero-text {
  padding: 42px 0 90px;
  font-size: var(--fs-2);
  line-height: 1.28;
  font-weight: var(--fw-light);
}


/* -----------------------------
   Simple text pages
   ----------------------------- */

.simple-page {
  max-width: 900px;
  /* Identische Anfangsposition wie .legal-page */
  padding: 0 0 140px;
  font-size: var(--fs-1);
  line-height: 1.18;
  font-weight: var(--fw-light);
}

.simple-page h1 {
  margin: 0 0 42px;
  font-size: inherit;
  font-weight: var(--fw-bold);
}

.simple-page p {
  margin: 0 0 22px;
}

.simple-page small {
  color: var(--muted);
  font-size: var(--fs-3);
}


/* -----------------------------
   Project overview
   ----------------------------- */

.project-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px 22px;
  padding-bottom: 80px;
}

.project-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  margin-bottom: 8px;
  object-fit: cover;
  background: #ddd8ce;
}

.project-card span {
  display: block;
  font-size: var(--fs-2);
  font-weight: var(--fw-light);
  line-height: 1.1;
}

.project-card:hover span {
  font-weight: var(--fw-bold);
}


/* -----------------------------
   Project detail
   ----------------------------- */

.project-detail {
  padding-bottom: 80px;
}

.project-images {
  /* Default-Layout: Bilder einfach gestapelt. Sobald JS sie in
     2 Spalten verteilt, bekommt der Container .is-masonry und
     wird zum Flex-Container. Mobile (≤900 px) bleibt einfach
     gestapelt — JS entfernt .is-masonry dort wieder. */
}

.project-images.is-masonry {
  display: flex;
  align-items: flex-start;
  gap: 22px;
}

.project-images__col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.project-images img {
  display: block;
  width: 100%;
  height: auto;          /* Originalverhältnis */
  background: #ddd8ce;
}

/* Wenn JS noch nicht gelaufen ist (oder fehlt), die Bilder
   bekommen einen kleinen Vertikalabstand, damit das Layout
   trotzdem aussieht. */
.project-images:not(.is-masonry) > img {
  margin-bottom: 22px;
}

.project-info {
  position: fixed;
  right: var(--pad);
  bottom: var(--pad);
  z-index: 30;
  width: calc(var(--right) - var(--pad) * 2);
  font-size: var(--fs-2);
  font-weight: var(--fw-light);
  line-height: 1.12;
  max-height: calc(100vh - 220px);
  overflow-y: auto;
}

.project-info h1 {
  margin: 0 0 28px;
  /* Projektdetail-Titel: Schriftgröße 1, fett */
  font-size: var(--fs-1);
  font-weight: var(--fw-bold);
}

.info-row {
  display: block;
  margin-bottom: 22px;
}

/* Letzte Zeile braucht keinen Bottom-Abstand mehr — sonst schiebt
   sie den sichtbaren Text vom Container-Boden weg, was bei der
   .project-info-Sidebar dazu führt, dass "Jahr 2018" nicht auf
   der Höhe der Social-Icons (.left-sidebar) endet. */
.info-row:last-child {
  margin-bottom: 0;
}

.project-info dl {
  margin: 0;
}

.info-row dt,
.info-row dd {
  margin: 0;
}

.info-row dt {
  /* Projektbeschreibtitel ("Nutzung", "Bauart"): fs-2 fett */
  color: var(--text);
  font-weight: var(--fw-bold);
}

.info-row dd {
  /* Werte ("Mehrfamilienhaus" usw.): fs-2 leicht */
  font-weight: var(--fw-light);
}

/* -----------------------------
   Project description
   (HTML aus dem WYSIWYG-Editor)
   ----------------------------- */

.project-description {
  margin-top: 28px;
  font-size: var(--fs-3);
  line-height: 1.45;
  font-weight: var(--fw-light);
  color: var(--text);
}

.project-description p             { margin: 0 0 10px; }
.project-description p:first-child { margin-top: 0; }
.project-description p:last-child  { margin-bottom: 0; }
.project-description ul,
.project-description ol             { margin: 0 0 10px; padding-left: 18px; }
.project-description li             { margin-bottom: 3px; }
.project-description a              { color: inherit; text-decoration: underline; }
.project-description img            { max-width: 100%; height: auto; margin: 8px 0; border-radius: 2px; }
.project-description strong         { font-weight: var(--fw-bold); }


/* -----------------------------
   Team page
   ----------------------------- */

.team-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 46px 24px;
  padding-bottom: 90px;
}

.team-member {
  min-width: 0;
}

.team-photo {
  width: 100%;
  aspect-ratio: 1 / 1.34;
  margin: 0 0 12px;
  object-fit: cover;
  background: #ddd8ce;
}

.team-copy {
  /* Standard für die Team-Karte: kleine Schrift, leicht.
     Gilt für Education / Mail / Tel. Funktion (strong) und
     Name (h2) bekommen ihre eigenen Werte unten. */
  font-size: var(--fs-3);
  line-height: 1.18;
  font-weight: var(--fw-light);
}

.team-copy h2 {
  margin: 0 0 16px;
  /* Team-Name: Schriftgröße 2, fett */
  font-size: var(--fs-2);
  font-weight: var(--fw-bold);
  line-height: 1.08;
}

.team-copy p {
  margin: 0 0 11px;
}

.team-copy strong {
  /* Team-Funktion (im strong-Tag): bleibt fs-3, aber fett */
  font-weight: var(--fw-bold);
}


/* -----------------------------
   Footer
   ----------------------------- */

.site-footer {
  display: block;
  margin-top: auto;
  padding: 32px 0 38px;
  border-top: 0;
  font-size: var(--fs-2);
  line-height: 1.2;
  font-weight: var(--fw-light);
}

.footer-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  width: 100%;
  /* Default + Tablet: gap-basiertes Layout (Items mit fixem
     Mindestabstand). Desktop bekommt unten via @media-Query
     justify-content: space-between (gestreckt). */
  gap: 12px 24px;
}

.footer-line > span {
  /* Jeder Footer-Eintrag bleibt atomar — bricht nie INNERHALB
     um. Damit bleiben "Kantonsstrasse 51", "6048 Horw",
     "041 342 08 70", "CHE-105.113.913 MWST",
     "Impressum / Datenschutz" jeweils auf einer Zeile.
     Bei zu wenig Platz brechen sie als Ganzes auf eine
     neue Zeile um. */
  white-space: nowrap;
}

.footer-line strong,
.footer-legal-link {
  font-weight: var(--fw-bold);
}

/* Globaler Default für <strong>: identisches Gewicht wie im Footer.
   Verhindert, dass der Browser synthetisches 700 rendert (weil
   Outfit nur 200/400/600 lädt — die echten Glyphen für 600 sehen
   sauberer aus als ein synthetisch verfetteter 700er). */
strong, b {
  font-weight: var(--fw-bold);
}


/* -----------------------------
   Legal page
   ----------------------------- */

.legal-page {
  max-width: 900px;
  /* Identische Anfangsposition wie .simple-page (Stellen-Seite) */
  padding: 0 0 140px;
  /* Lauftext im Impressum: Schriftgröße 2, leicht.
     <strong>arklinea architektur ag</strong> bekommt bold via global. */
  font-size: var(--fs-2);
  font-weight: var(--fw-light);
  line-height: 1.28;
}

.legal-section {
  margin-bottom: 84px;
}

.legal-section h1 {
  margin: 0 0 28px;
  /* Impressum/Datenschutz-Titel: Schriftgröße 1, fett */
  font-size: var(--fs-1);
  font-weight: var(--fw-bold);
  line-height: 1.1;
}

.legal-section p {
  max-width: 760px;
  margin: 0 0 22px;
}


/* -----------------------------
   Mobile layout
   ----------------------------- */

.mobile-topbar,
.mobile-rail,
.mobile-menu {
  display: none;
}

/* -----------------------------
   Tablet (NEU)
   Liegt zwischen Mobile (≤900) und Desktop (≥1201).
   Nur die Spaltenzahl der Grid-Übersichten wird angepasst,
   damit Texte wie "Geschäftsleitung / -inhaber" oder lange
   Namen nicht mehr umbrechen müssen. Alle übrigen Regeln
   erben unverändert von der Desktop-Default-Definition.
   ----------------------------- */
@media (min-width: 901px) and (max-width: 1200px) {
  /* Team-Übersicht: 4 → 3 Spalten */
  .team-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Projekt-Übersicht: 4 → 3 Spalten */
  .project-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  :root {
    --pad: 18px;
    --mobile-side: 62px;
    --mobile-header: 116px;
    --project-info-h: 170px;

    /* Typografie-System auf Mobile leicht angepasst:
       fs-1 deutlich größer (Hauptmenü-Look), fs-2/3 minimal kleiner */
    --fs-1: 31px;
    --fs-2: 15px;
    --fs-3: 13px;
  }

  .site-shell {
    display: block;
    height: 100dvh;
    padding-top: var(--mobile-header);
    padding-left: var(--mobile-side);
  }

  .left-sidebar {
    display: none;
  }

  .right-sidebar {
    position: static;
    display: block;
    height: 0;
    padding: 0;
    background: transparent;
  }

  .right-sidebar > a {
    display: none;
  }

  .content-scroll {
    height: calc(100dvh - var(--mobile-header));
    overflow-y: auto;
    padding: 0 18px 0 0;
  }

  .mobile-topbar {
    position: fixed;
    top: 0;
    right: 0;
    left: var(--mobile-side);
    z-index: 50;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    height: var(--mobile-header);
    /* Padding rechts = 18 px → identisch zum padding-right von
       .content-scroll. Damit endet die rechte Kante des Wordmarks
       auf einer Linie mit der rechten Kante aller Bilder, Project-
       Grids und Team-Portraits darunter. */
    padding: 18px;
    background: var(--bg);
  }

  .mobile-topbar .logo-wordmark {
    width: 150px;
  }

  .mobile-rail {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: var(--mobile-side);
    padding-top: var(--mobile-header);
    background: var(--bg);
  }

  .mobile-rail .logo-mark {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 38px;
    margin: 0;
    transform: translate(-50%, -50%);
  }

  .mobile-rail-icons {
    position: absolute;
    bottom: 24px;
    left: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 13px;
    transform: translateX(-50%);
  }

  .mobile-rail-icons .icon-link {
    width: 24px;
    height: 24px;
  }

  .burger {
    z-index: 80;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 18px;
  }

  .burger span {
    display: block;
    width: 100%;
    height: 2px;
    background: #111;
    transition: 0.2s;
  }

  body.menu-open .burger span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  body.menu-open .burger span:nth-child(2) {
    opacity: 0;
  }

  body.menu-open .burger span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  .mobile-menu {
    position: fixed;
    top: 116px;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 55;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* width: min(64vw, 260px); */
    padding: 0 26px 28px calc(var(--mobile-side) + 20px);
    border-right: 1px solid rgba(0, 0, 0, 0.08);
    background: var(--bg);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  body.menu-open .mobile-menu {
    transform: translateX(0);
  }

  .mobile-menu nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: var(--fs-1);
    font-weight: var(--fw-light);
    line-height: 1.04;
    margin-top: -8px;
  }

  .mobile-menu nav a.active,
  body.home .mobile-menu nav a {
    font-weight: var(--fw-bold);
  }

  .mobile-menu .sidebar-square-logo,
  .mobile-menu .sidebar-icons {
    display: none;
  }

  .hero-image {
    height: auto;
    min-height: 0;
  }

  .home .hero-image {
    height: calc((100dvh - var(--mobile-header)) * 0.5);
    min-height: 0;
  }

  .home .hero-text {
    
    min-height: calc((100dvh - var(--mobile-header)) * 0.5);
  }

  .hero-text {
    padding: 30px 0 70px;
    line-height: 1.24;
  }

  .simple-page {
    /* padding-top 0 + leichter negativer Margin: kompensiert die
       optische Lücke aus der Outfit-Line-Height, damit die SICHTBARE
       Oberkante des ersten Buchstabens auf gleicher Höhe wie das
       Burger-Menü-Symbol und die Oberkante der Projekt-Bilder sitzt. */
    padding: 0 0 60px;
    margin-top: -7px;
  }

  .project-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px 16px;
    padding-bottom: 70px;
  }

  .project-card img {
    aspect-ratio: 4 / 3;
  }

  .project-card span {
    /* fs-2 + fw-light kommt aus dem Default-Block, kein Override nötig */
  }

  .project-detail {
    padding-bottom: 0;
  }

  .project-images {
    /* Mobile: kein Masonry, einfach gestapelt
       (JS entfernt die .is-masonry-Klasse, falls aktiv) */
    display: block;
    padding-bottom: calc(var(--project-info-h) + 42px);
  }

  .project-images img {
    margin-bottom: 18px;
  }

  .project-info {
    position: fixed;
    right: 18px;
    bottom: 0;
    left: var(--mobile-side);
    z-index: 45;
    width: auto;
    min-height: var(--project-info-h);
    /* Inhalt wird vertikal nach UNTEN gedrückt (unten bündig).
       Damit klebt z.B. die "Jahr 2018"-Zeile an der Unterkante. */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    /* Padding unten = 24 px → exakt auf Höhe der Social-Icons unten
       links (.mobile-rail-icons hat bottom: 24px). So endet die
       "Jahr 2018"-Zeile auf identischer Höhe wie die Icons. */
    padding: 14px 0 24px;
    border-top: 0;
    background: var(--bg);
    line-height: 1.15;
  }

  .project-info h1 {
    margin: 0 0 12px;
  }

  .info-row {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 1px;
  }

  .info-row dt {
    color: var(--text);
    flex: 35%;
  }

  .info-row dd {
    flex: 65%;
  }

  .project-description {
    margin-top: 16px;
    line-height: 1.4;
  }
  .project-description p { margin: 0 0 8px; }

  .team .content-scroll {
    padding-top: 0;
  }

  .team-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 10px;
    padding-bottom: 70px;
  }

  .team-member {
    display: block;
    margin: 0;
  }

  .team-photo {
    height: auto;
    aspect-ratio: 1 / 1.34;
    margin: 0 0 8px;
    object-fit: cover;
  }

  .team-copy {
    padding: 0;
    background: transparent;
    line-height: 1.16;
  }

  .team-copy h2 {
    margin: 0 0 8px;
  }

  .team-copy p {
    margin: 0 0 6px;
  }

  .site-footer {
    display: block;
    padding: 32px 0 54px;
  }

  .footer-line {
    display: block;
    white-space: normal;
  }

  .footer-line span {
    display: block;
    margin-bottom: 10px;
  }

  .legal-page {
    /* identisch zu .simple-page (siehe oben) */
    padding: 0 0 60px;
    margin-top: -7px;
  }

  .legal-section h1 {
    /* fs-1 fw-bold aus default — hier nur ggf. line-height anpassen */
  }

  body.project-detail-page .site-footer,
  body.detail .site-footer {
    padding-bottom: calc(var(--project-info-h) + 42px);
  }
}


/* -----------------------------
   Footer breakpoint
   ----------------------------- */

@media (max-width: 1200px) {
  .footer-line {
    gap: 10px 24px;
  }
}


/* -----------------------------
   Desktop only (> 1200 px):
   Footer von links nach rechts gestreckt.
   Items verteilen sich gleichmäßig zwischen "arklinea architektur ag"
   (links) und "Impressum / Datenschutz" (rechts).
   Auf Tablet (≤ 1200 px) und Mobile (≤ 900 px) bleibt das gap-basierte
   bzw. gestapelte Layout aus den vorherigen Regeln aktiv.
   ----------------------------- */

@media (min-width: 1201px) {
  .footer-line {
    justify-content: space-between;
  }
}
