@font-face {
    font-family: 'IBM Plex Sans';
    src: url('assets/css/fonts.css');
    font-display: swap;
}

/* Fallback to remote fonts */
@font-face {
    font-family: 'IBM Plex Sans';
    src: url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&display=swap');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

/* Base Styles */
body {
    font-family: 'IBM Plex Sans', Verdana, Arial, sans-serif !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    scroll-behavior: smooth !important;
    scroll-padding-top: 100px !important;
    background-color: #E5E5E6 !important;
    color: var(--wp--preset--color--secondary) !important;
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
    max-width: 100vw;
    font-size: 16px;
    line-height: 1.6;
}

html {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

#page-wrapper {
    width: 100%;
    overflow-x: hidden;
    max-width: 100vw;
    position: relative;
}

.font-serif {
    font-family: 'IBM Plex Serif', Georgia, serif !important;
}

/* Logo slogan styling */
header .logo-slogan {
    font-size: 24px;
    margin-top: 10px;
}

/* Add margin to text-sm */
.text-sm {
    margin-top: 15px;
}

/* Enhanced Typography for Content */
.prose p,
.entry-content p,
.prose-lg p,
.content p,
.post-content p {
    font-size: var(--content-font-size, 1.125rem);
    line-height: 1.75;
    margin-bottom: 1.5em;
    color: #374151;
}

.prose h1,
.entry-content h1,
.prose-lg h1,
.content h1,
.post-content h1 {
    font-size: var(--heading-h1-size, 2.5rem);
    line-height: 1.2;
    margin-bottom: 0.75em;
    margin-top: 1.5em;
    font-weight: bold;
    font-family: 'IBM Plex Sans', Verdana, Arial, sans-serif !important;
    color: #1D2F3D;
}

.prose h2,
.entry-content h2,
.prose-lg h2,
.content h2,
.post-content h2 {
    font-size: var(--heading-h2-size, 2rem);
    line-height: 1.3;
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    font-weight: bold;
    font-family: 'IBM Plex Sans', Verdana, Arial, sans-serif !important;
    color: #1D2F3D;
}

.prose h3,
.entry-content h3,
.prose-lg h3,
.content h3,
.post-content h3 {
    font-size: var(--heading-h3-size, 1.5rem);
    line-height: 1.4;
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    font-weight: bold;
    font-family: 'IBM Plex Sans', Verdana, Arial, sans-serif !important;
    color: #1D2F3D;
}

.prose h4,
.entry-content h4,
.prose-lg h4,
.content h4,
.post-content h4 {
    font-size: var(--heading-h4-size, 1.25rem);
    line-height: 1.4;
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    font-weight: bold;
    font-family: 'IBM Plex Sans', Verdana, Arial, sans-serif !important;
    color: #1D2F3D;
}

.prose h5,
.entry-content h5,
.prose-lg h5,
.content h5,
.post-content h5 {
    font-size: var(--heading-h5-size, 1.125rem);
    line-height: 1.4;
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    font-weight: bold;
    font-family: 'IBM Plex Sans', Verdana, Arial, sans-serif !important;
    color: #1D2F3D;
}

.prose h6,
.entry-content h6,
.prose-lg h6,
.content h6,
.post-content h6 {
    font-size: var(--heading-h6-size, 1rem);
    line-height: 1.5;
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    font-weight: bold;
    font-family: 'IBM Plex Sans', Verdana, Arial, sans-serif !important;
    color: #1D2F3D;
}

.prose a,
.entry-content a,
.prose-lg a,
.content a,
.post-content a {
    color: var(--wp--preset--color--primary);
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 500;
    border-bottom: 1px solid transparent;
}

.prose a:hover,
.entry-content a:hover,
.prose-lg a:hover,
.content a:hover,
.post-content a:hover {
    color: color-mix(in srgb, var(--wp--preset--color--primary) 80%, #000);
    border-bottom-color: currentColor;
}

.prose ul,
.entry-content ul,
.prose-lg ul,
.content ul,
.post-content ul {
    margin-top: 1em;
    margin-bottom: 1em;
    list-style-type: disc;
    padding-left: 1.5em;
}

.prose ol,
.entry-content ol,
.prose-lg ol,
.content ol,
.post-content ol {
    margin-top: 1em;
    margin-bottom: 1em;
    list-style-type: decimal;
    padding-left: 1.5em;
}

.prose li,
.entry-content li,
.prose-lg li,
.content li,
.post-content li {
    margin-top: 0.5em;
    margin-bottom: 0.5em;
    font-size: var(--content-font-size, 1.125rem);
}

.prose blockquote,
.entry-content blockquote,
.prose-lg blockquote,
.content blockquote,
.post-content blockquote {
    margin-left: 0;
    margin-right: 0;
    padding-left: 1.5em;
    border-left: 4px solid var(--wp--preset--color--primary);
    font-style: italic;
    margin-top: 2em;
    margin-bottom: 2em;
    color: #4B5563;
}

.prose img,
.entry-content img,
.prose-lg img,
.content img,
.post-content img {
    margin-top: 2em;
    margin-bottom: 2em;
    border-radius: 0.75rem;
}

/* Update article-categories styling */
.article-categories {
    display: inline-block !important;
    background-color: #F9EBEB !important;
    color: #AB2026 !important;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
    padding-top: 0.25rem !important;
    padding-bottom: 0.25rem !important;
    border-radius: 9999px !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    letter-spacing: normal !important;
}

/* Footer headings */
footer h3, 
footer .text-xl.font-bold, 
footer .footer-col2-title,
footer .footer-col3-title,
footer .footer-col4-title {
    color: white !important;
}

/* Footer contact info text and label styling */
footer .text-sm.text-white,
footer .text-sm.text-gray-400 {
    color: white !important;
    margin-top: 0 !important;
    font-weight: 400;
}

/* Fix spacing in footer contact items */
footer .flex.items-start {
    align-items: flex-start !important;
    margin-bottom: 1rem;
}

/* Footer icons should be teal */
footer .text-[#C63A38], 
footer .text-[#3A8182] {
    color: #3A8182 !important;
}

/* Button Hover Styles - Lighter text */
.mt-8.bg-primary.text-white:hover span,
a.bg-primary.text-white:hover span,
a.text-white.bg-primary:hover span,
button.text-white.bg-primary:hover span,
.btn-primary:hover span {
    color: rgba(255, 255, 255, 0.9) !important;
    opacity: 0.9;
}

/* Fix button border-radius to ensure consistent rounded appearance */
.bg-primary.text-white,
a.bg-primary.text-white,
button.bg-primary.text-white,
.btn-primary,
.inline-flex.items-center.gap-2.bg-primary.text-white,
.inline-flex.items-center.bg-primary.text-white {
    border-radius: 9999px !important;
    transition: all 0.3s ease !important;
}

/* Fix for Se alle artikler button color */
.se-alle-temaer-knap, 
.flex.items-center.gap-2.text-white.bg-primary,
a.flex.items-center.gap-2.text-white.bg-primary,
.flex.flex-col.md\:flex-row.md\:justify-between.md\:items-end.gap-6.mb-16.bg-white.p-8.rounded-xl.shadow-md.border-l-4.border-primary.mt-16 {
    background-color: #3A8182 !important;
    color: white !important;
}

/* Fix for left border color in article grid summary box */
.flex.flex-col.md\:flex-row.md\:justify-between.md\:items-end.gap-6.mb-16.bg-white.p-8.rounded-xl.shadow-md.border-l-4 {
}

/* Fix for "Se alle temaer" button positioning */
.se-alle-temaer-knap {
    position: relative !important;
    z-index: 30 !important; 
    margin-bottom: 40px !important;
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Fix for category pages - make mt-12 more specific */
.category .mt-12:not(.pagination-container),
.archive .mt-12:not(.pagination-container) {
    margin-top: 0 !important;
}

/* Keep the margin for specific elements that need it */
.category .text-center.mb-12 + .mt-12,
.category .experts-section .mt-12,
.category .newsletter-section + .mt-12,
.archive .text-center.mb-12 + .mt-12,
.archive .experts-section .mt-12,
.archive .newsletter-section + .mt-12,
.pagination-container.mt-12 {
    margin-top: 3rem !important;
}

/* Reduce space under the latest articles box */
.flex.flex-col.md\:flex-row.md\:justify-between.md\:items-end.gap-6.mb-16.bg-white.p-8.rounded-xl.shadow-md.border-l-4.mt-16 {
    margin-bottom: 1rem !important;
    margin-top: 1rem !important;
}

/* Target the container that comes after the latest articles box */
.flex.flex-col.md\:flex-row.md\:justify-between.md\:items-end.gap-6.mb-16.bg-white.p-8.rounded-xl.shadow-md.border-l-4.mt-16 + div {
    padding-top: 1rem !important;
}

/* Specifically target the article grid container on the front page */
.front-page .container.mx-auto.px-4.py-16 {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Reduce space between "Seneste artikler" box and "Temaer" section */
.flex.flex-col.md\:flex-row.md\:justify-between.md\:items-end.gap-6.mb-16.bg-white.p-8.rounded-xl.shadow-md.border-l-4.border-primary.mt-16 {
    margin-bottom: 0 !important;
}

/* Reduce space above the "Temaer" section */
#categories-explore-section {
    margin-top: 0 !important;
    padding-top: 40px !important;
    padding-bottom: 60px !important;
}

/* Ensure proper spacing between article grid and categories section */
#categories-explore-section {
    background-color: #f8f9fa !important;
}

/* Add proper spacing for newsletter section */
.newsletter-section {
    padding-top: 60px !important;
    padding-bottom: 60px !important;
    margin-bottom: 0 !important;
}

/* Fix spacing between categories and experts section */
#categories-explore-section + .mt-16.pt-12.pb-24.bg-white {
    margin-top: 0 !important;
    padding-top: 40px !important;
    padding-bottom: 40px !important;
}

/* Remove the gray line between sections */
#categories-explore-section {
    border-bottom: none !important;
}

/* Fix the background color transition between sections */
#categories-explore-section {
    background-color: #f8f9fa !important;
}

.experts-section {
    background-color: #ffffff !important;
    margin-top: 0 !important;
    position: relative;
}

/* Remove any horizontal dividers that might be causing the gray line */
.py-10.bg-gradient-to-br::after,
#categories-explore-section::after,
#categories-explore-section + div::before {
    display: none !important;
}

/* Fix spacing between experts section and newsletter */
.mt-16.pt-12.pb-24.bg-white + .newsletter-section {
    margin-top: 0 !important;
}

/* Reduce padding for article grid container */
.front-page .container.mx-auto.px-4.py-16 {
    padding-top: 40px !important;
    padding-bottom: 20px !important;
}

/* Adjust spacing for the article grid summary box */
.flex.flex-col.md\:flex-row.md\:justify-between.md\:items-end.gap-6.mb-16.bg-white.p-8.rounded-xl.shadow-md.border-l-4.border-primary.mt-16 {
    margin-bottom: 20px !important;
    margin-top: 20px !important;
    position: relative !important;
    z-index: 20 !important;
}

/* Ensure buttons maintain rounded appearance on focus/active states */
.bg-primary.text-white:focus,
a.bg-primary.text-white:focus,
button.bg-primary.text-white:focus,
.btn-primary:focus,
.inline-flex.items-center.gap-2.bg-primary.text-white:focus,
.inline-flex.items-center.bg-primary.text-white:focus,
.bg-primary.text-white:active,
a.bg-primary.text-white:active,
button.bg-primary.text-white:active,
.btn-primary:active,
.inline-flex.items-center.gap-2.bg-primary.text-white:active,
.inline-flex.items-center.bg-primary.text-white:active {
    border-radius: 9999px !important;
}

/* Footer copyright color */
footer .pt-8 p {
    color: rgb(156 163 175 / var(--tw-text-opacity)) !important;
}

/* Mobile menu entries spacing fix */
#mobile-menu ul > li {
    margin-top: 0 !important;
    margin-bottom: 0.5rem !important;
}

/* Fix for WordPress pagination lists */
.nav-links ul,
ul.page-numbers {
    margin: 1rem 0 !important;
    padding: 0 !important;
    list-style: none !important;
    display: flex !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 0.75rem !important;
}

.nav-links li,
ul.page-numbers li {
    margin: 0 !important;
    list-style: none !important;
}

/* Pagination styling improvements */
.pagination-container {
    display: flex;
    justify-content: center;
    margin: 2.5rem 0;
}

/* Fixed pagination styling - removing duplicates and border */
.pagination-container .page-numbers,
.page-numbers {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    text-align: center;
    border-radius: 9999px;
    background-color: white;
    color: #1D2F3D;
    border: none !important;
    margin: 0 0.25rem;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.pagination-container .page-numbers.current,
.page-numbers.current {
    background-color: #3A8182;
    color: white;
    box-shadow: 0 4px 6px rgba(58, 129, 130, 0.2);
}

.pagination-container .page-numbers:hover:not(.dots):not(.current),
.page-numbers:hover:not(.dots):not(.current) {
    background-color: #f3f4f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.pagination-container .page-numbers.dots,
.page-numbers.dots {
    background-color: transparent;
    box-shadow: none;
    pointer-events: none;
    padding: 0 0.5rem;
    border: none !important;
}

/* Fix for featured image opacity on pages */
.h-\[40vh\] img,
.h-\[60vh\] img,
.absolute.inset-0.w-full.h-full.object-cover.opacity-50 {
    opacity: 1 !important;
}

.pagination-container .page-numbers.prev,
.pagination-container .page-numbers.next,
.page-numbers.prev,
.page-numbers.next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    width: 44px;
    height: 44px;
    border-radius: 9999px;
    overflow: hidden;
    font-size: 0;
}

.pagination-container .page-numbers.prev svg,
.pagination-container .page-numbers.next svg,
.page-numbers.prev svg,
.page-numbers.next svg {
    width: 20px;
    height: 20px;
}

/* Better pagination for WordPress - fix for double page numbers */
.nav-links a,
.nav-links span {
    display: inline-block;
    margin: 0 4px;
    border: none !important;
}

ul.page-numbers {
    border: none !important;
    background: none !important;
    box-shadow: none !important;
}

.page-numbers li {
    border: none !important;
    background: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

ul.page-numbers li span.page-numbers.current {
    background-color: #3A8182 !important;
    color: white !important;
}

/* Base font size classes */
.base-font-14 {
    --base-font-size: 14px;
    font-size: 14px;
}

.base-font-16 {
    --base-font-size: 16px;
    font-size: 16px;
}

.base-font-18 {
    --base-font-size: 18px;
    font-size: 18px;
}

.base-font-20 {
    --base-font-size: 20px;
    font-size: 20px;
}

/* Content font sizes */
.content-size-1 {
    --content-font-size: 1rem;
}

.content-size-1125 {
    --content-font-size: 1.125rem;
}

.content-size-1175 {
    --content-font-size: 1.175rem;
}

.content-size-125 {
    --content-font-size: 1.25rem;
}

/* Heading scales */
.heading-scale-small {
    --heading-h1-size: 2rem;
    --heading-h2-size: 1.75rem;
    --heading-h3-size: 1.5rem;
    --heading-h4-size: 1.25rem;
    --heading-h5-size: 1.125rem;
    --heading-h6-size: 1rem;
}

.heading-scale-normal {
    --heading-h1-size: 2.5rem;
    --heading-h2-size: 2rem;
    --heading-h3-size: 1.5rem;
    --heading-h4-size: 1.25rem;
    --heading-h5-size: 1.125rem;
    --heading-h6-size: 1rem;
}

.heading-scale-large {
    --heading-h1-size: 3rem;
    --heading-h2-size: 2.25rem;
    --heading-h3-size: 1.75rem;
    --heading-h4-size: 1.5rem;
    --heading-h5-size: 1.25rem;
    --heading-h6-size: 1.125rem;
}

.heading-scale-extra-large {
    --heading-h1-size: 3.5rem;
    --heading-h2-size: 2.5rem;
    --heading-h3-size: 2rem;
    --heading-h4-size: 1.75rem;
    --heading-h5-size: 1.5rem;
    --heading-h6-size: 1.25rem;
}

/* Line heights */
.line-height-tight {
    --line-height: 1.3;
}

.line-height-normal {
    --line-height: 1.5;
}

.line-height-relaxed {
    --line-height: 1.7;
}

.line-height-loose {
    --line-height: 2;
}

/* Letter spacing */
.letter-spacing-tight {
    --letter-spacing: -0.025em;
}

.letter-spacing-normal {
    --letter-spacing: 0;
}

.letter-spacing-wide {
    --letter-spacing: 0.025em;
}

.letter-spacing-wider {
    --letter-spacing: 0.05em;
}

/* Button styling */
.bg-primary.text-white,
a.bg-primary.text-white,
button.bg-primary.text-white {
    color: white !important;
}

/* Quote and factbox styling */
.journalist-quote-title,
.journalist-quote-block .quote-icon-start,
.journalist-quote-block .quote-icon-end {
    color: #3A8182 !important;
    font-family: 'IBM Plex Serif', Georgia, serif !important;
}

.factbox-title {
    color: #3A8182 !important;
    border-bottom-color: #3A8182 !important;
}

.factbox-block.bg-primary {
    background-color: rgba(58, 129, 130, 0.1) !important;
    border-left-color: #3A8182 !important;
}

/* Search modal close button */
#search-close {
    background-color: #3A8182 !important;
}

#search-close:hover {
    background-color: #2e6869 !important;
}

/* Mobile menu close button */
#mobile-menu button {
    background-color: #3A8182 !important;
}

#mobile-menu button:hover {
    background-color: #2e6869 !important;
}

/* Read article button styling */
a.inline-flex.items-center.bg-primary.text-white,
.inline-flex.items-center.gap-2.bg-primary.text-white {
    background-color: #3A8182 !important;
    color: white !important;
}

/* Make sure "Læs artikel" text is white */
a.inline-flex.items-center.bg-primary.text-white span,
.inline-flex.items-center.gap-2.bg-primary.text-white span {
    color: white !important;
}

/* Category styling for headers and titles */
h2.category-header, 
.categories-explore-heading, 
h2.text-3xl.font-serif.font-bold.text-secondary,
.font-bold.text-xl.md\:text-2xl.mb-4.text-secondary,
.font-bold.text-xl.mb-3.text-secondary {
    color: #1D2F3D !important;
}

/* Post heading styles - UPDATED */
.font-bold.text-xl.md\:text-2xl.mb-4.text-secondary.group-hover\:text-primary,
.font-bold.text-xl.mb-3.text-secondary.group-hover\:text-primary,
h2.font-bold.text-xl.md\:text-2xl.mb-4.text-secondary.group-hover\:text-primary,
h3.font-bold.text-xl.mb-3.text-secondary.group-hover\:text-primary,
h2.font-bold.text-2xl.mb-4.text-secondary,
h3.font-bold.text-2xl.mb-3.text-secondary {
    color: #1D2F3D !important;
}

/* Fix for post heading on frontpage */
.article-grid h3,
article h3.font-bold,
article .font-bold.text-xl.md\:text-2xl.mb-4.text-secondary {
    color: #1D2F3D !important;
}

/* Post titles on frontpage and article grid */
article h2,
article .font-bold {
    margin-top: 8px !important;
    color: #1D2F3D !important;
}

/* Livsstil label styling - UPDATED */
.inline-block.bg-primary\/10.text-primary,
.article-categories,
span.inline-block.bg-primary\/10.text-primary.px-3.py-1.rounded-full.text-sm, 
span.inline-block.bg-primary\/10.text-primary.px-3.py-1.rounded-full.text-sm.font-medium,
span.inline-block.px-4.py-2.rounded-full.bg-primary\/10.text-primary.text-sm,
span.bg-primary\/10.text-primary, 
.livsstil-badge { 
    margin-top: 1px !important;
    background-color: #F9EBEB !important;
    color: #AB2026 !important;
    font-weight: 400 !important;
    margin-bottom: 8px !important;
}

/* Add specific styling for the Livsstil label in the card */
.Livsstil,
span.Livsstil,
.Livsstil-badge {
    background-color: #F9EBEB !important;
    color: #AB2026 !important;
    font-weight: 400 !important;
    border-radius: 9999px !important;
    padding: 0.25rem 0.75rem !important;
    font-size: 0.875rem !important;
}

span.inline-block.px-3.py-1.rounded-full.text-sm.font-medium.bg-primary\/10.text-primary {
    background-color: #F9EBEB !important;
    color: #AB2026 !important;
    font-weight: 400 !important;
    border-radius: 9999px !important;
    padding: 0.25rem 0.75rem !important;
    font-size: 0.875rem !important;
}

/* Text color for article excerpt - UPDATED */
.text-gray-600,
article p,
.article-grid p,
.article-grid .text-gray-600,
article .text-gray-600 {
    color: #4B5563 !important;
}

/* Factbox with image button */
.factbox-billede-toggle {
    background-color: #3A8182 !important;
}

.factbox-billede-toggle:hover {
    background-color: #2e6869 !important;
}

/* Newsletter section buttons */
.newsletter-section button[type="submit"] {
    background-color: #3A8182 !important;
}

.newsletter-section button[type="submit"]:hover {
    background-color: #2e6869 !important;
}

/* Specific styling for frontpage elements */
.article-grid h3.font-bold {
    color: #1D2F3D !important;
}

.article-grid .text-gray-600,
.article-grid p {
    color: #4B5563 !important;
}

/* Frontpage article category badge */
.article-grid .Livsstil,
.article-grid span.inline-block.bg-primary\/10.text-primary.px-3.py-1.rounded-full.text-sm.font-medium,
.article-grid .article-categories {
    background-color: #F9EBEB !important;
    color: #AB2026 !important;
    font-weight: 400 !important;
}

/* Footer contact info styles */
footer li.flex.items-start {
    display: flex !important;
    align-items: flex-start !important;
}

footer li.flex.items-start .flex-shrink-0 {
    margin-right: 0.75rem !important;
    margin-top: 0.25rem !important;
}

footer li.flex.items-start > div {
    display: flex !important;
    flex-direction: column !important;
}

/* Make footer li.flex.items-start styling like the attached image */
footer .flex-shrink-0.text-\[\#3A8182\].mr-3.mt-1 {
    color: #3A8182 !important;
    flex-shrink: 0 !important;
}

/* Fix margin for section headers */
.text-center.mb-12 {
    margin-bottom: 3rem !important;
    padding-top: 1rem;
}

/* Fix spacing after category boxes */
.categories-container {
    margin-bottom: 2rem !important;
}

/* Add more space under the "Se alle temaer" button */
.se-alle-temaer-knap {
    margin-bottom: 80px !important; /* Increased margin below the button - adjusted from 60px to 80px */
}

/* Improve keyboard navigation focus styles for category boxes */
.category-box a:focus-visible,
.category-box h3:focus-visible,
.category-box p:focus-visible,
.category-box a:focus-visible {
    outline: 3px solid #3A8182 !important;
    outline-offset: 2px !important;
    z-index: 20 !important;
    box-shadow: none !important;
}

/* Fix category box jumping on focus */
.category-box {
    position: relative !important;
    transform: translateZ(0) !important; /* Prevents jumping in some browsers */
    will-change: transform !important; /* Performance optimization */
}

/* Improve focus visibility for category headers and subheading */
.categories-explore-heading:focus-visible,
.text-gray-600[tabindex="0"]:focus-visible {
    outline: 3px solid #3A8182 !important;
    outline-offset: 4px !important;
    border-radius: 4px !important;
}

/* Fix positioning of the categories section as shown in drawing */
.py-16.bg-gradient-to-br {
    padding-bottom: 140px !important; /* More padding at bottom to accommodate the section below */
}

/* Reduce vertical space between article section and categories section */
.mt-24.pt-16.pb-32 {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Fix spacing between "Se alle temaer" and KATEGORIER section */
.se-alle-temaer-knap {
    margin-bottom: 80px !important;
}

/* Fix vertical alignment of sections so they don't touch */
#categories-explore-section {
    margin-top: -80px !important;
}

/* CRITICAL: Force title to stay white on hover for category boxes */
.category-box .category-title,
.category-box h3.text-xl.font-bold.text-white, 
.group:hover .category-title,
.group:hover h3.text-xl.font-bold.text-white {
    color: white !important;
    text-decoration: none !important;
}

/* CRITICAL: Remove any underline on category links hover */
.category-link:hover,
.category-link:focus,
.category-box a:hover,
.category-box a:focus {
    text-decoration: none !important;
}

/* WCAG Improvements for keyboard navigation */
.category-box a:focus-visible,
.category-box h3:focus-visible,
.category-box p:focus-visible {
    outline: 3px solid #3A8182 !important;
    outline-offset: 4px !important;
    z-index: 50 !important;
    position: relative !important;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.8) !important;
}

/* Prevent overlapping category cards when one is focused */
.category-box:focus-within {
    z-index: 20 !important;
    position: relative !important;
}

/* Fix focus indicator for category link */
.category-box a:focus-visible {
    position: relative !important;
    z-index: 30 !important;
    outline: 3px solid #3A8182 !important;
    outline-offset: 3px !important;
    border-radius: 12px !important;
}

/* Special styling for the arrow inside category card */
.category-box .inline-flex.items-center.justify-center:focus-visible {
    outline: 3px solid #3A8182 !important;
    outline-offset: 2px !important;
    background-color: rgba(58, 129, 130, 0.7) !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5) !important;
    transform: scale(1.1) !important;
}

/* Screen reader text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Remove focus outline for normal users (only show on keyboard navigation) */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible):not(.no-focus), 
textarea:focus:not(:focus-visible):not(.no-focus),
select:focus:not(:focus-visible):not(.no-focus),
[tabindex="0"]:focus:not(:focus-visible) {
    outline: none !important;
    box-shadow: none !important;
    border-color: #e5e7eb !important; 
    outline-color: transparent !important; 
    outline-offset: 0 !important;
}

/* Remove focus styles for search input */
#search-input:focus,
#search-input:focus-visible {
    outline: none !important;
    border-color: #e5e7eb !important;
    box-shadow: none !important;
}

/* Override focus styles for input fields when using mouse */
input.no-focus:focus,
textarea.no-focus:focus,
select.no-focus:focus {
    outline: none !important;
    box-shadow: none !important;
    border-color: #e5e7eb !important;
    outline-color: transparent !important;
    outline-offset: 0 !important;
    border-radius: 0 !important;
}

/* Only show focus styles for keyboard navigation */
input.no-focus:focus-visible,
textarea.no-focus:focus-visible,
select.no-focus:focus-visible {
    border-color: #3A8182 !important;
    box-shadow: 0 0 0 2px rgba(58, 129, 130, 0.3) !important;
}

#search-results .inline-block.px-3.py-1.bg-primary\/10.text-primary,
#search-results span.inline-block.bg-primary\/10.text-primary.px-3.py-1.rounded-full.text-sm.font-medium {
    margin-top: 0 !important;
    background-color: #F9EBEB !important;
    color: #AB2026 !important;
    font-weight: 400 !important;
}

/* Search results styling */
#search-results .group {
    background-color: #f8f9fa !important;
    border-radius: 1rem !important;
    transition: all 0.3s ease !important; 
    margin-bottom: 12px !important;
    padding: 1.5rem !important;
}

#search-results .group:hover {
    background-color: white !important;
    transform: translateY(-4px) !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1) !important;
}

#search-results h3 {
    color: #1D2F3D !important;
    transition: color 0.3s ease !important;
}

#search-results .group:hover h3 {
    color: #3A8182 !important;
}

/* Fix search results styling */
#search-results a {
    display: block !important;
    text-decoration: none !important; 
    padding: 1.5rem !important;
    border-radius: 1rem !important;
    background-color: #f8f9fa !important;
    margin-bottom: 12px !important;
    transition: all 0.3s ease !important;
}

#search-results a:hover {
    background-color: white !important;
    transform: translateY(-4px) !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1) !important;
}

#search-results .inline-block.px-3.py-1.bg-primary\/10.text-primary {
    display: inline-block !important;
    background-color: #F9EBEB !important;
    color: #AB2026 !important;
    font-weight: 400 !important;
    padding: 0.25rem 0.75rem !important;
    border-radius: 9999px !important;
    font-size: 0.875rem !important;
    margin-top: 0 !important;
}

#search-results h3 {
    margin-top: 0.5rem !important;
    margin-bottom: 0.5rem !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
}

#search-results .mt-3 {
    margin-top: 0.5rem !important;
}

/* Fix search results padding */
#search-results .p-6 {
    padding: 0 !important;
}

/* Fix search results badge margin */
#search-results .inline-block.bg-primary\/10.text-primary,
#search-results span.inline-block.bg-primary\/10.text-primary.px-3.py-1.rounded-full.text-sm.font-medium {
    margin-top: 0 !important;
}

/* Standard Featured Image in customizer */
.customize-control-image .current-image img {
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    margin-bottom: 8px !important;
}

.customize-control-image .actions {
    margin-top: 8px !important;
}

/* Customizer category accordion styling */
.category-accordion-container {
    margin: 15px 0;
    padding: 15px;
    background: #f7f7f7;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.category-accordion-item {
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    overflow: hidden;
}

.category-accordion-header {
    padding: 12px 15px;
    background: #f7f7f7;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
}

.category-accordion-header:hover {
    background: #f0f0f0;
}

.category-accordion-header.open {
    background: #e7f5fa;
    border-color: #0073aa;
    color: #0073aa;
}

.category-accordion-content {
    padding: 15px;
    display: none;
}

.category-field-header {
    margin-top: 15px;
    font-weight: 600;
    border-top: 1px solid #eee;
    padding-top: 15px;
    font-size: 14px;
    color: #0073aa;
}

/* Mobile menu specific styling */
#mobile-menu li a {
    font-family: 'IBM Plex Serif', Georgia, serif !important;
    font-weight: 600 !important;
    display: block;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    font-size: 1.25rem;
}

/* Add more spacing to category archive headers */
#archive-header {
    margin-top: 3rem !important; /* Increased from 1.5rem */
    padding-top: 2.5rem !important; /* Additional padding */
}

/* Style archive title */
#archive-title {
    font-family: 'IBM Plex Sans', Verdana, Arial, sans-serif !important;
}

/* Remove background color from .bg-gray-50 */
.bg-gray-50 {
    background-color: transparent !important;
}

/* Fix the large gap between sections */
#categories-explore-section {
    margin-top: -60px !important;
    padding-top: 60px !important;
    z-index: 10;
    position: relative;
}

/* Reducer spacing efter "Se alle temaer" knappen */
.se-alle-temaer-knap {
    margin-bottom: 50px !important;
    padding-bottom: 10px !important;
}

/* Reducer vertikal spacing mellem sektioner generelt */
.mt-24 {
    margin-top: 2rem !important;
}

.py-32 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
}

/* Fix spacing after category boxes */
.categories-container {
    margin-bottom: 2rem !important;
}

/* Add more space under the "Se alle temaer" button */
.se-alle-temaer-knap {
    margin-bottom: 20px !important;
    position: relative !important; 
    top: 0 !important;
}

/* WCAG keyboard navigation improvements */
/* Make category title, description, and arrow link all focusable */
.category-box .category-title:focus-visible,
.category-box .category-description:focus-visible,
.category-box a:focus-visible {
    outline: 3px solid #3A8182 !important;
    outline-offset: 2px !important;
    border-radius: 4px !important;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.7) !important;
    position: relative !important;
    z-index: 50 !important;
}

/* Style the arrow button focus state */
.category-box .inline-flex:focus-visible {
    outline: 3px solid #3A8182 !important;
    background-color: rgba(58, 129, 130, 0.7) !important; 
    transform: scale(1.1) !important;
}

/* Ensure full-card click for better mouse UX */
.category-box {
    cursor: pointer !important;
}

/* Arrow icon in top right corner */
.arrow-icon {
    position: absolute !important;
    top: 1.25rem !important; 
    right: 1.25rem !important;
    z-index: 25 !important;
}

/* Hide keyboard-only arrow by default but show on focus */
.focusable-arrow {
    opacity: 0 !important;
    pointer-events: none !important;
}

.focusable-arrow:focus-visible {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Make sure the category card has clickable area */
.category-link {
    cursor: pointer !important;
    position: absolute !important;
    inset: 0 !important;
    z-index: 20 !important;
}

/* Fix keyboard focus for category links */
.category-box:focus-within .focusable-arrow {
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Related articles heading styling */
.related-article-heading,
h4.font-bold.text-xl.mb-3.text-secondary {
    color: #1D2F3D !important;
    margin-top: 8px !important;
    transition: color 0.3s ease !important;
}

.group:hover .related-article-heading,
article:hover h4.font-bold.text-xl.mb-3.text-secondary,
.group:hover h4.font-bold.text-xl.mb-3.text-secondary {
    color: #3A8182 !important; /* Hover color */
}

/* Override any existing styles that might be setting the color to #3A8182 by default */
.related-article-heading,
h4.font-bold.text-xl.mb-3.text-secondary,
h4.font-bold.text-xl.mb-3.text-secondary a {
    color: #1D2F3D !important;
}

/* Ensure the hover color is applied correctly */
.group:hover .related-article-heading,
.group:hover h4.font-bold.text-xl.mb-3.text-secondary,
.group:hover h4.font-bold.text-xl.mb-3.text-secondary a {
    color: #3A8182 !important;
}

/* Fix search input focus - remove border */
#search-input:focus,
#search-input:focus-visible,
input[type="search"]:focus,
input[type="search"]:focus-visible {
    outline: none !important; 
    border: 1px solid #d1d5db !important; /* Keep the border when focused */
    box-shadow: none !important; 
}

/* Ensure search input always has a border */
#search-input,
input[type="search"] {
    border: 1px solid #d1d5db !important; 
    border-radius: 0.5rem !important;
}

/* Fix for search modal input border disappearing */
#search-modal input[type="search"],
#search-modal #search-input {
    border: 1px solid #d1d5db !important;
    border-radius: 0.75rem !important;
}

/* Ensure the border stays visible when focused in the search modal */
#search-modal input[type="search"]:focus,
#search-modal #search-input:focus {
    border: 1px solid #d1d5db !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Override any styles that might be removing the border */
.w-full.px-6.py-4.pr-14.text-lg.md\\:text-xl.border.border-gray-200.rounded-xl.md\\:rounded-2xl.transition-all.duration-300.focus\\:outline-none.focus\\:border-transparent {
    border: 1px solid #d1d5db !important;
    border-color: #d1d5db !important;
}

.w-full.px-6.py-4.pr-14.text-lg.md\\:text-xl.border.border-gray-200.rounded-xl.md\\:rounded-2xl.transition-all.duration-300.focus\\:outline-none.focus\\:border-transparent:focus {
    border: 1px solid #d1d5db !important;
    border-color: #d1d5db !important;
}

/* Custom styling for the article grid summary box - ADDED TO FIX SPACING */
.flex.flex-col.md\:flex-row.md\:justify-between.md\:items-end.gap-6.mb-16.bg-white.p-8.rounded-xl.shadow-md.border-l-4.border-primary.mt-16 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
    margin-top: 3rem !important;
    margin-bottom: 3rem !important;
}

/* FRONT PAGE ONLY: Direct targeting for post-heading-ID elements */
.front-page article h3[id^="post-heading-"],
.front-page article h3[id^="post-heading-"] a {
    color: #1D2F3D !important;
    transition: color 0.3s ease !important;
}

/* FRONT PAGE ONLY: When hovering on the article, the heading should change color */
.front-page article:hover h3[id^="post-heading-"],
.front-page article:hover h3[id^="post-heading-"] a,
.front-page .group:hover h3[id^="post-heading-"],
.front-page .group:hover h3[id^="post-heading-"] a {
    color: #12154f !important;
}

/* FRONT PAGE ONLY: When hovering directly on the heading, it should remain black */
.front-page h3[id^="post-heading-"]:hover,
.front-page h3[id^="post-heading-"]:hover a,
.front-page h3[id^="post-heading-"] a:hover {
    color: #1D2F3D !important;
}

/* FRONT PAGE ONLY: Specifically target the headings with IDs on the front page */
.front-page .article-grid h3[id^="post-heading-"],
.front-page .article-grid h3[id^="post-heading-"] a {
    color: #1D2F3D !important;
    transition: color 0.3s ease !important;
}

/* FRONT PAGE ONLY: All hover color rules for article headings when hovering on the card */
.front-page .article-grid article:hover h3,
.front-page .article-grid article:hover h3 a,
.front-page .article-grid article:hover h3.font-bold,
.front-page .article-grid article:hover h3.font-bold a,
.front-page .article-grid .group:hover h3,
.front-page .article-grid .group:hover h3 a,
.front-page .article-grid .group:hover h3.font-bold,
.front-page .article-grid .group:hover h3.font-bold a,
.front-page .article-grid article:hover h2,
.front-page .article-grid article:hover h2 a,
.front-page .article-grid .group:hover h2,
.front-page .article-grid .group:hover h2 a,
.front-page .article-grid .group:hover h3[id^="post-heading-"],
.front-page .article-grid .group:hover h3[id^="post-heading-"] a {
    color: #3A8182 !important;
}

/* FRONT PAGE ONLY: When hovering directly on the heading, it should remain black */
.front-page .article-grid h3:hover,
.front-page .article-grid h3:hover a,
.front-page .article-grid h2:hover,
.front-page .article-grid h2:hover a,
.front-page .article-grid h3[id^="post-heading-"]:hover,
.front-page .article-grid h3[id^="post-heading-"]:hover a {
    color: #1D2F3D !important;
}

/* FRONT PAGE ONLY: Target article headings with specific classes */
.front-page .article-grid article:hover .font-bold.text-xl.md\:text-2xl.mb-4.text-secondary,
.front-page .article-grid article:hover .font-bold.text-2xl.md\:text-3xl.mb-4.text-secondary,
.front-page .article-grid article:hover .font-bold.text-xl.mb-3.text-secondary,
.front-page .article-grid .group:hover .font-bold.text-xl.md\:text-2xl.mb-4.text-secondary,
.front-page .article-grid .group:hover .font-bold.text-2xl.md\:text-3xl.mb-4.text-secondary,
.front-page .article-grid .group:hover .font-bold.text-xl.mb-3.text-secondary {
    color: #3A8182 !important;
}

/* FRONT PAGE ONLY: Keep headers black when hovering directly on them */
.front-page .article-grid .font-bold.text-xl.md\:text-2xl.mb-4.text-secondary:hover,
.front-page .article-grid .font-bold.text-2xl.md\:text-3xl.mb-4.text-secondary:hover,
.front-page .article-grid .font-bold.text-xl.mb-3.text-secondary:hover {
    color: #1D2F3D !important;
}

/* FRONT PAGE ONLY: Additional selectors to ensure all variants are covered */
.front-page .article-grid .group:hover h3.group-hover\:text-primary,
.front-page .article-grid .group:hover h3[id^="post-heading-"],
.front-page .article-grid .group:hover h3[id^="post-title-"],
.front-page .article-grid article:hover h3.group-hover\:text-primary,
.front-page .article-grid article:hover h3[id^="post-heading-"],
.front-page .article-grid article:hover h3[id^="post-title-"] {
    color: #3A8182 !important;
}

/* FRONT PAGE ONLY: Override to keep headings black when hovering directly */
.front-page .article-grid h3.group-hover\:text-primary:hover,
.front-page .article-grid h3[id^="post-heading-"]:hover,
.front-page .article-grid h3[id^="post-title-"]:hover {
    color: #1D2F3D !important;
}

/* FRONT PAGE ONLY: Target the exact Tailwind-generated classes */
.front-page .article-grid .group-hover\:text-primary,
.front-page .article-grid .group:hover .group-hover\:text-primary {
    color: #3A8182 !important;
}

/* Logo container improvements for mobile */
.logo-container {
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

/* Ensure text doesn't wrap awkwardly on mobile */
@media (max-width: 480px) {
    .logo-slogan {
        white-space: nowrap;
        font-size: 0.8rem !important;
    }
}

/* Fix mobile layout for logo and slogan */
@media (max-width: 768px) {
    header .flex.items-center.gap-2 {
        flex-direction: row !important; /* Ændret fra column til row */
        align-items: center !important; /* Ændret fra flex-start til center */
        gap: 8px !important;
    }
    
    header .logo-slogan {
        margin-left: 5px !important; /* Tilføjet margin til venstre */
        margin-top: 0 !important; /* Fjernet top margin */
        font-size: 0.85rem !important; /* Mindre skriftstørrelse på mobil */
        line-height: 1.1 !important;
    }
    
    /* Improved logo display on mobile */
    .logo-container {
        display: flex !important;
        align-items: center !important;
        gap: 5px !important;
    }
    
    .logo-image, 
    header a img,
    .logo-wrapper img {
        height: 28px !important;
        width: auto !important;
        max-height: 28px !important;
    }
    
    /* Adjust spacing for the menu layout */
    header .py-4 {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }
}

/* Additional specific fix for post-heading-634 and similar IDs */
h3[id="post-heading-634"],
h3[id="post-heading-640"],
h3[id="post-heading-596"], 
h3[id="post-heading-614"], 
h3[id="post-heading-591"], 
h3[id="post-heading-533"], 
h3[id="post-heading-511"], 
h3[id="post-heading-472"] {
    color: #1D2F3D !important;
}

h3[id="post-heading-634"] a,
h3[id="post-heading-640"] a,
h3[id="post-heading-596"] a, 
h3[id="post-heading-614"] a, 
h3[id="post-heading-591"] a, 
h3[id="post-heading-533"] a, 
h3[id="post-heading-511"] a, 
h3[id="post-heading-472"] a {
    color: #1D2F3D !important;
}

h3[id="post-heading-634"]:hover,
h3[id="post-heading-640"]:hover,
h3[id="post-heading-596"]:hover, 
h3[id="post-heading-614"]:hover, 
h3[id="post-heading-591"]:hover, 
h3[id="post-heading-533"]:hover, 
h3[id="post-heading-511"]:hover, 
h3[id="post-heading-472"]:hover,
h3[id="post-heading-634"]:hover a,
h3[id="post-heading-640"]:hover a,
h3[id="post-heading-596"]:hover a, 
h3[id="post-heading-614"]:hover a, 
h3[id="post-heading-591"]:hover a, 
h3[id="post-heading-533"]:hover a, 
h3[id="post-heading-511"]:hover a, 
h3[id="post-heading-472"]:hover a {
    color: #1D2F3D !important;
}

/* Force article group hover effect */
article.group:hover h3[id="post-heading-634"],
article.group:hover h3[id="post-heading-640"],
article.group:hover h3[id="post-heading-596"], 
article.group:hover h3[id="post-heading-614"], 
article.group:hover h3[id="post-heading-591"], 
article.group:hover h3[id="post-heading-533"], 
article.group:hover h3[id="post-heading-511"], 
article.group:hover h3[id="post-heading-472"],
article.group:hover h3[id="post-heading-634"] a,
article.group:hover h3[id="post-heading-640"] a,
article.group:hover h3[id="post-heading-596"] a, 
article.group:hover h3[id="post-heading-614"] a, 
article.group:hover h3[id="post-heading-591"] a, 
article.group:hover h3[id="post-heading-533"] a, 
article.group:hover h3[id="post-heading-511"] a, 
article.group:hover h3[id="post-heading-472"] a {
    color: #12154f !important;
}

/* Additional inline style to override any other styles */
.article-grid h3[id^="post-heading-"]:hover,
.article-grid h3[id^="post-heading-"] a:hover {
    color: #1D2F3D !important;
}

/* Ensure that when hovering over the article card, the heading turns the primary color */
article.article-grid.bg-white.overflow-hidden.group:hover h3[id^="post-heading-"], article.article-grid.bg-white.overflow-hidden.group:hover h3[id^="post-heading-"] a {
    color: #3A8182 !important;
}

/* Footer menu styling */
footer .menu a {
  @apply text-white hover:text-primary/80 transition-colors;
}

/* Footer links hover style - white with underline */
footer a:hover,
footer li a:hover,
footer .hover\:text-primary:hover,
footer .text-sm.text-white.hover\:text-primary:hover,
footer .text-white.hover\:text-primary:hover {
  color: white !important;
  text-decoration: underline !important;
}

footer ul {
  @apply list-none p-0 m-0;
}

/* Fix for link underline on hover */
.category-box a:hover,
.category-box a:hover h3,
.category-box a:hover .category-title,
.category-box a:hover * {
    text-decoration: none !important;
}

/* Override any other footer link hover styles */
footer a:hover {
  color: white !important;
  text-decoration: underline !important;
}

/* Ensure footer links don't turn #12154f on hover */
footer a.hover\:text-primary:hover,
footer .hover\:text-primary:hover,
footer a:hover {
  color: white !important;
  text-decoration: underline !important;
}

/* Fix mobile menu font */
#mobile-menu li a,
#mobile-menu a.block.text-xl.font-bold.text-secondary,
#mobile-menu a.block.text-xl.font-bold,
.mobile-menu-link {
    font-family: 'IBM Plex Sans', Verdana, Arial, sans-serif !important;
    font-weight: 600 !important;
}

/* Remove focus border from search input */
input:focus, 
textarea:focus, 
select:focus,
#search-input:focus,
input[type="search"]:focus {
    outline: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
}

/* --- Simple, compact embed/video rules (single articles) --- */
.single .entry-content figure.wp-block-embed,
.single .entry-content figure.wp-block-video {
    margin: 0 !important;
    padding: 0 !important;
}

.single .entry-content .wp-block-embed__wrapper,
.single .entry-content iframe,
.single .entry-content video {
    display: block;
    margin: 0 !important;
}

/* Make iframes/videos responsive and full-width without overflow */
.entry-content .wp-block-embed iframe,
.entry-content .wp-block-video video {
    width: 100% !important;
    max-width: 100% !important;
    height: auto;
}

/* Single article: reduce spacing around video and embed blocks */
.entry-content figure.wp-block-video,
.entry-content figure.wp-block-embed,
.entry-content .wp-block-video,
.entry-content .wp-block-embed {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.entry-content .wp-block-embed__wrapper,
.entry-content iframe,
.entry-content video {
    display: block;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.entry-content figure.wp-block-embed figcaption,
.entry-content figure.wp-block-video figcaption {
    margin-top: 0.5rem !important;
}

/* Remove adjacent spacing before/after embeds/videos */
.entry-content p + figure.wp-block-embed,
.entry-content p + figure.wp-block-video,
.entry-content h1 + figure.wp-block-embed,
.entry-content h2 + figure.wp-block-embed,
.entry-content h3 + figure.wp-block-embed,
.entry-content h4 + figure.wp-block-embed,
.entry-content h5 + figure.wp-block-embed,
.entry-content h6 + figure.wp-block-embed,
.entry-content h1 + figure.wp-block-video,
.entry-content h2 + figure.wp-block-video,
.entry-content h3 + figure.wp-block-video,
.entry-content h4 + figure.wp-block-video,
.entry-content h5 + figure.wp-block-video,
.entry-content h6 + figure.wp-block-video {
    margin-top: 0 !important;
}

.entry-content figure.wp-block-embed + p,
.entry-content figure.wp-block-video + p,
.entry-content figure.wp-block-embed + h1,
.entry-content figure.wp-block-embed + h2,
.entry-content figure.wp-block-embed + h3,
.entry-content figure.wp-block-embed + h4,
.entry-content figure.wp-block-embed + h5,
.entry-content figure.wp-block-embed + h6,
.entry-content figure.wp-block-video + h1,
.entry-content figure.wp-block-video + h2,
.entry-content figure.wp-block-video + h3,
.entry-content figure.wp-block-video + h4,
.entry-content figure.wp-block-video + h5,
.entry-content figure.wp-block-video + h6 {
    margin-top: 0 !important;
}

/* Zero paragraph/heading bottom margin when followed by embed/video (where supported) */
.entry-content p:has(+ figure.wp-block-embed),
.entry-content p:has(+ figure.wp-block-video),
.entry-content h1:has(+ figure.wp-block-embed),
.entry-content h2:has(+ figure.wp-block-embed),
.entry-content h3:has(+ figure.wp-block-embed),
.entry-content h4:has(+ figure.wp-block-embed),
.entry-content h5:has(+ figure.wp-block-embed),
.entry-content h6:has(+ figure.wp-block-embed),
.entry-content h1:has(+ figure.wp-block-video),
.entry-content h2:has(+ figure.wp-block-video),
.entry-content h3:has(+ figure.wp-block-video),
.entry-content h4:has(+ figure.wp-block-video),
.entry-content h5:has(+ figure.wp-block-video),
.entry-content h6:has(+ figure.wp-block-video) {
    margin-bottom: 0 !important;
}

/* Same rules when content is wrapped in .prose (used on single) */
.prose figure.wp-block-video,
.prose figure.wp-block-embed,
.prose .wp-block-video,
.prose .wp-block-embed {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.prose .wp-block-embed__wrapper,
.prose iframe,
.prose video {
    display: block;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

.prose figure.wp-block-embed figcaption,
.prose figure.wp-block-video figcaption {
    margin-top: 0.5rem !important;
}

/* Handle core embed aspect helpers explicitly */
.prose .wp-embed-aspect-16-9,
.prose .wp-embed-aspect-4-3,
.prose .wp-has-aspect-ratio,
.entry-content .wp-embed-aspect-16-9,
.entry-content .wp-embed-aspect-4-3,
.entry-content .wp-has-aspect-ratio {
    margin: 0 !important;
}

/* Extra defensive resets for all embed containers */
.prose figure.wp-block-embed,
.prose .wp-block-embed,
.prose figure.wp-block-video,
.prose .wp-block-video,
.entry-content figure.wp-block-embed,
.entry-content .wp-block-embed,
.entry-content figure.wp-block-video,
.entry-content .wp-block-video {
    margin: 0 !important;
    padding: 0 !important;
}

/* Override Tailwind Typography default spacing generated with :where() */
.prose :where(figure.wp-block-embed, figure.wp-block-video, iframe, video):not(:first-child) {
    margin-top: 0 !important;
}

.prose :where(figure.wp-block-embed, figure.wp-block-video, iframe, video):not(:last-child) {
    margin-bottom: 0 !important;
}

.prose :where(figure):not(:first-child) {
    margin-top: 0 !important;
}
.prose :where(figure):not(:last-child) {
    margin-bottom: 0 !important;
}

.prose .wp-block-embed__wrapper { 
    margin: 0 !important; 
}

.prose p + figure.wp-block-embed,
.prose p + figure.wp-block-video,
.prose h1 + figure.wp-block-embed,
.prose h2 + figure.wp-block-embed,
.prose h3 + figure.wp-block-embed,
.prose h4 + figure.wp-block-embed,
.prose h5 + figure.wp-block-embed,
.prose h6 + figure.wp-block-embed,
.prose h1 + figure.wp-block-video,
.prose h2 + figure.wp-block-video,
.prose h3 + figure.wp-block-video,
.prose h4 + figure.wp-block-video,
.prose h5 + figure.wp-block-video,
.prose h6 + figure.wp-block-video {
    margin-top: 0 !important;
}

.prose figure.wp-block-embed + p,
.prose figure.wp-block-video + p,
.prose figure.wp-block-embed + h1,
.prose figure.wp-block-embed + h2,
.prose figure.wp-block-embed + h3,
.prose figure.wp-block-embed + h4,
.prose figure.wp-block-embed + h5,
.prose figure.wp-block-embed + h6,
.prose figure.wp-block-video + h1,
.prose figure.wp-block-video + h2,
.prose figure.wp-block-video + h3,
.prose figure.wp-block-video + h4,
.prose figure.wp-block-video + h5,
.prose figure.wp-block-video + h6 {
    margin-top: 0 !important;
}

.prose p:has(+ figure.wp-block-embed),
.prose p:has(+ figure.wp-block-video),
.prose h1:has(+ figure.wp-block-embed),
.prose h2:has(+ figure.wp-block-embed),
.prose h3:has(+ figure.wp-block-embed),
.prose h4:has(+ figure.wp-block-embed),
.prose h5:has(+ figure.wp-block-embed),
.prose h6:has(+ figure.wp-block-embed),
.prose h1:has(+ figure.wp-block-video),
.prose h2:has(+ figure.wp-block-video),
.prose h3:has(+ figure.wp-block-video),
.prose h4:has(+ figure.wp-block-video),
.prose h5:has(+ figure.wp-block-video),
.prose h6:has(+ figure.wp-block-video) {
    margin-bottom: 0 !important;
}
