/* ==========================================================================
   Praxis Wabner - Responsive Stylesheet
   Mobile-first approach with breakpoints at 768px and 1024px
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables
   -------------------------------------------------------------------------- */
:root {
  /* Colors */
  --color-primary: #95ad6f;
  --color-secondary: #50452e;
  --color-accent: #665433;
  --color-background: #e1f1d8;
  --color-sidebar-bg: #fff;
  --color-slogan-bg: #f5e8d1;
  --color-text: #2e2e2e;
  --color-text-light: #6a6a6a;
  --color-text-dark: #51534e;
  --color-footer-bg: #aebaa7;

  /* Spacing */
  --spacing-xs: 5px;
  --spacing-sm: 10px;
  --spacing-md: 20px;
  --spacing-lg: 40px;

  /* Layout */
  --max-width: 980px;
  --header-height: 100px;
  --slogan-height: 70px;
  --border-radius: 5px;

  /* Typography */
  --font-family: Cantarell, "Droid Sans", "DejaVu Sans", sans-serif;
  --font-size-base: 16px;
  --font-size-small: 14px;
  --line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Reset & Base
   -------------------------------------------------------------------------- */
body {
  padding: 0;
  margin: 0;
  min-height: 100%;
  width: 100%;
  background: url(images/background.png) repeat-x;
  background-color: var(--color-secondary);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--line-height);
}

html {
  min-height: 100%;
  width: 100%;
}

ul {
  margin: 0;
  padding: 0;
}

/* --------------------------------------------------------------------------
   Layout Container
   -------------------------------------------------------------------------- */
#content {
  min-height: 100%;
  width: 100%;
}

#maindiv {
  display: block;
  min-height: 100%;
}

#maincontent {
  margin: auto;
  position: relative;
  top: 0;
  left: 0;
  width: 100%;
  max-width: var(--max-width);
  min-height: 100%;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
#header {
  min-height: var(--header-height);
  position: relative;
  z-index: 100;
  background-color: var(--color-primary);
  border-top-right-radius: var(--border-radius);
  border-top-left-radius: var(--border-radius);
  padding-bottom: 50px; /* Space for nav on mobile */
}

#header a {
  text-decoration: none;
}

#logo-bild {
  float: left;
  padding-left: var(--spacing-sm);
  padding-top: 14px;
}

#logo-bild img {
  max-width: 65px;
  height: auto;
}

#logo-text1 {
  padding-left: var(--spacing-md);
  padding-top: 25px;
  color: var(--color-text-dark);
  font-size: 15px;
  font-style: italic;
  float: left;
  display: block;
}

#logo-text2 {
  position: absolute;
  left: 0;
  top: 0;
  padding-left: 112px;
  padding-top: 50px;
  color: var(--color-text-dark);
  font-size: 15px;
  font-style: italic;
  display: block;
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
.nav-toggle {
  display: none;  /* Hidden on desktop, shown via media query on mobile */
  position: absolute;
  top: var(--spacing-sm);
  right: var(--spacing-sm);
  background: transparent;
  border: none;
  font-size: 28px;
  color: var(--color-text-dark);
  cursor: pointer;
  padding: var(--spacing-xs);
  z-index: 100;
  width: 44px;
  height: 44px;
}

/* CSS-based hamburger icon for better compatibility */
.nav-toggle span {
  display: block;
  width: 24px;
  height: 3px;
  background-color: var(--color-text-dark);
  margin: 5px auto;
  border-radius: 2px;
}

/* Navigation - Desktop (default) */
#header ul {
  position: absolute;
  margin: 0;
  bottom: 0;
  right: 0;
  padding: 10px 10px 0;
  list-style: none;
  letter-spacing: -0.05em;
  font-weight: 700;
}

#header li {
  float: left;
  background: url(images/menu-left.png) no-repeat left top;
  margin: 0 1px 0 0;
  padding: 0 0 0 13px;
}

#header li a {
  float: left;
  display: block;
  width: auto;
  background: url(images/menu-right.png) no-repeat right top;
  padding: 5px 13px 4px 0;
  color: var(--color-text-dark);
}

#header .current_page_item {
  background-position: 0 -220px !important;
}

#header .current_page_item a {
  background-position: 100% -220px !important;
  color: #252d3b !important;
}

/* Navigation - Mobile (unter 768px) */
@media (max-width: 767px) {
  .nav-toggle {
    display: block;
  }

  #header nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 9999;
  }

  #header ul {
    display: none;
    position: static;
    top: auto;
    bottom: auto;
    left: auto;
    right: auto;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
    background: #95ad6f;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    border-bottom-left-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
  }

  #header ul.open {
    display: block;
  }

  #header li {
    display: block;
    float: none;
    background: none;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid rgba(255,255,255,0.3);
  }

  #header li:last-child {
    border-bottom: none;
  }

  #header li a {
    float: none;
    display: block;
    background: none;
    padding: 14px 20px;
    min-height: 44px;
    text-align: center;
    font-size: 16px;
    color: var(--color-text-dark);
  }

  #header li a:hover,
  #header li a:active {
    background: rgba(255,255,255,0.2);
  }

  #header .current_page_item {
    background: rgba(0,0,0,0.1);
  }

  #header .current_page_item a {
    background: none;
  }
}

/* --------------------------------------------------------------------------
   Slogan
   -------------------------------------------------------------------------- */
#slogan {
  min-height: var(--slogan-height);
  position: relative;
  background-color: var(--color-slogan-bg);
  padding: var(--spacing-sm);
}

#slogan_text {
  color: var(--color-text-light);
  padding: var(--spacing-sm);
  margin: 0;
  font-family: Parisienne, cursive;
  font-size: 16px;
  text-align: center;
  width: auto !important;
  max-width: 100%;
  box-sizing: border-box;
}

#slogan_text div {
  text-align: center !important;
}

/* --------------------------------------------------------------------------
   Content Wrapper (Main + Sidebar)
   -------------------------------------------------------------------------- */
#content-wrapper {
  width: 100%;
  position: relative;
  background-color: var(--color-background);
  border-bottom-right-radius: var(--border-radius);
  border-bottom-left-radius: var(--border-radius);
  border-top: 1px solid #aaa;
  color: var(--color-text);
  font-size: var(--font-size-base);
  display: flex;
  flex-direction: column;
  min-height: 400px;
}

/* --------------------------------------------------------------------------
   Main Content
   -------------------------------------------------------------------------- */
#real-content {
  padding: var(--spacing-sm);
  width: 100%;
  box-sizing: border-box;
  order: 1;
}

#main_image {
  padding: var(--spacing-md) 0;
  text-align: center;
}

#main_image img,
#real-content img {
  max-width: 100%;
  height: auto;
}

#main_text {
  padding: var(--spacing-sm);
  text-align: center;
}

#additional_information {
  padding: var(--spacing-sm);
  font-weight: 700;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */
#sidebar-wrapper {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: var(--spacing-sm);
  order: 2;
}

#sidebar-content {
  padding: var(--spacing-xs);
  background-color: var(--color-sidebar-bg);
  border-radius: var(--border-radius);
  box-shadow: 5px 5px 5px var(--color-accent);
  text-align: left;
}

#sidebar-content ul {
  list-style: none;
  padding-bottom: 1em;
}

#sidebar-content li {
  display: block;
  margin: 0;
  padding: var(--spacing-xs);
  border-bottom: 1px solid #eee;
}

#sidebar-content img {
  max-width: 100%;
  height: auto;
}

#card_click {
  font-size: 12px;
  font-family: var(--font-family);
}

/* Accessible tap targets for sidebar links - only on mobile */
@media (max-width: 767px) {
  #sidebar-content a {
    display: inline-block;
    padding: 8px 0;
    min-height: 44px;
    line-height: 1.5;
  }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
#footer {
  width: 100%;
  height: auto;
  background-color: var(--color-footer-bg);
  border-bottom-right-radius: var(--border-radius);
  border-bottom-left-radius: var(--border-radius);
  order: 3;
  clear: both;
}

#footer_text {
  padding: var(--spacing-sm);
  font-size: 11px;
  font-family: var(--font-family);
  color: #fff;
  text-align: center;
}

#footer_text a {
  color: #000;
  text-decoration: none;
}

/* Mobile: Größere Touch-Targets und lesbare Schrift */
@media (max-width: 767px) {
  #footer_text {
    font-size: 12px;
    text-align: center;
    padding: 10px 5px;
  }

  #footer_text a {
    display: inline-block;
    padding: 8px 6px;
    min-height: 44px;
    line-height: 28px;
  }
}

/* --------------------------------------------------------------------------
   Responsive Tables
   -------------------------------------------------------------------------- */
table {
  max-width: 100%;
  table-layout: auto;
  word-wrap: break-word;
}

#sidebar-content table {
  width: 100%;
}

#real-content table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 767px) {
  #real-content table td {
    padding: 2px;
    font-size: 14px;
  }

  #real-content table td[width] {
    width: auto !important;
  }
}

/* --------------------------------------------------------------------------
   OpenLayers Map (praxis.html)
   -------------------------------------------------------------------------- */
#map {
  width: 100% !important;
  max-width: 500px;
  height: 300px !important;
}

@media (min-width: 768px) {
  #map {
    height: 400px !important;
  }
}

/* --------------------------------------------------------------------------
   PrettyPhoto Gallery (Desktop)
   -------------------------------------------------------------------------- */
.prettyPhoto {
  max-width: 100%;
  height: auto;
}

/* --------------------------------------------------------------------------
   Mobile Lightbox (replaces PrettyPhoto on mobile)
   -------------------------------------------------------------------------- */
.mobile-lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.mobile-lightbox.active {
  display: flex;
}

.mobile-lightbox img {
  max-width: 95%;
  max-height: 80vh;
  object-fit: contain;
}

.mobile-lightbox .lightbox-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 15px;
  color: #fff;
  font-size: 16px;
}

.mobile-lightbox .lightbox-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  padding: 12px 20px;
  font-size: 18px;
  cursor: pointer;
  border-radius: 5px;
  min-width: 50px;
}

.mobile-lightbox .lightbox-btn:hover,
.mobile-lightbox .lightbox-btn:active {
  background: rgba(255, 255, 255, 0.4);
}

.mobile-lightbox .lightbox-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  font-size: 28px;
  width: 44px;
  height: 44px;
  cursor: pointer;
  border-radius: 50%;
  line-height: 1;
}

.mobile-lightbox .lightbox-counter {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

/* --------------------------------------------------------------------------
   PrettyPhoto
   -------------------------------------------------------------------------- */
.prettyPhoto {
  border: 2px solid #000;
}

.prettyPhoto:hover {
  border: 2px solid #fff;
}

/* --------------------------------------------------------------------------
   Word Wrap for Long URLs/Text
   -------------------------------------------------------------------------- */
#real-content {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

#real-content a {
  word-break: break-all;
}

/* --------------------------------------------------------------------------
   Headings (semantic H1 styled to match original H4)
   -------------------------------------------------------------------------- */
#real-content h1 {
  font-size: 1em;
  font-weight: bold;
  margin: 0 0 0.5em 0;
  padding: 0;
}

/* --------------------------------------------------------------------------
   Utility Classes
   -------------------------------------------------------------------------- */
.text-center {
  text-align: center;
}

/* ==========================================================================
   TABLET BREAKPOINT (768px+)
   ========================================================================== */
@media (min-width: 768px) {
  :root {
    --font-size-base: 15px;
  }

  #header {
    padding-bottom: 0;
  }

  .nav-toggle {
    display: none;
  }

  #header nav {
    position: static;
    top: auto;
    left: auto;
    right: auto;
    z-index: auto;
  }

  #header ul {
    display: flex;
    position: absolute;
    top: unset;
    bottom: 0;
    right: 0;
    left: auto;
    padding: 10px 10px 0;
    flex-direction: row;
    background: transparent;
  }

  #header li {
    float: left;
    background: url(images/menu-left.png) no-repeat left top;
    margin: 0 1px 0 0;
    padding: 0 0 0 13px;
    border-bottom: none;
  }

  #header li a {
    float: left;
    display: block;
    width: auto;
    background: url(images/menu-right.png) no-repeat right top;
    padding: 5px 13px 4px 0;
    text-align: left;
  }

  #header .current_page_item {
    background-position: 0 -220px;
    background-color: transparent;
  }

  #header .current_page_item a {
    background-position: 100% -220px;
  }

  #logo-text1 {
    font-size: 17px;
  }

  #logo-text2 {
    font-size: 17px;
  }

  #slogan_text {
    font-size: 20px;
    padding-left: 60px;
    padding-top: 15px;
    width: auto;
    max-width: 100%;
    text-align: left;
  }

  #slogan_text div:first-child {
    text-align: left;
  }

  #slogan_text div:last-child {
    text-align: right;
  }

  /* Use pure flexbox layout - no floats */
  #content-wrapper {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
  }

  #real-content {
    flex: 1 1 auto;
    width: calc(100% - 290px);
    min-width: 0;
    padding: var(--spacing-sm) var(--spacing-sm) var(--spacing-md) var(--spacing-sm);
    order: 1;
  }

  #sidebar-wrapper {
    flex: 0 0 250px;
    width: 250px;
    margin: var(--spacing-xs) 15px 0 0;
    padding: var(--spacing-sm) var(--spacing-sm) var(--spacing-lg) var(--spacing-sm);
    order: 2;
  }

  #main_image {
    padding-left: 75px;
    padding-top: 55px;
    text-align: left;
  }

  #main_text {
    padding-left: 100px;
    padding-top: var(--spacing-sm);
    text-align: left;
  }

  #additional_information {
    padding-left: 120px;
    padding-top: var(--spacing-sm);
    text-align: left;
  }

  #footer {
    flex: 0 0 100%;
    width: 100%;
    order: 3;
  }

  #footer_text {
    padding: 0;
    padding-left: var(--spacing-sm);
    text-align: left;
  }
}

/* ==========================================================================
   DESKTOP BREAKPOINT (1024px+)
   ========================================================================== */
@media (min-width: 1024px) {
  #real-content {
    width: 660px;
  }

  /* Content-wrapper braucht kein position: absolute mehr,
     das war nur für den fixed-height Footer im Original */
}
