/* Minimal, Joomla-free styling for `site/` */

html { height: 100%; }
body {
  min-height: 100%;
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: #1c1c1c;
  line-height: 1.5;
  background-color: #6b7a72;
  background-image: url("/images/brand/bg-04.jpg");
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
  background-attachment: fixed;
}

.gd-page { max-width: 1100px; margin: 0 auto; padding: 16px; }

.gd-sheet-top {
  background: linear-gradient(180deg, #f9f7f4 0%, #ffffff 55%);
  border-top: 3px solid #c67000;
  border-radius: 8px 8px 0 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.gd-header-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 14px;
}

.gd-header-logo { flex: 0 0 auto; line-height: 0; min-width: 0; }
.gd-header-nav {
  flex: 1 1 auto;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  min-width: 0;
  gap: 0;
}

.gd-nav-toggle {
  display: none;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.gd-nav-toggle:hover {
  border-color: rgba(198, 112, 0, 0.45);
  background: #fffaf3;
}
.gd-nav-toggle:focus-visible {
  outline: 2px solid #c67000;
  outline-offset: 2px;
}
.gd-nav-toggle-lines {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 22px;
}
.gd-nav-toggle-line {
  display: block;
  height: 2px;
  border-radius: 1px;
  background: #2a2a2a;
}

.gd-logo {
  display: inline-block;
  text-decoration: none;
  color: #1c1c1c;
}
.gd-logo img {
  display: block;
  height: auto;
  width: auto;
  max-height: 150px;
  max-width: min(531px, 90.625vw);
}

.gd-nav-top { list-style: none; margin: 0; padding: 0; display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.gd-nav-item { position: relative; }
.gd-nav-link { text-decoration: none; color: #2a2a2a; padding: 6px 4px; display: inline-block; font-size: 1.02rem; }
.gd-nav-link[aria-current="page"] { color: #b35f00; }

.gd-nav-item.has-children > .gd-nav-link::after { content: " ▾"; opacity: 0.6; }
/* Luft som padding, ikke margin-top — margin utenfor abs. boksen gir hover-glipp mot undermeny. */
.gd-nav-sub { display: none; position: absolute; top: 100%; left: 0; background: #fff; border: 1px solid rgba(0,0,0,0.12); border-radius: 8px; padding: 16px 8px 8px; min-width: 220px; list-style: none; margin: 0; }
.gd-nav-item.has-children:hover > .gd-nav-sub,
.gd-nav-item.has-children:focus-within > .gd-nav-sub { display: block; }
.gd-nav-sub .gd-nav-link { white-space: nowrap; }

.gd-sheet {
  background: #fff;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.10);
  overflow: hidden;
}

.gd-pagehead { padding: 18px 16px; border-bottom: 1px solid rgba(0,0,0,0.07); background: linear-gradient(180deg,#fff 0%,#fafafa 100%); }
.gd-pagehead h1 { margin: 0; font-size: clamp(1.65rem, 3.6vw, 2.35rem); line-height: 1.18; letter-spacing: -0.025em; }
.gd-pagehead h1::before { content: ""; display: block; width: 44px; height: 4px; border-radius: 2px; margin-bottom: 10px; background: linear-gradient(90deg,#c67000,#ff9a2e); }

.gd-grid { display: grid; grid-template-columns: 1fr; gap: 18px; padding: 14px; }
.gd-grid.has-sidebar { grid-template-columns: 2fr 1fr; }
.gd-content, .gd-main, .gd-side { min-width: 0; }

/* Luft rundt bilder i brødtekst (header-logo styres av .gd-logo img) */
.gd-main img,
.gd-side-body img {
  max-width: 100%;
  height: auto;
  margin-block: 1.1em;
  margin-inline: 0;
}
.gd-main figure,
.gd-side-body figure {
  margin: 1.15em 0;
  max-width: 100%;
}
.gd-main figure img,
.gd-side-body figure img {
  margin-block: 0;
  display: block;
}

/* Flytbilde (float fra editor): margin-block gir lite mot tekst — bruk siderom */
.gd-main img[style*="float: right"],
.gd-main img[style*="float:right"],
.gd-side-body img[style*="float: right"],
.gd-side-body img[style*="float:right"] {
  margin: 0.35em 0 1em 1.15em;
}
.gd-main img[style*="float: left"],
.gd-main img[style*="float:left"],
.gd-side-body img[style*="float: left"],
.gd-side-body img[style*="float:left"] {
  margin: 0.35em 1.15em 1em 0;
}

/* Høyrekolonne: samme grønn som Xenon .box3 / .title3 på gripdagen.org (#00b060) */
.gd-side {
  align-self: start;
  padding: 0;
  overflow: hidden;
  background: #00b060;
  border: 1px solid rgba(0, 60, 30, 0.35);
  border-radius: 8px;
  border-top: 3px solid #c67000;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.12);
  color: #fff;
}

.gd-side-head {
  padding: 0.55rem 1rem 0.62rem;
  background: linear-gradient(180deg, #00c46a 0%, #00b060 55%, #009e54 100%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.gd-side-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  line-height: 1.3;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

.gd-side-body {
  padding: 14px 16px 18px;
  background: #00b060;
  color: #fff;
}

.gd-side-body > :first-child { margin-top: 0; }
.gd-side-body > :last-child { margin-bottom: 0; }

.gd-side-body h1,
.gd-side-body h2,
.gd-side-body h3 {
  margin: 0 0 0.55rem;
  font-size: 1.02rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
}

.gd-side-body p { margin: 0.5rem 0; }
.gd-side-body p:first-of-type { margin-top: 0; }

/* Lenker i sidekolonne (samme logikk som .box3 a på gamle tema) */
.gd-side-body a {
  color: #00170d;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.gd-side-body a:hover {
  color: #00fd8a;
}

.gd-footer { text-align: center; color: rgba(0,0,0,0.55); padding: 14px 0; }

/* Bildehøyde fra editor: maks høyde + object-fit så proporsjoner holdes også i trange kolonner */
img.gd-img-h140 { max-height: 140px !important; height: auto !important; width: auto !important; max-width: 100% !important; object-fit: contain !important; vertical-align: middle; }
img.gd-img-h180 { max-height: 180px !important; height: auto !important; width: auto !important; max-width: 100% !important; object-fit: contain !important; vertical-align: middle; }
img.gd-img-h220 { max-height: 220px !important; height: auto !important; width: auto !important; max-width: 100% !important; object-fit: contain !important; vertical-align: middle; }
img.gd-img-h280 { max-height: 280px !important; height: auto !important; width: auto !important; max-width: 100% !important; object-fit: contain !important; vertical-align: middle; }
img.gd-img-h350 { max-height: 350px !important; height: auto !important; width: auto !important; max-width: 100% !important; object-fit: contain !important; vertical-align: middle; }

/* To bilder ved siden av: grid + null margin på barn (unngå at høyre «hopper» pga. p/line-height) */
.gd-img-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(8px, 2vw, 16px);
  align-items: start;
  margin: 1.1em 0;
  clear: both;
}
.gd-img-row > * {
  min-width: 0;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}
.gd-img-row figure {
  margin: 0 !important;
}
.gd-img-row img {
  width: 100%;
  height: auto;
  margin: 0 !important;
  display: block;
}
.gd-img-row > p:has(img) {
  line-height: 0;
}
.gd-img-row > span {
  display: block;
}

@media (max-width: 520px) {
  .gd-img-row {
    grid-template-columns: 1fr;
  }
}

/* Gamle Joomla/editor: span som kun omslutter ett bilde — ikke la smal span begrense størrelsen */
@supports selector(:has(*)) {
  .gd-main span:has(> img:only-child),
  .gd-side-body span:has(> img:only-child) {
    display: inline-block;
    max-width: 100% !important;
    width: auto !important;
    min-width: 0;
    vertical-align: middle;
  }
  .gd-main span:has(> img:only-child) img,
  .gd-side-body span:has(> img:only-child) img {
    max-width: 100%;
    width: auto;
    height: auto;
    display: block;
  }
}

@media (max-width: 800px) {
  .gd-grid.has-sidebar { grid-template-columns: 1fr; }
  .gd-header-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .gd-header-logo {
    flex: 1 1 auto;
    min-width: 0;
  }
  .gd-logo img {
    max-height: min(150px, 38vw);
    max-width: min(531px, calc(100vw - 60px));
  }
  .gd-header-nav {
    flex: 0 0 auto;
    justify-content: flex-end;
    position: relative;
  }
  .gd-header-nav--empty {
    display: none;
  }
  .gd-nav-toggle {
    display: inline-flex;
  }
  .gd-header-nav:not(.is-menu-open) .gd-nav {
    display: none;
  }
  .gd-header-nav.is-menu-open .gd-nav {
    display: block;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: auto;
    min-width: min(300px, calc(100vw - 32px));
    max-height: min(70vh, 520px);
    overflow-y: auto;
    margin: 0;
    padding: 10px 12px 12px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.14);
    z-index: 200;
    -webkit-overflow-scrolling: touch;
  }
  .gd-header-nav.is-menu-open .gd-nav-top {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 2px;
  }
  .gd-header-nav.is-menu-open .gd-nav-link {
    display: block;
    padding: 10px 8px;
    border-radius: 6px;
  }
  .gd-header-nav.is-menu-open .gd-nav-link:hover,
  .gd-header-nav.is-menu-open .gd-nav-link:focus-visible {
    background: rgba(198, 112, 0, 0.08);
  }
  .gd-header-nav.is-menu-open .gd-nav-sub {
    display: block !important;
    position: static;
    margin: 0 0 4px;
    padding: 0 0 4px 12px;
    min-width: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }
  .gd-header-nav.is-menu-open .gd-nav-sub .gd-nav-link {
    padding: 8px 8px;
    font-size: 0.98rem;
  }
  body { background-attachment: scroll; }
  body.gd-menu-open {
    overflow: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  body { background-attachment: scroll; }
}

