@import url("https://fonts.googleapis.com/css2?family=Rajdhani:wght@600&family=Roboto:wght@400;500;700&display=swap");

:root {
  --fremtid-background: #113d2a;
  --fremtid-text: #ed6f00;
  --fremtid-foreground: #ffffff;
  --fremtid-border: #0e1513;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--fremtid-background);
  color: var(--fremtid-foreground);
  font-family: "Roboto", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Rajdhani", sans-serif;
  font-weight: 600;
  color: var(--fremtid-text);
}

/* ===== HEADER & NAVIGATION ===== */
.site-title {
  display: block;
  text-align: center;
  padding: 0.25rem 0;
  font-size: 2rem;
  font-weight: 600;
  font-family: "Rajdhani", sans-serif;
  color: #ed6f00;
  background-color: #113d2a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

header {
  background: rgba(17, 61, 42, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.375rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-wrap: wrap;
}

.header-brand {
  color: var(--fremtid-text);
  font-size: 1.8rem;
  font-weight: 600;
  font-family: "Rajdhani", sans-serif;
  margin: 0;
  display: flex;
  align-items: center;
  text-decoration: none;
}

.header-logo {
  height: 60px;
  width: 60px;
  object-fit: contain;
  flex-shrink: 0;
  background: transparent;
  margin-right: 0.5rem;
}

header nav {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex: 1;
  justify-content: flex-end;
}

header nav button,
header nav a {
  color: var(--fremtid-text);
  text-decoration: none;
  padding: 0.6rem 0.95rem;
  border-radius: 8px;
  transition:
    background 160ms ease,
    color 160ms ease;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: "Rajdhani", sans-serif;
}

header nav button:hover,
header nav a:hover {
  background: rgba(237, 111, 0, 0.15);
}

#dropdownRapporter,
#dropdownTemaer,
#dropdownKraft {
  z-index: 1000 !important;
}

/* Hamburger Menu */
.hamburger {
  display: none;
  flex-direction: column;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  gap: 0.4rem;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--fremtid-text);
  border-radius: 2px;
  transition: all 300ms ease;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile Menu */
.nav-menu-mobile {
  display: none;
  position: fixed;
  top: 120px;
  left: 0;
  width: 100%;
  height: calc(100vh - 120px);
  background: rgba(17, 61, 42, 0.98);
  flex-direction: column;
  list-style: none;
  margin: 0;
  padding: 1rem 2rem 2rem;
  z-index: 999;
  overflow-y: auto;
}

.nav-menu-mobile.active {
  display: flex;
}

.menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
}

.menu-overlay.active {
  display: block;
}

.nav-menu-mobile .nav-item {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu-mobile .nav-item > a {
  display: block;
  padding: 0.75rem 0;
  color: var(--fremtid-text);
  text-decoration: none;
  font-size: 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-menu-mobile .dropdown {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0.5rem 0 0.5rem 1.5rem;
}

.nav-menu-mobile .dropdown.active {
  display: block;
}

.nav-menu-mobile .dropdown li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu-mobile .dropdown a {
  display: block;
  color: #ed6f00;
  padding: 0.5rem 0;
  font-size: 0.95rem;
}

.nav-menu-mobile .nav-item > button,
.nav-menu-mobile .dropdown button {
  color: #ed6f00;
  padding: 0.5rem 0;
  text-decoration: none;
  font-size: 0.95rem;
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.menu-caret {
  margin-left: 0.5rem;
  font-size: 0.8rem;
}

/* ===== CONTENT AREA ===== */
.content {
  flex: 1;
  padding: 1rem 2.5rem;
  display: flex;
  justify-content: center;
}

.main-section {
  width: 100%;
  max-width: 900px;
}

.page-title {
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0 0 2rem;
  letter-spacing: 0.04em;
}

.page-content {
  font-size: 1rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.85);
}

.page-content h2 {
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
  color: var(--fremtid-text);
}

.page-content p {
  margin: 0 0 1.5rem;
}

.page-content ul {
  margin: 0 0 1.5rem 2rem;
  padding: 0;
}

.page-content li {
  margin: 0.5rem 0;
}

.back-button {
  display: inline-block;
  margin-bottom: 2rem;
  padding: 0.6rem 1.2rem;
  background: rgba(237, 111, 0, 0.15);
  border: 1px solid rgba(237, 111, 0, 0.3);
  border-radius: 8px;
  color: var(--fremtid-text);
  text-decoration: none;
  transition: background 200ms ease;
}

.back-button:hover {
  background: rgba(237, 111, 0, 0.25);
}

/* Bildekontroll-klasser for Markdown-innhold */
.page-content img {
  border-radius: 8px;
  margin: 1rem 0;
}

.page-content .img-right {
  float: right;
  margin: 0 0 1rem 2rem !important;
  max-width: 300px;
}

.page-content .img-left {
  float: left;
  margin: 0 2rem 1rem 0 !important;
  max-width: 300px;
}

.img-center {
  display: block;
  margin: 1.5rem auto;
  max-width: 100%;
}

.img-small {
  max-width: 200px;
}

.img-medium {
  max-width: 400px;
}

.img-large {
  max-width: 700px;
}

/* ===== FOOTER ===== */
footer {
  background: rgba(17, 61, 42, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-top {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.footer-top-line {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-menu {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
}

.footer-menu a {
  color: var(--fremtid-text);
  text-decoration: none;
  transition: opacity 200ms ease;
}

.footer-menu a:hover {
  opacity: 0.8;
}

.footer-top-text {
  color: var(--fremtid-text);
  font-weight: 600;
}

.footer-top-text-subtitle {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.footer-logo-table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 0;
  border: none;
}

.footer-logo-table td {
  border: none;
  padding: 0.5rem;
  vertical-align: bottom;
  text-align: center;
}

.footer-logo-table td:first-child {
  text-align: center;
}

.footer-logo-table td:nth-child(2) {
  text-align: center;
}

.footer-logo-table td:last-child {
  text-align: center;
}

.footer-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  min-width: 100px;
  margin: 0 auto 0.5rem;
  text-decoration: none;
  transition: opacity 200ms ease;
}

.footer-logo:hover {
  opacity: 0.8;
}

.footer-logo img {
  max-height: 50px;
  max-width: 120px;
  object-fit: contain;
}

.footer-logo-sv {
  flex-direction: column;
  gap: 0;
}

.footer-logo-sv img {
  max-height: 30px;
}

.footer-logo-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1;
  margin: 0;
}

.footer-logo-sv img {
  margin-top: -2px;
}

/* ===== LEGACY STYLES ===== */
.page {
  max-width: 720px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2rem;
  border-radius: 16px;
  background: rgba(17, 61, 42, 0.92);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

.brand {
  color: var(--fremtid-text);
  font-size: clamp(2.5rem, 4vw, 4rem);
  margin: 0 0 0.5rem;
  letter-spacing: 0.04em;
}

.subtitle {
  margin: 0 0 1.8rem;
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.05rem;
  line-height: 1.7;
}

.button {
  display: inline-block;
  padding: 0.95rem 1.6rem;
  border: 1px solid var(--fremtid-text);
  color: var(--fremtid-text);
  text-decoration: none;
  border-radius: 999px;
  transition:
    background 160ms ease,
    color 160ms ease;
}

.button:hover {
  background: var(--fremtid-text);
  color: var(--fremtid-background);
}

.container {
  padding: 2rem;
}

.link {
  color: var(--fremtid-text);
  border: 1px solid var(--fremtid-border);
  background: transparent;
  padding: 0.75rem 1.2rem;
  text-decoration: none;
}

.revision-info {
  margin-top: 2rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  font-family: "Courier New", monospace;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  header {
    padding: 0.5rem 1rem;
  }

  header nav {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .content {
    padding: 1rem;
  }

  .main-section {
    width: 100%;
  }

  .page-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
  }

  .page-content {
    font-size: 0.95rem;
  }

  .page-content .img-right,
  .page-content .img-left {
    float: none;
    display: block;
    margin: 1rem auto !important;
    max-width: 100%;
  }

  footer {
    padding: 1.5rem;
    font-size: 0.85rem;
  }
}
