/* ============================================================
   DOOWON-HAPKIDO.LV — REDESIGN
   Mobile-first, responsive
   ============================================================ */

/* ---- VARIABLES ---- */
:root {
  --c-bg:        #0a0c10;
  --c-surface:   #12151c;
  --c-surface2:  #1c2030;
  --c-border:    #2a2f3e;
  --c-text:      #e8eaf0;
  --c-muted:     #7a8099;
  --c-accent:    #c9a84c;
  --c-accent-dk: #a88635;
  --c-red:       #c0392b;
  --c-white:     #ffffff;

  /* Oswald is the display/title face (full Latin + Cyrillic). Bebas Neue kept as
     a fallback; Impact/sans-serif as last resort. */
  --font-display: 'Oswald', 'Bebas Neue', 'Impact', sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;

  --radius:  8px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);

  --nav-h: 68px;
}

/* ---- RESET & BASE ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ---- CONTAINER ---- */
.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- SECTIONS ---- */
.section      { padding: 72px 0; }
.section-dark { padding: 72px 0; background: var(--c-surface); }
.section-gray { padding: 72px 0; background: var(--c-surface2); }

.section-header { margin-bottom: 48px; }
.section-header.center { text-align: center; }
.section-header h2 { font-family: var(--font-display); font-size: clamp(32px, 5vw, 52px); letter-spacing: 1px; line-height: 1.1; margin-bottom: 12px; }
.section-header p { color: var(--c-muted); max-width: 540px; }
.section-header.center p { margin: 0 auto; }

.section-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: 10px;
}
.section-label.light { color: var(--c-accent); }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-decoration: none;
}
.btn-lg { padding: 15px 32px; font-size: 16px; }
.btn-primary  { background: var(--c-accent); color: var(--c-bg); border-color: var(--c-accent); }
.btn-primary:hover  { background: var(--c-accent-dk); border-color: var(--c-accent-dk); }
.btn-outline  { background: transparent; color: var(--c-accent); border-color: var(--c-accent); }
.btn-outline:hover  { background: rgba(201,168,76,0.1); }
.btn-ghost    { background: transparent; color: var(--c-white); border-color: rgba(255,255,255,0.3); }
.btn-ghost:hover    { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.5); }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(10, 12, 16, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-border);
  transition: background 0.3s;
}
.site-header.scrolled {
  background: rgba(10, 12, 16, 0.98);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 100%;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.logo-mark {
  height: 36px;
  width: auto;
  display: block;
  flex-shrink: 0;
}
.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.logo-text strong {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--c-white);
}
.logo-text em {
  font-size: 11px;
  font-style: normal;
  color: var(--c-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* Desktop Nav */
.main-nav { margin-left: auto; }
.main-nav > ul {
  display: flex;
  gap: 4px;
}
.main-nav > ul > li { position: relative; }
.main-nav > ul > li > a {
  display: block;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--c-muted);
  border-radius: var(--radius);
  transition: color 0.2s, background 0.2s;
}
.main-nav > ul > li > a:hover { color: var(--c-white); background: rgba(255,255,255,0.06); }
.main-nav > ul > li.has-dropdown:hover > a { color: var(--c-accent); }

/* Dropdown */
.dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: var(--shadow);
  z-index: 200;
}
.has-dropdown:hover .dropdown { display: block; }
/* invisible bridge over the 8px gap so hover isn't lost on the way down */
.dropdown::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 8px;
}
.dropdown li a {
  display: block;
  padding: 9px 12px;
  font-size: 14px;
  color: var(--c-muted);
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.dropdown li a:hover { color: var(--c-text); background: rgba(255,255,255,0.06); }

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

/* Language switcher */
.lang-switcher {
  display: flex;
  gap: 2px;
}
.lang {
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--c-muted);
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.lang:hover, .lang.active { color: var(--c-accent); background: rgba(201,168,76,0.1); }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
  margin-left: auto;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--c-text);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ============================================================
   MOBILE MENU
   ============================================================ */
.mobile-menu {
  position: fixed;
  top: 0; right: -320px;
  width: min(320px, 90vw);
  height: 100vh;
  background: var(--c-surface);
  z-index: 300;
  padding: 80px 28px 40px;
  overflow-y: auto;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--c-border);
}
.mobile-menu.open { right: 0; }
.mobile-menu-close {
  position: absolute;
  top: 20px; right: 20px;
  background: none;
  border: none;
  color: var(--c-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
}
.mobile-section {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--c-accent);
  margin: 24px 0 8px;
}
.mobile-menu nav ul > li:first-child .mobile-section { margin-top: 0; }
.mobile-menu nav ul ul li a {
  display: block;
  padding: 9px 0;
  color: var(--c-muted);
  font-size: 15px;
  border-bottom: 1px solid var(--c-border);
  transition: color 0.15s;
}
.mobile-menu nav ul ul li:last-child a { border-bottom: none; }
.mobile-menu nav ul ul li a:hover { color: var(--c-text); }
.mobile-footer {
  margin-top: auto;
  padding-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 250;
  backdrop-filter: blur(2px);
}
.mobile-overlay.show { display: block; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  display: grid;
  align-items: end;
  min-height: 100svh;
  padding: calc(var(--nav-h) + 72px) 0 38px;
  overflow: hidden;
  color: var(--c-white);
}
.hero-media,
.hero-overlay {
  position: absolute;
  inset: 0;
}
.hero-media {
  background: url("../img/header.jpg") center 36% / cover no-repeat;
  transform: scale(1.03);
}
.hero-overlay {
  background:
    linear-gradient(90deg, rgba(5, 12, 16, 0.9) 0%, rgba(5, 12, 16, 0.64) 48%, rgba(5, 12, 16, 0.3) 100%),
    linear-gradient(0deg, rgba(10, 12, 16, 0.94) 0%, rgba(10, 12, 16, 0) 48%);
}
.hero-content {
  position: relative;
  z-index: 1;
  padding-top: 54px;
  padding-bottom: 80px;
}
.hero-badge {
  margin: 0 0 16px;
  color: var(--c-accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}
.hero-title {
  max-width: 860px;
  font-family: var(--font-display);
  font-size: clamp(48px, 7vw, 108px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--c-white);
  margin-bottom: 22px;
}
.hero-sub {
  max-width: 620px;
  margin-bottom: 32px;
  color: rgba(255, 255, 255, 0.84);
  font-size: clamp(16px, 1.8vw, 21px);
  line-height: 1.6;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.hero-panel {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.hero-panel div {
  min-height: 106px;
  padding: 22px;
  background: rgba(5, 12, 16, 0.28);
}
.stat {
  display: block;
  color: var(--c-white);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
}
.stat-label {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 14px;
  line-height: 1.45;
}

/* ============================================================
   ABOUT STRIP
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}
.about-text h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.1;
  margin-bottom: 16px;
}
.about-text p {
  color: var(--c-muted);
  margin-bottom: 16px;
  line-height: 1.8;
}
.about-text .btn { margin-top: 8px; }

.about-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.feature-card {
  background: var(--c-surface2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  transition: border-color 0.2s, transform 0.2s;
}
.feature-card:hover { border-color: var(--c-accent); transform: translateY(-3px); }
.feature-icon { font-size: 28px; margin-bottom: 12px; }
.feature-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.feature-card p { font-size: 13px; color: var(--c-muted); line-height: 1.6; }

/* ============================================================
   SCHEDULE
   ============================================================ */
.schedule-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}
.schedule-card {
  background: var(--c-surface2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  transition: border-color 0.2s;
}
.schedule-card.active { border-color: var(--c-accent); }
.schedule-card .day { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.schedule-card .time {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--c-accent);
  margin-bottom: 10px;
}
.schedule-card .location { font-size: 13px; color: var(--c-muted); }
.schedule-cta { text-align: center; }

/* ============================================================
   BELT / PROGRAM
   ============================================================ */
.belt-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.belt-card {
  display: flex;
  gap: 14px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color 0.2s;
}
.belt-card:hover { border-color: var(--c-accent); }
.belt-bar {
  width: 6px;
  border-radius: 3px;
  background: var(--belt-color);
  flex-shrink: 0;
}
.belt-info { flex: 1; min-width: 0; }
.cup-label { font-size: 13px; font-weight: 700; color: var(--c-accent); display: block; margin-bottom: 8px; }
.belt-info ul li {
  font-size: 12px;
  color: var(--c-muted);
  padding: 3px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  line-height: 1.4;
}
.belt-info ul li:last-child { border-bottom: none; }
.program-note { text-align: center; }

/* ============================================================
   NEWS
   ============================================================ */
.news-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 36px;
}
.news-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.2s;
}
.news-card:hover { border-color: var(--c-accent); transform: translateY(-3px); }
.news-card-featured { background: linear-gradient(135deg, var(--c-surface2), var(--c-surface)); }
.news-date { font-size: 12px; color: var(--c-accent); font-weight: 600; margin-bottom: 10px; }
.news-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 10px; line-height: 1.4; }
.news-card h3 a:hover { color: var(--c-accent); }
.news-card p { font-size: 13px; color: var(--c-muted); flex: 1; line-height: 1.7; }
.news-link { font-size: 13px; font-weight: 600; color: var(--c-accent); margin-top: 16px; }
.news-more { text-align: center; }

/* ============================================================
   MATERIALS
   ============================================================ */
.material-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.7fr);
  gap: 16px;
}
.material-feature,
.material-row,
.contact-panel {
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.material-feature {
  display: flex;
  min-height: 340px;
  flex-direction: column;
  justify-content: flex-end;
  padding: 30px;
  background:
    linear-gradient(135deg, rgba(10, 12, 16, 0.35), rgba(10, 12, 16, 0.92)),
    url("../img/header.jpg") center / cover;
  color: var(--c-white);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.material-feature span,
.material-row span {
  display: block;
  margin-bottom: 28px;
  color: var(--c-accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.material-feature h3 {
  max-width: 560px;
  margin-bottom: 12px;
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 800;
  line-height: 1.04;
}
.material-feature p {
  max-width: 520px;
  color: rgba(255, 255, 255, 0.78);
}
.material-stack {
  display: grid;
  gap: 16px;
}
.material-row {
  display: grid;
  align-content: space-between;
  min-height: 162px;
  padding: 24px;
  background: var(--c-surface);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.material-row strong {
  font-size: 21px;
  line-height: 1.25;
}
.material-feature:hover,
.material-row:hover {
  transform: translateY(-3px);
  border-color: var(--c-accent);
  box-shadow: var(--shadow);
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact-band {
  background: var(--c-bg);
}
.contact-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: center;
  padding: clamp(26px, 4vw, 44px);
  background:
    linear-gradient(135deg, rgba(28, 32, 48, 0.94), rgba(18, 21, 28, 0.98)),
    url("../img/header.jpg") center / cover;
  box-shadow: var(--shadow);
}
.contact-panel h2 {
  max-width: 760px;
  margin-bottom: 12px;
  font-family: var(--font-display);
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1.08;
}
.contact-panel p {
  max-width: 620px;
  color: var(--c-muted);
}
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
}
.footer-inner {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 64px;
  padding: 56px 0;
}
.footer-brand p {
  font-size: 13px;
  color: var(--c-muted);
  margin-top: 16px;
  line-height: 1.7;
}
.footer-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.footer-col h4 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: 16px;
}
.footer-col ul li {
  margin-bottom: 10px;
}
.footer-col ul li a, .footer-col ul li {
  font-size: 13px;
  color: var(--c-muted);
  transition: color 0.15s;
}
.footer-col ul li a:hover { color: var(--c-text); }
.footer-bottom {
  border-top: 1px solid var(--c-border);
  padding: 20px 0;
}
.footer-bottom .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-bottom span { font-size: 12px; color: var(--c-muted); }

/* ============================================================
   RESPONSIVE — TABLET (≤ 900px)
   ============================================================ */
@media (max-width: 900px) {
  .main-nav { display: none; }
  .hamburger { display: flex; }
  /* Mobile header (logged in) shows only the initials avatar. The lang switcher,
     login/register, the full text greeting AND the Logout button are hidden here
     (all remain reachable in the mobile menu). Desktop is unchanged.
     NOTE: .user-avatar's display is toggled in pages.css (same file as its base
     rule) to avoid a cross-file source-order conflict. */
  .header-actions { gap: 8px; }
  .header-actions .lang-switcher,
  .header-actions .login-trigger,
  .header-actions .login-register,
  .header-actions .logout-link,
  .user-welcome { display: none; }

  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-panel, .material-layout, .contact-panel { grid-template-columns: 1fr; }
  .contact-actions { justify-content: flex-start; }
  .belt-grid { grid-template-columns: repeat(2, 1fr); }
  .news-grid { grid-template-columns: 1fr 1fr; }
  .news-card-featured { grid-column: 1 / -1; }
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .footer-nav { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   RESPONSIVE — MOBILE (≤ 600px)
   ============================================================ */
@media (max-width: 600px) {
  :root { --nav-h: 60px; }

  .section, .section-dark, .section-gray { padding: 48px 0; }
  .section-header { margin-bottom: 32px; }

  .hero { min-height: auto; padding-bottom: 24px; }
  .hero-title { font-size: clamp(42px, 14vw, 68px); }
  .hero-content { padding-top: 38px; padding-bottom: 36px; }
  .hero-panel div { min-height: 92px; padding: 18px; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }

  .about-cards { grid-template-columns: 1fr; }

  .schedule-grid { grid-template-columns: 1fr; gap: 12px; }

  .belt-grid { grid-template-columns: 1fr; }

  .news-grid { grid-template-columns: 1fr; }
  .news-card-featured { grid-column: auto; }

  .material-feature { min-height: 280px; }
  .contact-actions .btn { width: 100%; }

  .footer-inner { padding: 40px 0; }
  .footer-nav { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-bottom .container { flex-direction: column; text-align: center; }

}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-badge, .hero-title, .hero-sub, .hero-actions, .hero-panel {
  animation: fadeUp 0.7s ease both;
}
.hero-badge    { animation-delay: 0.1s; }
.hero-title    { animation-delay: 0.2s; }
.hero-sub      { animation-delay: 0.35s; }
.hero-actions  { animation-delay: 0.5s; }
.hero-panel    { animation-delay: 0.65s; }
