/* =========================================================================
 * Booxly – Schrank-Einzelseite (schrank.php)
 * Gleiche Farben und Formen wie die App (assets/css/booxly.css), aber als
 * normale, scrollende Seite. Hell und dunkel über prefers-color-scheme.
 * ========================================================================= */

:root {
  --sp-bg: #F0EBE4;
  --sp-surface: #FCF8F5;
  --sp-surface-2: #E9E2D8;
  --sp-text: #1C1914;
  --sp-muted: #6B5D4F;
  --sp-border: #E2DBD0;
  --sp-petrol: #0B7583;
  --sp-petrol-hover: #085F6B;
  --sp-petrol-text: #095E69;
  --sp-petrol-soft: #DCECEC;
  --sp-orange: #E9762B;
  --sp-shadow: 0 2px 8px rgba(74, 63, 53, 0.06);
  --sp-shadow-float: 0 6px 20px rgba(74, 63, 53, 0.14);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --sp-bg: #1F1D1B;
    --sp-surface: #2A2724;
    --sp-surface-2: #37332E;
    --sp-text: #F3EEE8;
    --sp-muted: #B8AEA2;
    --sp-border: #3B3631;
    --sp-petrol: #2E9AA7;
    --sp-petrol-hover: #4BB3BF;
    --sp-petrol-text: #8FD5DD;
    --sp-petrol-soft: #1D3638;
    --sp-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    --sp-shadow-float: 0 6px 20px rgba(0, 0, 0, 0.45);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--sp-bg);
  color: var(--sp-text);
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--sp-petrol-text); }
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.sp-page { max-width: 640px; margin: 0 auto; min-height: 100vh; }

/* ---------- Kopfzeile ---------- */
.sp-header {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 18px 12px;
  background: color-mix(in srgb, var(--sp-surface) 88%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--sp-border);
}
.sp-logo { display: flex; }
.sp-logo img { width: 82px; height: 22px; object-fit: contain; display: block; }
.sp-header-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
  font-size: 13px; font-weight: 600; text-decoration: none; color: var(--sp-petrol-text);
}

/* ---------- Inhalt ---------- */
.sp-main { padding: 16px 18px 0; display: flex; flex-direction: column; gap: 26px; }

.sp-crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--sp-muted); }
.sp-crumbs a { color: var(--sp-muted); text-decoration: none; }
.sp-crumbs a.is-city { color: var(--sp-petrol-text); font-weight: 600; }

.sp-card {
  background: var(--sp-surface); border: 1px solid var(--sp-border); border-radius: 24px;
  padding: 10px; box-shadow: var(--sp-shadow);
}
.sp-photo { position: relative; display: block; height: 230px; border-radius: 16px; overflow: hidden; background: var(--sp-surface-2); }
.sp-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Bildnachweis wie in der App (booxly.css: .bx-credit) */
.sp-credit {
  position: absolute; right: 8px; bottom: 8px; padding: 1px 6px; border-radius: 6px;
  background: rgba(30, 27, 24, 0.55); color: rgba(255, 255, 255, 0.92); font-size: 7px; line-height: 1.5;
  max-width: 55%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sp-photo-empty {
  height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px dashed var(--sp-border); text-decoration: none; text-align: center; transition: background-color .2s ease;
}
.sp-photo-empty:hover, .sp-photo-empty:active { background: var(--sp-petrol-soft); }
.sp-photo-empty-icon {
  width: 42px; height: 42px; border-radius: 21px; background: var(--sp-surface); color: var(--sp-petrol-text);
  display: flex; align-items: center; justify-content: center;
}
.sp-photo-empty-icon svg { width: 20px; height: 20px; }
.sp-photo-empty-text { font-size: 13px; line-height: 1.4; }
.sp-photo-empty-lead { display: block; color: var(--sp-muted); }
.sp-photo-empty-action { display: block; font-weight: 600; color: var(--sp-petrol-text); }

.sp-body { padding: 20px 6px 0; }
/* Schriftgrößen und Abstände der Karte wie in der App (booxly.css: .bx-title, .bx-address, .bx-desc) */
.sp-body h1 { margin: 0; font-size: 17px; line-height: 1.3; font-weight: 700; }
.sp-address { display: block; font-size: 13px; line-height: 24px; font-weight: 500; text-decoration: none; overflow-wrap: anywhere; }
.sp-desc { margin: 5px 0 0; font-size: 13px; line-height: 1.45; color: var(--sp-muted); }
.sp-hint { margin: 5px 0 0; font-size: 12px; line-height: 1.45; color: var(--sp-muted); }

.sp-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 20px 6px 4px; }
.sp-actions .sp-btn { min-height: 38px; height: 38px; padding: 0 8px; gap: 5px; font-size: 12.5px; font-weight: 600; }
.sp-btn {
  min-height: 44px; padding: 0 14px; border-radius: 999px; border: 0;
  background: var(--sp-surface-2); color: var(--sp-text);
  font-size: 13px; font-weight: 600; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.sp-btn svg { width: 14px; height: 14px; }
.sp-btn-primary { background: var(--sp-petrol); color: #FFFFFF; font-weight: 700; }
.sp-btn-primary:hover { background: var(--sp-petrol-hover); color: #FFFFFF; }

.sp-section { display: flex; flex-direction: column; gap: 12px; }
.sp-section h2 { margin: 0; font-size: 18px; font-weight: 800; }

/* ---------- Kleine Karte ---------- */
.sp-map {
  position: relative; height: 200px; border-radius: 20px; overflow: hidden;
  border: 1px solid var(--sp-border); background: var(--sp-surface-2);
}
@media (prefers-color-scheme: dark) { .sp-map canvas { filter: brightness(.78) contrast(1.05) saturate(.85); } }
.sp-map-open {
  position: absolute; left: 12px; bottom: 12px; z-index: 2;
  padding: 10px 16px; border-radius: 999px; background: var(--sp-surface); color: var(--sp-petrol-text);
  font-size: 13px; font-weight: 700; text-decoration: none; box-shadow: var(--sp-shadow-float);
}
.sp-pin {
  display: block; width: 22px; height: 22px; border-radius: 50%;
  background: var(--sp-orange); border: 3px solid #FFFFFF; box-shadow: 0 2px 10px rgba(233, 118, 43, 0.55);
}
.sp-map-credit { margin: -4px 0 0; font-size: 10px; color: var(--sp-muted); }
.sp-map-credit a { color: inherit; text-decoration: none; }

/* ---------- In der Nähe ---------- */
.sp-nearby { list-style: none; margin: 0; padding: 0; background: var(--sp-surface); border: 1px solid var(--sp-border); border-radius: 20px; overflow: hidden; }
.sp-nearby li + li { border-top: 1px solid var(--sp-border); }
.sp-nearby a { display: flex; gap: 12px; align-items: center; padding: 12px; text-decoration: none; color: inherit; }
.sp-nearby img, .sp-nearby-noimg { flex: none; width: 56px; height: 56px; border-radius: 12px; object-fit: cover; }
.sp-nearby-noimg { background: var(--sp-surface-2); color: var(--sp-petrol-text); display: flex; align-items: center; justify-content: center; }
.sp-nearby-noimg svg { width: 20px; height: 20px; }
.sp-nearby-text { flex: 1; min-width: 0; }
.sp-nearby-name { display: block; font-size: 14px; font-weight: 700; line-height: 1.3; }
.sp-nearby-addr { display: block; font-size: 12px; color: var(--sp-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-nearby-dist { flex: none; font-size: 12px; font-weight: 700; color: var(--sp-petrol-text); }
.sp-more { align-self: flex-start; font-size: 13px; font-weight: 600; text-decoration: none; padding: 6px 0; }

/* ---------- Mitmachen ---------- */
.sp-cta { background: var(--sp-petrol); color: #FFFFFF; border-radius: 24px; padding: 22px 18px; display: flex; flex-direction: column; gap: 10px; }
.sp-cta p { margin: 0; }
.sp-cta-title { font-size: 17px; font-weight: 800; line-height: 1.3; }
.sp-cta-text { font-size: 13px; line-height: 1.45; color: #D6ECEE; }
.sp-btn-light { align-self: flex-start; margin-top: 6px; background: #FCF8F5; color: #095E69; font-size: 14px; font-weight: 700; padding: 0 20px; }
@media (prefers-color-scheme: dark) { .sp-cta { background: #0B5E68; } }

.sp-footer { padding: 10px 0 calc(env(safe-area-inset-bottom, 0px) + 34px); font-size: 12px; color: var(--sp-muted); text-align: center; }
.sp-footer p { margin: 0 0 8px; }
.sp-footer-links { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
.sp-footer a { color: var(--sp-muted); }

/* ---------- Nicht gefunden ---------- */
.sp-notfound { padding-top: 80px; text-align: center; align-items: center; }
.sp-notfound h1 { font-size: 22px; margin: 0; }
.sp-notfound p { color: var(--sp-muted); margin: 0; }

@media (min-width: 700px) {
  .sp-main { padding-top: 24px; }
  .sp-photo { height: 340px; }
  .sp-map { height: 260px; }
}
