/* core.css — shared by index.html, short.html and english.html */

/* Reserve the scrollbar gutter so scroll-locking the body does not shift the page */
html {
  overflow-y: scroll;
}

/* === DESIGN TOKENS === */
:root {
  --bg-primary: #FDF8F2;
  --card-bg: #F0E4D9;
  --card-hover: #E8D3C1;
  --accent: #A8B5A2;      /* salvia-grön accent */
  --accent-dark: #8A9A82; /* mörkare salvia */
  --accent-soft: #D9E0D5; /* ljus salvia */
  --text-dark: #4A3C31;
  --text-body: #5C5147;
  --border: #8A5A34;
  --hero-tint: rgba(40, 60, 50, 0.15);
  --modal-bg: rgba(0,0,0,0.15);
  /* Desktop banner geometry: mirrors .main-nav (top: 8px) and .hero (height) so the
     sticky banner locks with an equal strip of image above and below the nav pill. */
  --nav-gap: 8px;
  --nav-height: 44px;
  --hero-height: 300px;
}

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

body {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  line-height: 1.85;
  color: var(--text-body);
  background: var(--bg-primary);
}

h1, h2, h3 {
  font-family: 'Playfair Display', serif;
  color: var(--text-dark);
}

/* HERO */
.hero {
  position: relative;
  background-image: url("images/regnbag.webp");
  background-size: cover;
  background-position: center 45%;
  color: white;
  text-align: center;
  padding: 56px 20px 47px;
  height: var(--hero-height);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--hero-tint);
}

.hero-inner,
.hero-content {
  position: relative;
  z-index: 2;
}

.hero h1 {
  font-size: 78px;
  margin: 0 0 12px;
  font-weight: 600;
  color: white;
  line-height: 1.85;
  letter-spacing: 0.06em;
}

.hero p {
  font-size: 1.4rem;
  letter-spacing: 4px;
  opacity: 0.92;
  margin: 0;
  line-height: 1.85;
}

/* FOOTER */
footer {
  position: relative;
  width: 100%;
  margin-top: 0;
  padding: 10px 20px;
  text-align: center;
  font-family: 'Manrope', sans-serif;
  font-size: 0.82rem;
  letter-spacing: 1px;
  line-height: 1.5;
  background-image: url("images/regnbag.webp");
  background-size: cover;
  background-position: center 45%;
  border-top: 1px solid rgba(0,0,0,0.1);
  color: rgba(255,255,255,0.98);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

footer,
footer * {
  color: rgba(255,255,255,0.98);
}

footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(52, 67, 58, 0.46);
}

footer > * {
  position: relative;
  z-index: 1;
}

.footer-meta {
  margin-bottom: 0;
  letter-spacing: inherit;
  line-height: inherit;
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: 18px;
  row-gap: 4px;
}

.footer-meta strong {
  font-weight: 700;
}

.footer-separator {
  opacity: 0.78;
}

.footer-credentials {
  color: rgba(255,255,255,0.98);
}

footer .email-link {
  color: rgba(255,255,255,0.98);
  text-decoration: none;
}

footer .email-link:hover {
  color: rgba(255,255,255,0.82);
}

.contact-separator {
  margin: 0 6px;
  color: var(--text-body);
}

/* MENU */
.menu-toggle {
  position: fixed;
  top: 24px;
  right: 24px;
  font-size: 32px;
  cursor: pointer;
  color: white;
  z-index: 500;
  background: rgba(0,0,0,0.45);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  pointer-events: auto;
}

.menu-toggle:hover {
  transform: scale(1.1);
}

.menu-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 104;
}

.menu-backdrop.open {
  display: block;
  pointer-events: auto;
  background: rgba(0,0,0,0.3);
}

.main-nav {
  display: none;
  position: fixed;
  top: 76px;
  right: 12px;
  z-index: 500;
  background: var(--card-bg);
  border-radius: 0 0 0 16px;
  min-width: 220px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  overflow: hidden;
}

.main-nav.open {
  display: block;
  animation: menuSlide 0.25s ease;
}

@keyframes menuSlide {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.main-nav button {
  display: block;
  width: 100%;
  padding: 14px 20px;
  color: var(--text-dark);
  text-decoration: none;
  font-family: 'Manrope', sans-serif;
  font-size: 1rem;
  transition: background 0.2s ease, color 0.2s ease;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
}

.main-nav button:hover {
  background: var(--accent-soft);
  color: var(--text-dark);
}

.main-nav button + button { border-top: 1px solid rgba(138, 154, 130, 0.25); }

/* Language & version switcher in the banner menu */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 0 4px 0 0;
}

.lang-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  text-decoration: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.lang-flag svg {
  width: 22px;
  height: auto;
}

.lang-flag:hover {
  transform: scale(1.1);
}

.lang-flag-text {
  font-family: 'Manrope', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: white;
}

/* Vertical divider separating the switcher cluster from the menu */
.nav-divider {
  display: block;
  width: 1px;
  height: 22px;
  flex: none;
  align-self: center;
  background: rgba(255,255,255,0.4);
  margin: 0 8px;
}

.lang-flag:focus-visible,
.lang-version:focus-visible {
  outline: 2px solid rgba(255,255,255,0.7);
  outline-offset: 2px;
}

.lang-version {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-family: 'Manrope', sans-serif;
  font-size: 0.86rem;
  color: white;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease;
}

.lang-version:hover {
  background: rgba(255,255,255,0.2);
  color: white;
}

/* Desktop: always-visible top nav */
@media (min-width: 1151px) {
  .menu-toggle {
    display: none;
  }

  .menu-backdrop {
    display: none !important;
  }

  .main-nav {
    display: flex;
    position: fixed;
    top: 8px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    z-index: 1200;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 999px;
    padding: 3px;
    min-width: 0;
    max-width: min(1400px, calc(100vw - 16px));
    box-shadow: 0 8px 22px rgba(0,0,0,0.14);
    overflow: visible;
    gap: 1px;
    flex-wrap: nowrap;
    justify-content: center;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }

  .main-nav::-webkit-scrollbar {
    display: none;
  }

  .main-nav.open {
    display: flex;
    animation: none;
  }

  .main-nav button {
    width: auto;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.86rem;
    white-space: nowrap;
    color: white;
  }

  .main-nav button + button {
    border-top: none;
  }

  .main-nav button:hover {
    background: rgba(255,255,255,0.2);
    color: white;
  }

  .main-nav button:focus-visible {
    outline: 2px solid rgba(255,255,255,0.7);
    outline-offset: 2px;
  }
}

/* MODAL shell */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--modal-bg);
  z-index: 1000;
  overflow-y: auto;
  padding: 56px 16px 32px;
}

.modal.is-open {
  display: block;
}

body.modal-open {
  position: fixed;
  width: 100%;
}

/* MOBILE — shared across pages */
@media (max-width: 1150px) {
  .hero {
    position: relative;
    padding: 18px 20px;
    height: auto;
    will-change: auto;
    transition: none;
    z-index: auto;
  }

  /* Modal shell inset halved so modals sit closer to the screen edges on mobile */
  .modal {
    padding: 56px 8px 32px;
  }

  .hero h1 {
    font-size: 2.4rem;
    margin: 0 0 4px;
    transition: none;
  }

  .hero p {
    font-size: 0.85rem;
    letter-spacing: 2px;
    margin: 0;
    transition: none;
  }

  .mobile-menu-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    pointer-events: none;
  }

  .mobile-menu-wrapper > * {
    pointer-events: auto;
  }

  .menu-toggle {
    position: absolute;
    top: 10px;
    right: 12px;
    font-size: 24px;
    width: 40px;
    height: 40px;
    z-index: 500;
    background: rgba(0,0,0,0.4);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }

  .main-nav {
    position: absolute;
    top: 54px;
    right: 8px;
    z-index: 500;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 16px;
    box-shadow: 0 8px 22px rgba(0,0,0,0.14);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }

  .main-nav button {
    color: white;
    font-size: 0.86rem;
    padding: 8px 12px;
    border-radius: 999px;
  }

  .main-nav button:hover {
    background: rgba(255,255,255,0.2);
    color: white;
  }

  .main-nav button + button {
    border-top: none;
    margin-top: 2px;
  }

  .main-nav button:focus-visible {
    outline: 2px solid rgba(255,255,255,0.7);
    outline-offset: 2px;
  }

  .lang-switch {
    display: flex;
    gap: 8px;
    padding: 10px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.25);
  }

  .lang-flag {
    width: 38px;
    height: 38px;
  }

  .lang-flag-text {
    color: white;
  }

  .nav-divider {
    width: 100%;
    height: 1px;
    margin: 0;
    background: rgba(255,255,255,0.25);
  }

  .lang-flag:focus-visible,
  .lang-version:focus-visible {
    outline-color: rgba(255,255,255,0.7);
  }

  .lang-version {
    display: block;
    width: 100%;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.86rem;
    letter-spacing: 0;
    color: white;
  }

  .lang-version:hover {
    background: rgba(255,255,255,0.2);
    color: white;
  }

  footer {
    position: relative;
  }

  .footer-meta {
    flex-direction: column;
    row-gap: 2px;
  }

  .footer-separator {
    display: none;
  }
}

@media (max-width: 768px) {
  .contact-separator {
    display: block;
    margin: 4px 0;
  }
}

/* Desktop: the banner scrolls with the page until its bottom reaches the nav pill,
   then sticks as a backdrop with an equal strip of image above and below the nav.
   (z-index: above page content, below the fixed nav at 1200 and modals at 1000.) */
@media (min-width: 1151px) {
  .hero {
    position: sticky;
    top: calc(var(--nav-gap) * 2 + var(--nav-height) - var(--hero-height));
    z-index: 100;
  }
}
