/* =====================================================
   Manisa MTB Patikalar — Modern Outdoor Theme
   Antrasit + Sunset Orange + Bakır
   ===================================================== */

:root {
  /* Surfaces — slightly cooler, more neutral */
  --bg: #0B0D11;
  --bg-elev-1: #11141A;
  --bg-elev-2: #171B22;
  --border: #232831;
  --border-soft: #1A1E25;

  /* Text — higher contrast for clarity */
  --text: #F2F4F7;
  --text-muted: #8B9099;
  --text-dim: #5A5F69;

  /* Single accent, used sparingly */
  --accent: #FF7A45;
  --accent-hover: #FF8E5E;
  --accent-deep: #C2410C;
  --accent-soft: rgba(255, 122, 69, 0.12);

  --diff-easy: #5DCB7A;
  --diff-medium: #F5B441;
  --diff-hard: #FF5A4F;

  /* Architectural radii — sharper, more confident */
  --radius-xs: 3px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  /* Reduced shadow noise */
  --shadow-md: 0 2px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);

  --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --container: 1280px;
  --container-narrow: 880px;
  --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

::selection { background: var(--accent); color: var(--bg); }

/* ===== Container ===== */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
.container-narrow { max-width: var(--container-narrow); margin: 0 auto; padding: 0 24px; }

/* ===== Typography ===== */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
}
h1 { font-size: clamp(2.2rem, 4.5vw, 3.6rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); }
h3 { font-size: 1.15rem; font-weight: 600; }
h4 { font-size: 0.95rem; font-weight: 500; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--text-dim);
}

/* ===== Header / Nav ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(14, 17, 22, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.logo-mark {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  display: grid; place-items: center;
  color: var(--bg);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
  list-style: none;
}
.nav-links a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }

.lang-toggle {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  transition: all var(--transition);
  letter-spacing: 0.08em;
}
.lang-toggle:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.nav-toggle span {
  display: block;
  width: 18px; height: 2px;
  background: var(--text);
  margin: 4px auto;
  transition: transform var(--transition);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: min(78vh, 680px);
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
  border-bottom: 1px solid var(--border-soft);
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url('../images/hero/hero-bg.svg') center/cover no-repeat;
  opacity: 0.55;
}
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(11, 13, 17, 0.6) 0%,
    rgba(11, 13, 17, 0.3) 40%,
    rgba(11, 13, 17, 0.95) 100%);
}
.hero-content {
  padding: 140px 0 110px;
  max-width: 760px;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  color: var(--text-muted);
}
.hero-eyebrow::before {
  content: '';
  width: 28px; height: 1px;
  background: var(--accent);
}
.hero h1 {
  font-weight: 700;
  letter-spacing: -0.035em;
  margin-bottom: 28px;
  line-height: 1.05;
}
.hero h1 .accent { color: var(--accent); }
.hero p {
  font-size: clamp(0.95rem, 1.3vw, 1.05rem);
  color: var(--text-muted);
  max-width: 520px;
  margin-bottom: 40px;
  line-height: 1.65;
}
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
  letter-spacing: -0.005em;
}
.btn-primary {
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--bg);
}
.btn-secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-secondary:hover {
  border-color: var(--text-muted);
  color: var(--text);
}
.btn-ghost {
  background: var(--bg-elev-1);
  color: var(--text-muted);
  border-color: var(--border-soft);
}
.btn-ghost:hover {
  background: var(--bg-elev-2);
  color: var(--text);
  border-color: var(--border);
}
.btn-icon { font-size: 1rem; }

/* ===== Section ===== */
section { padding: 110px 0; }
.section-head {
  margin-bottom: 56px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border-soft);
}
.section-head h2 { margin-top: 12px; }
.section-head p { color: var(--text-muted); max-width: 460px; margin-top: 8px; font-size: 0.95rem; }

/* ===== Filter Bar ===== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  padding: 0;
  margin-bottom: 36px;
  align-items: center;
}
.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.filter-label {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-right: 6px;
}
.filter-chip {
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  font-size: 0.82rem;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-soft);
  transition: all var(--transition);
  font-weight: 500;
}
.filter-chip:hover { border-color: var(--border); color: var(--text); }
.filter-chip.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
  font-weight: 600;
}
.view-toggle {
  margin-left: auto;
  display: flex;
  background: var(--bg-elev-1);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xs);
  padding: 3px;
  gap: 2px;
}
.view-btn {
  padding: 6px 12px;
  border-radius: 2px;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.view-btn.active { background: var(--bg-elev-2); color: var(--text); font-weight: 600; }

/* ===== Route Cards Grid ===== */
.routes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1px;
  background: var(--border-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.route-card {
  background: var(--bg);
  border: none;
  border-radius: 0;
  overflow: hidden;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}
.route-card:hover {
  background: var(--bg-elev-1);
}
.route-card-cover {
  aspect-ratio: 16 / 10;
  background: var(--bg-elev-1);
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border-soft);
}
.route-card-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 700ms cubic-bezier(0.2, 0, 0.2, 1);
}
.route-card:hover .route-card-cover img { transform: scale(1.03); }
.route-card-difficulty {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  font-size: 0.68rem;
  font-weight: 600;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  backdrop-filter: blur(8px);
  background: rgba(11, 13, 17, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.route-card-difficulty.easy { color: var(--diff-easy); }
.route-card-difficulty.medium { color: var(--diff-medium); }
.route-card-difficulty.hard { color: var(--diff-hard); }
.route-card-type {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  font-size: 0.68rem;
  font-weight: 600;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  backdrop-filter: blur(8px);
  background: rgba(11, 13, 17, 0.75);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.route-card-body {
  padding: 24px 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}
.route-card-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.route-card-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  flex: 1;
  line-height: 1.55;
}
.route-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 18px;
  margin-top: 4px;
  border-top: 1px solid var(--border-soft);
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-label {
  font-size: 0.64rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.stat-value .unit {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-dim);
  margin-left: 3px;
}

/* ===== Map (all routes) ===== */
.all-map {
  height: 540px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-soft);
}

/* ===== Detail Page ===== */
.detail-hero {
  padding: 32px 0 0;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.back-link:hover { color: var(--accent); }
.detail-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}
.tag {
  padding: 5px 10px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  border-radius: var(--radius-xs);
  background: transparent;
  border: 1px solid var(--border-soft);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
}
.tag.difficulty.easy { color: var(--diff-easy); border-color: rgba(93, 203, 122, 0.3); }
.tag.difficulty.medium { color: var(--diff-medium); border-color: rgba(245, 180, 65, 0.3); }
.tag.difficulty.hard { color: var(--diff-hard); border-color: rgba(255, 90, 79, 0.3); }

.detail-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 28px;
  margin-top: 32px;
}
.strava-wrap {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-soft);
  background: var(--bg-elev-1);
  min-height: 520px;
  display: flex;
  flex-direction: column;
}
.strava-wrap iframe {
  width: 100% !important;
  height: 520px !important;
  border: 0 !important;
  display: block;
}
.strava-wrap .strava-embed-placeholder { width: 100%; }
.strava-missing {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 32px;
  height: 100%;
  min-height: 520px;
}
.strava-missing-icon {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
}
.strava-missing strong { color: var(--text); display: block; margin-bottom: 6px; }
.strava-missing p { color: var(--text-muted); font-size: 0.95rem; margin: 0; }
.detail-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.stat-block {
  background: var(--bg-elev-1);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 22px;
}
.stat-block h3 {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 18px;
  font-weight: 500;
}
.stat-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.stat-row .stat { padding: 10px 0; }
.stat-row .stat:not(:last-child):not(:nth-last-child(2)) { border-bottom: 1px solid var(--border-soft); }
.detail-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.detail-section { margin-top: 64px; }
.detail-section h2 { margin-bottom: 16px; }
.detail-description p { color: var(--text-muted); max-width: 720px; font-size: 1.02rem; }

.warnings {
  background: var(--bg-elev-1);
  border: 1px solid var(--border-soft);
  border-left: 2px solid var(--diff-hard);
  border-radius: var(--radius-sm);
  padding: 22px;
}
.warnings h3 {
  color: var(--diff-hard);
  font-size: 0.7rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 12px;
  font-weight: 500;
}
.warnings ul { list-style: none; }
.warnings li {
  padding: 6px 0 6px 22px;
  position: relative;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.warnings li::before {
  content: '!';
  position: absolute;
  left: 0; top: 6px;
  width: 16px; height: 16px;
  background: var(--diff-hard);
  color: var(--bg);
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
}

.elevation-chart {
  background: var(--bg-elev-1);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 22px;
  height: 280px;
}

/* ===== Gallery ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  grid-auto-rows: 220px;
  gap: 4px;
}
.gallery-item {
  border-radius: var(--radius-xs);
  overflow: hidden;
  background: var(--bg-elev-1);
  position: relative;
  cursor: pointer;
}
.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 500ms cubic-bezier(0.2, 0, 0.2, 1);
}
.gallery-item:hover img { transform: scale(1.06); }
.gallery-item.tall { grid-row: span 2; }
.gallery-item.wide { grid-column: span 2; }

/* ===== About ===== */
.about-card {
  background: var(--bg-elev-1);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 56px;
  max-width: 760px;
}
.about-card p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 20px;
  max-width: 60ch;
}
.about-card p:last-child { margin-bottom: 0; }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: 56px 0 40px;
  margin-top: 80px;
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-grid p { color: var(--text-dim); font-size: 0.85rem; }
.footer-credits {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

/* ===== Loader ===== */
.loader {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
  background: var(--bg-elev-1);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}

/* ===== Leaflet overrides for dark theme ===== */
.leaflet-container {
  background: var(--bg-elev-2) !important;
  font-family: var(--font-body) !important;
}
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background: var(--bg-elev-1) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
}
.leaflet-popup-content { font-size: 0.9rem; }
.leaflet-popup-content strong { color: var(--accent); }
.leaflet-control-zoom a {
  background: var(--bg-elev-1) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
}
.leaflet-control-zoom a:hover {
  background: var(--bg-elev-2) !important;
  color: var(--accent) !important;
}
.leaflet-control-attribution {
  background: rgba(14, 17, 22, 0.7) !important;
  color: var(--text-dim) !important;
  font-size: 0.7rem !important;
}
.leaflet-control-attribution a { color: var(--text-muted) !important; }
/* invert default OSM tiles for dark mode while preserving readability */
.leaflet-tile-pane { filter: invert(0.92) hue-rotate(180deg) brightness(0.95) contrast(0.85) saturate(0.6); }

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .detail-grid { grid-template-columns: 1fr; }
  .detail-map { height: 380px; }
  section { padding: 72px 0; }
  .hero-content { padding: 80px 0 64px; }
}
@media (max-width: 720px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-elev-1);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    gap: 4px;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 12px 0; }
  .nav-toggle { display: block; }
  .filter-bar { padding: 16px; gap: 16px; }
  .view-toggle { margin-left: 0; width: 100%; justify-content: center; }
  .all-map { height: 380px; }
  .about-card { padding: 28px; }
  .gallery-item.wide { grid-column: span 1; }
  .footer-grid { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .routes-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .detail-actions .btn { width: 100%; justify-content: center; }
}
