/*
Theme Name: NIRUWP Theme
Theme URI: https://github.com/nirucon/niruwp-theme
Author: Nicklas Rudolfsson
Author URI: https://nirucon.se
Description: Generellt, fullt anpassningsbart tema för föreningar och organisationer. Alla färger, typsnitt, layout och texter konfigureras via Utseende → Anpassa.
Version: 1.0.17
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: niruwp-theme
Tags: custom-logo, custom-menu, featured-images, threaded-comments, full-width-template
*/

/* ============================================================
   CSS CUSTOM PROPERTIES
   Värden sätts dynamiskt från Customizer via inline-style i <head>.
   Dessa är fallback-värden om Customizer-output saknas.
   ============================================================ */
:root {
  /* Core palette – overrides from Customizer */
  --color-accent:       #1a1a1a;
  --color-accent-dark:  #111111;
  --color-accent-light: #444444;
  --color-dark:         #111827;
  --color-dark-mid:     #1F2937;
  --color-mid:          #4B5563;
  --color-bg:           #F9FAFB;
  --color-surface:      #F3F4F6;
  --color-border:       #E5E7EB;
  --color-muted:        #9CA3AF;
  --color-light:        #D1D5DB;

  /* Semantic */
  --bg-page:        var(--color-bg);
  --bg-surface:     var(--color-surface);
  --bg-dark:        var(--color-dark);
  --bg-dark-mid:    var(--color-dark-mid);
  --text-primary:   var(--color-dark);
  --text-secondary: var(--color-mid);
  --text-muted:     var(--color-muted);
  --accent:         var(--color-accent);
  --accent-hover:   var(--color-accent-dark);
  --border:         var(--color-border);

  /* Typography – overrides from Customizer */
  --font-display: 'Georgia', serif;
  --font-body:    'system-ui', 'Segoe UI', sans-serif;
  --font-mono:    'Courier New', monospace;

  /* Font sizes – overrides from Customizer */
  --font-size-base:    1rem;
  --font-size-sm:      0.875rem;
  --font-size-lg:      1.125rem;
  --font-size-xl:      1.25rem;
  --font-size-2xl:     1.5rem;
  --font-size-3xl:     1.875rem;
  --font-size-4xl:     2.25rem;
  --font-size-hero:    3.5rem;

  /* Spacing */
  --space-xs:  0.375rem;
  --space-sm:  0.75rem;
  --space-md:  1.5rem;
  --space-lg:  3rem;
  --space-xl:  5rem;
  --space-2xl: 8rem;

  /* Layout – overrides from Customizer */
  --max-width:        1180px;
  --max-width-narrow: 760px;
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  14px;

  /* Transitions */
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --dur:  0.28s;
}

/* ============================================================
   FÄRGLÄGEN (Color modes)
   Aktiveras via body-klass satt av WordPress Customizer.
   Standard (ingen klass) = Ljust läge.
   ============================================================ */

/* Mörkt läge */
body.color-mode-dark {
  --color-bg:      #111827;
  --color-surface: #1F2937;
  --color-border:  #374151;
  --color-muted:   #6B7280;
  --text-primary:  #F9FAFB;
  --text-secondary:#D1D5DB;
  --bg-page:       var(--color-bg);
  --bg-surface:    var(--color-surface);
  --bg-dark:       #0D1117;
  --bg-dark-mid:   #161B22;
}

/* Dämpat/neutralt läge */
body.color-mode-muted {
  --color-bg:      #F5F5F4;
  --color-surface: #E7E5E4;
  --color-border:  #D6D3D1;
  --bg-page:       var(--color-bg);
  --bg-surface:    var(--color-surface);
}

/* Accent-intensivt läge */
body.color-mode-accent {
  --bg-page:    var(--color-bg);
  --bg-surface: color-mix(in srgb, var(--color-accent) 8%, white);
  --border:     color-mix(in srgb, var(--color-accent) 20%, var(--color-border));
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base, 1.7);
  -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--color-link, var(--accent)); text-decoration: none; }
a:hover { color: var(--color-link-hover, var(--accent-hover)); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  line-height: 1.25;
  margin: 0 0 var(--space-sm);
  color: var(--text-primary);
}
h1 { font-size: clamp(2rem, 4vw, var(--font-size-hero)); }
h2 { font-size: clamp(1.5rem, 3vw, var(--font-size-4xl)); }
h3 { font-size: clamp(1.2rem, 2.5vw, var(--font-size-2xl)); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

p { margin: 0 0 var(--space-md); }

ul, ol { padding-left: 1.5em; margin: 0 0 var(--space-md); }
li { margin-bottom: 0.25em; }

blockquote {
  margin: var(--space-md) 0;
  padding: var(--space-sm) var(--space-md);
  border-left: 3px solid var(--accent);
  background: var(--bg-surface);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--text-secondary);
}

pre, code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}
code {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.1em 0.4em;
}
pre {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  overflow-x: auto;
}
pre code { background: none; border: none; padding: 0; }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-lg) 0;
}

/* ============================================================
   LAYOUT HELPERS
   ============================================================ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.container--narrow {
  max-width: var(--max-width-narrow);
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px,1px,1px,1px);
  clip-path: inset(50%);
  white-space: nowrap;
}
.screen-reader-text:focus {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 999999;
  width: auto;
  height: auto;
  clip: auto;
  clip-path: none;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-md);
  font-weight: 700;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--btn-radius, var(--radius-md));
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              color var(--dur) var(--ease),
              transform var(--dur) var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--btn-primary-bg, var(--accent));
  color: var(--btn-primary-text, #fff);
  border-color: var(--btn-primary-bg, var(--accent));
}
.btn--primary:hover {
  background: var(--btn-primary-hover, var(--accent-hover));
  border-color: var(--btn-primary-hover, var(--accent-hover));
  color: var(--btn-primary-text, #fff);
}

.btn--ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,0.45);
}
.btn--ghost:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.7);
  color: #fff;
}

.btn--outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.btn--outline:hover {
  background: var(--accent);
  color: #fff;
}

.btn--sm {
  padding: 0.5rem 1.25rem;
  font-size: 0.75rem;
}

.btn--lg {
  padding: 1rem 2.5rem;
  font-size: var(--font-size-base);
}

/* ============================================================
   SITE HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: var(--header-bg, var(--bg-dark));
  box-shadow: 0 1px 0 rgba(255,255,255,0.04);
  height: var(--header-height, 68px);
  display: flex;
  align-items: center;
  transition: background 0.3s;
}
.header-not-sticky .site-header {
  position: relative;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  height: 100%;
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  flex-shrink: 0;
}
.site-logo__img {
  width: var(--header-logo-size, 44px);
  height: var(--header-logo-size, 44px);
  object-fit: contain;
  border-radius: 50%;
}
.site-logo__text { display: flex; flex-direction: column; }
.site-logo__name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.site-logo__tagline {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Primary nav */
.primary-nav {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-left: auto;
}

.primary-nav__list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.25rem;
  align-items: center;
}

.primary-nav__list li { position: relative; }

.primary-nav__list a {
  display: block;
  padding: 0.45rem 0.8rem;
  color: rgba(255,255,255,0.8);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  transition: color var(--dur), background var(--dur);
}
.primary-nav__list a:hover,
.primary-nav__list .current-menu-item > a,
.primary-nav__list .current-page-ancestor > a {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

/* Dropdown */
.primary-nav__list .sub-menu {
  display: block;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  position: absolute;
  top: 100%;           /* flush - no gap, pseudo-element bridges */
  left: 0;
  min-width: 220px;
  background: var(--nav-dropdown-bg, var(--bg-dark-mid));
  border: 1px solid var(--nav-dropdown-border, rgba(255,255,255,0.1));
  border-radius: var(--radius-md);
  padding: 0.5rem;
  list-style: none;
  margin: 0;
  z-index: 200;
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
  transition: opacity 0.15s ease, visibility 0.15s ease, transform 0.15s ease;
  transform: translateY(-4px);
}
/* Bridge: covers gap so mouse can move from item to menu */
.primary-nav__list .menu-item-has-children::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 100%;
  height: 8px;
}
.primary-nav__list li:hover > .sub-menu,
.primary-nav__list li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.primary-nav__list .sub-menu a {
  display: block;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.875rem;
  color: var(--nav-dropdown-text, var(--header-text, #fff));
  transition: background 0.12s, color 0.12s;
}
.primary-nav__list .sub-menu a:hover {
  background: var(--nav-dropdown-hover, rgba(255,255,255,0.1));
  color: var(--nav-dropdown-hover-text, #fff);
}

.nav-cta { margin-left: var(--space-sm); }

/* Nav home button (configurable) */
.nav-home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.15);
  transition: color var(--dur), border-color var(--dur), background var(--dur);
  text-decoration: none;
  font-size: 1rem;
}
.nav-home-btn:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.08);
}

/* Search toggle */
.nav-search-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: color var(--dur), border-color var(--dur), background var(--dur);
  flex-shrink: 0;
}
.nav-search-toggle:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.08);
}

/* Mobile toggle */
.nav-mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 8px 7px;
  transition: border-color var(--dur);
}
.nav-mobile-toggle span {
  display: block;
  height: 2px;
  background: rgba(255,255,255,0.7);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.nav-mobile-toggle[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.nav-mobile-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-mobile-toggle[aria-expanded="true"] span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

/* Search overlay */
.site-search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10,12,14,0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: flex-start;
  justify-content: center;
  padding: 0 var(--space-md);
  overflow-y: auto;
}
.site-search-overlay.is-open { display: flex; }

/* Inner wrapper */
.search-overlay__inner {
  width: 100%;
  max-width: 760px;
  padding: 6rem 0 4rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

/* Sökfält */
.site-search-overlay form {
  width: 100%;
  display: flex;
  gap: 0.75rem;
}
.site-search-overlay input[type="search"] {
  flex: 1;
  padding: 1rem 1.25rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: var(--font-size-lg);
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.site-search-overlay input[type="search"]:focus {
  border-color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.09);
}
.site-search-overlay input[type="search"]::placeholder { color: rgba(255,255,255,0.3); }
.site-search-overlay form button {
  padding: 1rem 1.5rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
  flex-shrink: 0;
  transition: opacity 0.2s;
}
.site-search-overlay form button:hover { opacity: 0.85; }

/* Stäng-knapp */
.search-overlay-close {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.5);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
  z-index: 10000;
}
.search-overlay-close:hover {
  color: #fff;
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.3);
}

/* Nollställ ALL arv av temafärger inuti overlayern */
.site-search-overlay,
.site-search-overlay * {
  box-sizing: border-box;
}
.site-search-overlay a,
.site-search-overlay a:link,
.site-search-overlay a:visited {
  color: rgba(255,255,255,0.65) !important;
  text-decoration: none !important;
}
.site-search-overlay a:hover,
.site-search-overlay a:focus {
  color: #ffffff !important;
}
.site-search-overlay h1,
.site-search-overlay h2,
.site-search-overlay h3,
.site-search-overlay p,
.site-search-overlay li {
  color: rgba(255,255,255,0.65);
}

/* ── Sitemap-vy ─────────────────────────────────────────────── */
.search-sitemap {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  animation: fadeUp 0.25s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.search-sitemap.is-hidden { display: none; }

.search-sitemap__group {}

.search-sitemap__heading {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin: 0 0 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* Sidor – enkla rader */
.search-sitemap__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.search-sitemap__list li {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.search-sitemap__list a {
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 0.93rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: color 0.15s, padding-left 0.15s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.search-sitemap__list a:hover {
  color: #fff;
  padding-left: 0.4rem;
}

/* Datum-badge för nyheter & händelser */
.search-sitemap__date {
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 99px;
  padding: 0.2em 0.6em;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Mobil: stapla grupper */
@media (max-width: 640px) {
  .search-sitemap {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: var(--hero-min-height, 85vh);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-dark);
  text-align: center;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(ellipse 70% 60% at 50% 100%, var(--hero-glow-color, rgba(0,0,0,0.15)) 0%, transparent 70%),
    radial-gradient(ellipse 40% 50% at 80% 20%, var(--hero-glow-color2, rgba(0,0,0,0.1)) 0%, transparent 60%);
}

.hero--photo .hero__bg,
.hero--sequence .hero__bg { display: none; }

/* Photo slideshow */
.hero__slides {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero__slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease;
}
.hero__slide--active { opacity: 1; }
.hero--slideshow .hero__slide { transition: opacity 0.3s ease; }
.hero--morph .hero__slide { transition: opacity 2s ease; }
.hero__slide-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 760px;
  padding: var(--space-xl) var(--space-md) var(--space-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.hero__logo {
  width: var(--hero-logo-size, 120px);
  height: var(--hero-logo-size, 120px);
  object-fit: contain;
  margin-bottom: var(--space-md);
  filter: drop-shadow(0 0 32px var(--hero-logo-glow, rgba(0,0,0,0.35)));
}

.hero__kicker {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 var(--space-sm);
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 700;
  color: #fff;
  margin: 0 0 var(--space-md);
  line-height: 1.1;
}
.hero__title em {
  font-style: italic;
  color: var(--accent);
}

.hero__sub {
  font-size: var(--font-size-lg);
  color: rgba(255,255,255,0.7);
  max-width: 540px;
  line-height: 1.7;
  margin: 0 0 var(--space-lg);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
}

.hero__announcement {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255,255,255,0.1);
}
.hero__announcement-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.85);
}
.hero__announcement-icon { color: var(--accent); flex-shrink: 0; }
.hero__announcement-text { flex: 1; min-width: 0; }
.hero__announcement-link {
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255,255,255,0.4);
  padding-bottom: 1px;
  transition: border-color var(--dur);
}
.hero__announcement-link:hover { border-color: #fff; color: #fff; }

.hero__scroll {
  position: absolute;
  bottom: 4rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: rgba(255,255,255,0.35);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  animation: hero-bounce 2.5s ease-in-out infinite;
}
.hero__scroll::after {
  content: '';
  display: block;
  width: 1px;
  height: 36px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.3), transparent);
}
@keyframes hero-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

/* ============================================================
   INTRO STRIP (tre värden)
   ============================================================ */
.intro-strip {
  background: var(--strip-bg, linear-gradient(180deg, var(--bg-dark-mid) 0%, var(--bg-dark) 100%));
  padding: var(--space-xl) 0;
}

.intro-strip__inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  text-align: center;
}

.intro-strip__item { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }

.intro-strip__icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  opacity: 0.9;
  margin-bottom: 0.25rem;
}

.intro-strip__label {
  font-family: var(--font-display);
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.intro-strip__text {
  font-size: var(--font-size-sm);
  color: rgba(255,255,255,0.55);
  line-height: 1.65;
  max-width: 280px;
  margin: 0;
}

/* ============================================================
   SECTION HEADINGS
   ============================================================ */
.section-heading {
  text-align: center;
  margin-bottom: var(--space-lg);
}
.section-heading__eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.5rem;
}
.section-heading {
  position: relative;
}
.section-heading__title {
  font-family: var(--font-display);
  color: var(--color-section-heading, var(--text-primary));
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

/* ============================================================
   ARTICLE CARDS
   ============================================================ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.card {
  background: var(--card-bg, var(--bg-surface));
  box-shadow: var(--card-shadow, none);
  border: 1px solid var(--border);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
  border-color: var(--accent);
}

.card__image {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--color-border);
}
.card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}
.card:hover .card__image img { transform: scale(1.04); }
.card__image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.25), transparent 50%);
  transition: opacity var(--dur);
}
.card:hover .card__image-overlay { opacity: 0.7; }

.card__image--placeholder {
  background: linear-gradient(135deg, var(--color-border) 0%, var(--bg-surface) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.card__placeholder-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  opacity: 0.3;
  margin: auto;
}

.card__category {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  z-index: 1;
}

.card__body {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  flex: 1;
}
.card__meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.card__title {
  font-family: var(--font-display);
  font-size: var(--font-size-xl);
  font-weight: 600;
  color: var(--card-title-color, var(--text-primary));
  margin: 0 0 0.75rem;
  line-height: 1.3;
  min-height: 3.9em; /* ~3 rader – excerpt börjar på samma höjd */
}

.card__title a {
  color: var(--card-title-color, var(--text-primary));
  text-decoration: none;
}
.card__title a:hover {
  color: var(--card-title-hover, var(--accent));
}
.card__excerpt {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0 0 var(--space-md);
  flex: 1;
}
.card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--card-link-color, var(--accent));
  margin-top: auto;
  transition: gap var(--dur);
}
.card__link:hover { gap: 0.65rem; color: var(--accent-hover); }
.card__link svg { transition: transform var(--dur); }
.card__link:hover svg { transform: translateX(3px); }

/* ============================================================
   EVENT CARDS
   ============================================================ */
.event-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.event-card {
  display: flex;
  gap: var(--space-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: transform var(--dur), box-shadow var(--dur), border-color var(--dur);
}
.event-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  border-color: var(--accent);
  color: var(--text-primary);
}

.event-card__date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  height: 60px;
  background: var(--accent);
  border-radius: var(--radius-md);
  flex-shrink: 0;
  color: var(--btn-primary-text, #fff);
  text-align: center;
}
.event-card__day {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}
.event-card__month {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
}

.event-card__body { flex: 1; min-width: 0; }
.event-card__type {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.25rem;
}
.event-card__title {
  font-family: var(--font-display);
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin: 0 0 0.4rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.event-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.event-card__meta-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.event-card__meta svg { opacity: 0.6; flex-shrink: 0; }

/* ============================================================
   MEMBERSHIP BANNER (CTA)
   ============================================================ */
.membership-banner {
  position: relative;
  overflow: hidden;
  background: var(--bg-dark);
  padding: var(--space-2xl) 0;
  text-align: center;
}
.membership-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 50% 100%, var(--hero-glow-color, rgba(0,0,0,0.1)), transparent 70%);
  pointer-events: none;
}
.membership-banner__inner {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}
.membership-banner__kicker {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.75rem;
}
.membership-banner__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: #fff;
  margin: 0 0 var(--space-md);
}
.membership-banner__text {
  font-size: var(--font-size-base);
  color: rgba(255,255,255,0.65);
  line-height: 1.75;
  margin: 0 0 var(--space-lg);
}
.membership-banner__actions { display: flex; gap: var(--space-sm); justify-content: center; flex-wrap: wrap; }

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  padding: var(--section-padding, var(--space-2xl)) 0;
  background: var(--section-bg, transparent);
}
/* Alternating sections can use --section-alt-bg */
.section--alt { background: var(--section-alt-bg, var(--bg-surface)); }
.section--dark { background: var(--section-dark-bg, var(--bg-dark)); color: var(--section-dark-text, #fff); }
.section--accent { background: var(--section-accent-bg, color-mix(in srgb, var(--accent) 8%, var(--bg-page))); }
.section--surface {
  background: var(--bg-surface);
}
.section--dark {
  background: var(--bg-dark);
  color: #fff;
}

/* ============================================================
   ARCHIVE / BLOG
   ============================================================ */
.archive-header {
  background: var(--bg-dark);
  padding: var(--space-xl) 0 var(--space-lg);
  text-align: center;
}
.archive-header__eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.archive-header__title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 3rem);
  color: #fff;
  margin: 0;
}

.archive-content { padding: var(--space-2xl) 0; }

.archive-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-lg);
  align-items: start;
}

.archive-posts { display: flex; flex-direction: column; gap: var(--space-md); }

.archive-pagination {
  margin-top: var(--space-xl);
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.archive-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: background var(--dur), border-color var(--dur), color var(--dur);
}
.archive-pagination .page-numbers:hover,
.archive-pagination .page-numbers.current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.archive-pagination .page-numbers.dots {
  border: none;
  background: none;
  color: var(--text-muted);
}

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: var(--space-lg); }
.widget { }
.widget-title {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border);
}

/* ============================================================
   POST / PAGE
   ============================================================ */
.post-header {
  background: var(--page-header-bg, linear-gradient(180deg, var(--bg-dark-mid) 0%, var(--bg-dark) 60%));
  padding: var(--space-xl) 0 var(--space-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.post-header__eyebrow {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}
.post-header__eyebrow::before,
.post-header__eyebrow::after {
  content: '';
  display: block;
  width: 30px;
  height: 1px;
  background: var(--accent);
  opacity: 0.4;
}

.post-header__title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 3.5rem);
  color: #fff;
  margin: 0 auto var(--space-md);
  max-width: 760px;
  line-height: 1.2;
}

.post-header__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.5);
}
.post-header__meta-item { display: flex; align-items: center; gap: 0.4rem; }

.post-hero-image {
  aspect-ratio: 21/9;
  overflow: hidden;
}
.post-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-featured-image {
  overflow: hidden;
  height: var(--post-featured-height, 480px);
}
.post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--post-featured-position, center);
}

.post-container {
  max-width: var(--post-content-width, 760px);
  margin-left: auto;
  margin-right: auto;
}
/* ============================================================
   POST CONTENT WRAPPER – padding controlled via Customizer
   ============================================================ */
.post-content {
  padding: var(--post-content-padding-top, 3rem) 0 var(--post-content-padding-bottom, 4rem);
}


.post-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--space-xl);
  align-items: start;
  padding: var(--space-xl) 0;
}
.post-layout--wide { grid-template-columns: 1fr; }

/* Entry content */
.entry-content {
  font-size: var(--font-size-base);
  line-height: 1.8;
  color: var(--text-primary);
}
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}
.entry-content h2 { font-size: clamp(1.35rem, 2.5vw, 1.75rem); }
.entry-content h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); }
.entry-content p:last-child { margin-bottom: 0; }

.entry-content a {
  color: var(--accent);
  border-bottom: 1px solid var(--color-border, rgba(128,128,128,0.3));
  padding-bottom: 1px;
  transition: border-color var(--dur), color var(--dur);
}
.entry-content a:hover {
  color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.entry-content img {
  border-radius: var(--radius-md);
  margin: var(--space-md) 0;
}

.entry-content ul,
.entry-content ol {
  margin: var(--space-sm) 0 var(--space-md);
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-md) 0;
  font-size: var(--font-size-sm);
}
.entry-content th,
.entry-content td {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.entry-content th {
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-surface);
}

/* ============================================================
   WIDGETS / FOOTER COLUMNS
   ============================================================ */
.fp-widget { }
.fp-widget__title {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border);
}

/* ============================================================
   SITE FOOTER
   ============================================================ */
.site-footer {
  background: var(--footer-bg, var(--bg-dark));
  padding: var(--space-2xl) 0 0;
  color: var(--footer-text, rgba(255,255,255,0.6));
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: var(--space-xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.footer-brand { }
.footer-brand__logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  margin-bottom: var(--space-sm);
}
.footer-brand__name {
  font-family: var(--font-display);
  font-size: var(--font-size-xl);
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.5rem;
}
.footer-brand__tagline {
  font-size: var(--font-size-sm);
  color: rgba(255,255,255,0.45);
  line-height: 1.65;
  margin: 0 0 var(--space-md);
}

.footer-social {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: var(--space-sm);
}
.footer-social__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.5);
  transition: color var(--dur), border-color var(--dur), background var(--dur);
  text-decoration: none;
}
.footer-social__link:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.08);
}

.footer-col__heading {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin: 0 0 var(--space-md);
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.footer-col ul li { margin: 0; }
.footer-col ul a {
  color: rgba(255,255,255,0.5);
  font-size: var(--font-size-sm);
  transition: color var(--dur);
}
.footer-col ul a:hover { color: rgba(255,255,255,0.85); }

.footer-bottom {
  padding: var(--space-md) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.3);
}
.footer-bottom a {
  color: rgba(255,255,255,0.4);
  transition: color var(--dur);
}
.footer-bottom a:hover { color: rgba(255,255,255,0.7); }

/* ============================================================
   404
   ============================================================ */
.error-404 { text-align: center; padding: var(--space-2xl) var(--space-md); }
.error-404__code {
  font-family: var(--font-display);
  font-size: clamp(5rem, 15vw, 10rem);
  font-weight: 700;
  color: var(--accent);
  opacity: 0.15;
  line-height: 1;
  margin: 0;
}
.error-404__title { font-size: clamp(1.5rem, 3vw, 2rem); margin: -1rem 0 1rem; }
.error-404__text { color: var(--text-secondary); max-width: 480px; margin: 0 auto var(--space-lg); }

/* ============================================================
   SEARCH RESULTS
   ============================================================ */
.search-header {
  background: var(--bg-dark);
  padding: var(--space-xl) 0 var(--space-lg);
  margin-top: 0;   /* flush under sticky header */
}
.search-header__title { color: #fff; margin: 0; font-size: clamp(1.5rem, 3vw, 2.5rem); }
.search-header__title span { color: var(--accent); }
.search-header__count { font-size: var(--font-size-sm); color: rgba(255,255,255,0.5); margin-top: 0.5rem; }

.search-results { padding: var(--space-xl) 0; }
.search-item {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border);
}
.search-item:last-child { border-bottom: none; }
.search-item__title {
  font-family: var(--font-display);
  font-size: var(--font-size-2xl);
  margin: 0 0 0.4rem;
}
.search-item__meta { font-size: var(--font-size-sm); color: var(--text-muted); margin-bottom: 0.5rem; }
.search-item__excerpt { color: var(--text-secondary); }

/* ============================================================
   COMMENTS
   ============================================================ */
.comments-area {
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border);
}
.comments-title {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-lg);
}
.comment-list { list-style: none; padding: 0; margin: 0; }
.comment {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border);
}
.comment:last-child { border-bottom: none; }
.comment-author .avatar {
  border-radius: 50%;
  margin-right: 0.75rem;
  vertical-align: middle;
}
.comment-meta { font-size: var(--font-size-sm); color: var(--text-muted); margin-bottom: 0.75rem; }
.comment-content { font-size: var(--font-size-base); }
.comment-reply-link {
  font-size: var(--font-size-sm);
  color: var(--accent);
  font-weight: 600;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  margin-top: 0.4rem;
  transition: border-color var(--dur);
}
.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 20%, transparent);
}
.comment-form-comment { margin-bottom: var(--space-md); }
.comment-form input[type="submit"] {
  width: auto;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--dur);
}
.comment-form input[type="submit"]:hover { background: var(--accent-hover); }

/* ============================================================
   FORMS (generic)
   ============================================================ */
input[type="text"],
input[type="email"],
input[type="search"],
input[type="url"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  width: 100%;
  transition: border-color var(--dur), box-shadow var(--dur);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}

/* ============================================================
   NAVIGATION WALKER – dropdown arrow
   ============================================================ */
.menu-item-has-children > a::after {
  content: ' ▾';
  font-size: 0.7em;
  opacity: 0.6;
}

/* ============================================================
   SHARE BUTTONS
   ============================================================ */
.share-strip {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: var(--space-lg) 0 0;
  padding: var(--space-md) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.share-strip__label {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0;
  flex-shrink: 0;
}
.share-strip__sep {
  width: 1px;
  height: 18px;
  background: var(--border);
  flex-shrink: 0;
}
.share-strip__buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  text-decoration: none;
  background: transparent;
  cursor: pointer;
  position: relative;
  overflow: visible;
  flex-shrink: 0;
  transition: background var(--dur), border-color var(--dur), color var(--dur);
}
.share-btn svg { flex-shrink: 0; }
.share-btn__label {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-dark);
  color: #fff;
  font-size: 0.68rem;
  white-space: nowrap;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 10;
}
.share-btn:hover .share-btn__label,
.share-btn:focus-visible .share-btn__label { opacity: 1; }
.share-btn:hover, .share-btn:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  outline: none;
}
.share-btn--copy.copied {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ============================================================
   ADMIN BAR OFFSET
   ============================================================ */
.admin-bar .site-header { top: 32px; }
.header-not-sticky .site-header { position: relative; top: 0; }
@media screen and (max-width: 782px) {
  .admin-bar .site-header { top: 46px; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-lg); }
  .intro-strip__inner { gap: var(--space-md); }
  .archive-grid { grid-template-columns: 1fr; }
  .post-layout { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  /* ── Header ── */
  .primary-nav { display: none; }
  .site-logo__tagline { display: none; }
  .nav-home-btn { display: none; }
  .header-inner { gap: 0.5rem; }
  .nav-mobile-toggle { display: flex; margin-left: auto; }

  /* ── Mobile nav overlay ── */
  .primary-nav.is-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    top: var(--header-height, 68px);
    background: var(--header-bg, var(--bg-dark));
    padding: 1.5rem 1.25rem 2rem;
    z-index: 400;
    overflow-y: auto;
    gap: 0;
    align-items: stretch;
    animation: mobileNavIn 0.22s ease both;
  }
  .admin-bar .primary-nav.is-open { top: calc(var(--header-height, 68px) + 46px); }

  @keyframes mobileNavIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* Nav list */
  .primary-nav__list {
    flex-direction: column;
    gap: 0;
    width: 100%;
    margin: 0;
    padding: 0;
  }

  /* Each menu item row */
  .primary-nav__list li {
    border-bottom: 1px solid rgba(255,255,255,0.07);
  }
  .primary-nav__list > li:first-child {
    border-top: 1px solid rgba(255,255,255,0.07);
  }

  .primary-nav__list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0.25rem;
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-transform: none;
    color: rgba(255,255,255,0.85);
    border-radius: 0;
    background: transparent;
    transition: color 0.15s, padding-left 0.15s;
  }
  .primary-nav__list a:hover,
  .primary-nav__list .current-menu-item > a,
  .primary-nav__list .current-page-ancestor > a {
    color: #fff;
    background: transparent;
    padding-left: 0.5rem;
  }

  /* Dropdown arrow indicator */
  .primary-nav__list .menu-item-has-children::after { display: none; }
  .primary-nav__list .menu-item-has-children > a::after {
    content: '›';
    font-size: 1.2rem;
    color: rgba(255,255,255,0.3);
    transition: transform 0.2s;
    display: inline-block;
    margin-left: auto;
    padding-left: 0.5rem;
  }
  .primary-nav__list .menu-item-has-children.mobile-open > a::after {
    transform: rotate(90deg);
  }

  /* Sub-menu */
  .primary-nav__list .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 0 0 0.5rem 1rem;
    display: none;
  }
  .primary-nav__list .menu-item-has-children.mobile-open > .sub-menu {
    display: block;
  }
  .primary-nav__list .sub-menu li {
    border-bottom: 1px solid rgba(255,255,255,0.04);
  }
  .primary-nav__list .sub-menu a {
    font-size: 0.95rem;
    padding: 0.75rem 0.25rem;
    color: rgba(255,255,255,0.6);
    text-transform: none;
    letter-spacing: 0;
  }
  .primary-nav__list .sub-menu a:hover { color: #fff; padding-left: 0.5rem; }

  /* CTA button */
  .nav-cta {
    margin-left: 0;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.07);
  }
  .nav-cta .btn {
    width: 100%;
    text-align: center;
    justify-content: center;
    padding: 1rem;
    font-size: 1rem;
  }

  /* ── Layout ── */
  .intro-strip__inner { grid-template-columns: 1fr; }
  .event-cards-grid { grid-template-columns: 1fr !important; }
  .cards-grid { grid-template-columns: 1fr !important; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .hero__content { padding: var(--space-xl) var(--space-md) 5rem; }
  .hero { min-height: 100svh; }
  .hero__logo { width: 90px; height: 90px; }
  .post-layout { gap: var(--space-lg); }
}

@media (max-width: 480px) {
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { text-align: center; justify-content: center; }
  .membership-banner__actions { flex-direction: column; align-items: stretch; }
  .post-header__meta { flex-direction: column; gap: 0.5rem; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .site-header,
  .site-footer,
  .sidebar,
  .share-strip,
  .hero__scroll { display: none; }
  body { background: #fff; color: #000; }
  a { color: inherit; text-decoration: underline; }
  .post-layout { grid-template-columns: 1fr; }
}

/* ============================================================
   WP ALIGNMENT HELPERS
   ============================================================ */
.alignleft  { float: left; margin: 0 var(--space-md) var(--space-sm) 0; }
.alignright { float: right; margin: 0 0 var(--space-sm) var(--space-md); }
.aligncenter { display: block; margin: var(--space-md) auto; }
.alignwide  { margin-left: calc(-50vw + 50%); margin-right: calc(-50vw + 50%); }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: var(--font-size-sm); color: var(--text-muted); margin-top: 0.4rem; font-style: italic; }

/* ============================================================
   BACK TO TOP
   ============================================================ */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 400;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--btn-primary-bg, var(--accent));
  color: var(--btn-primary-text, #fff);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: opacity 0.3s, transform 0.3s, background 0.2s;
  opacity: 0;
  transform: translateY(8px);
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--btn-primary-hover, var(--accent-hover));
  transform: translateY(-2px);
}
@media (max-width: 768px) {
  .back-to-top { bottom: 1rem; right: 1rem; width: 40px; height: 40px; }
}

/* ============================================================
   EVENT ARCHIVE CARD (archive-event.php card-event.php)
   ============================================================ */
.events-archive-container { max-width: 860px; margin: 0 auto; }
.event-archive-card {
  display: grid;
  grid-template-columns: 130px 1fr;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--card-bg, var(--bg-surface));
  transition: transform .2s, box-shadow .2s;
  margin-bottom: 1px;
}
.event-archive-card:hover {
  transform: translateX(4px);
  box-shadow: -4px 0 0 var(--accent), var(--card-shadow);
}
.event-archive-card--past { opacity: 0.72; }

.event-archive-card__date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 0.75rem;
  min-height: 120px;
  background: var(--bg-dark);
  background-size: cover;
  background-position: center;
  position: relative;
}
.event-archive-card__date-inner { text-align: center; }
.event-archive-card__day {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  display: block;
}
.event-archive-card__month {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  display: block;
  margin-top: 4px;
}
.event-archive-card__past-badge {
  position: absolute;
  top: 8px;
  left: 0; right: 0;
  text-align: center;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
}
.event-archive-card__body {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.25em;
  background: var(--card-bg, var(--bg-surface));
}
.event-archive-card__type {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}
.event-archive-card__title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--card-title-color, var(--text-primary));
  line-height: 1.2;
  margin: 0.1em 0 0.3em;
}
.event-archive-card__title a { color: inherit; text-decoration: none; }
.event-archive-card__title a:hover { color: var(--card-title-hover, var(--accent)); }
.event-archive-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3em 1.2em;
  margin-bottom: 0.3em;
}
.event-archive-card__meta-item {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
}
.event-archive-card__excerpt {
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0 0 0.4em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.event-archive-card__link {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--card-link-color, var(--accent));
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  margin-top: 0.2em;
}
.event-archive-card__link:hover { color: var(--card-title-hover, var(--accent)); }
@media (max-width: 580px) {
  .events-archive-container { max-width: 860px; margin: 0 auto; }
.event-archive-card { grid-template-columns: 80px 1fr; }
  .event-archive-card__day { font-size: 2rem; }
  .event-archive-card__body { padding: 1rem; }
}

/* ============================================================
   COMMENTS – styled with CSS vars
   ============================================================ */
.comments-area {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.comments-title,
.comment-reply-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}
.comment-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
}
.comment-list .comment {
  padding: 1.25rem;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  border: 1px solid var(--border);
}
.comment-author .fn { font-weight: 600; color: var(--text-primary); }
.comment-author .url { color: var(--color-link); }
.comment-meta a { color: var(--text-muted); font-size: 0.8rem; }
.comment-body { color: var(--text-primary); }
.comment-body p { margin: 0.5rem 0; }
.comment-reply-link,
#cancel-comment-reply-link { color: var(--accent); font-size: 0.82rem; font-weight: 600; }
.comment-respond {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  box-sizing: border-box;
}
.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.comment-form-comment label,
.comment-form .comment-form-author label,
.comment-form .comment-form-email label { 
  display: block; font-size: 0.82rem; font-weight: 600; 
  color: var(--text-secondary); margin-bottom: 0.4rem;
}
.comment-form .submit {
  background: var(--btn-primary-bg, var(--accent));
  color: var(--btn-primary-text, #fff);
  border: none;
  border-radius: var(--btn-radius, var(--radius-md));
  padding: 0.65rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.comment-form .submit:hover { background: var(--btn-primary-hover, var(--accent-hover)); }

/* ============================================================
   SMOOTH TRANSITIONS & MODERN UX
   ============================================================ */
*, *::before, *::after {
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}
.btn, a, input, textarea, select {
  transition-duration: 0.15s;
}
img {
  image-rendering: auto;
  max-width: 100%;
  height: auto;
}

/* Focus visible for accessibility */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
:focus:not(:focus-visible) { outline: none; }

/* Better selection color */
::selection {
  background: var(--accent);
  color: var(--btn-primary-text, #fff);
}

/* Scroll behaviour */
html { scroll-behavior: smooth; }

/* ============================================================
   BREADCRUMBS
   ============================================================ */
.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3em 0.5em;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: var(--breadcrumb-margin-bottom, 2rem);
  padding-bottom: var(--breadcrumb-padding-bottom, 0);
  border-bottom: var(--breadcrumb-border, none);
}
.breadcrumbs a {
  color: var(--color-link);
  text-decoration: none;
}
.breadcrumbs a:hover { color: var(--color-link-hover); }
.breadcrumbs .sep { color: var(--text-muted); opacity: 0.5; }
.breadcrumbs [aria-current="page"] { color: var(--text-secondary); }

.post-content__body {
  padding-top: var(--content-body-gap, 0);
}

/* ============================================================
   ARCHIVE LIST – Nyheter / Kategori
   ============================================================ */
.archive-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.archive-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.archive-item:first-child { border-top: 1px solid var(--border); }
.archive-item:hover { background: color-mix(in srgb, var(--accent) 4%, var(--bg-page)); }
.archive-item__image {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--bg-surface);
}
.archive-item__image img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.3s ease;
}
.archive-item:hover .archive-item__image img { transform: scale(1.04); }
.archive-item__body {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.3rem;
}
.archive-item__date {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.05em;
}
.archive-item__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--card-title-color, var(--text-primary));
  line-height: 1.25;
  margin: 0;
}
.archive-item__title a {
  color: inherit;
  text-decoration: none;
}
.archive-item__title a:hover { color: var(--accent); }
.archive-item__excerpt {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.archive-item__cat {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}
.archive-pagination {
  margin-top: 2.5rem;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}
.archive-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all 0.15s;
}
.archive-pagination .page-numbers:hover,
.archive-pagination .page-numbers.current {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--btn-primary-text, #fff);
}
@media (max-width: 600px) {
  .archive-item { grid-template-columns: 80px 1fr; }
  .archive-item__body { padding: 0.9rem 1rem; }
  .archive-item__title { font-size: 0.95rem; }
}

/* ============================================================
   WORDPRESS QUERY LOOP BLOCK – matchar archive-list design
   Används när en sida listar inlägg via Gutenberg-block
   ============================================================ */

/* Reset block default spacing */
.wp-block-query { margin: 0; }

/* Post template list */
.wp-block-post-template {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Each post item */
.wp-block-post-template .wp-block-post {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  background: var(--bg-page);
  text-decoration: none;
}
.wp-block-post-template .wp-block-post:first-child {
  border-top: 1px solid var(--border);
}
.wp-block-post-template .wp-block-post:hover {
  background: color-mix(in srgb, var(--accent) 4%, var(--bg-page));
}

/* Featured image */
.wp-block-post-template .wp-block-post-featured-image {
  aspect-ratio: 4/3;
  overflow: hidden;
  margin: 0 !important;
  grid-row: 1 / -1;
  align-self: stretch;
  background: var(--bg-surface);
}
.wp-block-post-template .wp-block-post-featured-image img,
.wp-block-post-template .wp-block-post-featured-image a {
  display: block;
  width: 100%;
  height: 100%;
}
.wp-block-post-template .wp-block-post-featured-image img {
  object-fit: cover;
  transition: transform 0.3s ease;
}
.wp-block-post-template .wp-block-post:hover .wp-block-post-featured-image img {
  transform: scale(1.04);
}

/* Content column wrapper */
.wp-block-post-template .wp-block-post > :not(.wp-block-post-featured-image) {
  padding: 0;
}
/* Group/stack inside post item */
.wp-block-post-template .wp-block-group,
.wp-block-post-template .wp-block-stack {
  padding: 1.1rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  justify-content: center;
  height: 100%;
  box-sizing: border-box;
}

/* Post date */
.wp-block-post-template .wp-block-post-date,
.wp-block-post-template .wp-block-post-date time {
  font-size: 0.75rem !important;
  color: var(--text-muted) !important;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin: 0 !important;
}

/* Post title */
.wp-block-post-template .wp-block-post-title {
  font-family: var(--font-display) !important;
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  margin: 0 !important;
  color: var(--card-title-color, var(--text-primary)) !important;
}
.wp-block-post-template .wp-block-post-title a {
  color: inherit !important;
  text-decoration: none !important;
}
.wp-block-post-template .wp-block-post-title a:hover {
  color: var(--accent) !important;
}

/* Post excerpt */
.wp-block-post-template .wp-block-post-excerpt {
  font-size: 0.875rem !important;
  color: var(--text-secondary) !important;
  line-height: 1.55 !important;
  margin: 0 !important;
}
.wp-block-post-template .wp-block-post-excerpt__excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 !important;
}
.wp-block-post-template .wp-block-post-excerpt__more-link {
  display: none; /* Vi visar inte "Läs mer" i listan */
}

/* Category/tags */
.wp-block-post-template .wp-block-post-terms {
  font-size: 0.7rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  color: var(--accent) !important;
  margin: 0 !important;
}
.wp-block-post-template .wp-block-post-terms a {
  color: inherit !important;
  text-decoration: none !important;
}

/* Read more button if present */
.wp-block-post-template .wp-block-read-more {
  display: none !important; /* clean list, no buttons */
}

/* Pagination */
.wp-block-query-pagination {
  display: flex !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  margin-top: 2.5rem !important;
  flex-wrap: wrap;
}
.wp-block-query-pagination-numbers .page-numbers,
.wp-block-query-pagination-previous-arrow,
.wp-block-query-pagination-next-arrow,
.wp-block-query-pagination > a,
.wp-block-query-pagination > span {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 38px;
  height: 38px;
  padding: 0 0.85rem !important;
  border-radius: var(--radius-md) !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  color: var(--text-secondary) !important;
  border: 1px solid var(--border) !important;
  text-decoration: none !important;
  transition: all 0.15s !important;
  background: var(--bg-page) !important;
}
.wp-block-query-pagination .page-numbers:hover,
.wp-block-query-pagination > a:hover {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: var(--btn-primary-text, #fff) !important;
}
.wp-block-query-pagination .page-numbers.current {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: var(--btn-primary-text, #fff) !important;
}

/* No image fallback */
.wp-block-post-template .wp-block-post:not(:has(.wp-block-post-featured-image)) {
  grid-template-columns: 1fr;
}
.wp-block-post-template .wp-block-post:not(:has(.wp-block-post-featured-image)) .wp-block-group,
.wp-block-post-template .wp-block-post:not(:has(.wp-block-post-featured-image)) .wp-block-stack {
  padding: 1.1rem 1.4rem;
}

/* Mobile */
@media (max-width: 600px) {
  .wp-block-post-template .wp-block-post {
    grid-template-columns: 80px 1fr;
  }
}
