/*
Theme Name: Herlev Aikido
Description: Responsivt tema til Herlev Aikido - Granit & Rød med runde former
Version: 3.3
*/

:root {
  --red:         #c8102e;
  --red-dark:    #9b1a2a;
  --red-light:   #e8304a;
  --bg-outer:    #0e1012;
  --bg-nav:      #111418;
  --bg-dark:     #1a1e22;
  --bg-mid:      #222830;
  --bg-box:      #1e2328;
  --text:        #d8d0c8;
  --text-light:  #e8e0d8;
  --text-muted:  #b8a898;
  --border:      #2e3540;
  --radius-lg:   12px;
  --radius-md:   8px;
  --radius-sm:   5px;
  --nav-top-h:   90px;
  --nav-bot-h:   48px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg-outer);
  color: var(--text);
  font-family: 'Segoe UI', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.7;
}

a { color: var(--red-light); text-decoration: none; }
a:hover { color: #ff5070; text-decoration: underline; }

h1, h2, h3, h4 {
  color: var(--text-light);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.6em;
}
h1 {
  font-size: 1.7em;
  border-bottom: 2px solid var(--red-dark);
  padding-bottom: 0.3em;
  margin-bottom: 0.8em;
}
h2 { font-size: 1.3em; color: var(--red-light); }
h3 { font-size: 1.1em; color: var(--text-light); }

p { margin-bottom: 1em; }
ul, ol { margin: 0 0 1em 1.5em; }
li { margin-bottom: 0.3em; }
img { max-width: 100%; height: auto; display: block; }

table { border-collapse: collapse; width: 100%; margin-bottom: 1.2em; }
td, th { padding: 8px 12px; border: 1px solid var(--border); }
th { background: var(--bg-nav); color: var(--red-light); font-weight: 600; }
tr:nth-child(even) td { background: rgba(255,255,255,0.02); }

/* =====================
   SIDE-WRAPPER
   ===================== */
#page-wrapper {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

/* =====================
   NAVIGATION
   ===================== */
#site-nav {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  top: 0;
  z-index: 1000;
  background: var(--bg-nav);
  transition: all 0.35s ease;
}

/* Øverste bjælke: logo + søgefelt */
#nav-top {
  height: var(--nav-top-h);
  overflow: hidden;
  transform-origin: top;
  transition: transform 0.35s ease, opacity 0.35s ease, height 0.35s ease;
  will-change: transform, opacity;
  -webkit-transform-origin: top;
  -webkit-transition: -webkit-transform 0.35s ease, opacity 0.35s ease, height 0.35s ease;
}

#nav-top-inner {
  max-width: 1060px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.nav-logo img {
  height: 64px;
  width: auto;
  transition: height 0.35s ease;
}

/* Søgefelt */
#nav-search .search-form { display: flex; align-items: center; }

#nav-search input[type="search"] {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  color: var(--text-light);
  padding: 8px 14px;
  font-size: 0.88em;
  width: 220px;
  outline: none;
  transition: background 0.2s, border-color 0.2s;
}
#nav-search input[type="search"]:focus {
  background: rgba(255,255,255,0.1);
  border-color: var(--red-dark);
}
#nav-search input[type="search"]::placeholder { color: var(--text-muted); }

#nav-search button[type="submit"] {
  background: var(--red-dark);
  border: 1px solid var(--red-dark);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: #fff;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 0.88em;
  transition: background 0.2s;
}
#nav-search button[type="submit"]:hover {
  background: var(--red);
  border-color: var(--red);
}

/* Nedre menulinje */
#nav-bottom {
  background: var(--bg-mid);
  border-top: 1px solid rgba(200,16,46,0.2);
  border-bottom: 1px solid rgba(0,0,0,0.4);
  height: var(--nav-bot-h);
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  box-shadow: 0 3px 16px rgba(0,0,0,0.5);
}

#nav-menu {
  margin: 0;
  align-self: stretch;
  display: flex;
  align-items: center;
  list-style: none;
  gap: 2px;
}

#nav-menu li a {
  display: block;
  padding: 7px 13px;
  color: var(--text-muted);
  font-size: 0.88em;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

#nav-menu li a:hover,
#nav-menu li.current-menu-item a,
#nav-menu li.current_page_item a {
  background: rgba(200,16,46,0.15);
  color: var(--red-light);
  text-decoration: none;
}

/* Hamburger */
#nav-toggle:hover { color: var(--red-light); }
#nav-toggle:hover span { background: var(--red-light); }

#nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--red-dark);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 7px 10px;
  flex-direction: column;
  gap: 5px;
  margin-left: 16px;
}
#nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
}

/* SHRINK VED SCROLL */
#site-nav.scrolled #nav-top {
  height: 0;
  opacity: 0;
  pointer-events: none;
}
#site-nav.scrolled #nav-bottom {
  box-shadow: 0 4px 24px rgba(0,0,0,0.8);
  border-top: 2px solid var(--red-dark);
}

/* =====================
   HERO – RUNDE HJØRNER
   ===================== */
#hero {
  position: relative;
  width: 100%;
  height: 400px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  margin: 0 0 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}

#hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  filter: brightness(0.62) sepia(0.2);
}

#hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 42px;
  background: linear-gradient(to bottom, rgba(14,16,18,0.05) 0%, rgba(14,16,18,0.6) 100%);
  border-radius: var(--radius-lg);
  text-align: center;
  padding: 20px;
}

#hero-overlay p {
  font-size: 1.2em;
  color: rgba(255,255,255,0.9);
  text-shadow: 0 1px 6px rgba(0,0,0,0.9);
  margin-bottom: 1.4em;
  letter-spacing: 0.04em;
}

.hero-btn {
  display: inline-block;
  border: 2px solid var(--red);
  color: #fff;
  background: rgba(200,16,46,0.3);
  padding: 11px 32px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95em;
  letter-spacing: 0.06em;
  transition: background 0.2s;
}
.hero-btn:hover {
  background: var(--red);
  text-decoration: none;
  color: #fff;
}

/* =====================
   INDHOLDSBOKS – RUNDE HJØRNER
   ===================== */
#page-content {
  background: var(--bg-box);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 28px 32px 36px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
}

.entry-title {
  font-size: 1.5em;
  color: var(--text-light);
  border-bottom: 2px solid var(--red-dark);
  padding-bottom: 0.3em;
  margin-bottom: 0.9em;
}

.entry-content { color: var(--text); }
.entry-content img {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin: 6px 4px;
}

/* Nyheder */
.post { border-bottom: 1px solid var(--border); padding-bottom: 24px; margin-bottom: 24px; }
.post:last-child { border-bottom: none; }
.post-title { font-size: 1.15em; color: var(--text-light); margin-bottom: 0.2em; }
.post-title a { color: inherit; }
.post-title a:hover { color: var(--red-light); }
.post-meta { font-size: 0.8em; color: var(--text-muted); margin-bottom: 0.6em; }

/* Søgeresultater */
.search-results article { border-bottom: 1px solid var(--border); padding-bottom: 20px; margin-bottom: 20px; }

/* =====================
   FOOTER
   ===================== */
#site-footer {
  background: var(--bg-box);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin-top: 20px;
  padding: 18px 24px;
  text-align: center;
  font-size: 0.82em;
  color: var(--text-muted);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
#site-footer a { color: var(--red-light); }

/* =====================
   RESPONSIVT
   ===================== */

/* Nav centrering: CSS Grid giver ægte centrering altid */
/* Centrering: logo og actions er absolut-positioneret → menu altid ægte centreret */
#nav-bottom-logo {
  position: absolute;
  /* Align with content left edge: max-width 1060px centered + 16px padding */
  left: max(16px, calc(50% - 514px));
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  transition: opacity 0.35s ease;
}
#nav-bottom-logo img {
  height: 38px;
  width: auto;
  object-fit: contain;
  border-radius: 0;
}
#nav-bottom-logo:hover { opacity: 0.8; }
/* Logo skjult når ikke scrollet */
#site-nav:not(.scrolled) #nav-bottom-logo { opacity: 0; pointer-events: none; }
#site-nav.scrolled #nav-bottom-logo       { opacity: 1; pointer-events: auto; }
#nav-actions {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
}
/* Logo usynlig og pladsløs når ikke scrollet */



/* === Dynamisk burger (JS tilføjer .nav-mobile til #site-nav) === */
.nav-mobile #nav-toggle  { display: flex; }
.nav-mobile #nav-actions { display: flex; align-items: center; gap: 6px; justify-self: end; }
.nav-mobile #nav-menu {
  background: var(--bg-nav);
  display: none;
  position: fixed;
  top: 0;
  left: 0; right: 0;
  flex-direction: column;
  align-items: stretch;
  padding: 4px 0;
  box-shadow: 0 6px 20px rgba(0,0,0,0.7);
  z-index: 9999;
  max-height: 80vh;
  overflow-y: auto;
}
.nav-mobile #nav-menu.open  { display: flex; }
.nav-mobile #nav-menu li    { display: block; height: auto; margin: 0; }
.nav-mobile #nav-menu li a  {
  display: block;
  padding: 10px 16px;
  border-radius: 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 0.9em;
  line-height: 1.4;
  height: auto;
  white-space: normal;
}

@media (max-width: 900px) {
  #nav-menu li a { padding: 7px 9px; font-size: 0.82em; }
  #nav-search input[type="search"] { width: 160px; }
  #page-content { padding: 22px 20px 28px; }
}


@media (max-width: 480px) {
  :root { --nav-top-h: 70px; }
  .nav-logo img { height: 40px; }
  #nav-search { display: none; }
  #hero { height: 200px; }
  #hero-overlay p { font-size: 0.95em; }
}

/* =====================
   V8 RETTELSER
   ===================== */

/* 1. Afstand fra navbar til hero/indhold */
#page-wrapper {
  padding-top: 152px;
/* Juster for WP admin-bar (logger ind) */
}
.admin-bar #page-wrapper { padding-top: 120px; }

/* 2. Menubjælken clipper highlights korrekt */
#nav-bottom {
  overflow: hidden;
  padding: 0 12px;
}

/* 3. Menupunkter centreret i højden */
#nav-menu {
  height: 100%;
  align-items: center;
}

#nav-menu li {
  display: flex;
  align-items: center;
  height: 100%;
}

#nav-menu li a {
  display: flex;
  align-items: center;
  height: calc(var(--nav-bot-h) - 8px);
  padding: 0 13px;
  line-height: 1;
}

/* =====================
   FORSIDE ELEMENTER
   ===================== */

/* Velkomst */
.fp-welcome {
  font-size: 1.05em;
  color: var(--text);
  line-height: 1.8;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

/* Tre kort side om side */
.fp-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.fp-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 20px;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.fp-card:hover {
  border-color: var(--red-dark);
  background: #252b33;
  transform: translateY(-2px);
  text-decoration: none;
}

.fp-card-icon {
  font-size: 2em;
  margin-bottom: 10px;
  line-height: 1;
}

.fp-card h3 {
  font-size: 1.05em;
  color: var(--text-light);
  margin-bottom: 8px;
}

.fp-card p {
  font-size: 0.88em;
  color: var(--text-muted);
  flex: 1;
  margin-bottom: 14px;
  line-height: 1.6;
}

.fp-card-link {
  font-size: 0.85em;
  color: var(--red-light);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Næste arrangement – klistret indlæg */
.fp-event {
  background: rgba(200,16,46,0.08);
  border: 1px solid rgba(200,16,46,0.3);
  border-left: 4px solid var(--red);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 28px;
}

.fp-event-label {
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--red-light);
  margin-bottom: 6px;
  font-weight: 600;
}

.fp-event h3 {
  font-size: 1.1em;
  color: var(--text-light);
  margin-bottom: 4px;
}

.fp-event h3 a { color: inherit; }
.fp-event h3 a:hover { color: var(--red-light); }

.fp-event-meta {
  font-size: 0.8em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.fp-event-excerpt {
  font-size: 0.9em;
  color: var(--text);
  margin-bottom: 14px;
}

.fp-event-btn {
  font-size: 0.85em;
  color: var(--red-light);
  font-weight: 600;
}

/* Citat */
.fp-quote {
  border-top: 1px solid var(--border);
  padding-top: 28px;
  margin-top: 4px;
}

.fp-quote blockquote {
  font-size: 1.05em;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.8;
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
}

.fp-quote cite {
  display: block;
  margin-top: 12px;
  font-size: 0.82em;
  font-style: normal;
  color: var(--text-muted);
  opacity: 0.75;
}

/* Responsivt */
@media (max-width: 768px) {
  .fp-cards { grid-template-columns: 1fr; gap: 12px; }
  .fp-card { padding: 18px 16px; }
}

@media (max-width: 480px) {
  .fp-welcome { font-size: 0.95em; }
  .fp-quote blockquote { font-size: 0.95em; }
}

/* =====================
   V10 RETTELSER
   ===================== */


/* Logo i nav-bottom */
#nav-bottom-logo:hover { opacity: 1; }
#nav-bottom-logo img {
  height: 28px;
  width: 28px;
  border-radius: 50%;
  object-fit: contain;
}

/* Menu centreret */
#nav-menu {
  display: flex;
  justify-content: center;
}

/* Hamburger til højre */
#nav-toggle {
  display: none;
  justify-self: end;
  margin-left: 0;
}

/* Mobilmenu: fuld baggrund, vises under nav-bottom */

/* =====================
   V11 RETTELSER
   ===================== */

/* 1. Favicon kun synligt når scrolled – skjult som standard */

/* 2. Footer tekst */
#site-footer .footer-tagline {
  display: none;
}

/* 3. Fjern floats fra Drupal-billeder og lav grid-layout */

/* Alle inline-stylede billeder i indhold */
.entry-content img {
  float: none !important;
  display: inline-block !important;
  vertical-align: top;
  max-width: 100%;
  height: auto !important;
  width: auto !important;
  max-height: 220px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin: 3px !important;
}

/* Første billede (float:right i originalen) – stå alene til højre */
.entry-content > p:first-of-type img {
  float: right !important;
  margin: 0 0 12px 16px !important;
  max-height: 160px;
}

/* Paragraf der kun indeholder billeder – lav flexbox-grid */
.entry-content p:not(:first-of-type) {
  display: block;
}

/* Paragraf med kun billeder (ingen tekst) → flex-row */
.entry-content p img ~ img,
.entry-content p:has(img):not(:has(br + br)):not(:first-of-type) {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

/* Direkte billedgruppe-paragraf */
.entry-content p:not(:first-of-type):has(> img) {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 1em;
}

/* Responsivt: under 600px, billeder centreret ét ad gangen */
@media (max-width: 600px) {
  .entry-content p:not(:first-of-type):has(> img) {
    flex-direction: column;
    align-items: center;
  }
  .entry-content > p:first-of-type img {
    float: none !important;
    display: block !important;
    margin: 0 auto 12px !important;
  }
}

/* =====================
   V12 RETTELSER
   ===================== */

/* Fix menu-hop: brug max-height transition i stedet for height */
#nav-top {
  max-height: 200px;
  height: auto;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.4s ease, padding 0.4s ease;
}

#nav-top-inner {
  padding-top: 12px;
  padding-bottom: 12px;
}

#site-nav.scrolled #nav-top {
  height: 0 !important;
  opacity: 0;
  pointer-events: none;
  transform: scaleY(0);
  -webkit-transform: scaleY(0);
}

/* Skjul emoji-billeder (WordPress SVG emojis) */
img.emoji {
  display: none !important;
}


}

/* =====================
   INSTRUKTØR-SIDE LAYOUT
   ===================== */

.instruktor {
  overflow: hidden;
  border-top: 1px solid var(--border);
  padding-top: 24px;
  margin-top: 24px;
}

.instruktor:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.instruktor::after {
  content: "";
  display: table;
  clear: both;
}

/* Navn */
.instruktor h2 {
  color: var(--red-light) !important;
  font-size: 1.2em !important;
  margin-bottom: 10px !important;
  border: none !important;
  padding: 0 !important;
  margin-top: 0 !important;
  clear: none !important;
  min-height: 0 !important;
  overflow: visible !important;
}

/* Billedet – WordPress alignright klasse styrer floaten */
.instruktor .instruktor-foto,
.instruktor .alignright {
  float: right !important;
  width: 120px !important;
  height: 120px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  border: 2px solid var(--red-dark) !important;
  margin: 0 0 12px 20px !important;
  display: block !important;
  max-width: 120px !important;
}

/* Tekst */
.instruktor p {
  color: var(--text);
  margin-bottom: 6px;
  border-bottom: none !important;
  padding-bottom: 0 !important;
  overflow: visible;
}

/* Skjul billeder i h2 */
.instruktor h2 img {
  display: none !important;
}

/* Mobil */
@media (max-width: 600px) {
  .instruktor .instruktor-foto,
  .instruktor .alignright {
    width: 80px !important;
    height: 80px !important;
    max-width: 80px !important;
  }
}

@media (max-width: 380px) {
  .instruktor .instruktor-foto,
  .instruktor .alignright {
    float: none !important;
    display: block !important;
    margin: 0 auto 12px !important;
  }
}


/* V23: Fix mobilmenu afskæring */

/* =====================
   V24: MOBILMENU KOMPAKT
   ===================== */

/* =====================
   V25: FIX MOBILMENU LI HØJDE
   ===================== */

/* =====================
   V26: MOBILMENU DYNAMISK POSITIONERING
   ===================== */

/* =====================
   V27: MOBILMENU HØJREJUSTERET
   ===================== */

/* =====================
   V28: MOBILMENU STRAM
   ===================== */

/* =====================
   V32: MOBIL LOGO STØRRE + SAFARI SØGEFELT FIX
   ===================== */

/* Større logo på mobil */
@media (max-width: 768px) {
  .nav-logo img {
    height: 70px !important;
  }

  /* Safari iOS søgefelt fix – forhindrer zoom og forsvinden */
  #nav-search input[type="search"] {
    font-size: 16px !important; /* Forhindrer Safari auto-zoom */
    -webkit-appearance: none !important;
    appearance: none !important;
    opacity: 1 !important;
    -webkit-opacity: 1 !important;
  }

  #nav-search button[type="submit"] {
    -webkit-appearance: none !important;
    appearance: none !important;
  }

  /* Søgeformular altid synlig på mobil */
  #nav-search {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  /* Giv nav-top lidt mere plads til det større logo */
  #nav-top-inner {
    padding-top: 8px !important;
    padding-bottom: 8px !important;
  }
}

/* Ekstra Safari iOS fix – forhindrer input-forsvinden */
@supports (-webkit-touch-callout: none) {
  #nav-search input[type="search"] {
    font-size: 16px !important;
    -webkit-user-select: text !important;
    user-select: text !important;
  }
}

/* =====================
   MOBIL LUP-SØGNING
   ===================== */

/* Skjul desktop søgefelt på mobil */
@media (max-width: 768px) {
  #nav-search {
    display: none !important;
  }

  /* Nav-actions: lup + hamburger side om side */
  #nav-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
  }

  /* Lup-knap */
  #search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--red-dark);
    border-radius: var(--radius-sm);
    color: var(--red-light);
    cursor: pointer;
    padding: 7px 9px;
    transition: background 0.15s;
  }

  #search-toggle:hover {
    background: rgba(200,16,46,0.15);
  }

  /* Mobil søgefelt – skjult som standard */
  #mobile-search {
    display: none;
    background: var(--bg-nav);
    border-top: 1px solid var(--border);
    padding: 10px 16px;
  }

  #mobile-search.open {
    display: block;
  }

  #mobile-search .search-form {
    display: flex;
    width: 100%;
  }

  #mobile-search input[type="search"] {
    flex: 1;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--border);
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    color: var(--text-light);
    padding: 10px 14px;
    font-size: 16px; /* Forhindrer Safari auto-zoom */
    -webkit-appearance: none;
    outline: none;
  }

  #mobile-search input[type="search"]:focus {
    border-color: var(--red-dark);
    background: rgba(255,255,255,0.12);
  }

  #mobile-search button[type="submit"] {
    background: var(--red-dark);
    border: 1px solid var(--red-dark);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: #fff;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.9em;
    -webkit-appearance: none;
  }

  #mobile-search button[type="submit"]:hover {
    background: var(--red);
  }
}

/* Skjul lup og mobil søgefelt på desktop */
@media (min-width: 769px) {
  #search-toggle { display: none; }
  #mobile-search { display: none !important; }
}

/* =====================
   SAFARI IOS SCROLL TRANSITION FIX
   ===================== */

/* Brug transform i stedet for height/max-height for glat overgang på Safari */
#nav-top {
  transform-origin: top center;
  -webkit-transform-origin: top center;
  will-change: transform, opacity, height;
  transition: transform 0.3s ease, opacity 0.3s ease, height 0.3s ease !important;
  -webkit-transition: -webkit-transform 0.3s ease, opacity 0.3s ease, height 0.3s ease !important;
}

#site-nav.scrolled #nav-top {
  height: 0 !important;
  opacity: 0 !important;
  transform: scaleY(0) !important;
  -webkit-transform: scaleY(0) !important;
  pointer-events: none !important;
}

/* Sørg for at nav-bottom altid er synlig */
#nav-bottom {
  will-change: box-shadow;
  -webkit-transform: translateZ(0); /* Aktiver GPU-acceleration på Safari */
  transform: translateZ(0);
}

/* =====================
   FIX: NAV-BOTTOM OVERFLOW KLIPPER MENUEN
   ===================== */

/* Men menuhighlight må ikke gå ud over bjælken – løses med border-radius på link selv */
#nav-menu li a {
  overflow: hidden;
}

/* Sørg for hamburger altid er synlig på mobil */
@media (max-width: 768px) {
  #nav-actions {
    display: flex !important;
  }
  #nav-toggle {
    display: flex !important;
  }
  #search-toggle {
    display: flex !important;
  }
}

/* =====================
   BILLEDE-GRUPPER PÅ INDHOLDSSIDER
   ===================== */

/* Paragraf der KUN indeholder billeder → centreret flex-række */
.entry-content p:has(> img):not(:first-of-type) {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 1.2em;
  float: none !important;
  overflow: visible !important;
}

/* Billeder i en billedgruppe – ensartet størrelse */
.entry-content p:has(> img):not(:first-of-type) img {
  float: none !important;
  display: block !important;
  margin: 0 !important;
  width: auto !important;
  height: 160px !important;
  max-height: 160px !important;
  max-width: 100% !important;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

/* Responsivt – når siden er for smal: én ad gangen, centreret */
@media (max-width: 480px) {
  .entry-content p:has(> img):not(:first-of-type) {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .entry-content p:has(> img):not(:first-of-type) img {
    height: auto !important;
    max-height: 280px !important;
    width: 100% !important;
    max-width: 320px !important;
    margin: 0 auto !important;
  }
}

/* Alle flex-wrap situationer – centrer når billeder wrapper */
.entry-content p:has(> img):not(:first-of-type) {
  align-items: center !important;
}

/* Billedgrupper – sættes via JS med klassen .img-group */
.entry-content .img-group {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 1.2em;
  float: none !important;
  overflow: visible !important;
  clear: both;
}

.entry-content .img-group img {
  float: none !important;
  display: block !important;
  margin: 0 !important;
  width: auto !important;
  height: 180px !important;
  max-height: 180px !important;
  max-width: 100% !important;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

/* Responsivt – én ad gangen centreret */
@media (max-width: 480px) {
  .entry-content .img-group {
    flex-direction: column;
    align-items: center;
  }

  .entry-content .img-group img {
    height: auto !important;
    max-height: 260px !important;
    width: 100% !important;
    max-width: 300px !important;
  }
}
/* Nav-menu som dropdown-portal (appenderet til body) */
#nav-menu.nav-portal {
  position: fixed !important;
  flex-direction: column !important;
  align-items: stretch !important;
  height: auto !important;
  width: 260px !important;
  max-width: calc(100vw - 32px) !important;
  background: var(--bg-nav) !important;
  box-shadow: 0 6px 20px rgba(0,0,0,0.8) !important;
  border-radius: var(--radius-md, 6px) !important;
  z-index: 99999 !important;
  padding: 4px 0 !important;
  margin: 0 !important;
  max-height: 80vh !important;
  overflow-y: auto !important;
}
#nav-menu.nav-portal li {
  display: block !important;
  height: auto !important;
  margin: 0 !important;
}
#nav-menu.nav-portal li a {
  display: block !important;
  padding: 10px 16px !important;
  border-radius: 0 !important;
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
  font-size: 0.9em !important;
  line-height: 1.4 !important;
  height: auto !important;
  white-space: normal !important;
}
