/*------------------------------*/
/* Universelle                  */
/*------------------------------*/

/* wanted to use defined spaces, but turned out to be a hassle. Haven't used much on the page */
:root {
  --space-xxs: 0.25rem;
  --space-xs: 0.5rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-xxl: 6rem;
}

header {
  position: sticky;
  top: 0;
  z-index: 1000;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box; /* Include padding and border in element's total width and height */
}

main {
  max-width: 69vw;
  margin: 0 auto;
  padding: 0 1.5rem;
}

#main-forside {
  max-width: none;
  margin: 0 auto;
  padding: 0;
}

.main-content {
  width: 100%;
  text-align: left;
}

aside {
  width: 100%;
  padding: 1.5rem;
}

h1,
h2,
h3,
p {
  margin: 1.5rem auto; /* center paragraphs */
  max-width: 69vw;
}

h1 {
  text-align: center;
  margin-bottom: 4rem;
}

.content-description p {
  text-align: center;
  margin: 0.3rem auto; /* auto på left/right = centrer max-width-blokken */
}

.medie-blok {
  width: 69vw; /* styrer bredden for både billede/embed + tekst */
  margin: 2rem auto; /* centrer + lidt luft under blokken */
}

/*------------------------------*/
/* Navigation                   */
/*------------------------------*/

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-right: 1rem;
  margin-right: auto;
}

.nav-hovedmenu {
  min-height: 3.5rem;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
}

.nav-menucontainer {
  flex: 1;
}

/* Dark mode toggle container */
/* .dark-mode {
  display: flex;
  align-items: center;
  margin-left: auto;
  padding-left: 1rem;
} */

.hamburger-part {
  display: block; /*stacks bars vertically*/
  width: 2.5rem;
  height: 0.3rem;
  margin: 0.6rem auto;
}

.nav-menupunkter {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5rem;
}

/*------------------------------*/
/* Herosite                     */
/*------------------------------*/

.hero-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  inset: 0;
  width: 100%;
  min-height: calc(100dvh - 4rem);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-selection {
  display: grid;
  justify-content: center;
  align-content: center;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
  flex: 1;
  width: 70vw;
  max-width: 1200px;
  min-width: 768px;
}

.hero-selection > a {
  display: inline-block;
  justify-self: center;
  align-self: center;
}

.hero-selection > a > img {
  display: block; /* Remove bottom whitespace */
  max-width: 100%;
  height: auto;
}

#om-mig-hero {
  grid-column: 2 / 4; /* Centered in the grid */
  grid-row: 1 / -1;
}

#intro-hero {
  grid-column: 1 / 2;
  grid-row: 1 / 2;
}

#web-hero {
  grid-column: 4 / 5;
  grid-row: 1 / 2;
}

#uxui-hero {
  grid-column: 1 / 2;
  grid-row: 2 / 3;
}

#content-hero {
  grid-column: 4 / 5;
  grid-row: 2 / 3;
}

/*------------------------------*/
/* YouTube Embed                */
/*------------------------------*/

.medie-blok .youtube-embed {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
}

/* YouTube iframe skalerer inde i sin container */
.medie-blok .youtube-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/*------------------------------*/
/* Image Embed & Carousel       */
/*------------------------------*/

/*landscape version*/
.medie-blok .image-carousel,
.medie-blok .image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0 auto;
}

.medie-blok .image-wrapper {
  aspect-ratio: auto;
}

.medie-blok .image-wrapper img {
  max-width: 100%; /* må gerne blive mindre, men ikke større end originalen */
  height: auto;
  width: auto; /* eller bare fjern width helt */
  object-fit: contain; /* eller fjern helt – vigtigst er at du IKKE bruger cover */
  display: block;
  margin: 0 auto; /* hvis du vil centrere billedet horisontalt */
}

/* denne kode er ikke nødvendig, og skaber faktisk et skaleringsproblem, som jeg ikke helt forstår. Bedst at ignorere den. */
/* .medie-blok img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
} */

/* portrait version */
.medie-blok .image-carousel.portrait {
  aspect-ratio: 3 / 4;
  max-height: 600px;
  width: 100%;
}

.medie-blok .image-carousel.portrait {
  aspect-ratio: 3 / 4;
  max-height: 600px;
  width: auto;
}

/* Slides inde i carousel */
.medie-blok .carousel-item {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.medie-blok .carousel-item.active {
  opacity: 1;
}

.medie-blok .carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.medie-blok .image-carousel.portrait img {
  max-height: 600px;
  width: 100%;
  margin: 0 auto;
  object-fit: contain;
}

.image-wrapper img.logo {
  max-width: 300px;
  height: auto;
}

/*------------------------------*/
/* Direction buttons            */
/*------------------------------*/

.direction-knapper {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin: 0rem auto;
}

.direction-knapper > div:only-child {
  margin: 0 auto;
}

/*------------------------------*/
/* Mobil version                */
/*------------------------------*/
@media (max-width: 768px) {
  main {
    max-width: 95vw;
  }

  h1,
  h2,
  h3,
  p {
    margin: 1.5rem auto; /* center paragraphs */
    max-width: 95vw;
  }
  .hamburger-menu {
    display: block; /* Show hamburger menu on mobile */
  }

  .nav-menupunkter {
    position: fixed;
    top: 3.5rem;
    left: -100%;
    gap: 0;
    flex-direction: column;
    width: 100%;
    text-align: center;
  }

  .nav-menupunkt {
    margin: 1rem 0;
  }

  .nav-menupunkter.active {
    left: 0;
  }

  .dark-mode {
    padding-right: var(--space-m);
  }

  .hero-selection {
    width: 100vw;
    min-width: auto;
  }

  .medie-blok {
    width: 80vw; /* styrer bredden for både billede/embed + tekst */
  }

  .direction-knapper {
    width: 100%;
    margin: 1rem auto;
  }

  .direction-knapper > div > a {
    font-size: 1rem;
  }
}
/*------------------------------*/
/* About Me                     */
/*------------------------------*/

@media (min-width: 769px) {
  #about-me-picture .medie-blok img {
    max-width: 500px;
  }

  .grid-1-1 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
  }
}
