/* ============================================================
   css/main.css — Race Website — Mobile First
   ============================================================ */

/* ── CSS Custom Properties (Tema) ────────────────────────────── */
:root {
  --primary:          #e63946;
  --secondary:        #1d3557;
  --primary-hover:    color-mix(in srgb, var(--primary) 80%, black);
  --secondary-hover:  color-mix(in srgb, var(--secondary) 80%, black);
  --bg:               #ffffff;
  --bg-alt:           #f4f6f8;
  --text:             #1e293b;
  --text-light:       #64748b;
  --border:           #e2e8f0;
  --white:            #ffffff;
  --shadow-sm:        0 1px 3px rgba(0,0,0,0.10);
  --shadow:           0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg:        0 8px 32px rgba(0,0,0,0.14);
  --radius:           10px;
  --radius-sm:        6px;
  --transition:       0.25s ease;
  --max-width:        1200px;
  --header-height:    64px;
}

/* ── Reset ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img  { max-width: 100%; height: auto; display: block; }
a    { color: inherit; text-decoration: none; }
ul   { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, textarea, select { font: inherit; }

/* ── Layout ───────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}
.section        { padding: 3rem 0; }
.section--alt   { background: var(--bg-alt); }
.section__title {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 1.5rem;
}

/* ── Header / Navbar ──────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  background: var(--secondary);
  color: var(--white);
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 1rem;
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  flex-shrink: 0;
  max-width: 60%;
  overflow: hidden;
}
.site-logo img  { height: 38px; width: auto; flex-shrink: 0; }
.site-logo span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Hamburger button */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 8px;
  flex-shrink: 0;
  color: var(--white);
}
.nav-toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.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); }

/* Mobile nav drawer */
.site-nav {
  position: fixed;
  top: var(--header-height);
  left: 0; right: 0;
  background: var(--secondary);
  transform: translateY(-110%);
  opacity: 0;
  pointer-events: none;
  transition: transform var(--transition), opacity var(--transition);
  z-index: 999;
  max-height: calc(100dvh - var(--header-height));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.site-nav.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: all;
}
.site-nav ul  { padding: 0.5rem 0 1rem; }
.site-nav li  { border-bottom: 1px solid rgba(255,255,255,0.07); }
.site-nav a,
.site-nav > ul > li > button {
  display: block;
  width: 100%;
  padding: 0.875rem 1.5rem;
  color: rgba(255,255,255,0.88);
  font-size: 1rem;
  text-align: left;
  background: none;
  border: none;
  transition: background var(--transition);
}
.site-nav a:hover,
.site-nav > ul > li > button:hover { background: rgba(255,255,255,0.09); }
.site-nav .dropdown-menu { background: rgba(0,0,0,0.25); }
.site-nav .dropdown-menu a { padding-left: 2.25rem; font-size: 0.95rem; }

/* Language switch in nav */
.nav-lang {
  display: flex;
  gap: 0.375rem;
  padding: 0.875rem 1.5rem;
}
.nav-lang button {
  padding: 0.25rem 0.625rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
  border: 1px solid rgba(255,255,255,0.25);
  transition: background var(--transition), color var(--transition);
}
.nav-lang button.active,
.nav-lang button:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

/* ── Page content offset ──────────────────────────────────────── */
.page-content {
  padding-top: var(--header-height);
  min-height: 100dvh;
}

/* ── Hero ─────────────────────────────────────────────────────── */
.hero {
  position: relative;
  aspect-ratio: 16 / 9;
  max-height: 100vh;
  background: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hero__media {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    160deg,
    rgba(0,0,0,0.15) 0%,
    rgba(0,0,0,0.55) 100%
  );
}
.hero__content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: var(--white);
  padding: 2rem 1rem;
  max-width: 800px;
}
.hero__title {
  font-size: clamp(1.8rem, 6vw, 4rem);
  font-weight: 900;
  line-height: 1.15;
  text-shadow: 0 2px 12px rgba(0,0,0,0.45);
  letter-spacing: -0.01em;
}
.hero--empty { aspect-ratio: auto; min-height: 240px; }

/* ── Page Hero (inner pages) ──────────────────────────────────── */
.page-hero {
  position: relative;
  height: max(160px, 35vw);
  max-height: 320px;
  background: var(--secondary);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.page-hero__img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0.45;
}
.page-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.1) 60%);
}
.page-hero__title {
  position: relative;
  z-index: 1;
  color: var(--white);
  padding: 1.25rem 1.5rem;
  font-size: clamp(1.3rem, 4vw, 2.2rem);
  font-weight: 800;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

/* ── Cards Grid ───────────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  border: 1px solid var(--border);
}
.card:hover,
.card:focus-within {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.card__image {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  width: 100%;
  background: var(--bg-alt);
  display: block;
}
.card__image--placeholder { background: var(--bg-alt); }
.card__body  { padding: 1rem 1.125rem; }
.card__title { font-size: 1.05rem; font-weight: 700; color: var(--secondary); margin-bottom: 0.375rem; }
.card__desc  { font-size: 0.88rem; color: var(--text-light); line-height: 1.5; }
.card__register { margin-top: .75rem; display: inline-block; pointer-events: all; }
.card__footer {
  padding: 0.75rem 1.125rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  transition: background var(--transition), opacity var(--transition), transform var(--transition);
  cursor: pointer;
  border: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn--primary  { background: var(--primary); color: var(--white); }
.btn--primary:hover:not(:disabled)  { background: var(--primary-hover); }
.btn--secondary { background: var(--secondary); color: var(--white); }
.btn--secondary:hover:not(:disabled) { background: var(--secondary-hover); }
.btn--outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}
.btn--outline:hover:not(:disabled) { background: var(--primary); color: var(--white); }
.btn--sm { padding: 0.4rem 0.875rem; font-size: 0.85rem; }

/* ── Download Buttons ─────────────────────────────────────────── */
.download-buttons { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0; }

/* ── Sponsors ─────────────────────────────────────────────────── */
.sponsors-section {
  padding: 2.5rem 0;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
}
.sponsors-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
  align-items: center;
}
.sponsor-item img {
  max-height: 56px;
  width: auto;
  filter: grayscale(0.2);
  transition: filter var(--transition), opacity var(--transition);
  opacity: 0.85;
}
.sponsor-item img:hover { filter: grayscale(0); opacity: 1; }

/* ── Info Tabs ────────────────────────────────────────────────── */
.info-tabs {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}
.info-tab {
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-light);
  cursor: pointer;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--transition), border-color var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.info-tab:hover { color: var(--primary); }
.info-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── FAQ ──────────────────────────────────────────────────────── */
.faq-item { border-bottom: 1px solid var(--border); }
.faq-question {
  width: 100%;
  text-align: left;
  padding: 1rem 0;
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.faq-question::after {
  content: '+';
  font-size: 1.4rem;
  line-height: 1;
  color: var(--primary);
  flex-shrink: 0;
  font-weight: 300;
}
.faq-item.is-open .faq-question::after { content: '−'; }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.faq-item.is-open .faq-answer { max-height: 2000px; }
.faq-answer__inner {
  padding: 0 0 1.25rem;
  color: var(--text-light);
  line-height: 1.7;
}

/* ── Embed ────────────────────────────────────────────────────── */
.embed-section { padding: 2rem 0; }
.embed-section iframe { width: 100%; border: none; min-height: 400px; }

/* ── Prose / Rich Text ────────────────────────────────────────── */
.prose { max-width: 800px; }
.prose h1, .prose h2, .prose h3, .prose h4 {
  color: var(--secondary);
  margin: 1.75rem 0 0.75rem;
  line-height: 1.3;
}
.prose h1 { font-size: 1.8rem; }
.prose h2 { font-size: 1.4rem; }
.prose h3 { font-size: 1.15rem; }
.prose p  { margin-bottom: 1rem; }
.prose ul { list-style: disc; padding-left: 1.5rem; margin-bottom: 1rem; }
.prose ol { list-style: decimal; padding-left: 1.5rem; margin-bottom: 1rem; }
.prose li { margin-bottom: 0.25rem; }
.prose table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; overflow-x: auto; display: block; }
.prose th, .prose td { border: 1px solid var(--border); padding: 0.5rem 0.75rem; text-align: left; }
.prose th { background: var(--bg-alt); font-weight: 600; }
.prose a  { color: var(--primary); text-decoration: underline; }
.prose img { border-radius: var(--radius-sm); margin: 1rem 0; }

/* ── Footer ───────────────────────────────────────────────────── */
.site-footer {
  background: var(--secondary);
  color: rgba(255,255,255,0.65);
  text-align: center;
  padding: 1.75rem 1rem;
  font-size: 0.875rem;
}
.site-footer #footer-race-name {
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  margin-bottom: 0.5rem;
}
.footer-social {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.75rem 0;
}
.footer-social__link {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}
.footer-social__link:hover { color: #fff; }
.footer-contact {
  margin-top: 0.5rem;
  font-size: 0.82rem;
}
.footer-contact a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
}
.footer-contact a:hover { color: #fff; }

/* ── Utilities ────────────────────────────────────────────────── */
.hidden         { display: none !important; }
.text-center    { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ── Responsive — Tablet (≥ 640px) ───────────────────────────── */
@media (min-width: 640px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Responsive — Desktop (≥ 768px) ──────────────────────────── */
@media (min-width: 768px) {
  /* Desktop nav replaces drawer */
  .nav-toggle { display: none; }

  .site-nav {
    position: static;
    transform: none;
    opacity: 1;
    pointer-events: all;
    background: none;
    max-height: none;
    overflow: visible;
  }
  .site-nav ul {
    display: flex;
    align-items: center;
    padding: 0;
    gap: 0.125rem;
  }
  .site-nav li { border: none; position: relative; }
  .site-nav > ul > li > a,
  .site-nav > ul > li > button {
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    color: rgba(255,255,255,0.88);
    white-space: nowrap;
  }
  .site-nav > ul > li > a:hover,
  .site-nav > ul > li > button:hover { background: rgba(255,255,255,0.12); }

  /* Desktop dropdown */
  .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--secondary-hover);
    min-width: 200px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) var(--radius-sm);
    box-shadow: var(--shadow);
    z-index: 200;
    padding: 0.25rem 0;
  }
  .site-nav li:hover > .dropdown-menu { display: block; }
  .site-nav .dropdown-menu { background: #122336; }
  .site-nav .dropdown-menu a {
    padding: 0.625rem 1rem !important;
    font-size: 0.88rem !important;
  }

  /* Language switch inline */
  .nav-lang { padding: 0; }
}

/* ── Responsive — Large Desktop (≥ 1024px) ───────────────────── */
@media (min-width: 1024px) {
  .cards-grid { grid-template-columns: repeat(3, 1fr); }
  .container  { padding: 0 2rem; }
}

/* ── Geri Sayım ───────────────────────────────────────────────── */
.countdown-section {
  background: var(--secondary);
  color: #fff;
  padding: 2rem 1rem;
  text-align: center;
}
.countdown-label {
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 0.75rem;
}
.countdown-timer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
}
.countdown-unit span {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}
.countdown-unit small {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.65;
  margin-top: 0.25rem;
}
.countdown-sep {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  opacity: 0.5;
  align-self: flex-start;
  padding-top: 0.15rem;
}
@media (min-width: 480px) {
  .countdown-unit { min-width: 80px; }
  .countdown-unit span { font-size: 3.5rem; }
}

/* ── Sonuçlar Sayfası ─────────────────────────────────────────── */
.results-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 640px;
  margin: 0 auto;
}
.results-btn {
  display: block;
  width: 100%;
  padding: 1rem 1.5rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.results-btn:hover {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.results-btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

/* ── İletişim Sayfası ─────────────────────────────────────────── */
.contact-grid {
  display: grid;
  gap: 2rem;
}
.contact-info p {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}
.contact-info a {
  color: var(--primary);
  text-decoration: none;
}
.contact-info a:hover { text-decoration: underline; }

.contact-social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-start;
}
.social-link {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  transition: opacity 0.2s;
}
.social-link:hover { opacity: 0.85; }
.social-link--ig { background: #e1306c; }
.social-link--fb { background: #1877f2; }
.social-link--tw { background: #000; }

@media (min-width: 600px) {
  .contact-grid { grid-template-columns: 1fr 1fr; }
}
