/* ============================================================
   HUVA Academy — shared design system (new brand)
   Tokens + utilities + floating-pill header + 3-column footer.
   Loaded by base.html on every page, AFTER styles.css.
   All classes are hm- prefixed to avoid collisions with styles.css.
   ============================================================ */

:root {
  --huva-black: #000000;
  --huva-yellow: #e9ef00;
  --huva-white: #ffffff;
  --huva-blue: #1200ff;
  --huva-grey: #d7d9db;
  --section-grey: #edecf1;

  --neutral-100: #ececec;
  --neutral-500: #858585;
  --neutral-600: #444444;

  --white-a10: rgba(255, 255, 255, 0.10);
  --white-a50: rgba(255, 255, 255, 0.50);
  --text-muted: rgba(0, 0, 0, 0.50);

  --font-display: 'Archivo Expanded', 'Archivo', 'Noto Sans Armenian', 'Arial Black', sans-serif;
  --font-ui: 'Archivo', 'Noto Sans Armenian', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-body: 'Montserrat', 'Noto Sans Armenian', -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;

  --shadow-md: 0 8px 16px rgba(138, 129, 141, 0.20);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* The old layout reserved 70px for a fixed sticky-cta bar; the new dark
   footer would otherwise sit above a white strip. Reset it globally and
   restore the spacer only on pages that still use .sticky-cta. */
body { padding-bottom: 0; }

/* ============ SHARED UTILITIES ============ */
.hm-container { max-width: 1280px; margin: 0 auto; padding: 0 40px; }

.hm-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-ui); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  border-radius: 999px; border: 1.5px solid transparent; cursor: pointer; white-space: nowrap;
  transition: transform .15s var(--ease-out), background .15s var(--ease-out), color .15s var(--ease-out);
}
.hm-btn:hover { transform: translateY(-2px); }
.hm-btn-sm { height: 40px; padding: 0 18px; font-size: 12px; }
.hm-btn-md { height: 48px; padding: 0 24px; font-size: 13px; }
.hm-btn-lg { height: 56px; padding: 0 30px; font-size: 14px; }
.hm-btn-blue { background: var(--huva-blue); color: var(--huva-white); }
.hm-btn-blue:hover { background: #0d00cc; }
.hm-btn-black { background: var(--huva-black); color: var(--huva-white); }
.hm-btn-black:hover { background: #1a1a1a; }
.hm-btn-outline { background: transparent; border-color: var(--huva-black); color: var(--huva-black); }
.hm-btn-outline:hover { background: var(--huva-black); color: var(--huva-white); }
.hm-btn-yellow { background: var(--huva-yellow); color: var(--huva-blue); }
.hm-btn-yellow:hover { background: var(--huva-white); }
.hm-btn-white { background: var(--huva-white); color: var(--huva-black); }
.hm-btn-white:hover { background: var(--huva-yellow); }

.hm-eyebrow {
  font-family: var(--font-ui); font-weight: 700; font-size: 13px; letter-spacing: 0.22em;
  text-transform: uppercase; display: inline-flex; align-items: center; gap: 10px;
}
.hm-eyebrow img { width: 14px; height: 14px; display: block; }

.hm-section-head { display: flex; flex-direction: column; gap: 14px; max-width: 640px; }
.hm-section-title {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(30px, 4vw, 48px);
  letter-spacing: -0.05em; line-height: 1; text-transform: uppercase; margin: 0;
}
.hm-section-sub { font-family: var(--font-body); font-size: 17px; line-height: 1.55; color: var(--text-muted); margin: 0; }

.hm-badge {
  font-family: var(--font-ui); font-weight: 700; font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; border-radius: 999px; padding: 6px 12px;
}
.hm-badge-yellow { color: var(--huva-black); background: var(--huva-yellow); }
.hm-badge-outline { color: var(--text-muted); border: 1px solid var(--huva-grey); }
.hm-badge-soon { font-family: var(--font-ui); font-weight: 700; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--huva-blue); }

/* ============ HEADER (full-width fixed bar, left-anchored) ============ */
.hm-header { position: fixed; top: 0; left: 0; right: 0; z-index: 100; padding: 0; }
.hm-nav {
  max-width: none; margin: 0; display: flex; align-items: center; justify-content: flex-start;
  gap: 28px; background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: none; border-bottom: 1px solid var(--huva-grey); border-radius: 0; padding: 12px 40px; box-shadow: var(--shadow-md);
}
.hm-brand { display: flex; align-items: center; gap: 9px; }
.hm-brand img { height: 26px; display: block; width: auto; }
.hm-brand span { font-family: var(--font-ui); font-weight: 500; font-size: 15px; color: var(--neutral-500); }
.hm-navlinks { display: flex; align-items: center; gap: 16px; list-style: none; margin: 0; padding: 0; }
.hm-navlink {
  font-family: var(--font-ui); font-weight: 700; font-size: 11.5px; letter-spacing: 0.05em;
  text-transform: uppercase; white-space: nowrap; color: var(--huva-black); transition: opacity .15s var(--ease-out);
}
.hm-navlink:hover { opacity: 0.55; }
.hm-navlinks > li { position: relative; }

/* Nav dropdown (Courses) */
.hm-has-dropdown > .hm-navlink { display: inline-flex; align-items: center; gap: 5px; }
.hm-navlink .caret { width: 12px; height: 12px; transition: transform .2s var(--ease-out); }
.hm-has-dropdown:hover .caret { transform: rotate(180deg); }
/* invisible bridge across the gap so the menu doesn't close */
.hm-has-dropdown::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 18px; }
.hm-dropdown {
  position: absolute; top: calc(100% + 16px); left: 0; min-width: 256px; background: var(--huva-white);
  border: 1px solid var(--huva-grey); border-radius: 16px; box-shadow: var(--shadow-md); padding: 8px;
  display: none; flex-direction: column; gap: 2px; z-index: 120;
}
.hm-has-dropdown:hover .hm-dropdown, .hm-has-dropdown:focus-within .hm-dropdown { display: flex; }
.hm-dd-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 10px; transition: background .12s var(--ease-out); }
.hm-dd-item:hover { background: var(--section-grey); }
.hm-dd-name { font-family: var(--font-ui); font-weight: 700; font-size: 13px; letter-spacing: 0.02em; text-transform: none; color: var(--huva-black); }
.hm-dd-desc { font-family: var(--font-body); font-size: 12px; color: var(--text-muted); }

/* Mobile menu course sub-links */
.mobile-menu-sublinks { list-style: none; margin: 4px 0 0; padding: 0 0 0 16px; display: flex; flex-direction: column; gap: 8px; }
.mobile-menu-sublink { font-family: var(--font-ui); font-weight: 600; font-size: 14px; color: var(--neutral-600); }

.hm-nav-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

/* Language switcher (reuses #navLang / .lang-* hooks that main.js expects) */
.hm-lang {
  display: flex; align-items: center; gap: 7px; font-family: var(--font-ui); font-weight: 700;
  font-size: 12px; letter-spacing: 0.06em; color: var(--huva-black); cursor: pointer; white-space: nowrap;
  position: relative; user-select: none;
}
.hm-lang .nav-lang-flag { width: 20px; height: 20px; border-radius: 50%; overflow: hidden; flex: 0 0 auto; }
.hm-lang .nav-lang-flag img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hm-lang .nav-lang-chevron { width: 13px; height: 13px; transition: transform .2s var(--ease-out); }
.hm-lang.open .nav-lang-chevron { transform: rotate(180deg); }
.hm-lang .lang-dropdown {
  position: absolute; top: calc(100% + 12px); right: 0; min-width: 184px; background: var(--huva-white);
  border: 1px solid var(--huva-grey); border-radius: 16px; box-shadow: var(--shadow-md); padding: 8px;
  display: none; flex-direction: column; gap: 2px; z-index: 120;
}
.hm-lang.open .lang-dropdown { display: flex; }
.hm-lang .lang-option {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; cursor: pointer;
  transition: background .12s var(--ease-out);
}
.hm-lang .lang-option:hover { background: var(--section-grey); }
.hm-lang .lang-option-flag { width: 22px; height: 22px; border-radius: 50%; overflow: hidden; flex: 0 0 auto; }
.hm-lang .lang-option-flag img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hm-lang .lang-option-name { font-family: var(--font-body); font-weight: 600; font-size: 14px; color: var(--huva-black); flex: 1; text-transform: none; letter-spacing: 0; }
.hm-lang .lang-option-check { width: 16px; height: 16px; margin-left: auto; }

/* Hamburger (keeps .nav-hamburger hook for main.js) */
.hm-burger { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 5px; padding: 6px; }
.hm-burger span { width: 22px; height: 2px; background: var(--huva-black); display: block; border-radius: 2px; }

/* Spacer so fixed header doesn't overlap page content */
.hm-header-spacer { height: 92px; }

/* ============ FOOTER (3 column, dark) ============ */
.hm-footer { background: var(--huva-black); color: var(--huva-white); }
.hm-footer-top { max-width: 1280px; margin: 0 auto; padding: 64px 40px; display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.hm-footer-about { display: flex; flex-direction: column; gap: 18px; max-width: 280px; }
.hm-footer-about img { height: 28px; width: auto; align-self: flex-start; margin-left: -6px; }
.hm-footer-about p { font-family: var(--font-body); font-size: 14px; line-height: 1.55; color: var(--white-a50); margin: 0; }
.hm-footer-cols { display: flex; gap: 56px; flex-wrap: wrap; }
.hm-footer-col { display: flex; flex-direction: column; gap: 12px; }
.hm-footer-col-title { font-family: var(--font-ui); font-weight: 700; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--huva-yellow); }
.hm-foot { font-family: var(--font-body); font-size: 14px; color: var(--white-a50); transition: color .15s var(--ease-out); }
.hm-foot:hover { color: var(--huva-yellow); }
.hm-footer-bottom { border-top: 1px solid var(--white-a10); padding: 18px 40px; }
.hm-footer-bottom-inner { max-width: 1280px; margin: 0 auto; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-family: var(--font-body); font-size: 13px; color: var(--white-a50); }
.hm-footer-legal { display: flex; align-items: center; gap: 14px; }
.hm-footer-legal .hm-foot { font-size: 13px; }
.hm-foot-sep { color: var(--white-a50); }

/* ============ RESPONSIVE ============ */
@media (max-width: 1040px) {
  .hm-navlinks { display: none; }
  .hm-burger { display: flex; }
  .hm-header-spacer { height: 84px; }
}
@media (max-width: 600px) {
  .hm-header { padding: 0; }
  .hm-nav { padding: 12px 18px; }
  .hm-nav-actions .hm-btn { display: none; }
  /* Footer: keep the HUVA logo + intro left-aligned (not centered) on mobile. */
  .hm-footer-top { justify-content: flex-start; }
  .hm-footer-about { align-items: flex-start; text-align: left; max-width: none; width: 100%; }
  .hm-footer-about img { align-self: flex-start; }
}
