/* ===============================
   IVHZ – Site Custom Styles (clean)
   =============================== */

/* ---------- Variablen ---------- */
:root{
  --ivhz-accent: #ffc107;
  --ivhz-accent-hover: #ffca2c;
  --ivhz-divider: #F0F0F0;
  --ivhz-anchor-offset: 120px;
}

/* ===============================
   Weiterlesen (details/summary)
   =============================== */
.ivhz-details{ margin: 10px 0 0; }

.ivhz-summary,
.ivhz-close{
  display: inline-block;
  padding: 6px 16px;
  font-size: 0.95rem;
  font-weight: 500;
  background: var(--ivhz-accent);
  color: #fff !important;
  border-radius: 6px;
  text-decoration: none !important;
  cursor: pointer;
  border: none;
  appearance: none;
  -webkit-appearance: none;
}

.ivhz-summary:hover,
.ivhz-close:hover{ background: var(--ivhz-accent-hover); }

.ivhz-summary:focus-visible,
.ivhz-close:focus-visible{
  outline: 2px solid rgba(0,0,0,.25);
  outline-offset: 2px;
}

.ivhz-summary::-webkit-details-marker{ display:none; }
.ivhz-details > summary::marker{ content:""; }

.ivhz-details[open] > summary{ display: none; }
.ivhz-content{ margin-top: 4px; }
.ivhz-content p{ margin: 0.45em 0; }

.ivhz-closewrap{ margin: 12px 0 0; text-align: left; }

/* ===============================
   Shape Divider
   =============================== */
.custom-shape-divider-bottom-1766823447{
  position: absolute;
  bottom: 0; left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  transform: rotate(180deg);
}

.custom-shape-divider-bottom-1766823447 svg{
  display: block;
  width: calc(120% + 1.3px);
  height: 175px;
  transform: rotateY(180deg);
}

.custom-shape-divider-bottom-1766823447 .shape-fill{
  fill: var(--ivhz-divider);
}

/* ===============================
   Autor / Caption (IVHZ)
   =============================== */
.ivhz-author{
  font-size: 0.9em;
  font-style: italic;
  margin-top: 6px;
  text-align: center;
  opacity: 0.8;
}

/* ===============================
   2 Spalten – Artikel
   =============================== */
.com-content-article .ivhz-two-col{
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  align-items: start;
  margin: 14px 0 18px;
}

.com-content-article .ivhz-col-text{ padding-left: 10px; }

/* Varianten */
.com-content-article .ivhz-two-col--text-image{ grid-template-columns: 1fr 1fr; }
.com-content-article .ivhz-two-col--map,
.com-content-article .ivhz-two-col--reach{ grid-template-columns: 1fr 2fr; }

/* Mobil */
@media (max-width: 900px){
  .com-content-article .ivhz-two-col,
  .com-content-article .ivhz-two-col--text-image,
  .com-content-article .ivhz-two-col--map,
  .com-content-article .ivhz-two-col--reach{
    grid-template-columns: 1fr;
  }
  .com-content-article .ivhz-col-text{ padding-left: 0; }
}

/* ===============================
   Embed (16:9)
   =============================== */
.com-content-article .ivhz-embed{
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
}

.com-content-article .ivhz-embed iframe{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 900px){
  .com-content-article .ivhz-embed{ padding-top: 62%; }
}

/* ===============================
   Tabellen / breite Inhalte
   =============================== */
.com-content-article .ivhz-table-wrap{
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.com-content-article table{
  width: 100%;
  max-width: 100%;
}

/* ===============================
   Buttons (IVHZ)
   =============================== */
.com-content-article .ivhz-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 12px;
}

.com-content-article .ivhz-btn{
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration: none;
  border: 1px solid rgba(0,0,0,.15);
  background: var(--ivhz-accent);
  color: #fff !important;
  cursor: pointer;
  line-height: 1.2;
}

.com-content-article .ivhz-btn:hover{ background: var(--ivhz-accent-hover); }

.com-content-article .ivhz-btn--ghost{
  background: #fff;
  color: #333 !important;
}

.com-content-article .ivhz-btn--ghost:hover{ background: #f5f5f5; }

/* ===============================
   Bildunterschriften (FINAL)
   =============================== */
.com-content-article figure figcaption,
.com-content-article figcaption,
.com-content-article p.caption,
.com-content-article .caption,
.com-content-article .caption p,
.com-content-article p.img_caption,
.com-content-article .img_caption,
.com-content-article p.img-caption,
.com-content-article .img-caption,
.com-content-article p.image-caption,
.com-content-article .image-caption,
.com-content-article [class*="caption"],
.com-content-article .imgcap{
  font-size: 0.9em !important;
  font-style: italic !important;
  text-align: center !important;
  opacity: 0.8 !important;
  margin-top: 6px !important;
  font-family: inherit !important;
  color: inherit !important;
  line-height: 1.35 !important;
}

/* ===============================
   Anker-Offset (Sticky Header)
   =============================== */
[id]{ scroll-margin-top: var(--ivhz-anchor-offset); }

@media (max-width: 900px){
  :root{ --ivhz-anchor-offset: 90px; }
}

/* ===============================
   OpenStreetMap Embed
   =============================== */
.ivhz-map-embed{
  position: relative;
  width: 100%;
  height: 520px;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.ivhz-map-embed iframe{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 900px){
  .ivhz-map-embed{ height: 420px; }
}

/* ===============================
   Instagram Line
   =============================== */
.ivhz-igline{
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin: 6px 0 14px;
}

.ivhz-igline img{ width: 70px; height: auto; }

.ivhz-igline span{
  opacity: .75;
  font-size: 0.95em;
}

@media (max-width: 768px){
  .ivhz-igline{ justify-content: flex-start; }
}

/* ===============================
   Logout Menüpunkt als Button (Sidebar)
   =============================== */
li.item-289 > a.menu-logout-button{
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #ff7a00 !important;
  padding: 6px 16px !important;
  border-radius: 6px !important;
  text-decoration: none !important;
  margin-top: 18px !important;
}

li.item-289 > a.menu-logout-button > span.nav-title{
  color: #fff !important;
  font-size: 0.95rem !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
}

li.item-289 > a.menu-logout-button:hover{ background: #e56e00 !important; }
li.item-289 > a.menu-logout-button:hover > span.nav-title{ color: #fff !important; }

li.item-289::before,
li.item-289::after,
li.item-289 > a.menu-logout-button::before,
li.item-289 > a.menu-logout-button::after{
  content: none !important;
  display: none !important;
}

/* ==================================================
   LOGIN-SEITE (nur wenn Seitenklasse: login-page)
   ================================================== */

/* Deko-Elemente ausblenden (Header/Nav bleibt sichtbar) */
body.login-page .hero,
body.login-page .page-header,
body.login-page .intro,
body.login-page .header-image,
body.login-page .canvas,
body.login-page .svg,
body.login-page .slideshow{
  display: none !important;
}

/* Astroid Login-Illustration endgültig entfernen */
body.login-page .login-image,
body.login-page .login-image-wrap,
body.login-page .login-illustration,
body.login-page .login-icon,
body.login-page .user-icon,
body.login-page .astroid-login-image,
body.login-page .astroid-login-image-wrap,
body.login-page .com-users-login .login-image,
body.login-page .com-users-login .login-image-wrap,
body.login-page .com-users-login .login-illustration,
body.login-page .com-users-login .login-icon,
body.login-page .com-users-login .user-icon,
body.login-page .com-users-login svg,
body.login-page .com-users-login img,
body.login-page .com-users-login [class*="login-image"],
body.login-page .com-users-login [class*="login-icon"],
body.login-page .com-users-login [class*="illustration"]{
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

/* falls als Hintergrund gesetzt */
body.login-page .com-users-login,
body.login-page .com-users-login .login,
body.login-page .com-users-login .card,
body.login-page .com-users-login .card-body{
  background-image: none !important;
}

/* Login-Links (Passwort vergessen etc.) ausblenden */
body.login-page .com-users-login a[href*="reset"],
body.login-page .com-users-login a[href*="remind"],
body.login-page .com-users-login .login-links,
body.login-page .com-users-login .list-group{
  display: none !important;
}

/* ==================================================
   LOGOUT-SEITE (nur wenn Seitenklasse: logout-page)
   Hidden-Menu "Erfolgreich abgemeldet"
   ================================================== */

/* grüne Joomla-Systemmeldung NUR hier ausblenden */
body.logout-page #system-message-container,
body.logout-page .alert,
body.logout-page .alert-success{
  display: none !important;
}

/* Inhalt zentrieren */
body.logout-page .com-content-article{
  max-width: 720px;
  margin: 4rem auto 5rem !important;
  text-align: center;
}

/* Buttons mittig */
body.logout-page .ivhz-actions,
body.logout-page .ivhz-logout-actions{
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

/* =========================================
   LOGIN: leere weiße Box unter "Angemeldet bleiben" entfernen
   ========================================= */

/* leere Control-Groups im Login-Formular ausblenden */
body.login-page .com-users-login .control-group:has(input[type="hidden"]),
body.login-page .com-users-login .control-group:has(input[name="return"]),
body.login-page .com-users-login .control-group:has(input[name="task"]),
body.login-page .com-users-login .control-group:has(input[name="option"]),
body.login-page .com-users-login .control-group:has(input[name*="token"]){
  display: none !important;
}

/* Fallback: wirklich leere Gruppen */
body.login-page .com-users-login .control-group:empty{
  display: none !important;
}

/* ===============================
   IVHZ – Inventar: Cards + Filter
   =============================== */
.ivhz-inv-head{
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 10px 0 14px;
}

.ivhz-heading{
  margin: 0;
  padding-bottom: 6px;
  font-weight: 600;
  border-bottom: 2px solid rgba(0,0,0,.08);
}

/* Filter-Chips */
.ivhz-inv-filter{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ivhz-chip{
  appearance: none;
  border: 1px solid rgba(0,0,0,.12);
  background: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: .95rem;
  line-height: 1.2;
}

.ivhz-chip:hover{
  background: rgba(0,0,0,.04);
}

.ivhz-chip.is-active{
  background: var(--ivhz-accent);
  border-color: rgba(0,0,0,.12);
  color: #fff;
}

/* Layout: Karten */
.ivhz-inv-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 900px){
  .ivhz-inv-grid{
    grid-template-columns: repeat(3, 1fr);
  }
}

.ivhz-inv-card{
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 12px;
  padding: 14px 14px 10px;
  background: #fff;
}

.ivhz-inv-title{
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 600;
  display: flex;
  gap: 8px;
  align-items: center;
}

.ivhz-ico{ font-size: 1.1rem; }

.ivhz-inventar{
  margin: 0;
  padding-left: 1.2rem;
  line-height: 1.6;
}

.ivhz-inventar li{ margin: 4px 0; }

/* nicht vorhanden */
.ivhz-inventar li[data-status="out"]{
  opacity: .6;
}

.ivhz-inventar li[data-status="out"] del{
  text-decoration-thickness: 2px;
}

/* ===============================
   Druckansicht
   =============================== */
@media print{
  .ivhz-inv-filter{ display: none !important; }

  .ivhz-inv-card{
    border: 0 !important;
    padding: 0 !important;
  }

  .ivhz-inv-grid{
    gap: 18px !important;
  }

  .ivhz-inventar li[data-status="out"]{
    display: none !important;
  }
}

/* ===============================
   IVHZ – Download-Link mit SVG Icon + Meta
   =============================== */
.ivhz-file{
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  font-weight: 500;
  color: #fd7906;
}

.ivhz-file::before{
  content: "";
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  display: inline-block;
  background-repeat: no-repeat;
  background-size: 16px 16px;
  background-position: center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fd7906' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3Cpath d='M12 15V3'/%3E%3C/svg%3E");
}

.ivhz-filemeta{
  font-weight: 400;
  font-size: 0.95em;
  opacity: .75;
  white-space: nowrap;
}

.ivhz-file:hover{ text-decoration: underline; }

/* ==================================================
   IVHZ Lightbox: Klick zuverlässig (auch mit .imgcap)
   ================================================== */
.com-content-article .ivhz-floatbox > a.ivhz-lightbox{
  display: inline-block;
  position: relative;
  z-index: 2;
}

.com-content-article .ivhz-floatbox > a.ivhz-lightbox > img{
  display: block;
}

.com-content-article .ivhz-floatbox .imgcap{
  pointer-events: none !important;
  position: relative;
  z-index: 1;
}

.com-content-article .ivhz-floatbox::before,
.com-content-article .ivhz-floatbox::after{
  pointer-events: none;
}

/* ==================================================
   IVHZ Leaflet Map (DIV #ivhz-map / .ivhz-map)
   ================================================== */
.com-content-article .ivhz-map{
  width: 100%;
  height: 520px;          /* Desktop-Höhe */
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

@media (max-width: 900px){
  .com-content-article .ivhz-map{
    height: 420px;
  }
}
/* =========================================
   IVHZ Map – Mobile "Tap to Activate" (OSM iframe)
   ========================================= */

.com-content-article .ivhz-map-wrap{
  position: relative;
}

/* Overlay liegt über der Karte */
.com-content-article .ivhz-map-overlay{
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(255,255,255,.70);
  backdrop-filter: blur(2px);
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  padding: 12px;
}

/* Mobile: Overlay aktiv */
@media (max-width: 900px){
  .com-content-article .ivhz-map-overlay{
    display: flex;
  }

  /* solange Overlay da ist → Karte nicht klickbar */
  .com-content-article .ivhz-map-wrap iframe{
    pointer-events: none;
  }

  /* nach Aktivierung */
  .com-content-article .ivhz-map-wrap.is-active .ivhz-map-overlay{
    display: none;
  }
  .com-content-article .ivhz-map-wrap.is-active iframe{
    pointer-events: auto;
  }
}

/* =========================================
   IVHZ Media Grid – Galerie nebeneinander
   ========================================= */

.ivhz-media-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin: 24px 0;
}

/* Bilder im Grid */
.ivhz-media-grid .ivhz-media-img{
  text-align: center;
}

.ivhz-media-grid img{
  width: 100%;
  height: auto;
  border-radius: 8px;
}

/* Caption im Grid */
.ivhz-media-grid .ivhz-cap{
  margin-top: 6px;
  font-size: 0.9em;
  font-style: italic;
  opacity: 0.8;
}

/* Mobil etwas enger */
@media (max-width: 768px){
  .ivhz-media-grid{
    gap: 16px;
  }
}
/* Leaflet-Map Fläche */
#ivhz-map{
  width: 100%;
  height: 600px;
  border-radius: 10px;
  overflow: hidden;
}

.ivhz-map-wrap{ position: relative; }

.ivhz-map-overlay{
  position:absolute;
  inset:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  cursor:pointer;
  z-index:5;
  background: rgba(255,255,255,0.75);
}

.ivhz-map-wrap:not(.is-active) #ivhz-map{ pointer-events:none; }
.ivhz-map-wrap.is-active #ivhz-map{ pointer-events:auto; }
.ivhz-map-wrap.is-active .ivhz-map-overlay{ display:none; }

/* mobil */
@media (max-width: 992px){
  .ivhz-two-col--reach{
    display:flex !important;
    flex-direction:column !important;
    gap:16px !important;
  }
  #ivhz-map{ height: 360px !important; }
}
@media (max-width: 420px){
  #ivhz-map{ height: 300px !important; }
}

/* Overlay-Text darf umbrechen, aber nicht so extrem schmal wirken */
.ivhz-map-overlay{
  padding:16px;
  box-sizing:border-box;
}
/* REACH-LAYOUT: Mobil immer untereinander + volle Breite */
@media (max-width: 992px){
  .ivhz-two-col--reach{
    display:flex !important;
    flex-direction:column !important;
    gap:16px !important;
    min-width:0 !important;
  }

  .ivhz-two-col--reach .ivhz-col-text,
  .ivhz-two-col--reach .ivhz-map-wrap{
    width:100% !important;
    max-width:100% !important;
    flex: 0 0 auto !important;
  }

  /* Standard-Map-Höhe mobil */
  .ivhz-two-col--reach #ivhz-map{
    height:360px !important;
  }

  /* iFrame-Map im Reach-Artikel */
  .ivhz-two-col--reach .ivhz-map-embed iframe{
    width:100% !important;
    height:360px !important;
  }
}

@media (max-width: 420px){
  .ivhz-two-col--reach #ivhz-map{ height:300px !important; }
  .ivhz-two-col--reach .ivhz-map-embed iframe{ height:300px !important; }
}

/* Overlay soll immer gut aussehen */
.ivhz-map-overlay{
  padding:16px;
  box-sizing:border-box;
}

/* ===== FIX: Leaflet immer unter Sticky (ohne Sticky anzufassen) ===== */
#ivhz-map { position: relative; z-index: 0 !important; }

/* Leaflet interne Reihenfolge (niedrig halten, aber korrekt) */
#ivhz-map .leaflet-tile-pane        { z-index: 10 !important; }
#ivhz-map .leaflet-overlay-pane     { z-index: 20 !important; }
#ivhz-map .leaflet-shadow-pane      { z-index: 30 !important; }
#ivhz-map .leaflet-marker-pane      { z-index: 40 !important; }
#ivhz-map .leaflet-popup-pane       { z-index: 50 !important; }
#ivhz-map .leaflet-control-container{ z-index: 60 !important; }
#ivhz-map .leaflet-control          { z-index: 70 !important; }
