/* ================================
   Rotlicht Toolbox – Frontend CSS
   Version: 1.6.1
   ================================ */

:root {
  --rtx-red: #930c10;
  --rtx-red-90: rgba(147,12,16,.92);
  --rtx-red-70: rgba(147,12,16,.7);
  --rtx-text: #111;
  --rtx-text-inv: #fff;
  --rtx-muted: #6b7280;
  --rtx-border: #e5e7eb;
  --rtx-card-bg: #fff;
  --rtx-shadow: 0 6px 20px rgba(0,0,0,.08);
  --rtx-radius: 14px;
  --rtx-gap: 16px;
}

.rtx-scope { font-family: inherit; color: var(--rtx-text); }

/* GRID */
.rotlicht-sedcards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--rtx-gap);
  align-items: stretch;
}
@media (max-width: 1200px) { .rotlicht-sedcards-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px)  { .rotlicht-sedcards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .rotlicht-sedcards-grid { grid-template-columns: 1fr; } }

/* CARD */
.rotlicht-sedcard-box { background: var(--rtx-card-bg); border-radius: var(--rtx-radius); overflow: hidden; box-shadow: var(--rtx-shadow); display: flex; flex-direction: column; }
.rotlicht-sedcard-box .image-wrapper { position: relative; width: 100%; background: #f6f6f6; overflow: hidden; }
.rotlicht-sedcard-box .image-wrapper .image-link { display: block; width: 100%; height: 100%; }
.rotlicht-main-image { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; transition: transform .25s ease, opacity .25s ease; }
.rotlicht-sedcard-box .image-wrapper:hover .rotlicht-main-image { transform: scale(1.02); }

/* BADGES */
.rotlicht-sedcard-ort {
  position: absolute; top: 10px; right: 10px; left: auto; z-index: 3;
  display: inline-block; padding: 6px 10px; font-size: 12px; line-height: 1;
  color: var(--rtx-text-inv); background: var(--rtx-red); border-radius: 999px; text-decoration: none;
  box-shadow: 0 3px 12px rgba(0,0,0,.15); white-space: nowrap;
}
.rotlicht-sedcard-rubrik {
  position: absolute; bottom: 10px; left: 10px; z-index: 3;
  display: inline-block; padding: 6px 10px; font-size: 12px; line-height: 1;
  color: var(--rtx-text-inv); background: var(--rtx-red); border-radius: 999px; text-decoration: none;
  box-shadow: 0 3px 12px rgba(0,0,0,.15); white-space: nowrap;
}
.rotlicht-sedcard-ort:hover, .rotlicht-sedcard-rubrik:hover { opacity: .9; }

/* INFO */
.rotlicht-sedcard-info-icon {
  position: absolute; bottom: 10px; right: 10px; top: auto; z-index: 4;
  width: 28px; height: 28px; border-radius: 999px; background: var(--rtx-red);
  color: var(--rtx-text-inv); font-weight: 700; display: flex; align-items: center; justify-content: center;
  cursor: pointer; user-select: none; box-shadow: 0 4px 14px rgba(0,0,0,.2);
}
.rotlicht-sedcard-details {
  position: absolute; left: 8px; right: 8px; bottom: 56px; z-index: 3;
  background: var(--rtx-red-90); color: var(--rtx-text-inv);
  border-radius: 10px; padding: 10px 12px; box-shadow: 0 10px 24px rgba(0,0,0,.35);
  display: none;
}
.rotlicht-sedcard-details[aria-hidden="false"] { display: block; }
.rotlicht-sedcard-details ul { list-style: none; margin: 0; padding: 0; font-size: 13px; line-height: 1.4; }
.rotlicht-sedcard-details li + li { margin-top: 6px; }
.rotlicht-sedcard-details a, .rotlicht-sedcard-details a:visited { color: #fff; text-decoration: underline; }

/* NAME */
.rotlicht-name-link { display: block; width: 100%; text-decoration: none; }
.rotlicht-sedcard-name {
  background: var(--rtx-red); color: var(--rtx-text-inv);
  padding: 10px 12px; font-size: 15px; font-weight: 700; text-align: left; line-height: 1.25;
  min-height: 44px; display: block; word-break: break-word;
}

/* FILTERBAR */
.rtx-filterbar { margin: 0 0 14px; padding: 10px; background: #fff; border: 1px solid var(--rtx-border); border-radius: 10px; }
.rtx-filter-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Suchfeld etwas schmaler */
.rtx-filter-input {
  appearance: none; border: 1px solid var(--rtx-border); background: #fff; border-radius: 8px;
  padding: 8px 10px; font-size: 14px; line-height: 1.2; flex: 1 1 160px; min-width: 140px;
}
.rtx-filter-select {
  appearance: none; border: 1px solid var(--rtx-border); background: #fff; border-radius: 8px;
  padding: 8px 10px; font-size: 14px; line-height: 1.2; flex: 0 1 180px; min-width: 150px;
}

.rtx-toggle { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; color: var(--rtx-text); margin-left: 6px; }
.rtx-filter-clear { margin-left: auto; border: 1px solid var(--rtx-border); background: #fff; color: var(--rtx-text); padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.rtx-filter-clear:hover { border-color: #d1d5db; }

/* Toggle-Link für „Erweiterte Suche“ (inline in der Zeile) */
.rtx-adv-toggle {
  background: none; border: 0; padding: 0 6px;
  color: var(--rtx-red); text-decoration: underline; cursor: pointer; font-weight: 600;
}

/* Panel der erweiterten Suche – immer initial zu */
.rtx-adv-panel[hidden] { display: none !important; }

.rtx-adv-panel {
  margin-top: 10px; padding: 10px; border: 1px dashed var(--rtx-border); border-radius: 10px; background: #fafafa;
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px;
}
@media (max-width: 1000px){ .rtx-adv-panel{ grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 760px){ .rtx-adv-panel{ grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 520px){ .rtx-adv-panel{ grid-template-columns: 1fr; } }

.rtx-adv-field { display: flex; flex-direction: column; gap: 6px; }
.rtx-adv-field > span { font-size: 12px; color: var(--rtx-muted); }
.rtx-adv-field select {
  appearance: none; border: 1px solid var(--rtx-border); background: #fff; border-radius: 8px; padding: 8px 10px; font-size: 14px;
}

/* BELIEBTE ORTE */
.rtx-popular-orte { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 14px; font-size: 14px; }
.rtx-popular-orte > strong { margin-right: 4px; }
.rtx-popular-orte a {
  display: inline-block; padding: 6px 10px; border: 1px solid var(--rtx-border); border-radius: 999px;
  text-decoration: none; color: var(--rtx-text); background: #fff; font-size: 13px; line-height: 1;
}
.rtx-popular-orte a span { color: var(--rtx-muted); }

/* HOVER-FIX: niemals weiß auf weiß – Theme-Overrides aushebeln */
.rtx-popular-orte a:hover,
.rtx-popular-orte a:focus {
  background: #fafafa;
  color: var(--rtx-text) !important;
}

/* Der rote Button „Alle Orte anzeigen“ bleibt weißer Text auf Rot – auch bei Hover */
.rtx-popular-orte .rtx-orte-open {
  background: var(--rtx-red);
  color: var(--rtx-text-inv) !important;
  border-color: var(--rtx-red);
}
.rtx-popular-orte .rtx-orte-open:hover,
.rtx-popular-orte .rtx-orte-open:focus {
  background: var(--rtx-red);
  color: var(--rtx-text-inv) !important;
  opacity: .92;
}

/* ALLE ORTE – OVERLAY */
.rtx-orte-overlay[aria-hidden="true"] { display: none; }
.rtx-orte-overlay[aria-hidden="false"] {
  position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center; padding: 20px; overflow: auto; cursor: default;
}
.rtx-orte-dialog {
  width: min(100%, 900px); max-height: 90vh; background: #fff; border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25); overflow: hidden; display: flex; flex-direction: column;
}
.rtx-orte-head {
  display: flex; gap: 10px; align-items: center; border-bottom: 1px solid var(--rtx-border); padding: 12px;
  position: sticky; top: 0; background: #fff; z-index: 1;
}
.rtx-orte-head h3 { margin: 0; font-size: 18px; }
.rtx-orte-search { margin-left: auto; border: 1px solid var(--rtx-border); border-radius: 999px; padding: 8px 12px; min-width: 220px; }
.rtx-orte-close { margin-left: 6px; width: 36px; height: 36px; border-radius: 9999px; border: 0; background: var(--rtx-red); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; }
.rtx-orte-close:hover { opacity: .9; }
.rtx-orte-list { padding: 12px; display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 10px; overflow: auto; -webkit-overflow-scrolling: touch; flex: 1 1 auto; }
@media (max-width: 1000px) { .rtx-orte-list { grid-template-columns: repeat(4, minmax(0,1fr)); } }
@media (max-width: 800px)  { .rtx-orte-list { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 600px)  { .rtx-orte-list { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 420px)  { .rtx-orte-list { grid-template-columns: 1fr; } }

/* LOAD MORE */
.rtx-loadmore-wrap { display: flex; justify-content: center; padding: 14px 0 6px; }
.rtx-load-more { display: inline-block; padding: 10px 14px; border-radius: 10px; background: var(--rtx-red); color: var(--rtx-text-inv); border: none; cursor: pointer; font-weight: 600; }
.rtx-load-more:hover { opacity: .92; }

/* BLOG */
.rtx-blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--rtx-gap); }
@media (max-width: 900px){ .rtx-blog-grid{ grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px){ .rtx-blog-grid{ grid-template-columns: 1fr; } }
.rtx-blog .rtx-blog-card { background: #fff; border: 1px solid var(--rtx-border); border-radius: var(--rtx-radius); overflow: hidden; box-shadow: var(--rtx-shadow); }
.rtx-blog .rtx-blog-card img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; }
.rtx-blog .rtx-blog-card .rtx-blog-body { padding: 12px; }
.rtx-blog .rtx-blog-card .rtx-blog-title { font-size: 17px; margin: 0 0 8px; }
.rtx-blog .rtx-blog-card .rtx-blog-meta { color: var(--rtx-muted); font-size: 13px; margin-bottom: 8px; }

/* ACCESSIBILITY */
.rtx-scope a:focus, .rtx-scope button:focus, .rtx-scope input:focus, .rtx-scope select:focus { outline: 2px solid var(--rtx-red-70); outline-offset: 2px; }

/* Sicherheitsnetz – zentrale Elemente erzwingen Kontrast */
.rtx-scope .rotlicht-sedcard-name,
.rtx-scope .rotlicht-sedcard-ort,
.rtx-scope .rotlicht-sedcard-rubrik,
.rtx-scope .rotlicht-sedcard-info-icon {
  color: var(--rtx-text-inv) !important; text-decoration: none !important;
}
