:root {
  --bg: #faf7f2;
  --card: #ffffff;
  --ink: #24302a;
  --ink-soft: #5c6b62;
  --line: #e4ddd0;
  --accent: #1d4d3d;
  --accent-ink: #ffffff;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(30, 40, 35, 0.06);
}

* { box-sizing: border-box; }

/* Author styles like `.field { display: flex }` would otherwise override the
   browser's default [hidden] rule (author CSS beats UA CSS regardless of
   specificity) — this keeps elements with the hidden attribute truly hidden. */
[hidden] { display: none !important; }

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.site-header {
  padding: 2rem 1.25rem 1rem;
  text-align: center;
}

.nav-link {
  display: inline-block;
  margin-bottom: 0.75rem;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}
.nav-link:hover { text-decoration: underline; }

/* Theme switcher pill — shared across all three pages (Harta e Dashurisë /
   Harta e Lindjes / Harta e Udhëtimeve) so switching feels identical from
   any page. Wraps on narrow screens since the labels are the full page
   names rather than short tags. */
.theme-switcher {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem;
  background: rgba(29, 77, 61, 0.06);
  border-radius: 14px;
  padding: 0.25rem;
  margin-bottom: 0.9rem;
}
.switcher-tab {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink-soft);
}
.switcher-tab:hover { color: var(--ink); }
.switcher-tab.active {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 1px 4px rgba(30, 40, 35, 0.12);
}

.site-header h1 {
  margin: 0 0 0.4rem;
  font-size: 1.6rem;
}

.subtitle {
  margin: 0 auto;
  max-width: 32rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 0.5rem 1rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.step-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(29, 77, 61, 0.08);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  margin-bottom: 0.6rem;
}

.card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}

.hint {
  margin: 0 0 0.9rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.option-label {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 1.1rem 0 0.5rem;
}
.option-label:first-of-type { margin-top: 1.3rem; }

/* Autocomplete (shared pattern with the travel map page) */
.autocomplete { position: relative; }

#placeInput {
  width: 100%;
  font-size: 1rem;
  padding: 0.8rem 0.9rem;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
#placeInput:focus { outline: none; border-color: var(--accent); }

.suggestions {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0.3rem;
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  max-height: 260px;
  overflow-y: auto;
}
.suggestions[hidden] { display: none; }
.suggestions li {
  padding: 0.6rem 0.7rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.92rem;
  line-height: 1.3;
}
.suggestions li:hover, .suggestions li.active { background: rgba(29, 77, 61, 0.08); }
.suggestions .no-results, .suggestions .searching {
  color: var(--ink-soft);
  cursor: default;
}
.suggestions .no-results:hover, .suggestions .searching:hover { background: none; }

.place-status {
  margin: 0.6rem 0 0;
  font-size: 0.82rem;
}
.place-status.error { color: #b3261e; }
.place-status.selected { color: var(--accent); font-weight: 600; }

.caption-field { margin-top: 0.9rem; }
.caption-field label {
  font-size: 0.85rem;
  font-weight: 600;
  display: block;
  margin-bottom: 0.3rem;
}
.caption-field input {
  width: 100%;
  font-size: 0.95rem;
  padding: 0.7rem 0.85rem;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
.caption-field input:focus { outline: none; border-color: var(--accent); }

/* Poster live preview */
.poster-stage {
  display: flex;
  justify-content: center;
  padding: 0.5rem 0 0.25rem;
}

.poster-frame {
  --frame-color: #1c1c1c;
  width: 100%;
  max-width: 340px;
  aspect-ratio: 3 / 4;
  padding: 16px;
  background: var(--frame-color);
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(20, 20, 20, 0.18);
  transition: aspect-ratio 0.3s ease, background 0.3s ease;
}

.poster-frame.frame-black { --frame-color: #1c1c1c; }
.poster-frame.frame-white { --frame-color: #f7f5f1; box-shadow: 0 10px 30px rgba(20, 20, 20, 0.12), inset 0 0 0 1px #ddd6c8; }
.poster-frame.frame-brown { --frame-color: #6b4a2f; }

.poster-frame.size-15x15 { aspect-ratio: 1 / 1; }
.poster-frame.size-25x30 { aspect-ratio: 25 / 30; }
.poster-frame.size-30x40 { aspect-ratio: 30 / 40; }

.poster-mat {
  width: 100%;
  height: 100%;
  background: #fdfcfa;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.poster-map {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: #e7ece8;
}

.poster-map #mapEl {
  width: 100%;
  height: 100%;
}

.map-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -85%);
  pointer-events: none;
  z-index: 500;
}
.map-pin::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #d6402b;
  border: 2px solid #fff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 2px 4px rgba(0,0,0,0.35);
}

.poster-text {
  flex: 0 0 auto;
  padding: 5.5% 6% 6%;
  text-align: center;
}

.poster-headline {
  margin: 0 0 0.5em;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #1a1a1a;
  font-size: clamp(0.62rem, 3.6vw, 1rem);
  line-height: 1.25;
}

.poster-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35em;
  color: #3a3a3a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: clamp(0.46rem, 2.4vw, 0.7rem);
  font-weight: 600;
}

.poster-dot { opacity: 0.5; }

/* Leaflet default controls: keep, but shrink so they don't dominate a small poster preview */
.leaflet-control-attribution {
  font-size: 7px !important;
  padding: 0 3px !important;
  line-height: 1.4 !important;
}
.leaflet-container { background: #e7ece8; }

/* Swatches (frame color) */
.swatch-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.swatch-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.swatch-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.4rem;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
}

.swatch-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}
.swatch-dot-outline { box-shadow: 0 0 0 1px #d8d2c4, inset 0 0 0 1px rgba(0,0,0,0.05); }

.swatch-option input:checked + .swatch-card {
  border-color: var(--accent);
  background: rgba(29, 77, 61, 0.06);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.swatch-option input:focus-visible + .swatch-card {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Frame size (shares the travel-map page's visual pattern) */
.size-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}
@media (min-width: 480px) {
  .size-grid { grid-template-columns: repeat(3, 1fr); }
}
.size-option input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.size-card {
  display: block;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 0.8rem;
  cursor: pointer;
  text-align: center;
}
.size-card strong { display: block; font-size: 1rem; margin-bottom: 0.2rem; }
.size-card small { color: var(--ink-soft); font-size: 0.8rem; }
.size-card small.size-price {
  display: block;
  margin-top: 0.3rem;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
}
.size-option input:checked + .size-card {
  border-color: var(--accent);
  background: rgba(29, 77, 61, 0.06);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.size-option input:focus-visible + .size-card {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Form (shared pattern) */
.field { margin-bottom: 0.85rem; display: flex; flex-direction: column; gap: 0.3rem; }
.field label { font-size: 0.85rem; font-weight: 600; color: var(--ink); }
.field input, .field textarea {
  font-size: 1rem;
  padding: 0.75rem 0.85rem;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  width: 100%;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }

.field-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}
@media (min-width: 480px) {
  .field-row { grid-template-columns: 1fr 1fr; }
}
.field-row .field { margin-bottom: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.85rem 1.4rem;
  cursor: pointer;
  transition: transform 0.05s ease, opacity 0.15s ease;
  width: 100%;
}
.btn:active { transform: scale(0.99); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-large { padding: 1rem 1.4rem; font-size: 1.05rem; }

.form-message { min-height: 1.2rem; font-size: 0.9rem; margin: 0.9rem 0 0.7rem; }
.form-message.error { color: #b3261e; }
.form-message.success { color: var(--accent); font-weight: 600; }

/* Price summary */
.price-summary {
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 0.8rem 0.9rem;
  margin-top: 0.4rem;
  background: rgba(29, 77, 61, 0.04);
}
.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--ink);
  padding: 0.25rem 0;
}
.price-row.price-total {
  margin-top: 0.3rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
  font-weight: 700;
  font-size: 1rem;
}

.site-footer {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.85rem;
  padding: 1.5rem 1rem 3rem;
}
