/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Arvo:wght@400;700&family=Montserrat:wght@400;500;600;700&display=swap');

:root{
  /* Updated color palette using your specified scheme */
  --grey: #77787B;
  --slate-blue: #406D76;
  --medium-green: #6F9B74;
  --light-green: #ABC178;
  
  /* Core colors mapped to new palette */
  --bg:#ffffff;
  --fg:#406D76; /* Darker than grey for better contrast */
  --muted: var(--grey);
  --line: #e0e1e2; /* Light grey for borders */
  --accent: var(--slate-blue); /* Primary action color */
  --accent-600: #305258; /* Darker slate blue for hover */
  --accent-100: #e8f0f2; /* Very light slate blue */
  --secondary: var(--medium-green); /* Secondary actions */
  --secondary-light: var(--light-green); /* Light accent */
  --radius:10px;
  --radius-lg:10px;
  --pad:18px;
  --shadow:0 10px 30px rgba(64,109,118,.08);
}

*{box-sizing:border-box}
html,body{
  margin:0;height:100%;
  background:var(--bg);color:var(--fg);
  font-family: 'Montserrat', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, Apple Color Emoji, Segoe UI Emoji;
  -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
}
a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}

/* Global mobile-optimized styling (applies to all screen sizes) */
.container {
  max-width: 100%;
  padding: 0 16px;
}

@media (min-width: 640px) {
  .container {
    max-width: 100%;
    padding: 0 16px;
  }
}

/* Header — simple app bar */
header{
  position:sticky;top:0;background:#fff;
  border-bottom:1px solid var(--line);
  z-index:10;
  box-shadow:0 1px 0 rgba(64,109,118,.05);
}


.hdr{display:flex;gap:12px;align-items:center;padding:12px 16px;min-height:48px;}
.hdr .btn{padding:10px 16px;font-size:14px}
.hdrtitle{
  font-family: 'Arvo', serif;
  font-weight:700;
  font-size: 20px;
}
/* Base cards */
.card{
  border:1px solid var(--line);
  border-radius:12px;
  padding:16px;
  background:#fff;
  box-shadow:var(--shadow);
}

/* Typography */
.headline{font-size:24px;font-family: 'Arvo', serif; line-height:1.2;font-weight:800;margin:6px 0 6px;color:var(--fg)}
.muted{color:var(--muted);}
.chip{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.04em;
  background: var(--accent-100);
  color: var(--accent-600);
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
  display: inline-block;
}

.grid{display:grid;gap:16px}
.list{display:grid;gap:12px;padding:0;margin:0}
.list li{list-style:none;padding:0;margin:0}
.row{display:flex;gap:12px;align-items:center}

/* Thumbnail/list items */
.thumb{
  width:60px;height:60px;border-radius:8px;background:var(--secondary-light);
  display:grid;place-items:center;overflow:hidden;border:1px solid var(--line);
}
.thumb img{width:100%;height:100%;object-fit:cover}
.placeholder{width:100%;height:100%;display:grid;place-items:center;color:var(--secondary)}

/* List items styling - clean cards without button brackets */
.list-item {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(64, 109, 118, 0.04);
  transition: all 0.2s ease;
  cursor: pointer;
  margin: 0;
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-decoration: none;
  color: inherit;
}

.list-item:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(64, 109, 118, 0.15);
  transform: translateY(-1px);
}

.list-item:active {
  transform: translateY(0);
}

.list-item .row {
  display: flex;
  gap: 16px;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 0;
}

.list-item .row > div:last-child {
  margin-left: auto;
  color: var(--muted);
  font-size: 18px;
}

/* Hero image goes edge-to-edge like the screenshots */
.hero{
  aspect-ratio:16/9;
  border-radius:8px;
  overflow:hidden;
  background:var(--secondary-light);
  width:100%;
  border:1px solid var(--line);
}

/* Carousel styles */
.carousel-container {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: 8px;
  overflow: hidden;
  background: var(--secondary-light);
  width: 100%;
  border: 1px solid var(--line);
}

.carousel {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.carousel-slide.active {
  opacity: 1;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.carousel-controls {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 16px;
  pointer-events: none;
}

.carousel-btn {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  pointer-events: auto;
  box-shadow: 0 2px 8px rgba(64, 109, 118, 0.15);
  color: var(--accent);
}

.carousel-btn:hover {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.1);
  border-color: var(--accent);
}

.carousel-btn:active {
  transform: scale(0.95);
}

.carousel-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.carousel-btn svg {
  width: 20px;
  height: 20px;
}

.carousel-indicators {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: block;
  text-align: center;
  pointer-events: auto;
  white-space: nowrap;
}

.carousel-indicator {
  display: inline-block !important;
  width: 8px !important;
  height: 8px !important;
  border-radius: 50% !important;
  border: none !important;
  background: rgba(255, 255, 255, 0.6) !important;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 0 4px !important;
  vertical-align: middle;
  box-sizing: border-box !important;
  padding: 0 !important;
  min-width: 8px !important;
  min-height: 8px !important;
  max-width: 8px !important;
  max-height: 8px !important;
  flex: none !important;
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
  flex-basis: auto !important;
}

.carousel-indicator:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: scale(1.2);
}

.carousel-indicator.active {
  background: var(--accent);
  transform: scale(1.2);
}

/* Buttons — large, rounded, app-like */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:.6rem;
  padding:14px 18px;
  border-radius:10px;
  background:var(--accent);
  color:#ffffff;
  border:1px solid var(--accent);
  font-weight:700;
  transition:transform .02s ease, background .2s ease, border-color .2s ease;
  box-shadow:0 6px 14px rgba(64,109,118,.24);
  min-height:48px;
  font-size:15px;
}
.btn:hover{background:var(--accent-600);border-color:var(--accent-600)}
.btn:active{transform:translateY(1px)}

/* Secondary/ghost style when a button sits inside a neutral card */
/* Removed - now using consistent mobile styling globally */

/* Inline buttons layout: two columns for Previous/Next, single column for single buttons */
.inline-buttons{
  display:grid;gap:12px;margin-top:4px;
  grid-template-columns:1fr 1fr;
}

.inline-buttons.single{
  grid-template-columns:1fr;
  justify-items:stretch;
}

.inline-buttons .btn{
  text-align:center;
  justify-content:center;
  background:var(--accent);
  border-color:var(--accent);
  color:#ffffff;
  box-shadow:0 4px 12px rgba(64, 109, 118, 0.2);
}

.inline-buttons.single .btn{
  min-width:0;
  width:100%;
}

/* Audio player card: prominent green pill + visible progress/time */
#player{padding:0;border:0;box-shadow:none;background:transparent}
#player .muted{padding:0 var(--pad)}

/* Apple Podcast-style Audio Player */
.audio-player {
  background:#ffffff;
  border-radius:10px;
  padding:24px;
  border:1px solid var(--line);
  box-shadow:var(--shadow);
  margin:20px 0;
}

.audio-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.audio-title {
  font-weight: 600;
  color: var(--fg);
  font-size: 16px;
}

.audio-time{
  text-align:center;font-weight:600;color:var(--muted);font-size:14px;font-variant-numeric:tabular-nums;margin-bottom:12px;
}

.audio-controls{
  display:flex;align-items:center;justify-content:center;gap:24px;margin-bottom:18px;
}

.control-btn{
  all:unset;display:flex;flex-direction:column;align-items:center;gap:6px;cursor:pointer;
  transition:background .2s ease, transform .1s ease, box-shadow .2s ease;
  padding:10px;border-radius:10px;
}
.control-btn:hover{background:var(--accent-100)}
.control-btn:active{transform:scale(.98)}

.control-icon{width:28px;height:28px;display:block;}
.play-btn .control-icon{width:34px;height:34px}

.play-btn{
  background:#fff;border-radius:999px;width:64px;height:64px;display:flex;align-items:center;justify-content:center;
  border:2px solid var(--accent);box-shadow:0 6px 20px rgba(64,109,118,.18);
}
.play-btn:hover{background:var(--accent-100)}

.audio-progress{margin:0 8px}
.progress-bar{
  appearance:none;width:100%;height:6px;background:#e9ecef;border-radius:999px;outline:none;cursor:pointer;
  transition:background .2s ease;
}
.progress-bar:hover{background:#dbe4ea}
.progress-bar::-webkit-slider-thumb{
  appearance:none;width:18px;height:18px;border-radius:50%;background:var(--accent);border:3px solid #fff;box-shadow:0 2px 8px rgba(0,0,0,.15);cursor:pointer
}
.progress-bar::-moz-range-thumb{
  width:18px;height:18px;border-radius:50%;background:var(--accent);border:3px solid #fff;box-shadow:0 2px 8px rgba(0,0,0,.15);cursor:pointer
}
.progress-bar::-moz-range-track{height:6px;background:#e9ecef;border-radius:999px}

.control-label {
  font-size: 12px;
  font-weight: 600;
  color: white;
  text-transform: none;
  letter-spacing: 0;
}

.play-btn .control-label {
  display: none;
}

.controls{
  margin:0 var(--pad);
  background:var(--accent);
  border:1px solid var(--accent);
  border-radius:10px;
  padding:14px 18px;
  display:flex;align-items:center;gap:14px;
  box-shadow:0 8px 20px rgba(64,109,118,.28);
}
#pp{
  all:unset;
  display:inline-flex;align-items:center;justify-content:center;
  width:auto;height:auto;
  cursor:pointer;font-weight:700;
}

/* Show and style the timeline + time */
.controls .range{display:block;flex:1}
#time{display:block;width:54px;text-align:right;font-variant-numeric:tabular-nums;color:#ffffff;opacity:.85}

.controls .range input[type="range"]{
  appearance:none;
  width:100%;
  height:4px;
  background:rgba(255,255,255,0.3);
  border-radius:10px;
  outline:none;
}
.controls .range input[type="range"]::-webkit-slider-thumb{
  appearance:none;
  width:16px;height:16px;border-radius:50%;
  background:#ffffff;border:2px solid var(--accent-600);
  box-shadow:0 2px 6px rgba(0,0,0,.15);
  margin-top:-6px;
}
.controls .range input[type="range"]::-moz-range-thumb{
  width:16px;height:16px;border-radius:50%;
  background:#ffffff;border:2px solid var(--accent-600);
  box-shadow:0 2px 6px rgba(0,0,0,.15);
}
.controls .range input[type="range"]::-moz-range-track{
  height:4px;background:rgba(255,255,255,0.3);border-radius:999px;
}

/* Transcript disclosure */
.disclosure{border:1px solid var(--line);border-radius:var(--radius-lg);overflow:hidden;background:#fff}
.disclosure button{
  width:100%;display:flex;justify-content:space-between;align-items:center;
  padding:14px 16px;background:#fff;border:0;font-weight:600;
}
.disclosure .panel{padding:0 16px 16px}

/* Transcript arrow styling */
.disclosure .arrow {
  font-size: 18px;
  line-height: 1;
  transition: transform 0.3s ease;
  display: inline-block;
}

.disclosure button[aria-expanded="true"] .arrow {
  transform: rotate(180deg);
}

/* Transcript disclosure with rotating arrow */
.disclosure button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: #fff;
  border: 0;
  font-weight: 600;
  color: var(--fg);
}

.disclosure button span:first-child {
  color: var(--fg);
}

.disclosure button span:last-child {
  transition: transform 0.2s ease;
  display: inline-block;
  color: var(--accent);
}

.disclosure button[aria-expanded="true"] span:last-child {
  transform: rotate(90deg);
}

/* Footer minimal */
footer{
  padding:18px var(--pad);text-align:center;color:var(--muted);
  border-top:1px solid var(--line);
}

.footer-logo {
  margin-bottom: 12px;
  margin-top: 12px;
}
.footer-logo img {
  max-height: 100px;
  width: auto;
  display: block;
  margin: 0 auto;
}

/* Utilities */
.title{font-weight:800}
.range input{width:100%}

.audio-times{display:flex;justify-content:space-between;align-items:center;margin-top:8px;margin-left:8px;margin-right:8px}
.audio-times .audio-time{font-size:12px;color:var(--muted);font-weight:500;margin:0}
.audio-times #time{width:auto;text-align:left}
.audio-times #time-left{text-align:right}

main.container{padding-bottom:40px
  ;padding-top:10px;}

/* Mobile-first responsive improvements */
@media (max-width: 640px) {
  .container {
    padding: 0 16px;
  }
  
  .hdr {
    padding: 12px 16px;
    min-height: 48px;
  }
  
  .hdr .btn {
    padding: 10px 16px;
    font-size: 14px;
  }
  
  .headline {
    font-size: 24px;
    margin: 6px 0 6px;
  }
  
  .card {
    padding: 16px;
    border-radius: 12px;
  }
  
  .btn {
    padding: 12px 14px;
    font-size: 14px;
    min-height: 44px; /* Slightly smaller for mobile */
  }
  
  .inline-buttons {
    grid-template-columns: 1fr 1fr;
    gap: 8px; /* Tighter gap between buttons */
  }
  
  .inline-buttons .btn {
    padding: 10px 8px; /* Much narrower padding for side-by-side */
    font-size: 13px; /* Smaller font to fit better */
    min-height: 40px; /* Smaller height for mobile */
  }
  
  .inline-buttons.single .btn {
    min-width: 0;
    width: 100%;
    padding: 10px 8px; /* Match the Previous/Next button padding */
    font-size: 13px; /* Match the Previous/Next button font size */
    min-height: 40px; /* Match the Previous/Next button height */
  }
  
  .audio-player {
    padding: 20px 16px;
    border-radius: 12px;
  }
  
  .audio-controls {
    gap: 20px;
    margin-bottom: 20px;
  }
  
  .control-btn {
    padding: 10px;
  }
  
  .play-btn {
    width: 56px;
    height: 56px;
  }
  
  .play-btn .control-icon {
    width: 28px;
    height: 28px;
  }
  
  .control-icon {
    width: 24px;
    height: 24px;
  }
  
  .list-item {
    padding: 14px;
    border-radius: 12px;
  }
  
  .thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
  }
  
  .disclosure button {
    padding: 12px 14px;
    font-size: 15px;
  }
  
  .disclosure .panel {
    padding: 0 14px 14px;
  }
  
  .hero {
    border-radius: 8px;
  }
  
  .carousel-container {
    border-radius: 8px;
  }
  
  .carousel-btn {
    width: 40px;
    height: 40px;
  }
  
  .carousel-btn svg {
    width: 18px;
    height: 18px;
  }
  
  .carousel-controls {
    padding: 0 12px;
  }
  
  .carousel-indicators {
    bottom: 12px;
  }
  
  .carousel-indicator {
    width: 6px !important;
    height: 6px !important;
    margin: 0 3px !important;
    min-width: 6px !important;
    min-height: 6px !important;
    max-width: 6px !important;
    max-height: 6px !important;
  }
  
  .progress-bar::-webkit-slider-thumb {
    width: 22px;
    height: 22px;
  }
  
  .progress-bar::-moz-range-thumb {
    width: 22px;
    height: 22px;
  }
}

/* Enhanced touch interactions */
.btn:active,
.control-btn:active,
.list-item:active {
  transform: scale(0.98);
  transition: transform 0.1s ease;
}

/* Better focus states for accessibility */
.btn:focus,
.control-btn:focus,
.list-item:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Improved loading states */
.placeholder {
  background: linear-gradient(90deg, var(--secondary-light) 25%, var(--secondary) 50%, var(--secondary-light) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Additional mobile optimizations */
@media (max-width: 480px) {
  .container {
    padding: 0 12px;
  }
  
  .hdr {
    padding: 10px 12px;
  }
  
  .hdr > div:first-child {
    font-size: 18px;
  }
  
  .headline {
    font-size: 22px;
    line-height: 1.3;
  }
  
  .card {
    padding: 14px;
  }
  
  .btn {
    padding: 12px 16px;
    font-size: 14px;
  }
  
  .audio-player {
    padding: 16px 12px;
  }
  
  .audio-controls {
    gap: 16px;
  }
  
  .control-btn {
    padding: 8px;
  }
  
  .play-btn {
    width: 52px;
    height: 52px;
  }
  
  .list-item {
    padding: 12px;
  }
  
  .thumb {
    width: 56px;
    height: 56px;
  }
  
  .inline-buttons {
    gap: 10px;
  }
  
  .carousel-btn {
    width: 36px;
    height: 36px;
  }
  
  .carousel-btn svg {
    width: 16px;
    height: 16px;
  }
  
  .carousel-controls {
    padding: 0 8px;
  }
  
  .carousel-indicators {
    bottom: 8px;
  }
  
  .carousel-indicator {
    width: 5px !important;
    height: 5px !important;
    margin: 0 2px !important;
    min-width: 5px !important;
    min-height: 5px !important;
    max-width: 5px !important;
    max-height: 5px !important;
  }
}

/* Improved mobile navigation */
@media (max-width: 640px) {
  .inline-buttons .btn {
    text-align: center;
    justify-content: center;
  }
  
  .inline-buttons .btn:first-child,
  .inline-buttons .btn:last-child {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(64, 109, 118, 0.2);
  }
}

/* Better mobile audio controls */
@media (max-width: 640px) {
  .audio-times {
    margin-top: 6px;
  }
  
  .audio-times .audio-time {
    font-size: 11px;
  }
  
  .progress-bar {
    height: 5px;
  }
  
  .progress-bar::-webkit-slider-thumb {
    border-width: 2px;
  }
  
  .progress-bar::-moz-range-thumb {
    border-width: 2px;
  }
}

/* Reduced vertical spacing for location pages */
.grid {
  display: grid;
  gap: 12px; /* Reduced from 16px */
}

/* More compact audio player */
.audio-player {
  background: #ffffff;
  border-radius: 10px;
  padding: 16px; /* Reduced from 24px */
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  margin: 12px 0; /* Reduced from 20px */
}

.audio-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px; /* Reduced from 24px */
}

.audio-times {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px; /* Reduced from 8px */
  margin-left: 8px;
  margin-right: 8px;
}

.audio-times .audio-time {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  margin: 0;
}

.audio-progress {
  margin: 0 8px;
}

/* Mobile-specific compact styling */
@media (max-width: 640px) {
  .grid {
    gap: 10px; /* Even tighter on mobile */
  }
  
  .audio-player {
    padding: 12px; /* More compact on mobile */
    margin: 8px 0; /* Tighter margins on mobile */
  }
  
  .audio-controls {
    gap: 20px;
    margin-bottom: 12px; /* Tighter spacing on mobile */
  }
  
  .control-btn {
    padding: 8px; /* Smaller padding on mobile */
  }
  
  .play-btn {
    width: 52px; /* Slightly smaller on mobile */
    height: 52px;
  }
  
  .play-btn .control-icon {
    width: 26px; /* Proportionally smaller */
    height: 26px;
  }
  
  .control-icon {
    width: 22px; /* Smaller icons on mobile */
    height: 22px;
  }
  
  .audio-times {
    margin-top: 4px; /* Tighter spacing on mobile */
  }
  
  .audio-times .audio-time {
    font-size: 11px; /* Smaller text on mobile */
  }
}

/* Title row with inline stop number */
.title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.title-row .headline {
  margin: 0;
  font-family: 'Arvo', serif;
  flex: 1;
  min-width: 0; /* Allow text to wrap if needed */
}

.title-row .chip {
  margin: 0;
  flex-shrink: 0; /* Prevent chip from shrinking */
  white-space: nowrap; /* Keep chip text on one line */
}

/* Muted card button styling to match regular buttons */
.card.muted {
  background: var(--line);
  border: 1px solid var(--muted);
  color: var(--muted);
  text-align: center;
  padding: 10px 8px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 13px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  opacity: 0.7;
  pointer-events: none;
}

@media (max-width: 640px) {
  .card.muted {
    padding: 10px 8px;
    font-size: 13px;
    min-height: 40px;
  }
}
/* Apply Arvo to all headings */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Arvo', serif;
}


/* Always green Directions to Next Stop button */
a.btn[href*="google.com/maps"] {
  background-color: #6F9B74 !important;
  border-color: #6F9B74 !important;
  color: #ffffff !important;
}
a.btn[href*="google.com/maps"]:hover,
a.btn[href*="google.com/maps"]:active,
a.btn[href*="google.com/maps"]:focus {
  background-color: #6F9B74 !important;
  border-color: #6F9B74 !important;
  color: #ffffff !important;
}
/* Address line under the title */
.address-line {
  margin-top: -4px;         /* tucks closer to title */
  margin-bottom: 4px;
}

.address-link,
.address-text {
  display: inline-block;
  font-size: 14px;
  color: var(--muted);
}

.address-link {
  text-decoration: underline;
  color: var(--accent);
  font-weight: 600;
}

.address-link:focus,
.address-link:hover {
  outline: none;
  text-decoration: underline;
}