/* ==========================================================================
   Kanzlei Volmar · Haase · Glöggler – Modernisiertes Stylesheet
   ==========================================================================
   HINWEIS FÜR KUNDENABSTIMMUNG:
   Über die CSS-Variablen in :root lassen sich die behutsamen Modernisierungen
   (Schriftgröße, Zeilenhöhe, Abstände) bei Bedarf jederzeit mit einer Zeile
   wieder auf die exakten Contao-Originalwerte zurückstellen.
   ========================================================================== */

:root {
  /* Farben (Originalwerte) */
  --color-bg: #FFFFFF;
  --color-gray-bar: #E0E0E0;
  --color-text: #333333;
  --color-muted: #6C6C6C;
  --color-accent: #688DA2;

  /* Typografie (Modernisiert vs. Original im Kommentar) */
  --font-base: Verdana, Arial, Helvetica, sans-serif;
  --font-size-body: 13px;        /* Original Desktop: 12px */
  --font-size-h1: 18px;          /* Original Desktop: 16px */
  --font-size-h3: 13.5px;        /* Original Desktop: 12px */
  --font-size-h4: 13.5px;        /* Original Desktop: 12px */
  --line-height-body: 1.55;      /* Original: 1.5 */

  /* Layout-Maße (Originalwerte für Desktop-Optik) */
  --max-width: 960px;
  --nav-width: 225px;
  --nav-gap: 32px;
  --sidebar-width: 210px;
}

/* ==========================================================================
   1. Reset & Basis
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-y: scroll;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  border-top: 10px solid var(--color-gray-bar);
  font-family: var(--font-base);
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  color: var(--color-text);
  background-color: var(--color-bg);
}

img {
  max-width: 100%;
  height: auto;
  border: 0;
  display: block;
}

figure {
  margin: 0 0 16px 0;
}

/* ==========================================================================
   2. Typografie & Links
   ========================================================================== */
a,
a:link,
a:visited {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover,
a:focus,
a:active {
  text-decoration: underline;
}

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

h1 {
  font-size: var(--font-size-h1);
  font-weight: bold;
  color: var(--color-muted);
  margin: 0.67em 0 0.8em 0;
  line-height: 1.3;
}

h2,
h3,
h4,
h5,
h6 {
  font-size: var(--font-size-h3);
  font-weight: bold;
  margin: 1.2em 0 0.4em 0;
  line-height: 1.4;
}

#anwaelte-in-kempten h2,
h4,
h6 {
  color: #444444;
}

p {
  margin: 0 0 1em 0;
}

ul,
ol {
  margin: 0 0 1.2em 0;
  padding-left: 22px;
}

li {
  margin-bottom: 0.25em;
}

/* Blocksatz im Artikelbereich mit sauberer deutscher Silbentrennung */
.article-content p {
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}

/* Trennlinie auf der Startseite (ersetzt die 69 Unterstriche) */
.title-divider {
  border: 0;
  border-top: 1px solid var(--color-text);
  margin: 12px 0 24px 0;
}

/* Barrierefreier Skip-Link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  padding: 8px 16px;
  background: var(--color-text);
  color: #FFFFFF !important;
  font-weight: bold;
  border-radius: 4px;
}

.skip-link:focus {
  left: 8px;
}

/* ==========================================================================
   3. Header & Logo
   ========================================================================== */
#wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#header {
  width: 100%;
  max-width: var(--max-width);
  height: 228px;
  padding: 0 2px;
  margin: 0 auto;
  background: transparent url("../img/header.webp") no-repeat scroll left bottom;
  position: relative;
}

.logo {
  display: block;
  width: 300px;
  height: 85px;
  margin: 0 auto;
}

.logo img {
  width: 300px;
  height: 85px;
}

/* ==========================================================================
   4. Hauptlayout (CSS Grid statt altem Float-Konstrukt)
   ========================================================================== */
#container {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 2px 0 2px;
  display: grid;
  grid-template-columns: var(--nav-width) 1fr var(--sidebar-width);
  grid-template-areas: "nav main sidebar";
  align-items: stretch;
}

/* Linke Spalte: Hauptnavigation */
#mainnav {
  grid-area: nav;
  padding-bottom: 24px;
}

.menu-toggle {
  display: none;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list li {
  margin: 0;
  padding: 8px 0;
  /* Ersetzt trenner.gif durch reines CSS */
  background-image: linear-gradient(to right, var(--color-muted) 1px, transparent 1px);
  background-position: left bottom;
  background-size: 3px 1px;
  background-repeat: repeat-x;
}

.nav-list a,
.nav-list span {
  display: block;
  color: var(--color-muted);
  text-decoration: none;
}

.nav-list a:hover,
.nav-list a:focus {
  text-decoration: underline;
}

.nav-list li.active a,
.nav-list li.active span {
  color: var(--color-text);
  text-decoration: underline;
}

/* Mittlere Spalte: Hauptinhalt */
#main {
  grid-area: main;
  margin-left: var(--nav-gap);
  padding-right: 16px;
  padding-bottom: 32px;
  min-width: 0;
  /* Vertikale gepunktete Trennlinie rechts (ersetzt trenner_content.gif) */
  background-image: linear-gradient(to bottom, var(--color-muted) 1px, transparent 1px);
  background-position: right top;
  background-size: 1px 3px;
  background-repeat: repeat-y;
}

/* Rechte Spalte: Kanzlei-Kontaktdaten & Bürozeiten (nur 1x im HTML!) */
#buerozeiten {
  grid-area: sidebar;
  padding-left: 16px;
  padding-bottom: 32px;
  color: var(--color-accent);
  /* Vertikale gepunktete Trennlinie links (falls Sidebar höher als Inhalt ist) */
  background-image: linear-gradient(to bottom, var(--color-muted) 1px, transparent 1px);
  background-position: left top;
  background-size: 1px 3px;
  background-repeat: repeat-y;
  margin-left: -1px;
}

#buerozeiten h2,
#buerozeiten h3 {
  margin-top: 0;
  margin-bottom: 0.6em;
  color: var(--color-accent);
}

#buerozeiten .buerozeiten-heading {
  margin-top: 24px;
}

#buerozeiten p {
  margin: 0 0 0.75em 0;
}

#buerozeiten a.tel-link {
  color: inherit;
}

/* ==========================================================================
   5. Tabellen, Bilder & Komponenten
   ========================================================================== */
table {
  width: 100%;
  border: 1px solid var(--color-gray-bar);
  border-collapse: collapse;
  margin-bottom: 16px;
}

th,
td {
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

.article-content tr:nth-child(even) td {
  background-color: var(--color-gray-bar);
}

.article-content tr td:last-child {
  text-align: right;
}

/* Anwalts-Porträts */
.portrait-figure {
  margin: 12px 0 16px 0;
}

.avd-figure {
  margin-top: 20px;
}

/* ==========================================================================
   6. DSGVO 2-Klick Google Maps Lösung (anschrift.html)
   ========================================================================== */
.map-container {
  width: 100%;
  height: 400px;
  margin-top: 16px;
  border: 1px solid var(--color-gray-bar);
  background-color: #F7F9FA;
  position: relative;
  overflow: hidden;
}

.map-placeholder {
  width: 100%;
  height: 100%;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: radial-gradient(circle at center, #FFFFFF 0%, #EDF2F5 100%);
}

.map-placeholder h2,
.map-placeholder h3 {
  margin: 0 0 8px 0;
  color: var(--color-text);
}

.map-placeholder p {
  max-width: 380px;
  text-align: center !important;
  color: var(--color-muted);
  margin-bottom: 16px;
  font-size: 12px;
}

.map-btn {
  display: inline-block;
  padding: 9px 18px;
  background-color: var(--color-accent);
  color: #FFFFFF !important;
  font-family: var(--font-base);
  font-size: 12.5px;
  font-weight: bold;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  text-decoration: none !important;
  transition: background-color 0.15s ease;
}

.map-btn:hover,
.map-btn:focus {
  background-color: #537488;
}

.map-ext-link {
  margin-top: 12px;
  font-size: 11.5px;
}

.map-container iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* ==========================================================================
   7. Footer
   ========================================================================== */
#footer {
  background-color: var(--color-gray-bar);
  width: 100%;
}

.copyright {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px 6px;
  font-size: 10px;
  text-align: right;
  color: var(--color-text);
}

/* ==========================================================================
   8. Responsive Breakpoints (Tablet & Mobile – wie im Original)
   ========================================================================== */

/* Tablet (<= 991px): Rechte Bürozeiten-Spalte wandert nach links unter das Menü */
@media (max-width: 991px) {
  :root {
    --font-size-body: 14px;
    --font-size-h1: 18px;
    --font-size-h3: 14px;
    --font-size-h4: 14px;
  }

  th,
  td {
    padding: 8px 6px;
  }

  #container {
    grid-template-columns: var(--nav-width) 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "nav main"
      "sidebar main";
  }

  .nav-list li {
    padding: 14px 8px;
  }

  #main {
    background-image: none;
    padding-right: 8px;
  }

  #buerozeiten {
    background-image: none;
    margin-left: 0;
    margin-top: 12px;
    padding-left: 8px;
  }
}

/* Mobile (<= 767px): Ausklappbares Menü & Bürozeiten im Footer-Stil */
@media (max-width: 767px) {
  #container {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-template-areas:
      "nav"
      "main"
      "sidebar";
    padding-top: 0;
  }

  #mainnav {
    position: relative;
    padding-bottom: 0;
  }

  .menu-toggle {
    display: block;
    position: absolute;
    top: -66px; /* Positioniert den Button exakt bei 162px im Header wie im Original */
    left: 8px;
    z-index: 20;
    width: 120px;
    padding: 14px 24px;
    border: 1px dotted var(--color-muted);
    border-radius: 6px;
    font-family: var(--font-base);
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    color: var(--color-muted);
    background-color: #FFFFFF;
    cursor: pointer;
    text-align: center;
  }

  .menu-toggle:hover,
  .menu-toggle:focus {
    background-color: #F5F5F5;
  }

  .nav-list {
    display: none;
    background-color: var(--color-muted);
    margin: 0 -2px 16px -2px;
  }

  .nav-list.is-open {
    display: block;
  }

  .nav-list li {
    padding: 15px 12px;
    background-image: linear-gradient(to right, #999999 1px, transparent 1px);
  }

  .nav-list a,
  .nav-list span {
    color: #FFFFFF;
  }

  .nav-list li.active a,
  .nav-list li.active span {
    color: #FFFFFF;
    font-weight: bold;
    text-decoration: underline;
  }

  #main {
    margin-left: 0;
    padding: 16px 8px 24px 8px;
  }

  /* Bürozeiten verschmelzen auf Mobilgeräten optisch mit dem grauen Footer */
  #buerozeiten {
    background-color: var(--color-gray-bar);
    color: var(--color-text);
    text-align: center;
    margin: 0 -2px;
    padding: 24px 8px 8px 8px;
  }

  #buerozeiten h2,
  #buerozeiten h3 {
    color: var(--color-text);
  }

  .copyright {
    text-align: center;
    padding-bottom: 16px;
  }
}

@media (max-width: 720px) {
  #header {
    background-position: right bottom;
  }
}

