/*
 * TKD Roussin - shared design system (mobile-first).
 * Rolled out page by page; index.php is the first to use it.
 */

:root {
  --tkd-ink: #161412;
  --tkd-ink-soft: #38332a;
  --tkd-beige: #f4ecdf;
  --tkd-beige-mid: #e6d8bd;
  --tkd-beige-dark: #c9b48c;
  --tkd-cream: #fbf7ee;
  --tkd-red: #c1272d;
  --tkd-red-dark: #971f24;
  --tkd-blue: #1d4e89;

  --font-heading: 'Poppins', system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --container: 1140px;
  --radius: 14px;
  --shadow-sm: 0 2px 10px rgba(22, 20, 18, 0.08);
  --shadow-md: 0 12px 32px rgba(22, 20, 18, 0.16);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--tkd-beige);
  color: var(--tkd-ink);
  line-height: 1.55;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* ---------- Header / nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--tkd-ink);
  color: var(--tkd-beige);
  box-shadow: var(--shadow-sm);
}

.nav-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-block: 0.6rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-right: auto;
  text-decoration: none;
  color: var(--tkd-beige);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.lang-switch__item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 1.05rem;
  line-height: 1;
  text-decoration: none;
  opacity: 0.55;
  filter: grayscale(40%);
  transition: opacity 0.15s ease, filter 0.15s ease, background 0.15s ease;
}

.lang-switch__item:hover {
  opacity: 1;
  filter: grayscale(0%);
  background: rgba(244, 236, 223, 0.1);
}

.lang-switch__item.is-active {
  opacity: 1;
  filter: grayscale(0%);
  box-shadow: inset 0 0 0 2px var(--tkd-red);
}

.brand img {
  height: 40px;
  width: 40px;
  border-radius: 50%;
  background: var(--tkd-cream);
}

.nav-toggle-checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.nav-toggle-label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  cursor: pointer;
}

.nav-toggle-label span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--tkd-beige);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-links {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  background: var(--tkd-ink);
  border-top: 1px solid rgba(244, 236, 223, 0.12);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.nav-toggle-checkbox:checked ~ .nav-links {
  max-height: 400px;
}

.nav-links a {
  padding: 0.9rem 1.25rem;
  text-decoration: none;
  color: var(--tkd-beige);
  font-weight: 500;
  border-top: 1px solid rgba(244, 236, 223, 0.08);
}

.nav-links a:first-child { border-top: none; }

.nav-links a:hover,
.nav-links a.active {
  background: rgba(244, 236, 223, 0.08);
  color: var(--tkd-cream);
}

.nav-links a.active {
  box-shadow: inset 3px 0 0 var(--tkd-red);
}

@media (min-width: 768px) {
  .nav-toggle-label { display: none; }

  .nav-links {
    position: static;
    flex-direction: row;
    max-height: none;
    overflow: visible;
    background: transparent;
    border-top: none;
  }

  .nav-links a {
    border-top: none;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
  }

  .nav-links a.active { box-shadow: none; }

  .nav-links a:hover,
  .nav-links a.active {
    background: rgba(244, 236, 223, 0.1);
  }
}

/* ---------- Hero ---------- */

.hero {
  text-align: center;
  padding: 3rem 1.25rem 3.5rem;
}

.hero__logo {
  width: 150px;
  margin-inline: auto;
  margin-bottom: 1.5rem;
  filter: drop-shadow(var(--shadow-md));
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 5vw + 1rem, 3rem);
  font-weight: 700;
  margin: 0 0 0.6rem;
  color: var(--tkd-ink);
}

.hero p.tagline {
  font-size: clamp(1rem, 1vw + 0.85rem, 1.2rem);
  color: var(--tkd-ink-soft);
  max-width: 42ch;
  margin: 0 auto 2rem;
}

.cta-row {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-width: 320px;
  margin-inline: auto;
}

@media (min-width: 500px) {
  .cta-row {
    flex-direction: row;
    justify-content: center;
    max-width: none;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  font-size: 1rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover { transform: translateY(-2px); }

.btn--primary {
  background: var(--tkd-red);
  color: var(--tkd-cream);
  box-shadow: var(--shadow-sm);
}

.btn--primary:hover { background: var(--tkd-red-dark); }

.btn--outline {
  background: transparent;
  color: var(--tkd-ink);
  border: 2px solid var(--tkd-ink);
}

.btn--outline:hover { background: var(--tkd-ink); color: var(--tkd-cream); }

/* ---------- Social section ---------- */

.social {
  padding: 2rem 1.25rem 3rem;
  text-align: center;
  background: var(--tkd-beige-mid);
}

.social p {
  margin: 0 0 1rem;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--tkd-ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--tkd-ink);
  color: var(--tkd-cream);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, background 0.15s ease;
}

.social-link:hover {
  background: var(--tkd-blue);
  transform: translateY(-2px);
}

.social-link svg { width: 26px; height: 26px; fill: currentColor; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--tkd-ink);
  color: var(--tkd-beige-dark);
  text-align: center;
  padding: 1.75rem 1.25rem;
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--tkd-cream);
  text-decoration: none;
  font-weight: 600;
}

.site-footer a:hover { text-decoration: underline; }

/* ---------- Interior page hero (dojang / equipe / contact) ---------- */

.page-hero {
  background: var(--tkd-ink);
  color: var(--tkd-cream);
  text-align: center;
  padding: 2.75rem 1.25rem;
}

.page-hero h1 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.6rem, 3vw + 1rem, 2.4rem);
  margin: 0 0 0.5rem;
}

.page-hero p {
  color: var(--tkd-beige-dark);
  max-width: 50ch;
  margin: 0 auto;
}

/* ---------- Carousel (dojang.php) ---------- */

.carousel {
  max-width: 900px;
  margin: 2.5rem auto;
  padding-inline: 1.25rem;
}

.carousel__track {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  aspect-ratio: 4 / 3;
  background: var(--tkd-beige-mid);
}

.carousel__slide {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel__slide.is-active { display: block; }

.carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(22, 20, 18, 0.55);
  color: var(--tkd-cream);
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.carousel__arrow--prev { left: 0.75rem; }
.carousel__arrow--next { right: 0.75rem; }
.carousel__arrow:hover { background: var(--tkd-red); }

.carousel__dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.carousel__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--tkd-beige-dark);
  border: none;
  padding: 0;
  cursor: pointer;
}

.carousel__dot.is-active { background: var(--tkd-red); }

/* ---------- Team grid (equipe.php) ---------- */

.team-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding: 2.5rem 1.25rem 3rem;
  max-width: var(--container);
  margin-inline: auto;
}

@media (min-width: 640px) {
  .team-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1000px) {
  .team-grid { grid-template-columns: repeat(3, 1fr); }
}

.team-card {
  background: var(--tkd-cream);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.team-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.team-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.team-card__name {
  font-family: var(--font-heading);
  font-weight: 600;
  padding: 0.9rem 0.75rem 0.3rem;
  margin: 0;
  font-size: 1.02rem;
}

.team-card__rank {
  background: var(--tkd-ink);
  color: var(--tkd-beige);
  margin: 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- Contact form (contact.php) ---------- */

.contact-section {
  max-width: 640px;
  margin: 2.5rem auto;
  padding: 0 1.25rem 3rem;
}

.contact-card {
  background: var(--tkd-cream);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.75rem;
}

.contact-card h1 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin: 0 0 1.25rem;
}

.form-group {
  margin-bottom: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label { font-weight: 600; font-size: 0.92rem; color: var(--tkd-ink-soft); }

.form-group input[type=text],
.form-group input[type=email],
.form-group textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--tkd-beige-dark);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--tkd-beige);
  color: var(--tkd-ink);
}

.form-group textarea { resize: vertical; min-height: 120px; }

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--tkd-red);
  box-shadow: 0 0 0 3px rgba(193, 39, 45, 0.15);
}

.captcha-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 1.1rem;
}

.captcha-row img {
  width: 160px;
  height: 54px;
  border-radius: 8px;
  border: 1px solid var(--tkd-beige-dark);
}

.captcha-row input[type=text] {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--tkd-beige-dark);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--tkd-beige);
  color: var(--tkd-ink);
}

.captcha-row input[type=text]:focus {
  outline: none;
  border-color: var(--tkd-red);
  box-shadow: 0 0 0 3px rgba(193, 39, 45, 0.15);
}

.captcha-refresh { font-size: 0.85rem; color: var(--tkd-ink-soft); }
.captcha-refresh a { color: var(--tkd-blue); font-weight: 600; text-decoration: none; }
.captcha-refresh a:hover { text-decoration: underline; }

.form-status {
  padding: 0.7rem 1rem;
  border-radius: 8px;
  margin-bottom: 1.1rem;
  font-weight: 600;
  text-align: center;
}

.form-status--ok { background: #e4f3e6; color: #1e6b2e; }
.form-status--error { background: #fbe6e6; color: var(--tkd-red-dark); }

.btn--block {
  width: 100%;
  border: none;
  cursor: pointer;
}

/* ---------- Small form utilities (login / reset / create-new-pass) ---------- */

.form-group--inline { flex-direction: row; align-items: center; }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: var(--tkd-ink-soft);
  cursor: pointer;
}

.checkbox-label input[type=checkbox] {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--tkd-red);
}

.form-footnote {
  text-align: center;
  margin: 1.1rem 0 0;
  font-size: 0.92rem;
}

.form-footnote a { color: var(--tkd-blue); font-weight: 600; text-decoration: none; }
.form-footnote a:hover { text-decoration: underline; }

/* ---------- Plain data table (admin-only debug views) ---------- */

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--tkd-cream);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--tkd-beige-dark);
  text-align: left;
}

.data-table th {
  background: var(--tkd-ink);
  color: var(--tkd-beige);
  font-family: var(--font-heading);
  font-weight: 600;
}

.data-table tr:last-child td { border-bottom: none; }
