/*
Theme Name: Astra Child
Template: astra
Description: Child theme for Astra, tilpasset smartesider.no-inspirert design
Author: GitHub Copilot
Version: 1.0.0
*/

/* Fargepalett fra logo */
:root {
  --main-blue: #3b82f6;
  --light-blue: #60a5fa;
  --dark-blue: #22223b;
  --background: #f8fafd;
}

body {
  background: var(--background);
}

/* Max Mega Menu styling to match brand */
.mega-menu-wrap .mega-menu-toggle .mega-toggle-blocks-left .mega-toggle-animated-inner,
.mega-menu-wrap .mega-menu-toggle .mega-toggle-blocks-center .mega-toggle-animated-inner,
.mega-menu-wrap .mega-menu-toggle .mega-toggle-blocks-right .mega-toggle-animated-inner {
  background: var(--dark-blue);
}
.mega-menu-wrap .mega-menu > li > a.mega-menu-link {
  color: var(--dark-blue);
  padding: 10px 14px;
  font-weight: 600;
}
.mega-menu-wrap .mega-menu > li > a.mega-menu-link:hover,
.mega-menu-wrap .mega-menu > li.mega-current-menu-item > a.mega-menu-link {
  color: var(--main-blue);
}
.mega-menu-wrap .mega-menu > li > a.mega-menu-link::after {
  content: '';
  display: block;
  margin-top: 6px;
  height: 2px;
  width: 0;
  background: var(--main-blue);
  transition: width .25s ease;
}
.mega-menu-wrap .mega-menu > li:hover > a.mega-menu-link::after,
.mega-menu-wrap .mega-menu > li.mega-current-menu-item > a.mega-menu-link::after {
  width: 100%;
}
.mega-menu-wrap .mega-submenu {
  border-radius: 12px;
  box-shadow: 0 12px 30px #0f172a22;
  border: 1px solid #e5e9f6;
}
.mega-menu-wrap .mega-submenu a.mega-menu-link {
  padding: 10px 12px;
}

/* Ensure container spacing */
.primary-nav { margin-left: auto; }

/* Mega dropdown: Tjenester (two-column with icons + blurbs) */
/* Target both default WP classes and Max Mega Menu item classes just in case */
.mega-menu-wrap .mega-menu > li.menu-item-24 > ul.mega-sub-menu,
.mega-menu-wrap .mega-menu > li.mega-menu-item-24 > ul.mega-sub-menu,
.mega-menu-wrap .mega-menu > li.menu-item-24 > .mega-submenu,
.mega-menu-wrap .mega-menu > li.mega-menu-item-24 > .mega-submenu {
  width: 760px;
  max-width: calc(100vw - 32px);
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 14px 18px;
}

/* Cards for each service item */
.mega-menu-wrap .mega-menu > li.menu-item-24 ul li > a.mega-menu-link {
  display: block;
  background: #ffffff;
  border: 1px solid #eef2ff;
  border-radius: 12px;
  padding: 14px 14px 12px 44px; /* left space for icon */
  line-height: 1.25;
  position: relative;
  color: var(--dark-blue);
}
.mega-menu-wrap .mega-menu > li.menu-item-24 ul li > a.mega-menu-link:hover {
  border-color: #dbe4ff;
  box-shadow: 0 8px 20px #0f172a14;
  color: var(--main-blue);
}
/* Blurb: pull from title attribute */
.mega-menu-wrap .mega-menu > li.menu-item-24 ul li > a.mega-menu-link::after {
  content: attr(title);
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #475569;
  white-space: normal;
}

/* Icons via data-URI SVGs based on per-item classes set earlier */
.mega-menu-wrap .mega-menu > li.menu-item-24 ul li.svc-ai > a.mega-menu-link::before,
.mega-menu-wrap .mega-menu > li.menu-item-24 ul li.svc-dev > a.mega-menu-link::before,
.mega-menu-wrap .mega-menu > li.menu-item-24 ul li.svc-seo > a.mega-menu-link::before,
.mega-menu-wrap .mega-menu > li.menu-item-24 ul li.svc-web > a.mega-menu-link::before,
.mega-menu-wrap .mega-menu > li.menu-item-24 ul li.svc-host > a.mega-menu-link::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 14px;
  width: 20px;
  height: 20px;
  background-size: 20px 20px;
  background-repeat: no-repeat;
  filter: saturate(1) brightness(0.9);
}
/* AI brain */
.mega-menu-wrap .mega-menu > li.menu-item-24 ul li.svc-ai > a.mega-menu-link::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='%23006EE6'%3E%3Cpath d='M9 2a4 4 0 0 0-4 4v3H4a2 2 0 0 0 0 4h1v3a4 4 0 0 0 4 4h1V2H9zm5 0h-1v18h1a4 4 0 0 0 4-4v-3h1a2 2 0 0 0 0-4h-1V6a4 4 0 0 0-4-4z'/%3E%3C/svg%3E");
}
/* Code brackets */
.mega-menu-wrap .mega-menu > li.menu-item-24 ul li.svc-dev > a.mega-menu-link::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='%23006EE6' viewBox='0 0 16 16'%3E%3Cpath d='M6.5 3.5a.5.5 0 0 1 .5.5v1l-3 3 3 3v1a.5.5 0 0 1-.85.35l-4-4a.5.5 0 0 1 0-.7l4-4A.5.5 0 0 1 6.5 3.5zm3 0a.5.5 0 0 0-.5.5v1l3 3-3 3v1a.5.5 0 0 0 .85.35l4-4a.5.5 0 0 0 0-.7l-4-4A.5.5 0 0 0 9.5 3.5z'/%3E%3C/svg%3E");
}
/* SEO chart */
.mega-menu-wrap .mega-menu > li.menu-item-24 ul li.svc-seo > a.mega-menu-link::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='%23006EE6'%3E%3Cpath d='M3 3h2v18H3zM8 13h2v8H8zM13 9h2v12h-2zM18 5h2v16h-2z'/%3E%3C/svg%3E");
}
/* Webdesign monitor */
.mega-menu-wrap .mega-menu > li.menu-item-24 ul li.svc-web > a.mega-menu-link::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='%23006EE6'%3E%3Cpath d='M3 4h18a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1zm7 15h4a1 1 0 0 1 1 1v1H9v-1a1 1 0 0 1 1-1z'/%3E%3C/svg%3E");
}
/* Hosting server */
.mega-menu-wrap .mega-menu > li.menu-item-24 ul li.svc-host > a.mega-menu-link::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='%23006EE6'%3E%3Cpath d='M4 4h16a2 2 0 0 1 2 2v3H2V6a2 2 0 0 1 2-2zm-2 7h20v3a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-3zm6 8h8v1H8z'/%3E%3C/svg%3E");
}

/* Sticky, compact header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: box-shadow .2s ease, backdrop-filter .2s ease;
  backdrop-filter: saturate(1.2) blur(0px);
  height: 72px; /* lock header height */
}
.site-header.is-scrolled {
  box-shadow: 0 8px 24px #0f172a14;
  backdrop-filter: saturate(1.4) blur(6px);
}
.header-bar {
  /* Keep consistent padding/height to prevent layout jumps */
  padding: 16px 24px !important;
  min-height: 72px;
}
.site-logo {
  height: 48px; /* reserve space */
  display: block;
  transition: transform .2s ease;
  transform-origin: left center;
}
.site-header.is-scrolled .site-logo {
  /* Visual shrink without reflow */
  transform: scale(0.75);
}
/* Avoid changing font size on scroll to prevent reflow */
/* Tighten top-level menu spacing on scroll */
.site-header.is-scrolled .mega-menu-wrap .mega-menu > li > a.mega-menu-link {
  padding-top: 6px;
  padding-bottom: 6px;
}

/* Offset for WP admin bar */
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) {
  .admin-bar .site-header { top: 46px; }
}

/* Responsive: single column on small screens */
@media (max-width: 768px) {
  .mega-menu-wrap .mega-menu > li.menu-item-24 > ul.mega-sub-menu,
  .mega-menu-wrap .mega-menu > li.mega-menu-item-24 > ul.mega-sub-menu,
  .mega-menu-wrap .mega-menu > li.menu-item-24 > .mega-submenu,
  .mega-menu-wrap .mega-menu > li.mega-menu-item-24 > .mega-submenu {
    grid-template-columns: 1fr;
    width: calc(100vw - 24px);
  }
}

/* Hero video section */
.hero-video { position: relative; overflow: hidden; min-height: 58vh; display:flex; align-items:center; }
.hero-video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-video .hero-overlay { position:absolute; inset:0; background: linear-gradient(180deg, #0f172a99, #0f172a66 40%, #0f172a66); }
.hero-video .hero-inner { position: relative; z-index: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 72px 16px; text-align: center; }
.hero-video .hero-inner h1 { color: #fff; font-size: 2.6rem; font-weight: 800; line-height: 1.15; margin: 0; }
.hero-video .hero-inner p { color: #dbeafe; font-size: 1.15rem; margin: 20px auto 28px; max-width: 780px; }

@media (max-width: 768px) {
  .hero-video { min-height: 52vh; }
  .hero-video .hero-inner h1 { font-size: 2rem; }
}

/* Fallback styling when Max Mega Menu markup isn't present */
.primary-nav ul { list-style: none; margin: 0; padding: 0; }
.primary-nav > ul { display: flex; align-items: center; gap: 8px; }
.primary-nav li { position: relative; }
.primary-nav a { display: block; padding: 10px 12px; text-decoration: none; color: var(--dark-blue); font-weight: 600; }
.primary-nav > ul > li > a { padding: 10px 14px; }
.primary-nav a:hover { color: var(--main-blue); }
/* underline effect */
.primary-nav > ul > li > a::after { content:''; display:block; height:2px; width:0; background: var(--main-blue); transition: width .25s ease; margin-top:6px; }
.primary-nav > ul > li:hover > a::after { width:100%; }
/* dropdowns: remove hover gap by placing submenu flush to parent */
.primary-nav li ul { display: none; position: absolute; top: 100%; left: 0; min-width: 220px; background: #fff; border:1px solid #e5e9f6; border-radius: 12px; box-shadow: 0 12px 30px #0f172a22; padding: 8px; z-index: 1002; }
.primary-nav li:hover > ul, .primary-nav li:focus-within > ul, .primary-nav li ul:hover { display: block; }
.primary-nav li ul li a { padding: 10px 12px; border-radius: 8px; }
.primary-nav li ul li a:hover { background: #f8fafd; color: var(--main-blue); }
/* prevent bullets on nested lists in any case */
.primary-nav li ul { list-style: none; }

/* Mobile menu */
.mobile-menu-toggle { display:none; margin-left:auto; background:#0f172a; color:#fff; border:none; border-radius:10px; padding:10px 12px; font-weight:700; box-shadow:0 6px 18px rgba(15,23,42,.25); }
.mobile-drawer[hidden] { display:none; }
.mobile-drawer { position: fixed; inset: 0; z-index: 1100; }
.mobile-drawer .mobile-backdrop { position:absolute; inset:0; background:rgba(15,23,42,.45); }
.mobile-drawer .mobile-panel { position:absolute; top:0; right:0; width:86%; max-width:360px; height:100%; background:#fff; box-shadow:-12px 0 32px rgba(15,23,42,.22); transform: translateX(100%); transition: transform .25s ease; display:flex; flex-direction:column; }
.mobile-drawer.open .mobile-panel { transform: translateX(0); }
.mobile-panel-header { display:flex; align-items:center; justify-content:space-between; padding:14px 16px; border-bottom:1px solid #e5e9f6; }
.mobile-title { font-weight:800; color:#0f172a; }
.mobile-close { background:none; border:none; font-size:24px; line-height:1; cursor:pointer; }
.mobile-panel-body { padding:8px 10px 18px; overflow:auto; }
/* Show fallback by default; plugin is hidden until JS validates it's usable */
#mobile-menu-plugin { display: none; }
/* Generic fallback styling (wp_page_menu output) */
.mobile-panel-body .menu, /* wp_page_menu container */
.mobile-panel-body .menu ul { list-style: none; margin: 0; padding: 0; }
.mobile-panel-body .menu > ul > li { border-bottom:1px solid #eef2f7; }
.mobile-panel-body .menu a { display:block; padding:12px; color:#0f172a; text-decoration:none; font-weight:600; }
.mobile-panel-body .menu li ul { padding-left: 10px; }
/* WP core mobile menu fallback */
.mobile-menu { list-style:none; margin:0; padding:0; }
.mobile-menu li { border-bottom:1px solid #eef2f7; }
.mobile-menu li a { display:block; padding:12px; color:#0f172a; text-decoration:none; font-weight:600; }
.mobile-menu li .sub-menu { display:none; }
.mobile-menu li.open > .sub-menu { display:block; padding-left:10px; }

/* Mobile panel nav base (fallback only) */

@media (max-width: 992px) {
  .primary-nav { display:none; }
  .mobile-menu-toggle { display:inline-flex; align-items:center; gap:8px; }
  body.mobile-lock { overflow:hidden; }
}

/* Hover-bridge to prevent accidental close when moving cursor to submenu */
.primary-nav > ul > li { --hover-bridge: 10px; }
.primary-nav > ul > li::after { content:''; position:absolute; left:0; right:0; top:100%; height: var(--hover-bridge); }

/* Max Mega Menu: align submenu flush and raise z-index; add hover bridge */
.mega-menu-wrap { z-index: 1003; }
.mega-menu-wrap .mega-menu > li { position: relative; --hover-bridge: 10px; }
.mega-menu-wrap .mega-menu > li::after { content:''; position:absolute; left:0; right:0; top:100%; height: var(--hover-bridge); }
.mega-menu-wrap .mega-menu > li > .mega-submenu,
.mega-menu-wrap .mega-menu > li > ul.mega-sub-menu { top: 100% !important; margin-top: 0 !important; z-index: 1004; }

/* Breadcrumbs */
.breadcrumbs { max-width: 1100px; margin: 0 auto; padding: 10px 16px 0; color:#475569; font-size: .95rem; }
.breadcrumbs .crumb a { color:#0f172a; text-decoration:none; }
.breadcrumbs .crumb a:hover { color: var(--main-blue); text-decoration: underline; }
.breadcrumbs .crumb-sep { margin: 0 6px; color:#94a3b8; }

/* FAQ page styles */
.faq-container { 
  overflow: visible; 
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 16px;
  box-sizing: border-box;
}
.faq-container::after { content:''; display:block; clear: both; }
.faq-wrapper { 
  display: grid; 
  grid-template-columns: 280px 1fr; 
  gap: 32px; 
  align-items: start; 
  clear: both;
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}
.faq-aside { 
  position: sticky; 
  top: 96px; 
  align-self: start;
  z-index: 2;
}
.faq-content { 
  min-width: 0;
  position: relative;
  z-index: 1;
  width: 100%;
}
@media (max-width: 980px) {
  .faq-wrapper { 
    grid-template-columns: 1fr; 
    gap: 24px;
  }
  .faq-aside { 
    position: static; 
    z-index: auto;
  }
}
.faq-aside .page-title { 
  margin: 8px 0 16px; 
  font-size: 28px; 
  line-height:1.15; 
  scroll-margin-top: 120px;
  position: relative;
  z-index: 10;
}
.faq-aside p { color:#475569; margin: 0 0 14px; }
.faq-nav { display:flex; flex-direction:column; gap:10px; }
.faq-nav .pill { display:inline-block; padding:8px 12px; border-radius:10px; background:#0f172a; color:#fff; text-decoration:none; font-weight:700; box-shadow:0 6px 18px rgba(15,23,42,.15); }
.faq-nav .pill:hover, .faq-nav .pill.is-active { background:#1f2a44; }
.faq-section { margin: 8px 0 28px; scroll-margin-top: 110px; }
.faq-section + .faq-section { margin-top: 24px; }
.faq-section h2 { margin: 0 0 10px; font-size: 24px; letter-spacing: .2px; color:#0f172a; }
details.faq-item { border:1px solid #e5e9f6; border-radius:12px; background:#fff; margin:10px 0; overflow:hidden; width:100%; }
details.faq-item > summary { cursor:pointer; list-style:none; padding:14px 16px; font-weight:700; color:#0f172a; display:flex; align-items:center; justify-content:space-between; gap:12px; }
details.faq-item > summary::-webkit-details-marker { display:none; }
details.faq-item[open] > summary { background:#f8fafd; }
details.faq-item > summary::after { 
  content:'+'; 
  font-weight:900; 
  color:#64748b; 
  margin-left:12px; 
  font-size: 20px;
  line-height: 1;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
details.faq-item[open] > summary::after { 
  content:'−'; 
  font-size: 24px;
}
.faq-summary-text { flex: 1 1 auto; }
.faq-anchor { 
  color:#64748b; 
  text-decoration:none; 
  font-weight:700; 
  opacity:.7;
  font-size: 16px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 4px;
  transition: all 0.2s ease;
}
.faq-anchor:hover { 
  opacity:1;
  background: #f1f5f9;
  color: var(--main-blue);
}
.faq-answer { padding: 0 16px 14px; color:#1f2937; }
.faq-clearfix { clear: both; }

/* Single Post (Innlegg) Container - Prevent 100% width stretch */
.single-post-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Featured Image Layout - Below title, left-aligned within content area */
.single-featured-image-wrapper {
  max-width: 800px;
  margin: 1.5rem auto;
  padding: 0 16px;
}

.single-featured-image-wrapper .featured-image-container {
  float: left;
  width: 300px;
  margin: 0 1.5rem 1rem 0;
}

.single-featured-image-wrapper .featured-image {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  margin-bottom: 0.5rem;
}

.single-featured-image-wrapper .featured-image-caption {
  font-size: 0.85rem;
  color: #64748b;
  font-style: italic;
  text-align: left;
  margin-top: 0.5rem;
  line-height: 1.4;
}

/* Ensure content flows around the featured image */
.single .entry-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 16px;
  overflow: visible;
}

/* Clear floats after content */
.single .entry-content::after {
  content: "";
  display: table;
  clear: both;
}

/* Single post content width constraints */
.single .ast-container,
.single .site-content .ast-container {
  max-width: 1100px !important;
}

/* Ensure single post content doesn't stretch full width */
.single #primary {
  max-width: 100% !important;
}

.single .entry-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Improve content readability */
.entry-content p {
  line-height: 1.7;
  margin: 1rem 0;
  text-align: justify;
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4 {
  color: var(--dark-blue);
  margin: 2rem 0 1rem;
  line-height: 1.3;
}

.entry-content h2 {
  font-size: 1.75rem;
  border-bottom: 2px solid var(--light-blue);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

.entry-content h3 {
  font-size: 1.5rem;
  color: var(--main-blue);
}

.entry-content ul,
.entry-content ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.entry-content li {
  margin: 0.5rem 0;
  line-height: 1.6;
}

/* Single post header styling */
.single .entry-header {
  max-width: 800px;
  margin: 0 auto 2rem;
  padding: 0 16px;
  text-align: center;
}

.single .entry-title {
  font-size: 2.5rem;
  line-height: 1.2;
  margin: 1rem 0 0.5rem;
  color: var(--dark-blue);
}

.single .entry-meta {
  color: #64748b;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

/* Post content styling */
.single .entry-content h1,
.single .entry-content h2,
.single .entry-content h3,
.single .entry-content h4 {
  color: var(--dark-blue);
  margin: 2rem 0 1rem;
}

.single .entry-content p {
  line-height: 1.7;
  margin: 1rem 0;
}

.single .entry-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5rem 0;
}

/* Responsive adjustments for single posts */
@media (max-width: 992px) {
  /* Medium screens: reduce featured image width */
  .single-featured-image-wrapper .featured-image-container {
    width: 250px;
    margin-right: 1.25rem;
  }
}

@media (max-width: 768px) {
  .single-post-container {
    padding: 0 12px;
  }
  
  .single .entry-content,
  .single .entry-header {
    padding: 0 12px;
  }
  
  .single .entry-title {
    font-size: 2rem;
  }
  
  .single-featured-image-wrapper {
    padding: 0 12px;
  }
  
  /* Mobile: remove float, keep left-aligned but reduce width */
  .single-featured-image-wrapper .featured-image-container {
    float: none;
    width: auto;
    max-width: 300px;
    margin: 0 0 1.5rem 0;
  }
  
  .single-featured-image-wrapper .featured-image {
    border-radius: 8px;
  }
  
  .single-featured-image-wrapper .featured-image-caption {
    margin-top: 0.75rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  /* Small mobile: adjust spacing */
  .single-featured-image-wrapper {
    margin: 1rem auto;
  }
  
  .single-featured-image-wrapper .featured-image-container {
    max-width: 100%;
    margin-bottom: 1rem;
  }
  
  .single .entry-title {
    font-size: 1.75rem;
  }
}

/* Override Astra's full-width settings for single posts */
.single .ast-separate-container .ast-article-post,
.single .ast-separate-container .ast-article-single {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 16px;
}

.single .site-content > .ast-container {
  padding-left: 16px !important;
  padding-right: 16px !important;
}

/* Ensure proper content width in Astra's container structure */
.single .ast-container > .ast-row {
  max-width: 1100px;
  margin: 0 auto;
}

/* Make sure images and media don't break the layout */
.single .entry-content .alignwide {
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.single .entry-content .alignfull {
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* External links section at bottom of pages */
.external-links-section {
  border-radius: 8px;
}

.external-links-section a {
  color: var(--main-blue);
  text-decoration: underline;
}

.external-links-section a:hover {
  color: var(--dark-blue);
  text-decoration: none;
}

@media (max-width: 768px) {
  .external-links-section {
    margin-top: 2rem;
    padding: 1.5rem 12px;
  }
  
  .external-links-section p {
    font-size: 0.8rem;
  }
}

/* Additional FAQ page fixes to prevent content overlapping */
.page-template-page-faq .entry-content.elementor-content-area {
  margin-bottom: 32px;
  clear: both;
  overflow: hidden;
  width: 100%;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

/* Force proper containment for any problematic Elementor sections */
.page-template-page-faq .elementor-section {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.page-template-page-faq .elementor-container {
  width: 100% !important;
  max-width: 1100px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.page-template-page-faq .elementor-row {
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.page-template-page-faq .elementor-column {
  width: 100% !important;
}

.page-template-page-faq .elementor-widget-wrap {
  width: 100% !important;
}

/* Prevent CSS leakage from affecting FAQ layout */
.page-template-page-faq {
  /* Reset any global styles that might interfere */
  .badge, .tag, button, h1, h2, h3, h4, h5, h6 {
    /* Scope any global overrides to not affect FAQ */
  }
}

/* Ensure FAQ questions handle long words properly */
.faq-summary-text {
  overflow-wrap: anywhere;
  word-wrap: break-word;
  hyphens: auto;
}

.faq-answer p {
  overflow-wrap: anywhere;
  word-wrap: break-word;
  hyphens: auto;
}

/* Fix any duplicate ID issues by ensuring proper specificity */
.page-template-page-faq [id] {
  position: relative;
  scroll-margin-top: 120px;
}

/* Additional containment for any rogue elements */
.page-template-page-faq * {
  box-sizing: border-box;
}

/* Ensure FAQ sections don't get cut off */
.page-template-page-faq .faq-section {
  overflow: visible;
  position: relative;
  z-index: 1;
}

.page-template-page-faq .faq-wrapper {
  margin-top: 24px;
}

.page-template-page-faq .faq-section {
  margin-bottom: 32px;
}

.page-template-page-faq .faq-item {
  margin-bottom: 16px;
  clear: both;
}

/* Ensure proper stacking context for FAQ elements */
.page-template-page-faq .site-main {
  position: relative;
  z-index: 1;
}

/* Fix potential Elementor widget conflicts */
.page-template-page-faq .elementor-widget {
  margin-bottom: 24px;
  overflow: hidden;
}

.page-template-page-faq .elementor-element {
  clear: both;
}

/* Ensure FAQ container doesn't inherit problematic styles */
.page-template-page-faq .faq-container {
  margin-top: 0;
  padding-top: 0;
  isolation: isolate;
}

/* Force proper layout reset for FAQ page */
.page-template-page-faq * {
  box-sizing: border-box;
}

/* Additional mobile fixes for FAQ layout */
@media (max-width: 768px) {
  .page-template-page-faq .faq-wrapper {
    display: block;
    grid-template-columns: none;
  }
  
  .page-template-page-faq .faq-aside,
  .page-template-page-faq .faq-content {
    float: none;
    width: 100%;
    position: static;
    margin-bottom: 24px;
  }
  
  .page-template-page-faq .faq-section {
    clear: both;
    margin-bottom: 24px;
  }
  
  .page-template-page-faq .faq-item {
    position: relative;
    z-index: auto;
    margin-bottom: 12px;
  }
}
