/* =========================================================
   🔧 DESIGN KONFIGURATION
   ========================================================= */
:root{
  --color-primary: #0c6a93;
  --color-accent:  #ff8a00;
  --color-footer:  #f9f3ea;
  --color-bg:      #fafafa;
  --color-card:    #ffffff;
  --color-text:    #333333;
  --color-white:   #ffffff;

  --font-base: Arial, Helvetica, sans-serif;

  --fs-base:  15px;
  --fs-small: 13px;
  --fs-h1:    28px;
  --fs-h2:    22px;
  --fs-h3:    18px;

  --radius: 8px;
  --line-height: 1.4;
  --shadow: 0 2px 6px rgba(0,0,0,.12);

  --grid-cols: 6;

  /* Badge */
  --badge-hd-bg:       #2ecc71;
  --badge-new-bg:      #e74c3c;
  --badge-live-bg:     #27ae60;
  --badge-away-bg:     #95a5a6;
  --badge-private-bg:  #8e44ad;
  --badge-text-color:  #ffffff;
  --badge-radius:      6px;
  --badge-font-size:   11px;

  /* Pills */
  --name-pill-bg: rgba(255,138,0,0.20);
  --viewer-pill-bg: rgba(210, 218, 226, 0.55);

  /* Tags */
  --tag-text: var(--color-primary);
  --tag-radius: 999px;
}

/* =========================================================
   GLOBAL FIXES
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { scroll-behavior: smooth; }

body{
  font-family: var(--font-base);
  margin:0;
  background: var(--color-bg);
  color: var(--color-text);
}

/* =========================================================
   HEADER + NAV
   ========================================================= */
header{
  background: var(--color-primary);
  color: var(--color-white);
  padding:16px;
}

.header-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}

header h1{
  margin:0;
  text-align:center;
  font-size: var(--fs-h1);
  flex: 1;
}

/* ✅ TITEL-LINK FIX: alle Zustände + Safari */
header .site-title a,
header .site-title a:link,
header .site-title a:visited,
header .site-title a:hover,
header .site-title a:active,
header .site-title a:focus{
  color: var(--color-white) !important;
  -webkit-text-fill-color: var(--color-white) !important;
  text-decoration: none !important;
}
header .site-title a:hover{
  text-decoration: underline !important;
}

.burger{
  display:none;
  width:48px;
  height:46px;
  border-radius: var(--radius);
  border:1px solid rgba(255,255,255,0.35);
  background: rgba(0,0,0,0.22);
  cursor:pointer;
  padding:0 12px;
}
.burger span{
  display:block;
  height:2px;
  background: var(--color-white);
  margin:6px 0;
  border-radius:2px;
}

.nav{
  display:flex;
  gap:14px;
  justify-content:center;
  flex-wrap:wrap;
  align-items:flex-end;
}

.nav-item{
  display:flex;
  flex-direction:column;
  gap:6px;
  font-size: var(--fs-small);
  color: var(--color-white);
}

.nav select,
.nav input,
.nav button{
  height:46px;
  width:190px;
  padding:0 14px;
  border-radius: var(--radius);
  font-size: var(--fs-base);
  border:1px solid rgba(255,255,255,0.35);
}

.nav select,
.nav input{
  background: rgba(0,0,0,0.22);
  color: var(--color-white);
  outline:none;
  -webkit-appearance:none;
  appearance:none;
  box-shadow:none;
}

.nav select:focus,
.nav input:focus{
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(255,138,0,0.30);
}

.nav button{
  background: var(--color-accent);
  color: var(--color-white);
  border-color: var(--color-accent);
  font-weight:700;
  cursor:pointer;
}
.nav button:hover{ filter: brightness(1.05); }

#rooms-top{
  position:relative;
  top:-8px;
}

/* =========================================================
   GRID
   ========================================================= */
#rooms{
  padding:24px;
  display:grid;
  grid-template-columns: repeat(var(--grid-cols), minmax(0, 1fr));
  column-gap:18px;
  row-gap:34px;
  min-width:0;
}

.room{
  background: var(--color-card);
  padding:14px;
  border-radius: var(--radius);
  display:flex;
  flex-direction:column;
  text-align:center;
  box-shadow: var(--shadow);
  min-height:400px;
  position:relative;
  min-width:0;

  transition: transform .25s ease, box-shadow .25s ease;

  content-visibility:auto;
  contain-intrinsic-size: 400px;
}
@supports not (content-visibility: auto){
  .room{ content-visibility: visible; }
}

.room:hover{
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0,0,0,.14);
}

.room a, .room button, .room div { min-width:0; }

.profileLink{
  text-decoration:none;
  color:inherit;
  display:block;
}

.room img{
  width:100%;
  height:auto;
  aspect-ratio:4/3;
  object-fit:cover;
  border-radius: var(--radius);
  margin-bottom:10px;
  display:block;
  transition: transform .25s ease;
}
@supports not (aspect-ratio: 4 / 3){
  .room img{ height: 210px; }
}
.profileLink:hover img{ transform: scale(1.03); }

/* =========================================================
   BADGES
   ========================================================= */
.status-badges{
  position:absolute;
  top:8px;
  left:8px;
  display:flex;
  gap:6px;
  z-index:5;
  flex-wrap:wrap;
}

.badge{
  font-size: var(--badge-font-size);
  font-weight:800;
  padding:4px 7px;
  border-radius: var(--badge-radius);
  color: var(--badge-text-color);
  line-height:1;
  border:1px solid rgba(255,255,255,0.18);
  letter-spacing:.2px;
}

.badge.hd{ background: var(--badge-hd-bg); }
.badge.new{ background: var(--badge-new-bg); }
.badge.live{ background: var(--badge-live-bg); }
.badge.away{ background: var(--badge-away-bg); }
.badge.private{ background: var(--badge-private-bg); }

/* =========================================================
   CARD CONTENT
   ========================================================= */
.room-name{
  display:inline-block;
  background: var(--name-pill-bg);
  color: var(--color-text);
  padding:6px 14px;
  border-radius:999px;
  font-weight:700;
  font-size:14px;
  margin:2px auto 10px;
  max-width:100%;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;

  transition: transform .2s ease, background .2s ease;
}
.profileLink:hover .room-name{
  background: rgba(12,106,147,0.15);
  transform: translateY(-2px);
}

.subject{
  margin-bottom:8px;
  min-height:2.6em;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
@supports not (-webkit-line-clamp: 2){
  .subject{
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    min-height:auto;
  }
}

.country{
  font-size: 13px;
  opacity: .9;
  margin: 0 0 10px;
}
.country .flag{
  font-size: 16px;
  margin-right: 6px;
  vertical-align: -1px;
}

.meta{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  background: var(--viewer-pill-bg);
  color: var(--color-text);
  font-size: 12.5px;
  padding:4px 10px;
  border-radius:999px;
  margin: 0 auto 12px;
  font-weight:600;
  max-width:100%;
}
.meta .icon{ font-size:14px; opacity:.85; }
.meta small{ font-size:11.5px; opacity:.85; }

.roomButton{
  margin-top:auto;
  height:46px;
  border-radius: var(--radius);
  background: var(--color-accent);
  color: var(--color-white);
  font-weight:700;
  text-decoration:none;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--color-accent);
  transition: transform .15s ease, filter .2s ease;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.roomButton:hover{
  transform: translateY(-1px);
  filter: brightness(1.05);
}

/* =========================================================
   TAG CLOUD
   ========================================================= */
.tag-cloud{
  max-width:1100px;
  margin:6px auto 18px;
  padding:0 24px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.tag-cloud .tag{
  display:inline-block;
  color: var(--tag-text);
  border-radius: var(--tag-radius);
  padding:6px 12px;
  font-weight:700;
  text-decoration:none;
  line-height:1;
  border:1px solid rgba(12,106,147,0.15);
  transition: transform .15s ease, filter .2s ease;
  user-select:none;
}
.tag-cloud .tag:hover{
  transform: translateY(-1px);
  filter: brightness(1.05);
}

/* =========================================================
   API FALLBACK
   ========================================================= */
.api-fallback{
  grid-column: 1 / -1;
  background: var(--color-footer);
  border-left: 6px solid var(--color-primary);
  padding: 24px;
  border-radius: var(--radius);
  text-align: center;
  line-height: var(--line-height);
}
.api-fallback h2{
  margin: 0 0 10px;
  color: var(--color-primary);
  font-size: var(--fs-h2);
}
.api-fallback p{ margin: 0 0 10px; }
.api-fallback a{
  color: var(--color-primary);
  font-weight: 700;
  text-decoration: none;
}
.api-fallback a:hover{ text-decoration: underline; }

/* =========================================================
   PAGINATION
   ========================================================= */
.pagination--numbers{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:10px;
  padding:18px 24px 28px;
}

.page-numbers{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:center;
  max-width:1100px;
  min-width:0;
}

.page-btn{
  height:42px;
  min-width:42px;
  padding:0 12px;
  border-radius: var(--radius);
  background: var(--color-accent);
  color: var(--color-white);
  border:1px solid var(--color-accent);
  font-weight:800;
  cursor:pointer;
}
.page-btn:disabled{ opacity:.5; cursor:not-allowed; }

.page-number{
  background: rgba(255,138,0,0.18);
  border-color: rgba(255,138,0,0.28);
  color: var(--color-text);
}
.page-number:hover{ filter: brightness(1.03); }
.page-number.active{
  background: var(--color-accent);
  color: var(--color-white);
  border-color: var(--color-accent);
}
.page-dots{ font-weight:800; opacity:.65; padding:0 4px; }

/* =========================================================
   INHALT + INFO
   ========================================================= */
#Inhalt{
  padding:26px;
  max-width:1000px;
  margin:0 auto 20px;
  font-size: var(--fs-base);
  line-height: var(--line-height);
  color: var(--color-text);
}
#Inhalt h2{
  font-size: var(--fs-h2);
  margin:26px 0 14px;
  color: var(--color-primary);
}
#Inhalt p{ margin:0 0 14px; }

.info-box{
  max-width:1000px;
  margin:0 auto 40px;
  padding:22px;
  background: var(--color-footer);
  border-left:6px solid var(--color-primary);
  border-radius:6px;
  line-height: var(--line-height);
}

/* =========================================================
   FOOTER
   ========================================================= */
footer{
  background: var(--color-footer);
  padding:40px 20px;
}
.footer-inner{
  max-width:900px;
  margin:auto;
  text-align:center;
}
.footer-text{
  font-size:14px;
  line-height:1.6;
  color: var(--color-text);
  margin:0 auto 14px;
}
.footer-links{
  display:flex;
  justify-content:center;
  gap:16px;
  flex-wrap:wrap;
}
.footer-links a{
  color: var(--color-primary);
  text-decoration:none;
  font-weight:700;
  font-size:12px;
}
.footer-links a:hover{ text-decoration:underline; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media(max-width:1200px){
  #rooms{ grid-template-columns:repeat(4, minmax(0, 1fr)); }
}

@media(max-width:900px){
  .burger{ display:block; }

  .nav-wrap{
    max-height:0;
    overflow:hidden;
    transition:max-height .25s ease;
  }
  .nav-wrap.open{ max-height:900px; }

  .nav{
    padding-top:10px;
    flex-direction:column;
    align-items:stretch;
  }

  .nav select, .nav input, .nav button{ width:100%; }

  #rooms{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
}

@media(max-width:600px){
  .subject{ display:none !important; }
  .meta{ display:none !important; }
  .country{ display:none !important; }
  .room{ min-height:0; }
}
