/* ============================================================
   Town page — /towns/:slug ("Albergues in Sarria")
   Everything is scoped under .town-page: `:app` bundles this file
   onto every default-layout page.
   ============================================================ */

.town-page {
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  padding: calc(var(--space-5) + var(--safe-top)) max(var(--space-4), var(--safe-right))
    calc(var(--space-12) + var(--safe-bottom)) max(var(--space-4), var(--safe-left));
}
.town-page > * {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}
.town-page a {
  color: var(--terra);
}
.town-page a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* --- Head --- */
.town-page .tp-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13.5px;
  color: var(--ink-soft);
}
.town-page .tp-crumbs a {
  color: var(--ink-soft);
}
.town-page .tp-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(34px, 9vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 10px 0;
  text-wrap: balance;
}
.town-page .tp-lead {
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 60ch;
  margin: 0;
}

/* --- Figures --- */
.town-page .tp-glance {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1px;
  margin-top: var(--space-5);
  margin-bottom: 0;
  background: var(--ink-line);
  border: 1px solid var(--ink-line);
  border-radius: 10px;
  overflow: hidden;
}
@media (max-width: 520px) {
  .town-page .tp-glance {
    grid-template-columns: 1fr 1fr;
  }
  /* an odd one out takes the whole last row instead of leaving a hole */
  .town-page .tp-glance div:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}
.town-page .tp-glance div {
  background: var(--paper-card);
  padding: 12px 8px;
  text-align: center;
}
.town-page .tp-glance dd {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(20px, 5.6vw, 28px);
  color: var(--amber-deep);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.town-page .tp-glance dt {
  font-size: 12px;
  color: var(--ink-soft);
}

/* --- Still map --- */
.town-page .tp-map {
  position: relative;
  display: block;
  margin-top: var(--space-4);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-sunken);
}
.town-page .tp-map__canvas {
  height: 200px;
  pointer-events: none;
  z-index: 0;
}
.town-page .tp-map__open {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 8px;
  background: var(--paper-card);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-warm);
}
.town-page .tp-pin {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--terra);
  border: 3px solid #ffffff;
  box-shadow: 0 1px 4px rgba(28, 25, 23, 0.4);
}
.town-page .tp-credit {
  margin-top: 4px;
  margin-bottom: 0;
  font-size: 11px;
  text-align: right;
}
.town-page .tp-credit a {
  color: var(--ink-soft);
  text-decoration: none;
}

/* --- Sections --- */
.town-page .tp-section {
  margin-top: var(--space-5);
  padding: var(--space-5) var(--space-4);
  background: var(--paper-card);
  border: 1px solid var(--ink-line);
  border-radius: 10px;
}
.town-page .tp-section h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 24px;
  line-height: 1.15;
  margin: 0 0 4px;
  text-wrap: balance;
}
.town-page .tp-sub {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 12px;
}

/* --- The list of beds --- */
.town-page .tp-beds {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  border-top: 1px solid var(--ink-line);
}
.town-page .tp-beds li {
  border-bottom: 1px solid var(--ink-line);
}
.town-page .tp-bed {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  padding: 13px 4px;
  color: inherit;
  text-decoration: none;
}
.town-page .tp-bed:has(.tp-bed__photo) {
  grid-template-columns: 56px 1fr auto;
}
.town-page .tp-bed__photo {
  grid-row: 1 / span 2;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-sunken);
}
.town-page .tp-bed__name {
  font-weight: 700;
  font-size: 16.5px;
}
.town-page .tp-bed__price {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  color: var(--amber-deep);
  text-align: right;
  white-space: nowrap;
}
.town-page .tp-bed__price--word {
  font-size: 15px;
}
.town-page .tp-bed__meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  font-size: 14px;
  color: var(--ink-soft);
}
.town-page .tp-bed:has(.tp-bed__photo) .tp-bed__meta {
  grid-column: 2 / -1;
}
/* Marks: the two things worth spotting in a list at a glance */
.town-page .tp-bed__marks {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 3px 0 4px;
}
.town-page .tp-bed:has(.tp-bed__photo) .tp-bed__marks {
  grid-column: 2 / -1;
}
.town-page .tp-mark {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px 3px 7px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}
.town-page .tp-mark img,
.town-page .tp-mark svg {
  flex-shrink: 0;
  max-width: none;
}
.town-page .tp-mark--book {
  background: var(--paper-warm);
  color: var(--amber-deep);
}
.town-page .tp-mark--leaf {
  background: var(--ls-leaf-tint);
  color: var(--ls-pine);
}
.town-page .tp-marks-key > span {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}
.town-page .tp-marks-key {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 4px;
  font-size: 14px;
  color: var(--ink-soft);
}
.town-page .tp-chip {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-sunken);
  color: var(--ink-soft);
}
.town-page .tp-chip--sage {
  background: var(--sage-bg);
  color: var(--sage-deep);
}
.town-page .tp-chip--closed {
  background: var(--red-100);
  color: var(--red-700);
}
.town-page .tp-cta {
  display: inline-block;
  margin-top: var(--space-4);
  padding: 12px 18px;
  border-radius: 8px;
  background: var(--brand-amber-600);
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
}

/* --- In town --- */
.town-page .tp-services {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.town-page .tp-services li {
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--surface-sunken);
}
.town-page .tp-water {
  margin: 14px 0 0;
  font-size: 15px;
}

/* --- Along the way --- */
.town-page .tp-way {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.town-page .tp-way__card {
  display: block;
  padding: 14px;
  border: 1px solid var(--ink-line);
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
}
.town-page .tp-way__card--next {
  text-align: right;
  grid-column: 2;
}
.town-page .tp-way__card small {
  display: block;
  font-size: 12.5px;
  color: var(--ink-soft);
}
.town-page .tp-way__card b {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.town-page .tp-also {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
}

@media (hover: hover) {
  .town-page .tp-bed:hover,
  .town-page .tp-way__card:hover {
    background: var(--surface-hover);
  }
}

/* --- Route pages reuse the town page; the few things that differ --- */
.town-page .tp-lead--more {
  margin-top: var(--space-3);
  font-size: 15.5px;
}
.town-page .tp-bed__price--km {
  font-size: 16px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.town-page .tp-also--in-list {
  margin: -4px 4px 12px;
}
