/* ==========================================================================
   MAESTEG — Circa-2017 Rail Franchise Pastiche Stylesheet
   Palette inspired by Arriva Trains Wales / Trenau Arriva Cymru (c. 2017)
   ========================================================================== */

:root {
  --atw-teal-darkest: #00343b;
  --atw-teal-dark:    #00525d;
  --atw-teal:         #007785;
  --atw-teal-mid:     #008d9c;
  --atw-aqua:         #4ec0cc;
  --atw-aqua-pale:    #dff3f5;
  --atw-aqua-tint:    #f1f9fa;
  --atw-cream:        #f5f0e1;
  --atw-amber:        #f5a623;
  --atw-amber-hover:  #e09112;
  --led-amber:        #ffaa1d;
  --led-amber-dim:    #4a3208;
  --status-green:     #2b8a3e;
  --bg-page:          #e8eff1;
  --bg-card:          #ffffff;
  --border-color:     #c9d8dc;
  --text-main:        #1e2d30;
  --text-muted:       #52676b;
  --radius-sm:        3px;
  --radius-md:        5px;
  --shadow-card:      0 2px 5px rgba(0, 52, 59, 0.09);
  --shadow-raised:    0 4px 12px rgba(0, 52, 59, 0.16);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Frutiger", "Helvetica Neue", Arial, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-page);
  line-height: 1.55;
}

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

a {
  color: var(--atw-teal);
  text-decoration: none;
}

a:hover {
  color: var(--atw-teal-dark);
  text-decoration: underline;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 18px;
}

/* ==========================================================================
   1. TOP UTILITY BAR & LANGUAGE SWITCHER (2017 TOC Style)
   ========================================================================== */
.utility-bar {
  background: var(--atw-teal-darkest);
  color: #cbe6ea;
  font-size: 0.8125rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.utility-bar__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 36px;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 4px;
  padding-bottom: 4px;
}

.utility-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #ffffff;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #4cd964;
  box-shadow: 0 0 6px #4cd964;
  display: inline-block;
}

.utility-links {
  display: flex;
  align-items: center;
  gap: 14px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.utility-links li + li::before {
  content: "|";
  margin-right: 14px;
  color: rgba(255, 255, 255, 0.25);
}

.utility-links a {
  color: #d6eef2;
  text-decoration: none;
}

.utility-links a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.lang-switcher {
  display: inline-flex;
  border: 1px solid rgba(78, 192, 204, 0.5);
  border-radius: 3px;
  overflow: hidden;
}

.lang-switcher a,
.lang-switcher span {
  padding: 2px 9px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none !important;
}

.lang-switcher .is-current {
  background: var(--atw-amber);
  color: #162022;
}

.lang-switcher a {
  background: rgba(255, 255, 255, 0.1);
  color: var(--atw-cream);
}

.lang-switcher a:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

/* ==========================================================================
   1B. LIVE EXHIBITION DAY SPECIAL NOTICE BANNER
   ========================================================================== */
.live-exhibition-banner {
  display: none;
  background: linear-gradient(90deg, #f7a800 0%, #ffbf3c 50%, #f7a800 100%);
  color: #132124;
  border-bottom: 3px solid var(--atw-teal-darkest);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.live-exhibition-banner.is-visible {
  display: block;
}

.live-exhibition-banner__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 18px;
  flex-wrap: wrap;
}

.live-exhibition-banner__content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.live-exhibition-badge {
  background: var(--atw-teal-darkest);
  color: var(--led-amber);
  font-weight: 700;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 2px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.live-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4cd964;
  box-shadow: 0 0 6px #4cd964;
  display: inline-block;
}

.live-exhibition-banner__text {
  font-size: 0.95rem;
  font-weight: 700;
}

.live-exhibition-banner__sub {
  font-weight: 600;
  font-size: 0.88rem;
  color: #1f353a;
}

/* ==========================================================================
   2. MAIN FRANCHISE HEADER & STATION TOTEM BRANDING
   ========================================================================== */
.site-header {
  background: linear-gradient(180deg, var(--atw-teal-mid) 0%, var(--atw-teal) 65%, var(--atw-teal-dark) 100%);
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
  position: relative;
}

.site-header__brand-row {
  padding: 18px 0;
  background-image: radial-gradient(circle at 85% 120%, rgba(78, 192, 204, 0.28) 0%, rgba(78, 192, 204, 0.28) 38%, transparent 38.5%);
}

.site-header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: #ffffff;
}

.brand-lockup:hover {
  text-decoration: none;
  color: #ffffff;
}

.station-totem {
  background: var(--atw-cream);
  border: 3px solid #c2bcab;
  border-radius: 6px;
  padding: 6px 18px 0 18px;
  box-shadow: inset 0 1px 0 #ffffff, 0 3px 6px rgba(0, 0, 0, 0.28);
  min-width: 210px;
  overflow: hidden;
}

.station-totem__name {
  display: block;
  font-family: "Frutiger", "Segoe UI", Arial, sans-serif;
  font-size: 1.85rem;
  font-weight: 700;
  color: #11181a;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-align: center;
  padding-bottom: 5px;
}

.station-totem__band {
  background: var(--atw-teal-dark);
  color: var(--atw-cream);
  margin: 0 -18px;
  padding: 3px 10px;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 600;
}

.brand-subtitle {
  display: flex;
  flex-direction: column;
}

.brand-subtitle__main {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #ffffff;
}

.brand-subtitle__welsh {
  font-size: 0.85rem;
  color: var(--atw-aqua-pale);
  font-style: italic;
}

.header-cta-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* 2017 Franchise glossy-bevel buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none !important;
  transition: background 0.15s ease, transform 0.1s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn--amber {
  background: linear-gradient(180deg, #ffba38 0%, var(--atw-amber) 100%);
  color: #1b2528;
  border-color: #c7800a;
}

.btn--amber:hover {
  background: linear-gradient(180deg, #ffc452 0%, var(--atw-amber-hover) 100%);
  color: #111;
}

.btn--teal {
  background: linear-gradient(180deg, var(--atw-teal-mid) 0%, var(--atw-teal-dark) 100%);
  color: #ffffff;
  border-color: var(--atw-teal-darkest);
}

.btn--teal:hover {
  background: linear-gradient(180deg, #009eb0 0%, var(--atw-teal) 100%);
  color: #ffffff;
}

.btn--outline-light {
  background: rgba(0, 52, 59, 0.35);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: none;
}

.btn--outline-light:hover {
  background: rgba(0, 52, 59, 0.6);
  color: #ffffff;
}

/* ==========================================================================
   3. PRIMARY NAVIGATION BAR (2017 Tabbed Franchise Bar)
   ========================================================================== */
.main-nav {
  background: var(--atw-teal-dark);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-bottom: 3px solid var(--atw-aqua);
}

.main-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
}

.main-nav__item {
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.main-nav__item:first-child {
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.main-nav__link {
  display: block;
  padding: 11px 18px;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  transition: background 0.15s ease;
}

.main-nav__link:hover,
.main-nav__link.is-active {
  background: var(--atw-teal-darkest);
  color: var(--atw-aqua);
  text-decoration: none;
}

/* Subpage Title Banner */
.page-banner {
  background: linear-gradient(90deg, var(--atw-teal-darkest) 0%, var(--atw-teal-dark) 100%);
  color: #ffffff;
  padding: 26px 0;
  border-bottom: 4px solid var(--atw-teal);
}

.page-banner h1 {
  margin: 0 0 6px 0;
  font-size: 1.9rem;
}

.page-banner p {
  margin: 0;
  color: #cde8ec;
  font-size: 0.98rem;
}

/* ==========================================================================
   4. HERO BANNER WITH "LIVE ROUTE / JOURNEY WIDGET" OVERLAY (2017 TOC Style)
   ========================================================================== */
.hero-section {
  position: relative;
  background-color: var(--atw-teal-darkest);
  border-bottom: 4px solid var(--atw-teal);
}

.hero-backdrop {
  position: relative;
  min-height: 450px;
  background-image: linear-gradient(90deg, rgba(0, 42, 48, 0.88) 0%, rgba(0, 52, 59, 0.62) 48%, rgba(0, 52, 59, 0.15) 100%),
                    url("../img/hero-station-day.jpg");
  background-size: cover;
  background-position: center 42%;
  display: flex;
  align-items: center;
  padding: 36px 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 28px;
  align-items: center;
}

.hero-copy {
  color: #ffffff;
}

.hero-kicker {
  display: inline-block;
  background: var(--atw-aqua);
  color: var(--atw-teal-darkest);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 2px;
  margin-bottom: 12px;
}

.hero-copy h1 {
  font-size: 2.35rem;
  line-height: 1.15;
  margin: 0 0 14px 0;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.hero-copy p {
  font-size: 1.05rem;
  color: #e2f3f5;
  margin: 0 0 20px 0;
  max-width: 58ch;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.hero-badge {
  background: rgba(0, 28, 33, 0.72);
  border: 1px solid rgba(78, 192, 204, 0.55);
  color: #ffffff;
  font-size: 0.82rem;
  padding: 4px 11px;
  border-radius: 3px;
  font-weight: 600;
}

/* 2017 TOC "Plan Your Journey / Key Layout Facts" Tabbed Widget Box */
.toc-widget {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-raised);
  overflow: hidden;
  border: 2px solid var(--atw-teal);
}

.toc-widget__tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--atw-teal-dark);
}

.toc-widget__tab {
  padding: 11px 14px;
  color: #cbe6ea;
  font-weight: 700;
  font-size: 0.88rem;
  text-align: center;
  border: none;
  background: transparent;
  cursor: pointer;
  border-bottom: 3px solid transparent;
}

.toc-widget__tab.is-active {
  background: var(--bg-card);
  color: var(--atw-teal-darkest);
  border-bottom-color: var(--atw-amber);
}

.toc-widget__body {
  padding: 18px 20px;
}

.toc-widget__panel {
  display: none;
}

.toc-widget__panel.is-active {
  display: block;
}

.fact-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-bottom: 14px;
}

.fact-table tr + tr {
  border-top: 1px solid #e3ecee;
}

.fact-table th {
  text-align: left;
  padding: 6px 8px 6px 0;
  color: var(--text-muted);
  font-weight: 600;
  width: 42%;
}

.fact-table td {
  padding: 6px 0;
  font-weight: 600;
  color: var(--text-main);
}

.widget-notice {
  background: var(--atw-aqua-tint);
  border-left: 4px solid var(--atw-teal);
  padding: 8px 12px;
  font-size: 0.82rem;
  color: var(--text-main);
  margin-bottom: 14px;
}

/* ==========================================================================
   5. ROUTE MAP STRIP (Echoing the Exhibition Cloth Diagram)
   ========================================================================== */
.route-strip {
  background: #14181c;
  color: #ffffff;
  border-bottom: 3px solid var(--atw-aqua);
  padding: 14px 0;
}

.route-strip__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.route-strip__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  color: #ffffff;
  white-space: nowrap;
}

.route-strip__icon {
  display: inline-flex;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  align-items: center;
  justify-content: center;
  font-style: italic;
  font-family: Georgia, serif;
  font-size: 0.85rem;
}

.route-stops {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.82rem;
}

.route-stops li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #d6eef2;
}

.route-stops li::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid #9ad7e0;
  background: #14181c;
  display: inline-block;
}

.route-stops li.is-origin {
  font-weight: 700;
  color: #ffffff;
}

.route-stops li.is-origin::before {
  background: var(--atw-amber);
  border-color: #ffffff;
}

.route-stops li + li {
  padding-left: 10px;
  position: relative;
}

.route-stops li + li::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 8px;
  height: 3px;
  background: #89c4ce;
  transform: translateY(-50%);
}

/* ==========================================================================
   6. SECTION SHELLS & 2017 PORTAL CARDS
   ========================================================================== */
.section {
  padding: 44px 0;
}

.section--alt {
  background: #dce7ea;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--atw-teal);
}

.section-header h2 {
  margin: 0;
  font-size: 1.6rem;
  color: var(--atw-teal-darkest);
}

.section-header__sub {
  margin: 4px 0 0 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.portal-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.portal-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-top: 4px solid var(--atw-teal);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card__img-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #102024;
}

.card__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.card:hover .card__img-wrap img {
  transform: scale(1.03);
}

.card__tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--atw-teal-darkest);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
  letter-spacing: 0.04em;
}

.card__body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card__title {
  margin: 0 0 8px 0;
  font-size: 1.18rem;
  color: var(--atw-teal-darkest);
}

.card__text {
  margin: 0 0 16px 0;
  font-size: 0.92rem;
  color: var(--text-muted);
  flex-grow: 1;
}

/* ==========================================================================
   7. DEPARTURE BOARD (refactored from TAS PIDSmall.py) & 2017 TIMETABLE
   Theme: PIDSmall PANEL_COLOR (30,20,0) with TEXT_COLOR (255,200,50);
   top row 36px, mid rows 24px, clock 48px with 24px seconds.
   ========================================================================== */
.pid-housing {
  background: #000000;
  border: 6px solid #1c1c1c;
  border-radius: 8px;
  padding: 16px 18px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.85), 0 4px 12px rgba(0, 0, 0, 0.25);
  color: #ffc832;
}

.pid-housing__top-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9aa7b0;
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid #343b42;
}

.pid-screen {
  background: #1e1400;
  border: 2px solid #000000;
  padding: 10px;
  border-radius: 3px;
  color: #ffc832;
  font-family: "SansSerif", "Segoe UI", Arial, sans-serif;
  font-weight: 700;
}

/* PIDSmall topPanel: destination left, time right */
.pid-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  background: #1e1400;
  padding: 5px 10px;
  min-height: 50px;
}

.pid-dest {
  font-size: 36px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pid-time {
  font-size: 36px;
  line-height: 1.1;
  white-space: nowrap;
}

/* PIDSmall secondPanel: "Calling at:" + scrolling marquee */
.pid-calling-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1e1400;
  padding: 5px 10px;
  min-height: 40px;
}

.pid-calling-static {
  font-size: 24px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.pid-marquee-viewport {
  position: relative;
  overflow: hidden;
  flex: 1 1 auto;
  height: 34px;
}

.pid-marquee-text {
  position: absolute;
  top: 0;
  left: 0;
  font-size: 24px;
  white-space: nowrap;
  will-change: transform;
}

/* PIDSmall thirdPanel: alternating 2nd/3rd rows, one visible at a time */
.pid-alt-viewport {
  position: relative;
  overflow: hidden;
  height: 40px;
  background: #1e1400;
}

.pid-alt-strip {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

.pid-alt-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  height: 40px;
  padding: 0 10px;
  font-size: 24px;
  background: #1e1400;
}

.pid-alt-row .pid-time {
  font-size: 24px;
}

/* PIDSmall clockPanel: centred HH:MM with smaller :SS */
.pid-clock-panel {
  display: flex;
  justify-content: center;
  align-items: baseline;
  background: #1e1400;
  padding: 5px 0;
}

#pid-clock-hm {
  font-size: 48px;
  line-height: 1.1;
}

#pid-clock-ss {
  font-size: 24px;
  line-height: 1.1;
}

.pid-note {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 12px;
}

/* Stacked timetable below the board; table fits without scrolling */
.tt-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.tt-table-wrap--fit {
  overflow-x: visible;
}

.tt-dest {
  font-weight: 600;
}

@media (max-width: 700px) {
  .pid-dest,
  .pid-time {
    font-size: 26px;
  }

  .pid-calling-static,
  .pid-marquee-text,
  .pid-alt-row,
  .pid-alt-row .pid-time {
    font-size: 18px;
  }

  #pid-clock-hm {
    font-size: 36px;
  }

  #pid-clock-ss {
    font-size: 18px;
  }

  .tt-table th,
  .tt-table td {
    padding: 6px 6px;
    font-size: 0.78rem;
  }
}

/* 2017 Franchise Online Timetable Table */
.tt-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-top: 4px solid var(--atw-teal-dark);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
}

.tt-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--atw-aqua-tint);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  margin-bottom: 14px;
  border-radius: 3px;
}

.tt-table-wrap {
  overflow-x: auto;
}

.tt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.tt-table th,
.tt-table td {
  border: 1px solid #cddadd;
  padding: 8px 11px;
  text-align: center;
}

.tt-table thead th {
  background: var(--atw-teal-dark);
  color: #ffffff;
  font-weight: 700;
}

.tt-table tbody th {
  text-align: left;
  background: #f3f8f9;
  color: var(--atw-teal-darkest);
  font-weight: 700;
  white-space: nowrap;
}

.tt-table tbody tr:nth-child(even) td {
  background: #fafcfd;
}

.tt-placeholder-note {
  margin-top: 12px;
  padding: 10px 14px;
  background: #fff8e6;
  border: 1px dashed #d99b26;
  color: #5c4108;
  font-size: 0.83rem;
  border-radius: 3px;
}

/* Exhibition Status Pills */
.ex-badge {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ex-badge--present {
  background: #2b8a3e;
  color: #ffffff;
}

.ex-badge--future {
  background: var(--atw-aqua-pale);
  color: var(--atw-teal-darkest);
  border: 1px solid var(--atw-teal);
}

.ex-badge--past {
  background: #e2e8ea;
  color: #52676b;
}

/* ==========================================================================
   8. TIMETABLE AUTOMATION SYSTEM (TAS) SHOWCASE & SCREENSHOT SLOTS
   ========================================================================== */
.tas-banner {
  background: linear-gradient(135deg, var(--atw-teal-darkest) 0%, var(--atw-teal-dark) 100%);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-raised);
  border: 1px solid var(--atw-aqua);
  margin-bottom: 26px;
}

.tas-banner__grid {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 24px;
  align-items: center;
}

.tas-banner h3 {
  margin: 0 0 10px 0;
  font-size: 1.5rem;
  color: #ffffff;
}

.tas-banner p {
  color: #d8eff2;
  margin: 0 0 16px 0;
}

.tas-feature-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.tas-pill {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(78, 192, 204, 0.5);
  color: var(--atw-cream);
  padding: 4px 10px;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: 600;
}

.screenshot-slot-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.tas-shot-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-top: 4px solid var(--atw-teal);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.tas-shot-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-raised);
}

.tas-shot-card__img-wrap {
  background: #0d1518;
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--border-color);
  padding: 8px;
}

.tas-shot-card__img-wrap img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.tas-shot-card__body {
  padding: 14px 16px;
}

.tas-shot-card__title {
  margin: 0 0 4px 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--atw-teal-darkest);
}

.tas-shot-card__desc {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.screenshot-slot__badge {
  display: inline-block;
  background: var(--atw-aqua-pale);
  color: var(--atw-teal-darkest);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 2px;
  text-transform: uppercase;
}

/* ==========================================================================
   9. FILTERABLE PHOTO GALLERY & LIGHTBOX
   ========================================================================== */
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.filter-btn {
  padding: 7px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--atw-teal-darkest);
  font-weight: 600;
  font-size: 0.86rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-btn:hover,
.filter-btn.is-active {
  background: var(--atw-teal);
  color: #ffffff;
  border-color: var(--atw-teal-dark);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.gallery-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.gallery-item.is-hidden {
  display: none;
}

.gallery-item__thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #111;
  position: relative;
}

.gallery-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.gallery-item:hover .gallery-item__thumb img {
  transform: scale(1.04);
}

.gallery-item__caption {
  padding: 11px 14px;
}

.gallery-item__title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--atw-teal-darkest);
  margin: 0 0 3px 0;
}

.gallery-item__meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

/* Lightbox Modal */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 22, 26, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

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

.lightbox__dialog {
  max-width: 1040px;
  width: 100%;
  background: #0f1b1e;
  border: 2px solid var(--atw-aqua);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.65);
}

.lightbox__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: var(--atw-teal-darkest);
  color: #ffffff;
}

.lightbox__close {
  background: var(--atw-amber);
  color: #111;
  border: none;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 2px;
  cursor: pointer;
}

.lightbox__img-box {
  max-height: 75vh;
  display: flex;
  justify-content: center;
  background: #070d0f;
}

.lightbox__img-box img {
  max-height: 75vh;
  width: auto;
  object-fit: contain;
}

.lightbox__caption {
  padding: 12px 16px;
  color: #d8eff2;
  font-size: 0.9rem;
}

/* ==========================================================================
   10. EXHIBITION MANAGERS SPEC TABLE & FOOTER
   ========================================================================== */
.spec-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
}

.spec-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-top: 4px solid var(--atw-teal);
  border-radius: var(--radius-sm);
  padding: 22px;
  box-shadow: var(--shadow-card);
}

.spec-list {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.spec-list tr + tr {
  border-top: 1px solid #e1ecee;
}

.spec-list th {
  text-align: left;
  padding: 9px 12px 9px 0;
  color: var(--atw-teal-darkest);
  width: 38%;
}

.spec-list td {
  padding: 9px 0;
  color: var(--text-main);
}

.site-footer {
  background: var(--atw-teal-darkest);
  color: #c2dfe4;
  border-top: 5px solid var(--atw-aqua);
  padding: 40px 0 24px 0;
  font-size: 0.88rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

.footer-col h4 {
  color: #ffffff;
  margin: 0 0 12px 0;
  font-size: 0.96rem;
  border-bottom: 1px solid rgba(78, 192, 204, 0.35);
  padding-bottom: 6px;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col li + li {
  margin-top: 6px;
}

.footer-col a {
  color: #c2dfe4;
}

.footer-col a:hover {
  color: #ffffff;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.8rem;
  color: #8ab4bc;
}

/* ==========================================================================
   11B. TIMETABLE DAY TABS
   ========================================================================== */
.tt-day-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tt-source-note {
  margin-top: 12px;
  padding: 10px 14px;
  background: #f1f9fa;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--atw-teal);
  color: var(--text-main);
  font-size: 0.83rem;
  border-radius: 3px;
}

.tt-table thead th small {
  font-weight: 400;
  font-size: 0.72rem;
  color: #d6eef2;
}

#tt-count-line {
  font-weight: 600;
}

/* ==========================================================================
   11. RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 960px) {
  .hero-grid,
  .portal-grid-3,
  .portal-grid-2,
  .tas-banner__grid,
  .spec-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .screenshot-slot-grid,
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .screenshot-slot-grid,
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    font-size: 1.75rem;
  }
}
