/* ============================================================
   Kuk Sool Won — Responsive, ADA (WCAG 2.2 AA) & Print CSS
   Linked after kswStyles.css in all pages
   ============================================================ */

/* ── Visually hidden (ADA screen-reader only) ──────────────── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ── Skip-to-content (ADA) ─────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 8px;
  background: #CC0000;
  color: #fff;
  padding: 8px 16px;
  font-weight: bold;
  font-size: 0.9em;
  border-radius: 0 0 4px 4px;
  text-decoration: none;
  z-index: 9999;
  transition: top 0.15s;
}
.skip-link:focus {
  top: 0;
}

/* ── Focus visible states (ADA keyboard nav) ────────────────── */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #F5C300;
  outline-offset: 2px;
}
/* Remove default outline only when our custom one is showing */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none;
}

/* ── Hamburger nav toggle (mobile) ─────────────────────────── */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px 14px;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #ddd;
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.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);
}

/* ── Reduced-motion (ADA) ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .bg-slide { transition: none !important; }
  #hero-img-wrap img { animation: none !important; }
}

/* ── Kids section ───────────────────────────────────────────── */
.kids-intro {
  font-size: 1em;
  color: #333;
  margin-bottom: 20px;
  line-height: 1.8;
}
.kids-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 16px;
}
.kids-card {
  border-radius: 6px;
  overflow: hidden;
  border: 3px solid #CC0000;
  box-shadow: 0 3px 14px rgba(0,0,0,0.12);
  transition: transform 0.2s, box-shadow 0.2s;
}
.kids-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 22px rgba(204,0,0,0.2);
}
.kids-card img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  display: block;
}
.kids-card-label {
  background: #111;
  color: #F5C300;
  text-align: center;
  font-size: 0.72em;
  font-weight: bold;
  letter-spacing: 0.1em;
  padding: 6px 4px;
  text-transform: uppercase;
}

/* Championship flag section */
.flag-section {
  display: flex;
  gap: 30px;
  align-items: flex-start;
  margin-top: 16px;
}
.flag-photo {
  flex-shrink: 0;
  width: 280px;
}
.flag-photo img {
  width: 100%;
  height: auto;
  border: 3px solid #F5C300;
  display: block;
}
.flag-text { flex: 1; }
/* Achievement callout box — replaces old flag-placeholder */
.flag-callout {
  margin: 18px 0;
  padding: 16px 22px;
  border-left: 4px solid #CC0000;
  background: #fff8f8;
  border-radius: 0 4px 4px 0;
  font-size: 0.95em;
  line-height: 1.7;
  color: #222;
}

/* ── Tablet (max 900px) ─────────────────────────────────────── */
@media (max-width: 900px) {
  #page-wrapper,
  #site-header {
    width: 100%;
  }
  /* Testimonials drop to 2-col on tablet */
  .testimonials-grid { grid-template-columns: 1fr 1fr; }
  .content-card {
    padding: 24px 20px;
  }
  .about-grid {
    flex-direction: column;
  }
  /* Intro slideshow — shorter on tablet */
  #intro { height: 60vh; min-height: 320px; }
  .intro-brand h1 { font-size: 1.6em; }
  .flag-section {
    flex-direction: column;
  }
  .flag-photo {
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
  }
  .contact-grid {
    flex-direction: column;
  }
  .contact-info-col {
    width: 100%;
  }
  .kids-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .schedule-table {
    font-size: 0.72em;
  }
}

/* ── Mobile (max 640px) ─────────────────────────────────────── */
@media (max-width: 640px) {
  body { font-size: 14px; }

  /* Show hamburger, hide nav list by default */
  .nav-toggle { display: flex; }
  .kslinks { position: relative; }
  .kslinks ul {
    display: none;           /* hidden until hamburger tapped */
    flex-direction: column;
    padding: 0;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(10,10,10,0.98);
    z-index: 1001;           /* above everything including bg-layer */
    border-bottom: 3px solid #CC0000;
    width: 100%;             /* 100% not 100vw — Chrome iOS adds scrollbar gutter to vw */
  }
  .kslinks ul.open { display: flex; }
  .kslinks li { display: block; width: 100%; }
  .kslinks li a {
    border-right: none;
    border-bottom: 1px solid #2a2a2a;
    padding: 13px 18px;    /* 13px top+bottom + border = ~44px WCAG touch target */
    min-height: 44px;
    display: flex;
    align-items: center;
    font-size: 13px;
  }
  .kslinks-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  /* Intro slideshow — shorter on mobile */
  #intro { height: 50vh; min-height: 220px; }
  .intro-brand h1 { font-size: 1.25em; }
  .intro-brand { padding: 16px 16px 14px; }

  /* Header compact — stack logo+title, hide social icons to save space */
  #header { height: auto; padding: 8px 10px; flex-wrap: nowrap; align-items: center; }
  #header-title-area .site-name    { font-size: 1em; }
  #header-title-area .site-tagline { font-size: 0.6em; }
  #header-social { display: none; } /* hidden on mobile — links are in nav */

  /* Hero */
  .hero-overlay-text h1 { font-size: 1.5em; }
  .hero-overlay-text p  { font-size: 0.8em; }
  #home { min-height: 85vh; }

  /* Content */
  .content-section { padding: 50px 10px 40px; }
  .content-card { padding: 18px 14px; }  /* tighter side padding on narrow screens */
  .content-card h2 { font-size: 1.3em; }

  /* Schedule table — horizontal scroll */
  .schedule-table-wrap {
    width: 100%;              /* explicit 100% so Chrome measures container, not content */
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .schedule-table { min-width: 560px; font-size: 0.7em; }

  /* Kids grid single column on very small */
  .kids-grid { grid-template-columns: 1fr 1fr; }
  .kids-card img { height: 160px; }
  .curriculum-grid    { grid-template-columns: 1fr; }
  .schedule-split     { grid-template-columns: 1fr; }
  .testimonials-grid  { grid-template-columns: 1fr; }

  /* Hero gone — kill any lingering hero refs */
  .hero-overlay-text, .scroll-hint { display: none !important; }
}

/* ── Print styles ───────────────────────────────────────────── */
@media print {
  #bg-layer, #site-header .kslinks, .skip-link,
  .gallery-controls, .thumb-strip, .scroll-hint { display: none !important; }
  body { background: white; color: black; font-size: 12pt; }
  .content-card { box-shadow: none; border: 1px solid #ccc; }
  #page-wrapper { width: 100%; }
  #footer { background: white; color: black; border-top: 1px solid #ccc; }
  a[href]::after { content: ' (' attr(href) ')'; font-size: 0.75em; color: #555; }
}
