:root {
  --brand: #0e7c66;
  --brand-soft: #e3f1ed;
  --bg: #f5f8f7;
  --card: #ffffff;
  --text: #17211f;
  --muted: #5f6f6b;
  --border: #e3e9e7;
  --radius: 16px;
  --shadow: 0 1px 3px rgba(16, 40, 35, 0.06), 0 8px 24px rgba(16, 40, 35, 0.05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #5cc9ad;
    --brand-soft: #123028;
    --bg: #0e1513;
    --card: #172220;
    --text: #e8f0ee;
    --muted: #9fb0ac;
    --border: #253330;
    --shadow: none;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 16px 16px 32px;
  flex: 1;
}

/* Stany: ładowanie / błąd / brak strony */
.state {
  padding: 72px 16px;
  text-align: center;
  color: var(--muted);
}

.state h2 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 1.2rem;
}

.state p {
  margin: 0 auto;
  max-width: 46ch;
}

.spinner {
  width: 28px;
  height: 28px;
  margin: 0 auto;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Nagłówek obiektu */
.hero {
  padding: 18px 4px 20px;
}

.hero h1 {
  margin: 0 0 4px;
  font-size: 1.6rem;
  line-height: 1.25;
}

.hero .address {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.badge {
  display: inline-block;
  margin-top: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 600;
}

/* Karty-kategorie (akordeon) */
details.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

details.card > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

details.card > summary::-webkit-details-marker {
  display: none;
}

details.card > summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
  border-radius: var(--radius);
}

/* strzałka */
details.card > summary::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  margin-left: auto;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

details.card[open] > summary::after {
  transform: rotate(-135deg);
}

details.card > summary .icon {
  flex: none;
  font-size: 1.3rem;
  line-height: 1;
}

details.card > summary .labels {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

details.card > summary .title {
  font-size: 1.05rem;
  font-weight: 600;
}

details.card > summary .hint {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 400;
}

details.card[open] > summary .hint {
  display: none;
}

/* plakietka z liczbą zdjęć */
details.card > summary .count {
  flex: none;
  margin-left: auto;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 600;
}

details.card.has-count > summary::after {
  margin-left: 10px;
}

details.card > .content {
  padding: 0 16px 16px;
}

details.card > .content p {
  margin: 0 0 8px;
  white-space: pre-line;
}

/* Wi-Fi / dane */
.kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
}

.kv .k {
  color: var(--muted);
}

.kv .v {
  font-weight: 600;
  word-break: break-all;
  text-align: right;
}

/* Przyciski */
.btn {
  appearance: none;
  display: inline-block;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
}

.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* Zdjęcia — pełna szerokość strony (najpierw zdjęcia, potem treść) */
.photos {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.photos .photo {
  margin: 0;
}

/* Odstęp tekstu od zdjęć — selektor celowo bardziej specyficzny niż
   `details.card > .content p { margin: 0 }`, inaczej reguła jest nadpisywana! */
details.card > .content .photos + p {
  margin-top: 24px;
}

.photo-caption {
  margin-top: 6px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.photos img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  cursor: zoom-in;
}

/* Przełącznik języka */
.lang {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding-top: 8px;
}

.lang .btn {
  padding: 5px 12px;
  font-size: 0.82rem;
}

.lang .btn.active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
}

/* Stopka */
.footer {
  text-align: center;
  padding: 20px 16px 28px;
  color: var(--muted);
  font-size: 0.82rem;
}

.footer strong {
  color: var(--brand);
}

/* Podgląd pełnoekranowy zdjęcia */
body.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 72px 16px 100px;
  background: rgba(6, 12, 10, 0.93);
}

.lightbox-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
}

.lightbox-stage img {
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  will-change: transform;
}

.lightbox-caption {
  color: #ffffff;
  font-size: 0.9rem;
  text-align: center;
  max-width: min(100%, 60ch);
}

.lightbox-caption:empty {
  display: none;
}

.lightbox-thumbs {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  display: flex;
  gap: 8px;
  padding: 8px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.lightbox-thumbs::-webkit-scrollbar {
  display: none;
}

.lightbox-thumb {
  flex: none;
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  opacity: 0.55;
  cursor: pointer;
  border: 2px solid transparent;
}

.lightbox-thumb.active {
  opacity: 1;
  border-color: #ffffff;
}

.lightbox-counter {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.lightbox-nav.prev {
  left: 12px;
}

.lightbox-nav.next {
  right: 12px;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.28);
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.28);
}
