:root {
  --header-height: 80px;
  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
  overflow-x: hidden;
}

* {
  box-sizing: border-box;
}

body {
  color: var(--color-black);
  font-family: var(--font-body);
  line-height: 1.6;
  margin: 0;
  padding: 0;
  padding-top: var(--header-height);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-primary);
}

a {
  color: var(--color-primary);
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 1000;
  display: flex;
  align-items: center;
  background: transparent;
  border-bottom: none;
}

.header-inner {
  width: 100%;
  height: 100%;
  background: var(--color-white);
  background: color-mix(in srgb, var(--color-white) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #eee;
  position: relative;
  z-index: 1002;
}

.header-inner .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.logo {
  height: 100%;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.logo a {
  font-family: var(--font-heading);
  font-weight: bold;
  font-size: 1.5rem;
  color: var(--color-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  height: 100%;
}

.logo img {
  height: 80%;
  width: auto;
  max-height: 100%;
}

.header-logo {
  pointer-events: none;
  opacity: 0;
  transform: translateY(50%) translateX(70%) scale(1.5);
  transition: opacity 0.05s ease-in, transform 0.1s ease-in;
}

.header-logo.visible {
  pointer-events: auto;
  transform: translateY(0) translateX(0) scale(1);
  transition: all 0.6s var(--ease-out-expo);
  opacity: 1;
}

/* Home Logo */
.home-logo {
  width: 80vw;
  max-width: 30em;
  text-align: center;
  margin-bottom: 2rem;
}

.home-logo img {
  max-width: 100%;
  height: auto;
  max-height: 200px;
}

/* Menu */
.main-menu {
  flex: 0 0 auto;
}

.main-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 5ch;
}

.main-menu a {
  color: var(--color-black);
  text-decoration: none;
  font-weight: 500;
  font-family: var(--font-heading);
}

.main-menu a:hover {
  color: var(--color-primary);
}

/* Language Switcher */
.language-switcher {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.language-switcher a {
  color: var(--color-black);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  opacity: 0.6;
}

.language-switcher a:hover,
.language-switcher a.active {
  opacity: 1;
  color: var(--color-primary);
}

.language-switcher-mobile {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #eee;
  display: flex;
  gap: 15px;
}

.language-switcher-mobile a {
  color: var(--color-black);
  text-decoration: none;
  font-weight: 500;
  opacity: 0.6;
}

.language-switcher-mobile a.active {
  opacity: 1;
  color: var(--color-primary);
}

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  top: 0; /* Start from top */
  left: 0;
  width: 100%;
  /* Use same translucent background */
  background: var(--color-white);
  background: color-mix(in srgb, var(--color-white) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #eee;
  padding: 20px;
  padding-top: calc(var(--header-height) + 20px); /* Add padding for header height */
  transform: translateY(-100%);
  transition: transform 0.6s var(--ease-out-expo);
  z-index: 1001; /* Lower than header-inner but high enough */
  visibility: hidden;
}

.mobile-menu.active {
  transform: translateY(0);
  visibility: visible;
}

.mobile-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-menu li {
  margin-bottom: 0.5em;
  font-family: var(--font-heading);
  font-size: 1.75em;
}

.mobile-menu a {
  display: block;
  color: var(--color-black);
  text-decoration: none;
}

/* Hamburger */
.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 20px;
  position: relative;
  display: none;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-primary);
  position: absolute;
  left: 0;
  transition: all 0.3s;
}

.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 9px; }
.hamburger span:nth-child(3) { top: 18px; }

.hamburger.active span:nth-child(1) { transform: rotate(45deg); top: 9px; }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg); top: 9px; }

/* Sections */
.section {
  padding: 80px 0;
  background-size: cover;
  background-position: center;
  text-wrap: pretty;

  h2 {
    font-size: 3.5em;
  }
  h3 {
    font-size: 2.25em;
    margin: 0;
    margin-bottom: 1em;
  }
  h4 {
    font-size: 1.5em;
    margin-bottom: 0;
  }
  p {
    font-size: 1.1em;
    margin-bottom: 2.5rem;
    max-width: 80ch;
    text-align: justify;
    hyphens: auto;

    &.unjust {
      text-align: left;
    }
  }
}

@media (max-width: 768px) {
  .section {
    padding: 60px 0;
    h2 {
      font-size: 2.5em;
    }
    h3 {
      font-size: 2em;
    }
    h4 {
      font-size: 1.5em;
    }
    p {
      font-size: 1.2em;
      margin-bottom: 1.5rem;
    }
  }
}

/* Section with image layout */
.section-with-image {
  overflow: visible;
}

.section-layout {
  display: flex;
  gap: 0 3em;
  align-items: flex-start;
}

.section-content {
  flex: 1;
  min-width: 0;
}

.section-image {
  flex: 0 0 65%;
  max-width: 65vw;
  margin-top: 4em;
  margin-right: -15vw; /* Offset beyond container */
}

.section-image img {
  width: 100%;
  height: auto;
}

/* Image on the left */
.section-image-left .section-image {
  margin-right: 0;
  margin-left: -15vw;
}

.section-image-left .section-layout {
  flex-direction: row-reverse;
}

@media (max-width: 1200px) {
  .section-image {
    max-width: 45vw;
    margin-right: -60px;
  }

  .section-image-left .section-image {
    margin-right: 0;
    margin-left: -60px;
  }
}

@media (max-width: 768px) {
  .section-layout {
    flex-direction: column;
  }

  .section-image {
    flex: 0 0 auto;
    max-width: none;
    width: 100vw;
    position: relative;
    left: 50%;
    margin-left: -50vw;
    order: 1; /* Image below content on mobile */
    margin-top: 2rem;
    margin-bottom: -90px;
  }

  .section-image-left .section-image {
    margin-left: -50vw;
    margin-right: 0;
  }

  .section-image-left .section-layout {
    flex-direction: column;
  }
}

.section-home {
  min-height: 60vh;
  display: flex;
  align-items: start;
  color: var(--color-white);
  background-position: bottom;
  
  h1 {
    color: var(--color-primary);
    font-size: 3.5rem;
    margin-bottom: 1rem;
  }
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -15px;
}

.col-12 {
  width: 100%;
  padding: 0 15px;
}

.col-md-6 {
  width: 100%;
  padding: 0 15px;
}

@media (min-width: 1100px) {
  .col-md-6 {
    width: 50%;
  }
  .d-none { display: none !important; }
  .d-md-block { display: block !important; }
  .d-md-flex { display: flex !important; }
  .d-md-none { display: none !important; }
  .hamburger { display: none; }
}

@media (max-width: 1099px) {
  .d-none { display: none !important; }
  .d-md-block { display: none !important; }
  .d-md-flex { display: none !important; }
  .hamburger { display: block; }
}

footer {
  padding: 40px 0;
  background: var(--color-primary);
  color: var(--color-white);
}

/* Standard list styles */
.section ul:not(.card-list) {
  list-style: none;
  padding-left: 0;
}

.section ul:not(.card-list) li {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 0.5rem;
}

.section ul:not(.card-list) li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75em;
  width: 1.2rem;
  height: 1px;
  background: var(--color-primary);
}

/* Card List Styles (opt-in with {.card-list} in markdown) */
ul.card-list {
  list-style: none;
  padding: 0;
  margin-top: 4em;
  margin-bottom: 1.5em;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(25em, 1fr));
  gap: 5em;
}

ul.card-list li {
  /*
  background: var(--color-white);
  padding: 1.5rem;
  border: 1px solid;
  */
  font-size: 1.15em;
  padding-inline-end: 5ch;
  max-width: 100vw;
  border-color: var(--color-grey);
  border-color: color-mix(in srgb, var(--color-primary) 30%, transparent);
  text-align: justify;
  hyphens: auto;
}

ul.card-list li strong {
  display: flex;
  align-items: center;
  gap: 0.5em;
  color: var(--color-primary);
  font-family: var(--font-heading);
  font-size: 1.5em;
  text-align: initial;
  margin-bottom: 0.5rem;
}

/* ul.card-list li strong::after {
  content: "";
  flex: 1;
  height: 1px;
  margin-top: 0.25em;
  background: var(--color-primary);
} */

@media (max-width: 768px) {
  ul.card-list {
    gap: 3em;
    margin: 0;
  }
}

/* Two-column layout */
.section-two-columns {
  margin-top: -8em;
}

.section-two-columns .container {
  display: flex;
  gap: 3em;
  
  div:first-child {
    flex: 0 0 65%;
    max-width: 65vw;
    margin-left: -15vw;
    padding-left: 15vw;
  }
}

@media (max-width: 768px) {
  .section-two-columns {
    margin-top: 0;
  }

  .section-two-columns .container {
    flex-direction: column;
    gap: 0;
  }
}
