:root {
  /* Fargevariabler */
  --main-bg: #222222;
  --highlight-color: #c2b497;
  --text: #ffffff;
  --secondary-bg: #000000;
}

/* GLOBAL RESET OG GRUNNLEGGENDE STILER */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", sans-serif;
  background-color: var(--main-bg);
  color: var(--text);
  scroll-behavior: smooth;
}

/* HERO-SEKSJON */
.hero {
  position: relative;
  height: 60vh;
  background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.8)),
    url("img/header.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 3rem 4rem 2rem 23rem;
  text-align: left;
  margin: 0;
  overflow: hidden;
}

.hero-content {
  margin-bottom: 1rem;
}

.hero-title {
  font-size: 2.2rem;
  color: var(--highlight-color);
  font-family: "Orbitron", sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0 0 0.5rem 0;
}

.hero-content p {
  font-size: 1rem;
  margin: 0;
  line-height: 1.4;
  color: var(--text);
}

/* NAVIGASJON */
nav {
  position: absolute;
  top: 20px;
  right: 20px;
  background-color: transparent;
  display: flex;
  justify-content: flex-end;
  padding: 0;
  z-index: 200;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0;
}

.nav-links li a {
  color: var(--highlight-color);
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
}

.nav-links li a:hover {
  color: #fff9ec;
}

.nav-links li a.active {
  color: #fff9ec;
  border-bottom: 2px solid var(--highlight-color);
}

/* GENERELLE SEKSJONER */
.section {
  width: 100%;
  max-width: 1000px;
  padding: 3.5rem 1.5rem 5rem 1.5rem;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 4rem;
}

.section p {
  line-height: 1.6;
}

.narrow-text {
  max-width: 200ch;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
  text-align: center;
}

.section h2 {
  font-size: 1.5rem;
  color: var(--highlight-color);
  margin-bottom: 1rem;
  font-family: "Orbitron", sans-serif;
}

.section ul {
  list-style-type: none;
  padding-left: 0;
  margin-left: 0;
  text-align: center;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.solarsystem-img {
  width: 100%;
  max-width: 800px;
  height: auto;
  border-radius: 8px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* EKSTERNE LENKER-BOKS */
.link-box {
  margin-top: 1.5rem;
  padding: 0;
  text-align: center;
}

.link-box h3 {
  font-family: "Orbitron", sans-serif;
  color: var(--highlight-color);
  margin-bottom: 0.75rem;
  font-size: 1.3rem;
}

.link-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.link-list li a {
  color: var(--highlight-color);
  font-weight: 600;
  text-decoration: none;
  font-size: 1.1rem;
  transition: color 0.3s ease;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}

.link-list li a:hover,
.link-list li a:focus {
  color: #fff9ec;
  border-bottom-color: var(--highlight-color);
  text-decoration: none;
}

/* DVERGPLANETER */
.dverg-info {
  clear: both;
  margin-top: 4rem;
  background-color: rgba(0, 0, 0, 0.5);
  padding: 2rem;
  border-radius: 12px;
  text-align: left;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  color: var(--text);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(10px);
}

.dverg-info.visible {
  opacity: 1;
  transform: translateY(0);
}

.dverg-info h3 {
  color: var(--highlight-color);
  font-size: 1.8rem;
  margin-bottom: 1rem;
  font-family: "Orbitron", sans-serif;
}

/* Container for dvergplanet-bilder */
.dvergplaneter-bilder {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  margin-top: 4rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 1rem;
}

/* Selve bildene */
.dvergplaneter-bilder .dverg-icon,
.dvergplaneter-bilder .haumea {
  width: 100px;
  height: auto;
  border-radius: 8px;
  margin: 0;
  transition: transform 0.3s ease, filter 0.3s ease;
  flex-shrink: 0;
  object-fit: contain;
}

.dvergplaneter-bilder .dverg-icon:hover,
.dvergplaneter-bilder .haumea:hover {
  transform: scale(1.15);
  filter: brightness(1.2);
}

/* SOLA */
.sun-section {
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.sun-text {
  max-width: 700px;
  margin: 0 auto 2rem auto;
  text-align: center;
}

.sun-img {
  width: 100%;
  max-width: 300px;
  height: auto;
  margin-top: 1rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* PLANETER */
.planet-meny-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin: 2rem 0;
}

.planet-icon {
  width: 75px;
  height: 75px;
  object-fit: contain;
  cursor: pointer;
  transition: transform 0.3s ease, filter 0.3s ease;
  filter: brightness(0.9);
  margin-top: 2rem;
}

.planet-icon:hover {
  transform: scale(1.2);
  filter: brightness(1.2);
}

.planet-info {
  margin-top: 2rem;
  background-color: rgba(0, 0, 0, 0.5);
  padding: 2rem;
  border-radius: 12px;
  text-align: left;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  color: var(--text);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
  transition: opacity 0.4s ease;
  opacity: 0;
}

.planet-info.visible {
  opacity: 1;
}

.planet-info h3 {
  color: var(--highlight-color);
  font-size: 1.8rem;
  margin-bottom: 1rem;
  font-family: "Orbitron", sans-serif;
}

.planet-info p {
  line-height: 1.6;
  font-size: 1rem;
  margin-bottom: 0.8rem;
}

.bold {
  font-weight: bold;
  color: var(--highlight-color);
}

/* TILBAKE TIL TOPPEN-KNAPP */
#toTopBtn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background-color: transparent;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  display: none;
  transition: transform 0.3s ease;
  color: var(--highlight-color);
}

#toTopBtn:hover {
  transform: scale(1.2) rotate(-20deg);
}

/* FOOTER */
footer {
  background-color: var(--secondary-bg);
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.9rem;
  color: var(--text);
}

/* HAMBURGER-MENY */
.hamburger {
  display: none;
  position: absolute;
  top: 20px;
  right: 20px;
  width: 30px;
  height: 25px;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
  z-index: 300;
}

.hamburger div {
  height: 4px;
  background-color: var(--highlight-color);
  border-radius: 2px;
}

/* MEDIA QUERIES */

/* Mellomstore skjermer */
@media (max-width: 992px) {
  .hero {
    height: 40vh;
    padding: 2rem 2rem 1.5rem 2rem;
  }
}

/* Små skjermer (mobil) */
@media (max-width: 768px) {
  .hero {
    padding: 1.5rem 1rem 1rem 1rem;
    height: 30vh;
  }
  .hero-title {
    font-size: 1.5rem;
    white-space: normal;
  }

  .hamburger {
    display: flex;
  }

  .nav-links {
    flex-direction: column;
    background-color: rgba(0, 0, 0, 0.85);
    position: absolute;
    top: 50px;
    right: 10px;
    border-radius: 8px;
    display: none;
    width: 160px;
    padding: 1rem;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
    z-index: 250;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li {
    margin: 0.5rem 0;
  }

  .nav-links li a {
    font-size: 1.1rem;
    white-space: nowrap;
  }

  .planet-meny-icons {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .planet-icon {
    width: 50px;
    height: 50px;
  }

  .section h2 {
    font-size: 1.2rem;
  }

  .section p,
  .planet-info p {
    font-size: 0.9rem;
  }
}

/* Ekstra små skjermer (under 480px) */
@media (max-width: 480px) {
  .nav-links {
    position: fixed;
    top: 60px;
    right: 20px;
    width: 250px; 
    max-height: 70vh; 
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.85);
    border-radius: 8px;
    padding: 1rem;
    gap: 0.5rem;
    display: none; 
    flex-direction: column;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    z-index: 250;
    font-size: 0.9rem; 
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li a {
    font-size: 0.9rem; 
    padding: 0.3rem 0; 
    white-space: nowrap;
  }

  /* Juster planetbildene i små skjermer */
  .dvergplaneter-bilder .dverg-icon,
  .dvergplaneter-bilder .haumea {
    width: 60px;
    height: auto;
  }

  .link-list {
    flex-direction: column;
    gap: 0.8rem;
  }

  .link-list li a {
    font-size: 0.9rem;
  }
}
