/*
Theme Name: APStract Base
Theme URI: https://hallonsoda.se/
Author: Anders Larsson
Description: Base theme for multi-site APStract implementations. Use child themes for site-specific customizations.
Version: 2.0
Text Domain: apstract-base
*/

/* Google Fonts loaded via functions.php for better performance */

/* Font imports are now handled in functions.php to avoid editor path issues */
/* @import url('./fonts/gulams-condensed-medium.css'); */
/* @import url('./fonts/balney.css'); */

/* ========== CSS Custom Properties ========== */
:root {
  /* Colors */
  --color-primary: #7367f0;
  --color-secondary: #4ecdcc;
  --color-text: #191919;
  --color-text-light: #444;
  --color-text-muted: #666;
  --color-text-gray: #999;
  --color-text-light-gray: #bbb;
  --color-background: #f9fafb;
  --color-white: #fff;
  --color-border: #ececec;
  --color-shadow: rgba(20, 24, 38, 0.08);
  --color-shadow-light: rgba(44, 119, 231, 0.07);
  
  /* Layout */
  --max-width: 1200px;
  --border-radius: 0.7rem;
  --border-radius-large: 1.1rem;
  --transition: 0.25s ease;
  --transition-smooth: 0.4s cubic-bezier(.77,0,.18,1);
  
  /* Typography */
  --font-family: 'Albert Sans', sans-serif;
  --font-size-base: 1rem;
  --font-size-large: 1.2rem;
  --line-height-base: 1.5;
}

/* ========== Base & Body ========== */
html {
  overflow-x: hidden;
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-family);
  background: var(--color-background);
  color: var(--color-text);
  overflow-x: hidden;
  max-width: 100vw;
  box-sizing: border-box;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

*, *::before, *::after {
  box-sizing: inherit;
}

/* ========== Sticky Footer Layout ========== */

/* ========== Universal Card Base Style ========== */
.aps-card-base {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  box-shadow: 0 2px 8px var(--color-shadow);
  padding: 20px;
  transition: var(--transition);
}

.aps-card-base:hover {
  box-shadow: 0 4px 16px var(--color-shadow-light);
  transform: translateY(-2px);
}

/* ========== Typography - GulamsCondensed Medium Font for Headers ========== */
h1, h2, h3 {
  font-family: 'GulamsCondensed Medium', var(--font-family);
  font-weight: 500; /* Use Medium weight for GulamsCondensed */
}

/* ========== Global List Styling ========== */
/* Första nivån av listor - punkten/siffran linjerar med texten */
ul, ol {
  padding-left: 1.2em;
  margin: 1em 0;
  list-style-position: outside; /* Punkten/siffran utanför textområdet för korrekt radjustering */
}

/* Konsistent li-styling för alla block */
li {
  list-style: inherit !important;
  margin-bottom: 0.3rem;
}

/* Nästlade listor (andra nivån och djupare) behåller standardbeteende */
ul ul, ol ol, ul ol, ol ul {
  padding-left: 1.5em;
  list-style-position: outside; /* Standardbeteende för nästlade listor */
}

/* Block width adjustments */
.alignwide {
    max-width: 1200px;
}

.alignfull {
    max-width: 100%;
    width: 100%;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Nullställ WP-block-margins för heading och paragraf i våra block */

/* ========== Animation for gradients ========== */
@keyframes subtle-shift {
  0% {background-position: 0% 50%;}
  50% {background-position: 100% 50%;}
  100% {background-position: 0% 50%;}
}

/* ========== Sticky Header & Navigation ========== */
.site-header {
  position: fixed;
  top: 0; left: 0; width: 100%;
  z-index: 100;
  background: transparent;
  box-shadow: none;
  transition:
    background-color var(--transition-smooth),
    box-shadow var(--transition-smooth),
    backdrop-filter var(--transition-smooth);
  backdrop-filter: blur(0);
}
.site-header.is-scrolled {
  background: var(--color-white);
  box-shadow: 0 2px 12px 0 var(--color-shadow);
  backdrop-filter: blur(10px);
}
.site-header__container {
  max-width: var(--max-width); margin: 0 auto;
  padding: 1.5rem 2rem;
  display: flex; align-items: center; justify-content: space-between;
  box-sizing: border-box;
}
.site-header__branding { flex: 0 0 auto; }
.site-logo-link img, .custom-logo {
  height: 48px; width: auto; display: block;
  transition: filter 0.4s, height 0.4s;
}
.site-header.is-transparent .site-logo-link img,
.site-header.is-transparent .custom-logo {
  filter: drop-shadow(0 2px 8px rgba(20,24,38,0.06));
}
.site-header.is-scrolled .site-logo-link img,
.site-header.is-scrolled .custom-logo {
  filter: none;
  height: 40px;
}
.site-nav .main-menu {
  display: flex; gap: 2.4rem; list-style: none;
  margin: 0; padding: 0;
}
.main-menu li { display: flex; align-items: center; position: relative; }
.main-menu a {
  position: relative; text-decoration: none; color: #191919;
  font-weight: 500; font-size: 1.08rem; letter-spacing: 0.01em;
  transition: color 0.25s; padding: 0.25em 0;
}
.main-menu a::after {
  content: '';
  display: block; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: linear-gradient(90deg, #7367f0, #4ecdcc);
  border-radius: 2px;
  opacity: 0; transform: scaleX(0.7);
  transition: opacity 0.18s, transform 0.18s;
}
.main-menu a:hover,
.main-menu a:focus { color: #7367f0; }
.main-menu a:hover::after,
.main-menu a:focus::after { opacity: 1; transform: scaleX(1); }
.site-nav__toggle { display: none; }

@media (max-width: 900px) {
  .site-header__container { 
    padding: 1rem;
    justify-content: space-between;
    align-items: center;
  }
  .site-nav .main-menu { gap: 1.1rem; }
}
@media (max-width: 700px) {
  .site-header__container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.6rem;
  }
  .site-nav .main-menu { gap: 0.6rem; font-size: 1rem; }
  .site-logo-link img, .custom-logo { height: 38px; }
}

/* ========== Mobile Menu & Hamburger ========== */
.theme-menu-desktop, .theme-menu-mobile, .theme-hamburger { display: none; }
.site-nav__toggle {
  display: none; flex-direction: column; justify-content: center; align-items: center;
  width: 48px; height: 48px; background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px); border: 2px solid var(--color-border);
  border-radius: 12px; cursor: pointer; padding: 0;
  z-index: 120;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(115, 103, 240, 0.15);
}
.site-nav__toggle:hover {
  background: rgba(115, 103, 240, 0.1);
  border-color: var(--color-primary);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(115, 103, 240, 0.25);
}
.site-nav__toggle span {
  display: block; width: 24px; height: 2.5px; background: var(--color-primary);
  margin: 3px 0; border-radius: 3px; 
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}
.site-nav__toggle.open {
  background: var(--color-primary);
  border-color: var(--color-primary);
}
.site-nav__toggle.open span {
  background: white;
}
.site-nav__toggle.open span:nth-child(1) { 
  transform: rotate(45deg) translateY(5.5px);
}
.site-nav__toggle.open span:nth-child(2) { 
  opacity: 0; transform: scaleX(0);
}
.site-nav__toggle.open span:nth-child(3) { 
  transform: rotate(-45deg) translateY(-5.5px);
}
/* Mobile menu overlay backdrop */
.mobile-menu-overlay {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px);
  z-index: 200; opacity: 0; transition: opacity 0.3s ease;
}
.mobile-menu-overlay.show {
  display: block; opacity: 1;
}

.main-menu-mobile { 
  display: none !important; 
  list-style: none; margin: 0; padding: 0;
}

@media (max-width: 900px) {
  .main-menu { display: none !important; }
  .site-nav__toggle { display: flex; }
  
  /* Ensure proper alignment on mobile */
  .site-nav {
    display: flex;
    justify-content: flex-end;
    align-items: center;
  }
  
  /* Force header container to maintain proper layout */
  .site-header__container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  
  .main-menu-mobile {
    display: none !important; position: fixed; top: 0; right: -100%;
    width: min(85vw, 400px); height: 100vh; 
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px); 
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
    padding: 0; z-index: 210;
    flex-direction: column; gap: 8px; font-size: 1.2rem;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    align-items: stretch; text-align: left;
    overflow-y: auto; list-style: none;
  }
  
  .main-menu-mobile.show { 
    display: flex !important; 
    right: 0;
  }
}

/* Full screen on very small devices */
@media (max-width: 480px) {
  .main-menu-mobile {
    width: 100vw; right: -100vw;
  }
}
/* Close button styling */
.mobile-menu-close {
  position: absolute; top: 24px; right: 24px; z-index: 220;
  width: 44px; height: 44px; background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px); border: 2px solid rgba(115, 103, 240, 0.2);
  border-radius: 50%; color: var(--color-text); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-close:hover {
  background: rgba(115, 103, 240, 0.1); border-color: var(--color-primary);
  transform: scale(1.05); box-shadow: 0 4px 12px rgba(115, 103, 240, 0.3);
}

/* Hide WordPress generated ul/li structure visual artifacts - Ultra strong rules */
#mobile-menu,
#mobile-menu ul,
#mobile-menu li,
#mobile-menu .sub-menu,
#mobile-menu .sub-menu li,
.main-menu-mobile, 
.main-menu-mobile ul, 
.main-menu-mobile .sub-menu,
.main-menu-mobile li,
.main-menu-mobile .sub-menu li {
  list-style: none !important; 
  list-style-type: none !important;
  list-style-image: none !important;
  padding: 0 !important; 
  margin: 0 !important;
}

.main-menu-mobile li {
  position: relative;
}

/* Remove all possible bullet points */
#mobile-menu li::before,
#mobile-menu .sub-menu li::before,
#mobile-menu ul li::before,
.main-menu-mobile li::before,
.main-menu-mobile .sub-menu li::before,
.main-menu-mobile ul li::before {
  display: none !important;
  content: none !important;
  visibility: hidden !important;
}

/* Additional anti-bullet rules */
#mobile-menu ul,
.main-menu-mobile ul {
  list-style-position: inside !important;
}

#mobile-menu * {
  list-style: none !important;
}

.main-menu-mobile * {
  list-style: none !important;
}

/* Ultra-specific rules based on debug info */
ul#mobile-menu ul.sub-menu,
ul#mobile-menu ul.sub-menu li,
#mobile-menu ul.sub-menu,
#mobile-menu ul.sub-menu li,
.main-menu-mobile ul.sub-menu,
.main-menu-mobile ul.sub-menu li {
  list-style: none !important;
  list-style-type: none !important;
  list-style-image: none !important;
  list-style-position: outside !important;
  -webkit-margin-before: 0 !important;
  -webkit-padding-start: 0 !important;
}

/* Nuclear option - remove ALL bullets everywhere */
#mobile-menu, #mobile-menu *, 
.main-menu-mobile, .main-menu-mobile * {
  list-style: none !important;
  list-style-type: none !important;
  list-style-image: none !important;
  list-style-position: outside !important;
}

/* Specific submenu bullet removal */
#mobile-menu .sub-menu,
#mobile-menu .sub-menu *,
.main-menu-mobile .sub-menu,
.main-menu-mobile .sub-menu * {
  list-style: none !important;
  list-style-type: none !important;
  list-style-image: none !important;
}

/* Remove any possible pseudo-element bullets */
#mobile-menu .sub-menu li::marker,
.main-menu-mobile .sub-menu li::marker,
#mobile-menu li::marker,
.main-menu-mobile li::marker {
  display: none !important;
  content: none !important;
}

/* Nuclear option - destroy all webkit/browser bullet styling */
#mobile-menu ul,
#mobile-menu .sub-menu,
.main-menu-mobile ul,
.main-menu-mobile .sub-menu {
  -webkit-margin-before: 0 !important;
  -webkit-margin-after: 0 !important;
  -webkit-margin-start: 0 !important;
  -webkit-margin-end: 0 !important;
  -webkit-padding-start: 0 !important;
  margin-block-start: 0 !important;
  margin-block-end: 0 !important;
  padding-inline-start: 0 !important;
}

/* Target browser default styles directly */
#mobile-menu .sub-menu li,
.main-menu-mobile .sub-menu li {
  display: block !important;
  list-style: none !important;
  list-style-type: none !important;
  list-style-image: none !important;
  -webkit-margin-before: 0 !important;
  -webkit-margin-after: 0 !important;
  margin-block-start: 0 !important;
  margin-block-end: 0 !important;
}

/* Target ONLY the first LI element (after button) in root menu */
#mobile-menu > li:first-of-type,
.main-menu-mobile > li:first-of-type,
#menu-item-9 {
  margin-top: 140px !important; /* Reduced spacing - more reasonable */
  padding-top: 10px !important;
}

/* Ensure submenus don't get this spacing */
#mobile-menu .sub-menu li:first-child,
#mobile-menu .sub-menu li:first-of-type,
.main-menu-mobile .sub-menu li:first-child,
.main-menu-mobile .sub-menu li:first-of-type {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Top level menu items */
.main-menu-mobile > li > a {
  display: flex; align-items: center; justify-content: space-between;
  color: var(--color-text); text-decoration: none; 
  font-weight: 500; font-size: 1.15rem; 
  padding: 18px 32px; margin: 2px 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative; border-left: 3px solid transparent;
}

.main-menu-mobile > li > a:hover,
.main-menu-mobile > li > a:focus {
  color: var(--color-primary); outline: none; 
  transform: translateX(8px);
  border-left-color: var(--color-primary);
  background: rgba(115, 103, 240, 0.04);
}

.main-menu-mobile .current-menu-item > a,
.main-menu-mobile .current-menu-ancestor > a {
  color: var(--color-primary); 
  border-left-color: var(--color-primary);
  background: rgba(115, 103, 240, 0.06);
  font-weight: 600;
}

/* Submenu toggle arrow - make it a separate clickable area */
.main-menu-mobile .menu-item-has-children > a {
  position: relative;
  padding-right: 60px !important; /* Make room for arrow area */
}

.main-menu-mobile .menu-item-has-children > a::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 50px;
  background: rgba(115, 103, 240, 0.05);
  border-left: 1px solid rgba(115, 103, 240, 0.1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.main-menu-mobile .menu-item-has-children > a::before {
  content: '';
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid currentColor;
  transition: transform 0.3s ease;
  z-index: 10;
  pointer-events: none;
}

.main-menu-mobile .menu-item-has-children.open > a::before {
  transform: translateY(-50%) rotate(180deg);
}

/* Submenus */
.main-menu-mobile .sub-menu {
  list-style: none !important;
  padding: 0 !important; margin: 0 !important;
  background: rgba(115, 103, 240, 0.02);
  border-left: 2px solid rgba(115, 103, 240, 0.1);
  margin-left: 16px !important;
  max-height: 0; overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s ease;
  opacity: 0;
}

.main-menu-mobile .sub-menu.show {
  max-height: 500px; /* Adjust based on your needs */
  opacity: 1;
}

/* Style both UL and DIV submenu structures */
.main-menu-mobile .sub-menu a,
.main-menu-mobile .sub-menu-div a {
  display: flex; align-items: center;
  color: var(--color-text-light); text-decoration: none;
  font-weight: 400; font-size: 1rem;
  padding: 12px 20px; margin: 2px 0;
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
}

.main-menu-mobile .sub-menu a::before,
.main-menu-mobile .sub-menu-div a::before {
  content: ''; /* Remove arrow indicators */
}

.main-menu-mobile .sub-menu a:hover,
.main-menu-mobile .sub-menu a:focus,
.main-menu-mobile .sub-menu-div a:hover,
.main-menu-mobile .sub-menu-div a:focus {
  color: var(--color-primary);
  background: rgba(115, 103, 240, 0.04);
  transform: translateX(4px);
}

/* Style DIV-based submenus same as UL-based */
.main-menu-mobile .sub-menu-div {
  background: rgba(115, 103, 240, 0.02);
  border-left: 2px solid rgba(115, 103, 240, 0.1);
  margin-left: 16px !important;
  margin-top: 8px !important;
  border-radius: 8px;
  max-height: 0; overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s ease;
  opacity: 0;
}

.main-menu-mobile .sub-menu-div.show {
  max-height: 500px;
  opacity: 1;
}

/* Menu header area */
.main-menu-mobile::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 120px; background: rgba(115, 103, 240, 0.05);
  border-bottom: 1px solid rgba(115, 103, 240, 0.1);
  backdrop-filter: blur(10px);
}

.main-menu-mobile::after {
  content: 'NAVIGERING'; position: absolute; top: 50px; left: 32px;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 2px;
  color: var(--color-text-muted); text-transform: uppercase;
  z-index: 220;
}

/* ========== Footer ========== */
.site-footer {
  background: linear-gradient(120deg, #2c3e50 0%, #34495e 100%);
  padding: 2.5rem 1.5rem 1rem 1.5rem;
  margin-top: -2px;
  color: #ecf0f1; font-size: 1.06rem; border-top: none;
}
.site-footer__container {
  max-width: 1200px; margin: 0 auto;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start;
  gap: 2rem;
}
.site-footer__brand { display: flex; flex-direction: column; gap: 1.2rem; min-width: 280px; max-width: 500px; }
.site-footer__logo .custom-logo,
.site-footer__logo .footer-logo { height: 40px; width: auto; display: block; }

/* Footer-specific logo styling */
.footer-logo-link {
  display: inline-block;
}

.site-footer__logo .footer-logo {
  max-width: 80px;
  max-height: 60px;
  filter: brightness(0) invert(1);
  opacity: 0.9;
  transition: opacity 0.3s ease;
}

.site-footer__logo .footer-logo:hover {
  opacity: 1;
}
.site-footer__logotext {
  font-size: 1.2rem; font-weight: bold; color: #7367f0; letter-spacing: 0.05em;
}

/* Contact and availability section */
.site-footer__contact { display: flex; flex-direction: column; gap: 1rem; }
.site-footer__availability {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.9rem; font-weight: 500; color: #28a745;
}
.availability-indicator {
  color: #28a745; font-size: 0.8rem; animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.site-footer__info { color: #bdc3c7; line-height: 1.5; font-size: 0.98rem; }
.site-footer__info a { color: #4ecdcc; text-decoration: none; transition: color 0.18s;}
.site-footer__info a:hover, .site-footer__info a:focus { color: #7367f0; text-decoration: underline;}

/* Social section layout */
.site-footer__social {
  flex: 1; min-width: 200px; max-width: 400px;
}
.site-footer__social h4 {
  margin: 0 0 1rem 0; font-size: 1rem; font-weight: 600; color: #ecf0f1;
}

/* Social links */
.social-links {
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.8rem 1.2rem;
}
.social-link {
  display: flex; align-items: center; gap: 0.7rem;
  color: #ecf0f1; text-decoration: none; transition: all 0.2s;
  padding: 0.4rem 0.6rem; border-radius: 6px; font-size: 0.95rem;
  border: 1px solid #4a5a6a;
}
.social-link:hover {
  color: #7367f0; background: rgba(255, 255, 255, 0.1); border-color: #7367f0;
  transform: translateY(-1px); box-shadow: 0 2px 8px rgba(115, 103, 240, 0.3);
}
.social-icon {
  font-size: 1.1rem; width: 20px; text-align: center;
}


/* Footer meta section */
.site-footer__meta {
  display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; margin-top: 2rem; flex-wrap: wrap;
  padding-top: 1.5rem; border-top: 1px solid #4a5a6a;
}
.site-footer__cta {
  display: flex; flex-direction: column; gap: 0.2rem;
}
.site-footer__cta strong {
  color: #7367f0; font-size: 1rem;
}
.site-footer__cta span {
  color: #bdc3c7; font-size: 0.9rem;
}
.footer-policy-link {
  color: #4ecdcc; text-decoration: underline; font-size: 0.93rem; transition: color 0.18s;
}
.footer-policy-link:hover, .footer-policy-link:focus { color: #7367f0; outline: none; }
.site-footer__copy { font-size: 0.87rem; color: #95a5a6; letter-spacing: 0.01em; margin: 0; padding: 0; }

/* Responsive design */
@media (max-width: 768px) {
  .site-footer__container { flex-direction: column; gap: 2.2rem; align-items: flex-start; }
  .site-footer__social { min-width: 100%; max-width: none; }
  .site-footer__brand { max-width: none; }
  .social-links { grid-template-columns: 1fr; }
  .site-footer__meta { flex-direction: column; gap: 1rem; text-align: center; }
  .site-footer__cta { text-align: center; }
}
@media (max-width: 500px) {
  .site-footer { padding: 2rem 1rem 1rem 1rem; }
  .social-links { gap: 1rem; }
  .social-link { padding: 0.6rem 0.8rem; font-size: 1rem; }
}

/* ========== Button Components ========== */
.theme-buttons,
.generic_aps_buttons {
  display: flex;
  gap: 1.3rem;
  flex-wrap: wrap;
  margin-top: 0.2em;
  margin-bottom: 0.2em;
  justify-content: flex-start;
}

/* --- Buttons (reusable) --- */
.theme-buttons a,
.generic_aps_buttons a {
  display: inline-block;
  text-align: center;
  border-radius: 6px;
  justify-content: center;
  align-items: center;
  padding: 0.75rem 1rem;
  text-decoration: none;
  font-size: 0.7rem;
  transition: all .3s cubic-bezier(.68,-0.2,.4,1.2);
  box-shadow:
    0 2px 5px #0003,
    inset 0 0 0 1px #0001,
    inset 0 2px #fff3;
  border: none;
  cursor: pointer;
  font-weight: 600;
  min-width: 110px;
}

.theme-buttons .primary,
.generic_aps_buttons .primary {
  background-color: #2c77e7;
  background-image: linear-gradient(#617fe3, #3e63dd);
  color: #eef5ff !important;
}

.theme-buttons .primary:hover,
.theme-buttons .primary:focus,
.generic_aps_buttons .primary:hover,
.generic_aps_buttons .primary:focus {
  background-color: #205bc4;
  background-image: linear-gradient(#3e63dd, #205bc4);
  color: #fff !important;
}

.theme-buttons .secondary,
.generic_aps_buttons .secondary {
  background-color: #eef5ff;
  color: #2c77e7 !important;
}

.theme-buttons .secondary:hover,
.theme-buttons .secondary:focus,
.generic_aps_buttons .secondary:hover,
.generic_aps_buttons .secondary:focus {
  background-color: #e2e8f7;
  color: #1d4078 !important;
  border-color: #205bc4;
}

/* ========== Wrapper-block (section-wrapper) Offset ========== */
.wp-block-aps-section-wrapper:first-of-type,
.wp-block-section-wrapper:first-of-type {
  padding-top: 96px;
}

/* No header padding when no header exists */
.no-header .wp-block-aps-section-wrapper:first-of-type,
.no-header .wp-block-section-wrapper:first-of-type {
  padding-top: 0;
}
@media (max-width: 700px) {
  .wp-block-aps-section-wrapper:first-of-type,
  .wp-block-section-wrapper:first-of-type { 
    margin-top: 76px; 
  }
  
  /* No margin on mobile when no header */
  .no-header .wp-block-aps-section-wrapper:first-of-type,
  .no-header .wp-block-section-wrapper:first-of-type { 
    margin-top: 0 !important; 
  }
}

/* ========== HERO BLOCK ========== */
/* --- Layout och Flex för container --- */
.hero-block__container {
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  min-height: 340px;
  overflow: visible;
  /* CSS-variabler --image-ratio och --text-ratio kommer från inline style på detta element */
}
/* --- Bilddel --- */
.hero-block__media {
  position: relative;
  z-index: 1;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-block__media img {
  max-width: 100%;
  max-height: 70vh;
  width: auto;
  height: auto;
  display: block;
  border-radius: 0;
}
/* --- Textdel --- */
.hero-block__inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  background: none;
  text-align: left;
  width: 100%;
  box-sizing: border-box;
  position: static;
  z-index: 2;
  overflow: hidden;
  padding: 0 1rem;
  word-wrap: break-word;
  min-width: 0;
}
.hero-block--img-left .hero-block__inner {
  text-align: right;
  align-items: flex-end;
}
.hero-block--img-right .hero-block__inner {
  text-align: left;
  align-items: flex-start;
}
/* --- Rubrik, text och knappar --- */
.hero-block__title {
  font-family: 'Balney', 'GulamsCondensed Medium', var(--font-family);
  margin: 0 0 0.7rem 0;
  line-height: 1.05;
  font-weight: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  max-width: 100%;
  /* font-size set inline */
}
.hero-block__text {
  font-size: 1.04rem;
  margin-bottom: 1.1rem;
  color: #36373a;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

.hero-block__text p {
  font-size: var(--font-size-large);
  line-height: var(--line-height-base);
  letter-spacing: 0.01em;
  font-weight: 400;
  color: var(--color-text-light);
  margin-bottom: 1rem;
  margin-top: 0.6rem;
}

/* ========== Section Wrapper System ========== */
/* 
 * Redaktören använder wp-block-aps-section-wrapper för centrerat innehåll
 * Allt utanför wrapper = edge-to-edge (medvetet val)
 * Enkelt och förutsägbart system
 */

/* APS Section Wrapper - theme handles visual styling only */
.wp-block-aps-section-wrapper .section-wrapper__container {
  max-width: var(--max-width, 1200px);
  margin: 0 auto;
  padding: 1.5rem 1.5rem;
  box-sizing: border-box;
}

/* Full-width containers (not handled by section-wrapper plugin) */
.wp-block-cover,
.wp-block-group.alignfull {
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}
.wp-block-aps-section-wrapper:last-child {
  margin-bottom: 0 !important;
}

/* Ensure no gaps between main content and footer */
#main-content {
  margin: 0 !important;
  padding: 0 !important;
  flex: 1;
}

#main-content:last-child,
main:last-child {
  margin-bottom: 0 !important;
}

/* Remove any default WordPress block spacing at page bottom */
.wp-block:last-child,
.wp-block-group:last-child,
.wp-block-aps-section-wrapper:last-child {
  margin-bottom: 0 !important;
}

/* Additional footer gap prevention */
.site-footer {
  margin-top: 0 !important;
}

/* Ensure body has no bottom spacing */
body {
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

/* Reset - ta bort all annan spacing som kan störa */
* {
  box-sizing: border-box;
}

/* --- Responsivitet Hero --- */
@media (max-width: 1200px) {
  .hero-block__container {
    max-width: 98vw;
  }
}
@media (max-width: 768px) {
  .hero-block__container {
    flex-direction: column;
    min-height: 0;
    gap: 2rem;
  }
  .hero-block__media,
  .hero-block__inner {
    width: 100% !important;
    max-width: 100% !important;
    height: auto;
  }
  .hero-block__media {
    order: -1; /* Visa alltid bilden först på mobil */
  }
  .hero-block__media img {
    max-width: 90vw;
    max-height: 50vh;
    min-height: 300px;
    width: auto;
    height: auto;
    object-fit: cover;
    border-radius: var(--border-radius);
  }
  .hero-block__inner {
    text-align: center !important;
    align-items: center !important;
    padding: 1rem;
  }
}
@media (max-width: 600px) {
  .hero-block__container {
    gap: 1.5rem;
  }
  .hero-block__inner { 
    padding: 0.8rem 1rem;
  }
  .hero-block__media img {
    border-radius: var(--border-radius);
    max-width: 95vw;
    max-height: 45vh;
    min-height: 250px;
    width: auto;
    height: auto;
    object-fit: cover;
  }
  .hero-block__title { 
    margin-bottom: 0.8rem;
    font-size: 2.2rem !important; /* Override inline style på mobil */
  }
}


/* === APStract Grid Cards List Styles === */
.apstract_grid_cards__inner-content ul,
.apstract_grid_cards__inner-content ol {
  list-style: initial !important;
  margin-bottom: 1rem;
  list-style-position: outside !important; /* Punkten utanför för korrekt radjustering */
  padding-left: 1.2em !important; /* Korrekt indentering */
}

.apstract_grid_cards__inner-content ul {
  list-style-type: disc !important;
}

.apstract_grid_cards__inner-content ol {
  list-style-type: decimal !important;
}

/* Nästlade listor i APStract Grid Cards */
.apstract_grid_cards__inner-content ul ul,
.apstract_grid_cards__inner-content ol ol,
.apstract_grid_cards__inner-content ul ol,
.apstract_grid_cards__inner-content ol ul {
  padding-left: 1.5em !important;
  list-style-position: outside !important;
}

/* === Grid Item Block === */
.grid-item-block {
  background: #fff;
  border-radius: 1.1em;
  box-shadow: 0 2px 8px rgba(44, 119, 231, 0.07);
  padding: 2.2em 1.6em 1.6em 1.6em;
  margin: 0 auto;
  text-align: center;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7em;
}

.grid-item-block__icon {
  font-size: 2.7rem;
  color: #2c77e7;
  margin-bottom: 0.2em;
}
.grid-item-block__heading {
  font-size: 1.32rem;
  font-weight: 500;
  margin: 0 0 0.3em 0;
}
.grid-item-block__video {
  width: 100%;
  max-width: 360px;
  margin: 0 auto 1em auto;
}
.grid-item-block__video iframe {
  width: 100%;
  border-radius: 0.7em;
  aspect-ratio: 16/9;
  min-height: 180px;
  background: #eef2f6;
}
.grid-item-block__text {
  font-size: 1.04rem;
  color: #444;
  line-height: 1.5;
  margin-bottom: 0;
  margin-top: 0;
}

@media (max-width: 700px) {
  .grid-item-block {
    max-width: 98vw;
    padding: 1.3em 0.5em 1.3em 0.5em;
  }
}

.card-grid-block__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
}
/* Uppdaterad för att matcha aps_grid_cards design */
.card-item-block {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  box-shadow: 0 2px 8px var(--color-shadow);
  padding: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 280px;
  transition: var(--transition);
}
.card-item-block__icon {
  font-size: 2.6rem;
  color: #4ecdcc;
  margin-bottom: 1.1rem;
}
.card-item-block__title {
  font-size: 1.3rem;
  font-weight: 500;
  margin: 0 0 0.9rem 0;
  color: #2c77e7;
}
.card-item-block__video {
  width: 100%;
  margin: 1.2rem 0;
  border-radius: 0.9rem;
  overflow: hidden;
}
.card-item-block__text {
  color: #444;
  font-size: 1.09rem;
  line-height: 1.5;
}

/* Gör grid responsivt */
@media (max-width: 900px) {
  .card-grid-block__grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }
  .card-item-block {
    min-height: 0;
  }
}

.aps_grid_cards {
  display: grid;
  gap: 24px;
}

.aps_grid_cards--small {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.aps_grid_cards--medium {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.aps_grid_cards--large {
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}

/* ========== Section Wrapper Theme Presets ========== */
/* 
 * Base theme does NOT define section wrapper presets
 * Child themes should define their own site-specific presets
 * This ensures clean separation and avoids style conflicts
 */

/* ========== APStract Buttons Styling ========== */
.generic_aps_buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.generic_aps_buttons a {
  display: inline-flex;
  align-items: center;
  padding: 12px 24px;
  border-radius: var(--border-radius);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
  transition: var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
}

.generic_aps_buttons a.primary {
  background: var(--site-primary, var(--color-primary));
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(115, 103, 240, 0.2);
}

.generic_aps_buttons a.primary:hover {
  background: var(--site-secondary, var(--color-secondary));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(115, 103, 240, 0.3);
}

.generic_aps_buttons a.secondary {
  background: transparent;
  color: var(--site-primary, var(--color-primary));
  border-color: var(--site-primary, var(--color-primary));
}

.generic_aps_buttons a.secondary:hover {
  background: var(--site-primary, var(--color-primary));
  color: #ffffff;
  transform: translateY(-1px);
}

.generic_aps_buttons .aps_buttons__icon {
  margin-right: 8px;
}

/* Responsive knapp-styling */
@media (max-width: 768px) {
  .generic_aps_buttons {
    flex-direction: column;
    width: 100%;
  }
  
  .generic_aps_buttons a {
    width: 100%;
    justify-content: center;
  }
}

/* ========== 404 Error Page ========== */
.error-404-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 2rem;
}

.error-404-content {
  max-width: 600px;
  text-align: center;
  width: 100%;
}

.error-404-header {
  margin-bottom: 2rem;
}

.error-404-title {
  font-size: 3rem;
  font-weight: 700;
  color: var(--site-primary, var(--color-primary));
  margin: 0 0 1rem 0;
  line-height: 1.2;
  text-shadow: 0 4px 12px rgba(115, 103, 240, 0.1);
}

.error-404-subtitle {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  line-height: 1.2;
}

.error-404-message {
  margin-bottom: 2.5rem;
}

.error-404-message p {
  font-size: 1.1rem;
  color: var(--color-text-light);
  margin: 0;
  line-height: 1.6;
}

.error-404-actions {
  margin-bottom: 2.5rem;
}

.error-404-actions .btn {
  display: inline-block;
  background: var(--site-primary, var(--color-primary));
  color: #ffffff;
  padding: 12px 24px;
  border-radius: var(--border-radius);
  font-weight: 600;
  text-decoration: none;
  font-size: 1rem;
  transition: var(--transition);
  border: none;
  box-shadow: 0 2px 8px rgba(115, 103, 240, 0.2);
}

.error-404-actions .btn:hover {
  background: var(--site-secondary, var(--color-secondary));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(115, 103, 240, 0.3);
}


/* Responsive 404 */
@media (max-width: 768px) {
  .error-404-page {
    min-height: 50vh;
    padding: 1rem;
  }
  
  .error-404-title {
    font-size: 2.5rem;
  }
  
  .error-404-subtitle {
    font-size: 1.4rem;
  }
}

