/* ============================================================
   CumbriaGuru — town.css
   Elevated place-card grid: editorial/organic aesthetic
   ============================================================ */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --ink:       #1a1a18;
  --ink-soft:  #4a4a44;
  --ink-quiet: #888880;
  --cream:     #f7f4ef;
  --cream-mid: #ede9e1;
  --gold:      #9a6b3a;
  --gold-light:#b8874a;
  --forest:    #2a4035;
  --forest-mid:#3b5a4e;
  --white:     #ffffff;
  --badge-trending: #c94a2a;
  --badge-worthit:  #2a6b40;
  --badge-featured: #9a6b3a;
  --radius-card: 16px;
  --shadow-card: 0 2px 8px rgba(26,26,24,0.06), 0 8px 24px rgba(26,26,24,0.08);
  --shadow-card-hover: 0 8px 20px rgba(26,26,24,0.1), 0 20px 48px rgba(26,26,24,0.12);
  --transition: 0.28s cubic-bezier(0.22, 0.68, 0, 1.2);
}

/* ── Page chrome ─────────────────────────────────────────── */
body.page-town {
  background: var(--cream);
}

/* ── Town hero ───────────────────────────────────────────── */
.town-hero {
  position: relative;
  height: clamp(260px, 36vw, 440px);
  overflow: hidden;
  background: var(--forest);
}

.town-hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  display: block;
}

.town-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(26, 40, 32, 0.18) 0%,
    rgba(26, 40, 32, 0.55) 60%,
    rgba(26, 40, 32, 0.80) 100%
  );
}

.town-hero__content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1.25rem, 5vw, 3rem);
}

.town-hero__label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
  margin: 0 0 0.4rem;
}

.town-hero__title {
  font-family: 'Lora', Georgia, serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.5rem;
  line-height: 1.05;
}

.town-hero__count {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
  margin: 0;
}

/* ── Town description ────────────────────────────────────── */
.town-desc-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem clamp(1.25rem, 5vw, 3rem) 0;
}

.town-desc {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--ink-soft);
}

/* ── Filter tabs ─────────────────────────────────────────── */
.town-filter-wrap {
  padding: 1.75rem clamp(1.25rem, 5vw, 3rem) 0;
  max-width: 1280px;
  margin: 0 auto;
}

.town-filter {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1.5px solid var(--cream-mid);
  background: var(--white);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.filter-pill:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.filter-pill--active {
  background: var(--forest);
  border-color: var(--forest);
  color: #fff;
}

.filter-pill--active:hover {
  background: var(--forest-mid);
  border-color: var(--forest-mid);
  color: #fff;
}

/* ── Town body / grid container ─────────────────────────── */
.town-body {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem clamp(1.25rem, 5vw, 3rem) 4rem;
}

.town-empty {
  color: var(--ink-quiet);
  font-size: 1rem;
  padding: 3rem 0;
}

/* ══════════════════════════════════════════════════════════
   PLACE CARD — the core component
   ══════════════════════════════════════════════════════════ */

.places-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

/* Card wrapper */
.place-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: var(--radius-card);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-card);
  transition:
    transform var(--transition),
    box-shadow var(--transition);
  will-change: transform;
}

.place-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
}

/* Image area */
.place-card__img-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--cream-mid);
  flex-shrink: 0;
}

.place-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.55s cubic-bezier(0.22, 0.68, 0, 1);
}

.place-card:hover .place-card__img {
  transform: scale(1.04);
}

/* Placeholder — organic gradient, no flat green */
.place-card__img--placeholder {
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 30% 40%, rgba(59, 90, 78, 0.6), transparent 60%),
    radial-gradient(ellipse at 75% 70%, rgba(154, 107, 58, 0.35), transparent 55%),
    linear-gradient(145deg, #2a4035 0%, #3b5a4e 45%, #506a5a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.place-card__img--placeholder::after {
  content: '';
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  border: 1.5px solid rgba(255,255,255,0.2);
  /* mountain icon via clip-path */
}

/* Gradient overlay on image bottom */
.place-card__img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 45%,
    rgba(26, 26, 24, 0.18) 100%
  );
  pointer-events: none;
}

/* Badges */
.place-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

.place-card__badge--trending {
  background: rgba(201, 74, 42, 0.92);
  color: #fff;
}

.place-card__badge--worthit {
  background: rgba(42, 107, 64, 0.92);
  color: #fff;
}

.place-card__badge--featured {
  background: rgba(154, 107, 58, 0.92);
  color: #fff;
}

/* Card body */
.place-card__body {
  padding: 1.1rem 1.25rem 1.3rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.25rem;
}

/* Category label */
.place-card__cat {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

/* Title */
.place-card__title {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  margin-top: 0.1rem;
}

/* Verdict snippet */
.place-card__verdict {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0.3rem 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Footer row — rating + town */
.place-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid var(--cream-mid);
}

.place-card__rating {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.place-card__stars {
  display: flex;
  gap: 1px;
}

.place-card__stars svg {
  width: 12px;
  height: 12px;
}

.place-card__rating-num {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
}

.place-card__rating-count {
  font-size: 0.78rem;
  color: var(--ink-quiet);
}

.place-card__town {
  font-size: 0.78rem;
  color: var(--ink-quiet);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.place-card__town svg {
  flex-shrink: 0;
  opacity: 0.6;
}

/* ── Nearby towns section ────────────────────────────────── */
.nearby-section {
  background: var(--forest);
  padding: 3rem clamp(1.25rem, 5vw, 3rem);
}

.nearby-inner {
  max-width: 1280px;
  margin: 0 auto;
}

.nearby-header {
  margin-bottom: 1.5rem;
}

.nearby-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  display: block;
  margin-bottom: 0.3rem;
}

.nearby-title {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.nearby-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.nearby-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  border: 1.5px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.85);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.18s ease;
}

.nearby-pill:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.4);
  color: #fff;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .places-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.875rem;
  }

  .place-card__body {
    padding: 0.9rem 1rem 1.1rem;
  }

  .place-card__title {
    font-size: 0.95rem;
  }

  .place-card__verdict {
    display: none; /* hide on small screens for density */
  }

  .place-card__footer {
    padding-top: 0.65rem;
  }
}

@media (max-width: 380px) {
  .places-grid {
    grid-template-columns: 1fr;
  }
}
