/* ============================================================
   Kuk Sool Won of Dublin — Phase 2 Stylesheet
   Single-page scroll experience with parallax backgrounds
   Palette: Black | Deep Red | Gold | White
   ============================================================ */

/* ----- Reset & Base ----- */
*, *::before, *::after { box-sizing: border-box; }

/* All images are fluid by default — they shrink but never overflow.
   height:auto is intentionally NOT set globally — it would override
   the logo's HTML height="55" attribute and blow up the header.      */
img { max-width: 100%; }

/* Content images (not UI chrome) should scale proportionally */
.content-card img,
.about-photo img,
.instructor-photo-wrap img,
.kids-card img,
.flag-photo img {
  height: auto;
}

/* Chrome iOS fix: flex children default to min-width:auto which lets them
   blow past their container. Setting min-width:0 on every flex/grid child
   allows them to shrink properly. Safari is forgiving; Chrome is not. */
.content-card,
.about-grid > *,
.instructor-row > *,
.contact-grid > *,
.flag-section > *,
.schedule-split > *,
.curriculum-grid > *,
#header > *,
.kslinks-inner > * {
  min-width: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: Verdana, Arial, Georgia, sans-serif;
  font-size: 15px;
  color: #111;
  background: #0a0a0a;
  line-height: 1.65;
}

/* ----- Fixed background layer (sits behind everything) ----- */
#bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.bg-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center center;
  opacity: 0;
  transition: opacity 2.5s ease;
}

/* Portrait photos (taller than wide) use contain so they are not
   zoomed in on a landscape screen. Black bars on the sides blend
   with the dark body background and overlay.                      */
.bg-slide.bg-portrait {
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center center;
}

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

#bg-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
}

/* ----- Page wrapper (max 1024px, centered, above bg) ----- */
#page-wrapper {
  position: relative;
  z-index: 2;
  max-width: 1024px;
  width: 100%;
  margin: 0 auto;
  background: transparent;
}

/* ----- STICKY HEADER ----- */
#site-header {
  position: -webkit-sticky; /* Chrome iOS needs the vendor prefix */
  position: sticky;
  top: 0;
  z-index: 1000;
  max-width: 1024px;
  width: 100%;
  margin: 0 auto;
}

#header {
  background: rgba(10, 10, 10, 0.97);
  padding: 0;
  display: flex;
  align-items: center;
  height: 76px;
  border-bottom: 2px solid #CC0000;
}

#header-logo-area {
  padding: 8px 12px;
  flex-shrink: 0;
}

#header-logo-area img {
  height: 55px;   /* explicit CSS beats any global img rule */
  width: auto;
  display: block;
}

#header-title-area {
  flex: 1;
  padding: 6px 0;
}

#header-title-area .site-name {
  color: #FFFFFF;
  font-size: 1.35em;
  font-weight: bold;
  font-family: Georgia, 'Times New Roman', serif;
  letter-spacing: 0.04em;
  margin: 0;
  padding: 0;
  line-height: 1.2;
}

#header-title-area .site-tagline {
  color: #F5C300;
  font-size: 0.72em;
  font-style: italic;
  letter-spacing: 0.08em;
  margin: 3px 0 0 0;
  padding: 0;
}

/* Social icons in header (replaced Taeguk) */
#header-social {
  padding: 8px 14px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

#header-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: opacity 0.18s, transform 0.18s;
}

#header-social a:hover {
  opacity: 0.8;
  transform: translateY(-2px);
}

#header-social img {
  display: block;
  width: 30px;
  height: 30px;
  object-fit: contain;
}

/* ----- NAVIGATION BAR ----- */
.kslinks {
  background: rgba(10, 10, 10, 0.95);
  border-top: 1px solid #333;
  border-bottom: 3px solid #CC0000;
  position: relative;   /* mobile dropdown anchors here */
}

.kslinks ul {
  margin: 0;
  padding: 0;
  font: bold 11.5px Arial, sans-serif;
  list-style: none;
  display: flex;         /* flex replaces floats — no clearfix needed */
  flex-direction: row;
  flex-wrap: wrap;
}

.kslinks li { display: block; margin: 0; }

.kslinks li a {
  display: flex;
  align-items: center;
  text-decoration: none;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #CCCCCC;
  background: transparent;
  padding: 9px 16px 8px;
  border-right: 1px solid #2a2a2a;
  transition: background 0.18s, color 0.18s;
  white-space: nowrap;
}

.kslinks li a:hover,
.kslinks li a.selected {
  color: #FFFFFF;
  background: #CC0000;
}

/* ----- INTRO SECTION (full-viewport slideshow) ----- */
#intro {
  width: 100%;           /* fluid — never forces a wider layout viewport */
  max-width: 1024px;     /* caps to page width on desktop */
  margin: 0 auto;
  height: calc(100vh - 118px);
  position: relative;
  overflow: hidden;
  background: #060606;
}

/* Slideshow container: clips slides entering/leaving */
.slideshow {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

/* Each slide: fills the full section, starts off-screen right */
.slide {
  position: absolute;
  inset: 0;
  transform: translateX(100%);
}

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

/* Portrait slides — anchor top so faces show, not feet */
.slide:nth-child(1) img { object-position: center top; } /* swords portrait */
.slide:nth-child(2) img { object-position: center top; } /* kick portrait   */

/* Brand overlay — always visible above the slideshow */
.intro-brand {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 44px 32px 30px;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.85) 0%,
    rgba(0,0,0,0.50) 55%,
    transparent 100%
  );
  z-index: 20;
  text-align: center;
}

.intro-brand h1 {
  font-family: Georgia, serif;
  font-size: 2em;
  color: #fff;
  margin: 0 0 6px;
  text-shadow: 0 2px 16px rgba(0,0,0,1);
  letter-spacing: 0.04em;
}

.intro-brand .brand-alt {
  display: block;
  color: #F5C300;
  font-size: 0.7em;
  font-weight: bold;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 18px;
  text-shadow: 0 1px 8px rgba(0,0,0,0.9);
}

.intro-brand .brand-cta {
  display: inline-block;
  background: #CC0000;
  color: #fff;
  padding: 10px 26px;
  font-size: 0.76em;
  font-weight: bold;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 2px;
  transition: background 0.2s;
}

.intro-brand .brand-cta:hover { background: #990000; }

/* Scroll hint — bobs gently at the very bottom */
.intro-scroll-hint {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.55);
  font-size: 0.65em;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  z-index: 30;
  white-space: nowrap;
  animation: hintBob 2s ease-in-out infinite;
}

@keyframes hintBob {
  0%, 100% { transform: translateX(-50%) translateY(0);   }
  50%       { transform: translateX(-50%) translateY(5px); }
}

/* ----- CONTENT SECTIONS ----- */
.content-section {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 70px 20px 60px;
  overflow: hidden; /* contain any child wider than the section */
}

.content-card {
  background: rgba(255, 255, 255, 0.93);
  border-radius: 3px;
  padding: 36px 44px;
  width: 100%;
  max-width: 100%;       /* never overflow the wrapper on any screen */
  box-sizing: border-box;
  box-shadow: 0 8px 40px rgba(0,0,0,0.45);
  border-top: 4px solid #CC0000;
  position: relative;
}

/* ----- TYPOGRAPHY (inside cards) ----- */
.content-card h2 {
  font-family: Georgia, serif;
  color: #111;
  font-size: 1.65em;
  margin: 0 0 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid #ccc;  /* was 3px gold — lighter so it reads as decoration not divider */
}

.content-card h3 {
  color: #CC0000;
  border-bottom: 1px solid #ddd;  /* was 2px gold — same treatment as h2 */
  padding-bottom: 4px;
  margin: 18px 0 10px;
  font-size: 1.1em;
}

/* Curriculum 2-column grid */
.curriculum-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 28px;
  margin-top: 14px;
}

/* Curriculum subtitle — italic tagline below h2 */
.curriculum-subtitle {
  font-style: italic;
  color: #CC0000;
  font-size: 0.92em;
  margin: -4px 0 16px;
  letter-spacing: 0.02em;
}

/* Curriculum note — the 24-weapons asterisk paragraph */
.curriculum-note {
  background: #fffcf0;
  border-left: 4px solid #F5C300;
  padding: 10px 14px;
  margin: 10px 0 4px;
  font-size: 0.88em;
  border-radius: 0 4px 4px 0;
}

.content-card p {
  margin: 0 0 12px;
  text-align: justify;
  line-height: 1.75;
  font-size: 0.9em;
}

.content-card a { color: #CC0000; text-decoration: none; }
.content-card a:hover { color: #990000; text-decoration: underline; }

/* ----- ABOUT SECTIONS — side-by-side photo + text ----- */
.about-grid {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

.about-photo {
  flex-shrink: 0;
  width: 320px;
}

.about-photo img {
  width: 100%;
  height: auto;
  border: 3px solid #CC0000;
  display: block;
}

.about-text {
  flex: 1;
}

.about-sub-links {
  margin-top: 18px;
  padding: 10px 14px;
  background: #f9f9f9;
  border-left: 4px solid #CC0000;
  font-size: 0.82em;
}

.about-sub-links a {
  display: inline-block;
  margin-right: 14px;
  color: #CC0000;
  font-weight: bold;
}

/* ----- SCHEDULE TABLE ----- */
.schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8em;
  margin-top: 14px;
}

.schedule-table th {
  background: #fff;
  color: #111;
  padding: 7px 4px;
  text-align: center;
  border: 1px solid #CC0000;
  letter-spacing: 0.04em;
  font-weight: bold;
}

.schedule-table td {
  border: 1px solid #CC0000;
  padding: 5px 3px;
  text-align: center;
  height: 30px;
  vertical-align: middle;
}

.schedule-table tr:nth-child(even) td { background: #f9f9f9; }
.schedule-table td.h-col  { background: #fff !important; color: #111 !important; font-weight: bold; }
.schedule-table th.h-col  { background: #fff !important; color: #111 !important; font-weight: bold; }
.schedule-table td.t-open { color: #880000; font-weight: bold; font-size: 0.9em; }
.schedule-table td.t-child { color: #7a5500; font-weight: bold; font-size: 0.9em; }
.schedule-table td.t-private { color: #444; font-style: italic; }
.sparring-note { display: block; font-size: 0.72em; font-weight: normal;
  color: #CC0000; letter-spacing: 0.04em; }

/* Etiquette + Creed 2-col split */
.schedule-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 28px;
  margin: 14px 0 20px;
  align-items: start;
}

/* Etiquette list */
.schedule-etiquette {
  margin: 8px 0 16px 22px;
  font-size: 0.9em;
  line-height: 1.9;
}

/* Student creed box */
.student-creed {
  border-left: 4px solid #CC0000;
  background: #fff8f8;
  padding: 14px 20px;
  margin: 16px 0;
  border-radius: 0 4px 4px 0;
  font-size: 0.9em;
}
/* ----- TESTIMONIALS ----- */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 18px;
}

.testimonial-card {
  border: 2px solid #CC0000;
  border-radius: 6px;
  padding: 18px 18px 14px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.testimonial-title {
  font-weight: bold;
  color: #CC0000;
  font-size: 0.95em;
  border-bottom: 2px solid #F5C300;
  padding-bottom: 6px;
  margin-bottom: 4px;
}

.testimonial-card blockquote {
  margin: 0;
  font-size: 0.88em;
  line-height: 1.75;
  color: #333;
  font-style: italic;
  flex: 1;
}

.testimonial-card blockquote p { margin: 0 0 8px; }
.testimonial-card blockquote p:last-child { margin-bottom: 0; }

.testimonial-card cite {
  display: block;
  font-style: normal;
  font-weight: bold;
  font-size: 0.82em;
  color: #555;
  text-align: right;
  margin-top: 8px;
}

/* ----- GALLERY (reuse from phase 1 but compacted) ----- */
.carousel-stage-img {
  width: 100%;
  height: 460px;
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #CC0000;
  margin-bottom: 6px;
}

.carousel-stage-img img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.thumb-strip {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 5px;
  padding: 6px 0;
  background: #f0f0f0;
  border: 1px solid #ccc;
}

.thumb-strip img {
  height: 70px;
  width: auto;
  cursor: pointer;
  border: 2px solid transparent;
  flex-shrink: 0;
  transition: border-color 0.15s;
}

.thumb-strip img:hover, .thumb-strip img.active { border-color: #CC0000; }

.gallery-controls {
  margin-top: 8px;
  text-align: center;
}

.gallery-controls button {
  background: #CC0000;
  color: #fff;
  border: none;
  padding: 7px 20px;
  font-size: 1.05em;
  cursor: pointer;
  margin: 0 5px;
  border-radius: 2px;
  font-weight: bold;
  transition: background 0.15s;
}

.gallery-controls button:hover { background: #990000; }
.gallery-counter { display: inline-block; min-width: 55px; font-weight: bold; color: #333; font-size: 0.88em; vertical-align: middle; }

/* ----- CONTACT ----- */
.contact-grid { display: flex; gap: 24px; }
.contact-info-col { flex-shrink: 0; width: 310px; }
.contact-detail {
  margin: 7px 0;
  padding: 8px 12px;
  border-left: 4px solid #CC0000;
  background: #f9f9f9;
  line-height: 1.9;
  font-size: 0.88em;
}
.contact-detail strong { display: inline-block; min-width: 80px; }

/* ----- EVENTS BOX ----- */
.events-box {
  margin-top: 12px;
  padding: 12px 14px;
  background: #fafafa;
  border-left: 4px solid #CC0000;
  font-size: 0.88em;
  line-height: 1.85;
}

/* ----- SOCIAL ICONS ----- */
.social-icons { margin-top: 14px; }
.social-icons img { margin-right: 6px; vertical-align: middle; transition: opacity 0.15s; }
.social-icons img:hover { opacity: 0.75; }

/* ----- FOOTER ----- */
#footer {
  background: rgba(10, 10, 10, 0.97);
  color: #999;
  font-size: 0.75em;
  text-align: center;
  padding: 16px 0;
  border-top: 3px solid #CC0000;
  position: relative;
  z-index: 2;
}

#footer span { display: block; line-height: 1.9; }

/* ----- BREADCRUMB ----- */
.breadcrumb { font-size: 0.8em; color: #666; margin-bottom: 14px; }
.breadcrumb a { color: #CC0000; }

/* Symmetrical 50/50 split and float wrap for About card */
.about-wrap-photo {
  float: right;
  width: 50%;
  max-width: 500px;
  margin-left: 24px;
  margin-bottom: 16px;
}

.about-wrap-photo img {
  width: 100%;
  height: auto;
  border: 3px solid #CC0000;
  display: block;
}

@media (max-width: 600px) {
  .about-wrap-photo {
    float: none;
    width: 100%;
    margin-left: 0;
    margin-bottom: 16px;
  }
}

/* Float wrap for Master Saidi card */
.saidi-wrap-photo {
  float: left;
  width: 50%;
  max-width: 500px;
  margin-right: 24px;
  margin-bottom: 16px;
}

.saidi-wrap-photo img {
  width: 100%;
  height: auto;
  border: 3px solid #CC0000;
  display: block;
}

@media (max-width: 600px) {
  .saidi-wrap-photo {
    float: none;
    width: 100%;
    margin-right: 0;
    margin-bottom: 16px;
  }
}

/* ── Instructor alternating photo layout ───────────────────── */
.instructor-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 36px;           /* extra space so the gold bar breathes */
  padding-bottom: 32px;
  border-bottom: 3px solid #F5C300; /* was 1px faint — thick gold clearly marks each new instructor */
}

/* Last row needs no divider — nothing follows it */
.instructor-row:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Even instructors: image on left, text on right */
.instructor-row.img-left {
  flex-direction: row;
}

/* Odd instructors: text on left, image on right */
.instructor-row.img-right {
  flex-direction: row-reverse;
}

.instructor-photo-wrap {
  flex: 0 0 26%;
  max-width: 240px;
  position: relative;
  align-self: flex-start; /* text scrolls past image freely */
}

.instructor-photo-wrap img {
  width: 100%;
  height: auto;
  display: block;
  border: 3px solid #CC0000;
  border-radius: 2px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.25);
}

/* "Image Coming Soon" overlay */
.instructor-coming-soon {
  position: absolute;
  inset: 3px; /* aligns with border */
  background: rgba(0, 0, 0, 0.58);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #F5C300;
  font-size: 1.05em;
  font-weight: bold;
  letter-spacing: 0.06em;
  text-align: center;
  text-shadow: 0 2px 6px rgba(0,0,0,0.7);
  gap: 8px;
  border-radius: 2px;
}

.instructor-coming-soon span {
  background: rgba(0,0,0,0.45);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 1em;
}

.instructor-text {
  flex: 1;
  min-width: 0;
}

.instructor-text h3 {
  margin-top: 0;
}

@media (max-width: 750px) {
  .instructor-row,
  .instructor-row.img-left,
  .instructor-row.img-right {
    flex-direction: column !important;
  }
  .instructor-photo-wrap {
    max-width: 200px; /* stays portrait-sized on mobile too */
    width: 100%;
  }
}
