/* ============================================
   イルカサーキット - Iruka Circuit
   Modern RC Racing Website Stylesheet
   ============================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-ocean-dark: #0a1628;
  --color-ocean-deep: #0d2137;
  --color-ocean-mid: #134b6e;
  --color-ocean-light: #1a8a9e;
  --color-teal: #00bcd4;
  --color-teal-light: #4dd0e1;
  --color-teal-pale: #e0f7fa;
  --color-white: #ffffff;
  --color-off-white: #f4f8fa;
  --color-gray-light: #e8eef2;
  --color-gray-mid: #94a3b8;
  --color-gray-dark: #475569;
  --color-text: #1e293b;
  --color-text-light: #64748b;
  --color-ep: #00897b;
  --color-ep-bg: #e0f2f1;
  --color-gp: #e65100;
  --color-gp-bg: #fff3e0;
  --color-df: #7b1fa2;
  --color-df-bg: #f3e5f5;
  --color-mixed-1: #00897b;
  --color-mixed-2: #e65100;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition: 0.25s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Helvetica Neue', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Noto Sans JP', 'Yu Gothic', Meiryo, sans-serif;
  color: var(--color-text);
  background: var(--color-off-white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---- Header ---- */
.site-header {
  background: linear-gradient(135deg, var(--color-ocean-dark) 0%, var(--color-ocean-deep) 50%, var(--color-ocean-mid) 100%);
  color: var(--color-white);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--color-white);
}

.logo-icon {
  font-size: 2rem;
  line-height: 1;
}

.site-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.site-subtitle {
  font-size: 0.75rem;
  opacity: 0.7;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---- Hamburger ---- */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 200;
}

.hamburger span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--color-white);
  border-radius: 2px;
  transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ---- Navigation ---- */
.main-nav {
  background: rgba(10, 22, 40, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.nav-list {
  display: flex;
  list-style: none;
  flex-wrap: wrap;
}

.nav-list li a {
  display: block;
  padding: 0.75rem 1rem;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: var(--transition);
  position: relative;
}

.nav-list li a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 1rem;
  right: 1rem;
  height: 2px;
  background: var(--color-teal);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.nav-list li a:hover,
.nav-list li a.active {
  color: var(--color-white);
}

.nav-list li a:hover::after,
.nav-list li a.active::after {
  transform: scaleX(1);
}

/* ---- Hero / Page Header ---- */
.page-hero {
  background: linear-gradient(135deg, var(--color-ocean-mid) 0%, var(--color-ocean-light) 100%);
  color: var(--color-white);
  padding: 3rem 1.5rem;
  text-align: center;
}

.page-hero h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.page-hero p {
  font-size: 1.05rem;
  opacity: 0.85;
  max-width: 600px;
  margin: 0 auto;
}

/* ---- Main Content ---- */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* ---- Year Grid ---- */
.year-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.year-btn {
  padding: 0.85rem 0.5rem;
  border: 2px solid var(--color-gray-light);
  background: var(--color-white);
  color: var(--color-text);
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.year-btn:hover {
  border-color: var(--color-teal);
  color: var(--color-ocean-mid);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.year-btn.active {
  background: linear-gradient(135deg, var(--color-ocean-mid), var(--color-ocean-light));
  color: var(--color-white);
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(26, 138, 158, 0.35);
}

/* ---- Section Title ---- */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-ocean-deep);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--color-teal);
  display: inline-block;
}

.race-count {
  font-size: 0.9rem;
  color: var(--color-text-light);
  font-weight: 400;
  margin-left: 0.75rem;
}

/* ---- Race Table ---- */
.race-table-wrapper {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  margin-top: 1rem;
  animation: fadeSlideIn 0.4s ease;
}

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.race-table {
  width: 100%;
  border-collapse: collapse;
}

.race-table thead {
  background: linear-gradient(135deg, var(--color-ocean-dark), var(--color-ocean-deep));
  color: var(--color-white);
}

.race-table th {
  padding: 0.85rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: left;
  white-space: nowrap;
}

.race-table td {
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--color-gray-light);
  vertical-align: middle;
}

.race-table tbody tr {
  transition: var(--transition);
}

.race-table tbody tr:hover {
  background: var(--color-teal-pale);
}

.race-table tbody tr:last-child td {
  border-bottom: none;
}

/* Row number */
.row-num {
  color: var(--color-gray-mid);
  font-size: 0.8rem;
  font-weight: 600;
  width: 40px;
}

/* Date column */
.race-date {
  font-weight: 600;
  white-space: nowrap;
  color: var(--color-ocean-mid);
}

/* Race name link */
.race-name a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.race-name a:hover {
  color: var(--color-teal);
}

/* Category Badge */
.badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge-ep {
  background: var(--color-ep-bg);
  color: var(--color-ep);
}

.badge-gp {
  background: var(--color-gp-bg);
  color: var(--color-gp);
}

.badge-df {
  background: var(--color-df-bg);
  color: var(--color-df);
}

.badge-mixed {
  background: linear-gradient(135deg, var(--color-ep-bg), var(--color-gp-bg));
  color: var(--color-ocean-mid);
}

/* ---- No results ---- */
.no-results {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-light);
}

/* ---- Footer ---- */
.site-footer {
  background: var(--color-ocean-dark);
  color: rgba(255, 255, 255, 0.5);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.8rem;
}

.site-footer a {
  color: var(--color-teal-light);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--color-white);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-note {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  opacity: 0.6;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(10, 22, 40, 0.98);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .main-nav.open {
    display: block;
  }

  .nav-list {
    flex-direction: column;
  }

  .nav-list li a {
    padding: 0.85rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .nav-list li a::after {
    display: none;
  }

  .page-hero h1 {
    font-size: 1.6rem;
  }

  .page-hero p {
    font-size: 0.9rem;
  }

  .year-grid {
    grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
    gap: 0.5rem;
  }

  .year-btn {
    padding: 0.7rem 0.3rem;
    font-size: 0.95rem;
  }

  /* Make table scrollable on mobile */
  .race-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .race-table {
    min-width: 550px;
  }

  .race-table th,
  .race-table td {
    padding: 0.6rem 0.75rem;
    font-size: 0.82rem;
  }

  .section-title {
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  .site-title {
    font-size: 1.1rem;
  }

  .site-subtitle {
    font-size: 0.65rem;
  }

  .logo-icon {
    font-size: 1.5rem;
  }

  .header-inner {
    padding: 0.75rem 1rem;
  }

  .year-grid {
    grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
  }
}
