:root {
  --header-big: 72px;     /* initial size */
  --header-small: 48px;   /* scrolled size */
  --header-padding-x: clamp(12px, 4vw, 24px);
}

/* Prevent content jump when the header changes size */
body {
  padding-top: var(--header-big);
  font-family: "Domine", sans-serif;
  transition: padding-top .25s ease;
}

body{
  opacity:0;
  transition:opacity 0.25s ease;
}

/* Header layout: 5 equal columns */
.header {
  font-family: "Chakra Petch", sans-serif;
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-big);
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* Muuda esimene number kui on vaja lisada header valikuid */
  align-items: center;
  text-align: center;
  padding: 0 var(--header-padding-x);
  text: black;
  background: black; /* dark transparent */
  color: #fff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  transition: height .25s ease, box-shadow .25s ease, background .25s ease;
  z-index: 1000;
}

.header-slot a {
  display: inline-block;
  width: 100%;
  font-size: clamp(0.95rem, 1.4vw + 0.25rem, 1.45rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  transition: font-size .25s ease, transform .25s ease, opacity .25s ease;
  text-decoration: none;
  color: inherit;
}

/* Shrink state */
.header.is-scrolled {
  height: var(--header-small);
  background: black;
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
}

.header.is-scrolled .header-slot a {
  font-size: clamp(0.65rem, 1.3vw + 0.25rem, 1.1rem);
  transform: translateY(-1px) scale(0.95);
  opacity: 0.95;
}

.header-slot .nav-logo {
  height: 2.2em;              /* default size, matches text */
  vertical-align: middle;     /* align with text baseline */
  transition: height 0.3s ease;
  max-width: 100%;            /* make sure it doesn’t overflow */
}

.home-link {
  display: flex;
  align-items: center;
  gap: 8px;
}

.home-icon {
  font-size: 32px;
  font-variation-settings:
    'FILL' 0,
    'wght' 400,
    'GRAD' 0,
    'opsz' 32;

  line-height: 1;
  opacity: 0.85;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.home-link:hover .home-icon {
  opacity: 1;
  transform: translateY(-1px) scale(1.05);
}

.header-slot a:hover {
  opacity: 1;
  transform: translateY(-1px) scale(1.05);
}
/* ================= LANGUAGE SELECTOR (NEW DESIGN) ================= */

.language-dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

/* Selected flag + dropdown icon */
.lang-control {
  display: flex;
  align-items: center;
  gap: 6px;
}

.active-flag {
  width: 34px;
  height: 22px;
  object-fit: cover;
}

/* Dropdown toggle icon */
.lang-toggle {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: center;
}

.lang-toggle .material-symbols-outlined {
  font-size: 20px;
  opacity: 0.85;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.lang-toggle:hover .material-symbols-outlined {
  opacity: 1;
  transform: translateY(1px);
}

/* Dropdown menu */
.lang-menu {
  position: absolute;
  top: calc(100% + 8px);

  /* LEFT-ALIGNED DROPDOWN */
  left: 0;
  right: auto;

  display: none;
  flex-direction: column;
  gap: 6px;

  padding: 6px;
  background: #000;

  /* sharp edges */
  border-radius: 3px;

  /* light-blue glowing border */
  border: 1px solid rgba(14, 165, 233, 0.9);
  box-shadow:
    0 0 0 1px rgba(14, 165, 233, 0.35),
    0 0 12px rgba(14, 165, 233, 0.6);

  z-index: 2000;
}


/* Flag buttons inside dropdown */
.lang-menu button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;
}

.lang-menu .flag-icon {
  width: 45px;
  height: 26px;
  object-fit: cover;
}

/* ===== MOBILE HEADER ===== */
@media (max-width: 768px) {

  /* kogu header veidi madalam */
  .header {
    height: 58px;
    column-gap: 20px;
  }

  header .home-link .home-icon {
  font-size: clamp(18px, 3.5vw, 26px);
  transform: translateY(2px);
}


/* ===== SCROLLED ===== */
.header.is-scrolled .home-link .home-icon {
  font-size: clamp(16px, 2.75vw, 20px);
  transform: translateY(4px);
}

.header.is-scrolled .home-icon {
  transform: scale(0.8) translateY(1px);
}

  /* nav lingid väiksemaks */
  .header-slot a {
    font-size: 0.75rem;
    letter-spacing: 0.05em;
  }

  /* keel lipu pilt väiksemaks */
  .active-flag {
    width: 24px;
    height: 16px;
  }

  .lang-menu .flag-icon {
    width: 28px;
    height: 16px;
  }

  /* dropdown noole ikoon väiksemaks */
  .lang-toggle .material-symbols-outlined {
    font-size: 16px;
  }

  :root {
    --header-big: 58px;
    --header-small: 42px;
  }

  .header.is-scrolled .header-slot a {
  transform: translateY(-3px) scale(0.95);
}

}


