/* ============================================================
   Glasgow Arts Blog — Main Stylesheet
   Mobile-first. Syne (headings) + DM Sans (body).
   Palette: charcoal, burnt orange, limited teal.
   ============================================================ */

/* ── Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Tokens ── */
:root {
  --charcoal:      #2C2D3A;
  --charcoal-mid:  #383947;
  --charcoal-light:#44455A;
  --orange:        #D4622A;
  --orange-light:  #E07848;
  --teal:          #4A8C8C;
  --teal-light:    #5AACAC;
  --white:         #F5F3EE;
  --muted:         #9A9BAA;
  --border:        rgba(255,255,255,0.08);
  --card-bg:       #32334080;

  --radius:        4px;
  --radius-lg:     8px;

  --space-xs:      0.5rem;
  --space-sm:      1rem;
  --space-md:      1.5rem;
  --space-lg:      2.5rem;
  --space-xl:      4rem;

  --container:     1200px;
  --container-sm:  720px;
}

/* ── Base ── */
html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background-color: var(--charcoal);
  color: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: var(--orange);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--orange-light);
}

/* ── Skip link ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--orange);
  color: var(--white);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  z-index: 1000;
}
.skip-link:focus { top: 1rem; }

/* ── Typography ── */
h1, h2, h3, h4 {
  font-family: 'Syne', sans-serif;
  line-height: 1.1;
  font-weight: 700;
}

h1 { font-size: clamp(2.5rem, 8vw, 5rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 3vw, 1.6rem); }
h4 { font-size: 1rem; font-weight: 600; }

p { margin-bottom: var(--space-sm); }
p:last-child { margin-bottom: 0; }

.eyebrow {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--orange);
  display: block;
  margin-bottom: var(--space-sm);
}

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

/* ── Layout ── */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(1rem, 5vw, 2rem);
}

.container--sm {
  max-width: var(--container-sm);
}

.section {
  padding: clamp(3rem, 8vw, 5rem) 0;
}

.section--flush-top { padding-top: 0; }

/* ── Site header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--charcoal);
  border-bottom: 1px solid var(--border);
  padding: 0 clamp(1rem, 5vw, 2rem);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
  gap: var(--space-md);
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  flex-shrink: 0;
}

.nav__brand-mark {
  width: 3px;
  height: 1.4rem;
  background: var(--teal);
  border-radius: 2px;
}

.nav__brand-text {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.01em;
}

.nav__brand-text span {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1;
}

/* Mobile nav toggle */
.nav__toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  margin-right: -0.5rem;
}

.nav__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: all 0.25s;
}

.nav__toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav__toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav__toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Nav links */
.nav__links {
  display: none;
  flex-direction: column;
  position: absolute;
  top: 3.5rem;
  left: 0;
  right: 0;
  background: var(--charcoal-mid);
  border-bottom: 1px solid var(--border);
  padding: var(--space-sm) clamp(1rem, 5vw, 2rem);
  gap: 0.25rem;
}

.nav__links.is-open {
  display: flex;
}

.nav__links a {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--muted);
  text-decoration: none;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  transition: color 0.2s;
}

.nav__links a:last-child { border-bottom: none; }

.nav__links a:hover,
.nav__links a[aria-current="page"] {
  color: var(--white);
}

.nav__links a[aria-current="page"] {
  color: var(--orange);
}

@media (min-width: 768px) {
  .nav__toggle { display: none; }

  .nav__links {
    display: flex;
    flex-direction: row;
    position: static;
    background: none;
    border: none;
    padding: 0;
    gap: clamp(1rem, 2.5vw, 2rem);
  }

  .nav__links a {
    font-size: 0.85rem;
    padding: 0;
    border: none;
  }
}

/* ── Hero ── */
.hero {
  padding: clamp(3rem, 10vw, 6rem) 0 clamp(2rem, 6vw, 4rem);
  border-bottom: 1px solid var(--border);
}

.hero__eyebrow {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: var(--space-md);
}

.hero__title {
  color: var(--white);
  margin-bottom: var(--space-md);
}

.hero__title span { color: var(--orange); }

.hero__strapline {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--muted);
  max-width: 560px;
  margin-bottom: 0;
}

/* ── Page header ── */
.page-header {
  padding: clamp(2rem, 6vw, 4rem) 0 clamp(1.5rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--border);
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

.page-header h1 {
  font-size: clamp(2rem, 6vw, 3.5rem);
  margin-bottom: var(--space-xs);
}

.page-header p {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 0;
}

/* ── Divider ── */
.divider {
  width: 2.5rem;
  height: 2px;
  background: var(--teal);
  margin: var(--space-lg) 0;
}

hr.rule {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-lg) 0;
}

/* ── Venue cards ── */
.venue-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
}

@media (min-width: 560px) {
  .venue-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .venue-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.venue-card {
  background: var(--charcoal-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  transition: border-color 0.2s, transform 0.2s;
  cursor: pointer;
}

.venue-card:hover {
  border-color: var(--orange);
  transform: translateY(-2px);
}

.venue-card.is-highlighted {
  border-color: var(--teal);
  box-shadow: 0 0 0 1px var(--teal);
}

.venue-card__type {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--teal);
}

.venue-card__name {
  font-family: 'Syne', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
}

.venue-card__address {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

.venue-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: auto;
  padding-top: var(--space-xs);
}

.venue-card__postcode {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--orange);
  text-decoration: none;
  margin-top: 0.15rem;
}

.venue-card__postcode .ti {
  font-size: 1rem;
  line-height: 1;
}

.venue-card__postcode:hover {
  color: var(--orange-light);
}

.venue-card__website {
  font-size: 0.75rem;
  color: var(--teal);
  text-decoration: none;
  margin-top: var(--space-xs);
  transition: color 0.2s;
}

.venue-card__website:hover {
  color: var(--teal-light);
}

.venues-city-heading {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  color: var(--white);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border);
}

/* Leaflet popup */
.leaflet-popup-content-wrapper {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: var(--radius);
  color: #222;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}

.leaflet-popup-tip {
  background: #ffffff;
}

.leaflet-popup-close-button {
  color: #666 !important;
}

.badge {
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2em 0.6em;
  border-radius: 2px;
}

.badge--open {
  background: rgba(74, 140, 140, 0.2);
  color: var(--teal-light);
}

.badge--closed {
  background: rgba(255,255,255,0.06);
  color: var(--muted);
}

.badge--show {
  background: rgba(212, 98, 42, 0.2);
  color: var(--orange-light);
}

/* ── Venue current shows (always visible — no layout jump on hover) ── */
.venue-card__shows {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}

.venue-card__show-title {
  font-size: 0.75rem;
  color: var(--orange-light);
  line-height: 1.3;
  font-style: italic;
}

.venue-card__show-title--empty {
  visibility: hidden; /* holds space without showing anything */
}

.venue-card__show-title + .venue-card__show-title {
  padding-top: 2px;
  border-top: 1px solid var(--border);
  margin-top: 2px;
}

/* ── Postcode group ── */
.postcode-group {
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

.postcode-group__heading {
  font-family: 'Syne', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border);
}

.postcode-group__code {
  font-weight: 400;
  letter-spacing: 0.15em;
  opacity: 0.55;
  margin-left: 0.6em;
}

/* ── Map city toggle ── */
.map-city-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.map-city-btn {
  font-family: 'Syne', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.45rem 1.2rem;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}

.map-city-btn:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.map-city-btn.is-active {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--charcoal);
}

/* ── Map ── */
.map-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

.map-wrap #venue-map {
  height: 320px;
  width: 100%;
  background: var(--charcoal-mid);
}

@media (min-width: 768px) {
  .map-wrap #venue-map {
    height: 480px;
  }
}

.map-toggle {
  width: 100%;
  background: var(--charcoal-mid);
  border: none;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.75rem;
  cursor: pointer;
  transition: color 0.2s;
  display: none;
}

.map-toggle:hover { color: var(--white); }

@media (max-width: 767px) {
  .map-toggle { display: block; }

  .map-wrap.is-collapsed #venue-map {
    display: none;
  }
}

/* ── Exhibitions table ── */
.exhibitions-section {
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.exhibitions-section h2 {
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  margin-bottom: var(--space-xs);
  color: var(--white);
}

.exhibitions-section .week-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: var(--space-md);
}

.exhibitions-section h3 {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border);
}

.exh-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin-bottom: var(--space-md);
  table-layout: fixed;
}

.exh-table th {
  display: none;
}

.exh-table td {
  display: block;
  padding: 0.35rem 0;
}

.exh-table td::before {
  content: attr(data-th) ": ";
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 0.25rem;
}

.exh-table td[data-th="Title"]::before,
.exh-table td[data-th="Artist(s)"]::before { display: none; }

.exh-table td[data-th="Title"] {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  padding-top: var(--space-sm);
}

.exh-table td[data-th="Artist(s)"] {
  color: var(--orange);
  font-size: 0.85rem;
  font-weight: 400;
}

.exh-table td[data-th="Tags"] { display: none; }

.exh-table tr {
  display: block;
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.exh-table tr:last-child { border-bottom: none; }

@media (min-width: 768px) {
  .exh-table th {
    display: table-cell;
    text-align: left;
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0.5rem 0.75rem 0.5rem 0;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
  }

  /* Fixed column widths — consistent across all tables */
  .exh-table th:nth-child(1),
  .exh-table td:nth-child(1) { width: 26%; }   /* Title */
  .exh-table th:nth-child(2),
  .exh-table td:nth-child(2) { width: 18%; }   /* Artist(s) */
  .exh-table th:nth-child(3),
  .exh-table td:nth-child(3) { width: 22%; }   /* Venue */
  .exh-table th:nth-child(4),
  .exh-table td:nth-child(4) { width: 16%; }   /* Dates */
  .exh-table th:nth-child(5),
  .exh-table td:nth-child(5) { width: 6%;  }   /* £ */
  .exh-table th:nth-child(6),
  .exh-table td:nth-child(6) { width: 12%; }   /* Link */

  .exh-table td {
    display: table-cell;
    padding: 0.75rem 0.75rem 0.75rem 0;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
  }

  .exh-table td::before { display: none; }

  .exh-table td[data-th="Title"] {
    font-size: 0.9rem;
    padding-top: 0.75rem;
  }

  .exh-table td[data-th="Tags"] { display: none; }

  .exh-table tr {
    display: table-row;
    border: none;
    padding: 0;
    margin: 0;
  }
}

.exh-info-btn {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--teal);
  border: 1px solid var(--teal);
  border-radius: var(--radius);
  padding: 0.2em 0.6em;
  white-space: nowrap;
  transition: all 0.2s;
}

.exh-info-btn:hover {
  background: var(--teal);
  color: var(--charcoal);
}

.exh-key {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: var(--space-md);
}

.postcode-group-row td {
  padding: 0.75rem 0 0.35rem;
  border-top: 1px solid var(--border);
  border-bottom: none;
}

.postcode-group-empty {
  border-top: 1px solid var(--border) !important;
}

.postcode-group-label {
  font-family: 'Syne', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
}

.postcode-group-code {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.7rem;
}

.closing-badge {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--orange);
}

.new-badge {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #15803d;
}

#edinburgh {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--teal);
  color: var(--teal);
}

.gi-badge {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--orange);
  background: rgba(212, 98, 42, 0.15);
  border-radius: 2px;
  padding: 0.15em 0.4em;
  margin-left: 0.4em;
  vertical-align: middle;
  white-space: nowrap;
}

.venue-directions {
  display: block;
  font-size: 0.75rem;
  color: var(--teal);
  margin-top: 0.2em;
  white-space: nowrap;
}

.venue-directions:hover { color: var(--teal-light); }

/* ── Subscribe box ── */
.subscribe-box {
  background: var(--charcoal-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  max-width: 540px;
}

.subscribe-box__title {
  font-family: 'Syne', sans-serif;
  font-size: 1.3rem;
  margin-bottom: var(--space-xs);
}

.subscribe-box__text {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: var(--space-md);
}

.subscribe-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 480px) {
  .subscribe-form { flex-direction: row; }
}

.subscribe-input {
  flex: 1;
  background: var(--charcoal);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  color: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 300;
  padding: 0.75rem 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.subscribe-input::placeholder { color: var(--muted); }
.subscribe-input:focus { border-color: var(--teal); }

.subscribe-btn {
  background: var(--orange);
  border: none;
  border-radius: var(--radius);
  color: var(--white);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.75rem 1.5rem;
  transition: background 0.2s;
  white-space: nowrap;
}

.subscribe-btn:hover { background: var(--orange-light); }

.subscribe-legal {
  font-size: 0.7rem;
  color: var(--muted);
  opacity: 0.7;
  margin-top: var(--space-xs);
}

.subscribe-success {
  font-size: 0.85rem;
  color: var(--teal);
  margin-top: var(--space-xs);
}

/* ── Site footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: clamp(2rem, 5vw, 3rem) 0;
  margin-top: auto;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

@media (min-width: 768px) {
  .footer__grid {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.footer__brand {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: var(--space-xs);
}

.footer__copy {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: var(--space-sm);
}

.footer__nav-heading {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-sm);
}

.footer__nav a {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
  padding: 0.25rem 0;
  transition: color 0.2s;
}

.footer__nav a:hover { color: var(--white); }

/* ── Loading / banners ── */
.loading {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  padding: var(--space-xl) 0;
}

.banner {
  display: none;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-bottom: var(--space-md);
}

.banner--info {
  background: rgba(74,140,140,0.1);
  color: var(--teal-light);
  border: 1px solid rgba(74,140,140,0.3);
}

.banner--error {
  background: rgba(212,98,42,0.1);
  color: var(--orange-light);
  border: 1px solid rgba(212,98,42,0.3);
}

/* ── Dev tools ── */
.dev { display: none; }
.dev pre {
  background: var(--charcoal-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-sm);
  font-size: 0.75rem;
  color: var(--muted);
  overflow-x: auto;
  margin-top: var(--space-sm);
}

/* ── Utility ── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.text-orange { color: var(--orange); }
.text-teal   { color: var(--teal); }
.text-muted  { color: var(--muted); }
