/* ==========================================================================
   Main Styles
   ========================================================================== */

/* Fixed header offset - ensure main content starts below header */
#main-content {
    margin-top: 96px; /* Mobile: logo bar only */
}

@media (min-width: 1024px) {
    #main-content {
        margin-top: 191px; /* Desktop: header height */
    }
}

/* Hero banner - ensure no overlap with header */
.block-hero-banner {
    margin-top: 0 !important;
}


/* Hover text white - missing from Tailwind purge */
.hover\:text-white:hover {
    color: #fff !important;
}

/* All burgundy buttons - ensure text stays white on hover */
a.bg-burgundy-700:hover,
button.bg-burgundy-700:hover,
.bg-burgundy-700:hover {
    background-color: #B01419 !important;
    color: #fff !important;
}

/* ==========================================================================
   Contact Form 7 Styles
   ========================================================================== */

.wpcf7-response-output {
    margin: 1.5rem 0 !important;
    padding: 1rem 1.5rem !important;
    border-radius: 0.5rem !important;
    font-size: 0.95rem;
}

.wpcf7-form.sent .wpcf7-response-output {
    background-color: #d4edda !important;
    border: 1px solid #c3e6cb !important;
    color: #155724 !important;
}

.wpcf7-form.failed .wpcf7-response-output,
.wpcf7-form.aborted .wpcf7-response-output {
    background-color: #f8d7da !important;
    border: 1px solid #f5c6cb !important;
    color: #721c24 !important;
}

.wpcf7-form.invalid .wpcf7-response-output,
.wpcf7-form.unaccepted .wpcf7-response-output {
    background-color: #fff3cd !important;
    border: 1px solid #ffeeba !important;
    color: #856404 !important;
}

.wpcf7-form.spam .wpcf7-response-output {
    background-color: #f8d7da !important;
    border: 1px solid #f5c6cb !important;
    color: #721c24 !important;
}

/* Form validation messages */
.wpcf7-not-valid-tip {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    display: block;
}

/* Spinner during submission */
.wpcf7-spinner {
    margin-left: 1rem;
}

/* Site Wrapper */
.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-main {
    flex: 1;
}

/* Page Header */
.page__header {
    position: relative;
    background-size: cover;
    background-position: center;
    padding: 6rem 0 4rem;
    text-align: center;
    color: #fff;
}

.page__header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.page__header--simple {
    background: var(--color-secondary, #1a1a2e);
    padding: 4rem 0 3rem;
}

.page__header .container {
    position: relative;
    z-index: 1;
}

.page__title {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0;
}

.page__content {
    /* Container for regular content */
}

/* Allow Gutenberg blocks to break out of container */
.page__content .container > .wp-block-acf-about-section,
.page__content .container > .wp-block-acf-features-grid,
.page__content .container > .wp-block-acf-latest-posts,
.page__content .container > .wp-block-acf-partners,
.page__content .container > .wp-block-acf-partners-global,
.page__content .container > .wp-block-acf-hero-banner,
.page__content .container > [class*="block-"] {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    padding-left: 0;
    padding-right: 0;
}

/* Archive */
.archive__header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.archive__title {
    font-size: 2rem;
    margin: 0 0 0.5rem;
}

.archive__description {
    color: var(--color-gray, #6c757d);
}

.archive__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.archive__empty {
    text-align: center;
    padding: 3rem;
    color: var(--color-gray, #6c757d);
}

/* Single Post */
.single-post__header {
    position: relative;
}

.single-post__hero {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center center; /* Default position */
}

/* Hero Image Position Options */
.single-post__hero--position-top {
    background-position: center 15% !important; /* Shows more of the top part */
}

.single-post__hero--position-top-extreme {
    background-position: center 0% !important; /* Shows absolute top of image */
}

.single-post__hero--position-top-more {
    background-position: center 5% !important; /* Shows more of top, minimal cut */
}

.single-post__hero--position-top-slight {
    background-position: center 10% !important; /* Slightly favors top */
}

.single-post__hero--position-center {
    background-position: center center !important;
}

.single-post__hero--position-bottom {
    background-position: center 70% !important; /* Shows more of the bottom part */
}

.single-post__hero--position-bottom-extreme {
    background-position: center bottom !important; /* Shows very bottom of image */
}

.single-post__hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.7) 100%);
}

.single-post__header-content {
    position: relative;
    z-index: 1;
    padding: 8rem 0 4rem;
    color: #fff;
    max-width: 800px;
}

.single-post__header:not(:has(.single-post__hero)) .single-post__header-content {
    padding: 4rem 0 2rem;
    color: var(--color-dark, #212529);
}

.single-post__categories {
    margin-bottom: 1rem;
}

.single-post__category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background-color: var(--color-primary, #B31B1B);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 3px;
    margin-right: 0.5rem;
}

.single-post__title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 1rem;
}

.single-post__meta {
    font-size: 0.9rem;
    opacity: 0.9;
}

.single-post__author {
    margin-left: 1rem;
}

.single-post__content {
    max-width: 800px;
    font-size: 1.1rem;
    line-height: 1.8;
}

.single-post__content h2 {
    margin-top: 2rem;
}

.single-post__content p {
    margin-bottom: 1.5rem;
}

.single-post__content img {
    border-radius: 8px;
    margin: 2rem 0;
}

.single-post__tags {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.single-post__tags-label {
    font-weight: 600;
    margin-right: 0.5rem;
}

.single-post__tag {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: #f5f5f5;
    color: var(--color-gray, #6c757d);
    font-size: 0.8rem;
    border-radius: 3px;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.single-post__tag:hover {
    background: var(--color-primary, #B31B1B);
    color: #fff;
}

.single-post__share {
    margin-top: 1.5rem;
}

.single-post__share-label {
    font-weight: 600;
    margin-right: 0.5rem;
}

.single-post__share-link {
    display: inline-block;
    margin-right: 1rem;
    color: var(--color-primary, #B31B1B);
}

/* Related Posts */
.related-posts__title {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.related-posts__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
}

.pagination__pages {
    display: flex;
    gap: 0.25rem;
}

.pagination__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    background: #f5f5f5;
    color: var(--color-dark, #212529);
    border-radius: 4px;
    font-weight: 500;
}

.pagination__link:hover {
    background: var(--color-primary, #B31B1B);
    color: #fff;
}

.pagination__link--current {
    background: var(--color-primary, #B31B1B);
    color: #fff;
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 30px;
    height: 30px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.mobile-menu-toggle__bar {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--color-dark, #212529);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
}

.mobile-menu.is-active {
    display: block;
}

/* Mobile Menu - Improved scrolling and safe areas */
#mobile-menu {
    /* Use dvh for better mobile viewport support */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

#mobile-menu::-webkit-scrollbar {
    width: 6px;
}

#mobile-menu::-webkit-scrollbar-track {
    background: transparent;
}

#mobile-menu::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

/* Ensure safe area for bottom button */
@supports (padding: max(0px)) {
    #mobile-menu {
        padding-bottom: max(8rem, env(safe-area-inset-bottom, 0));
    }
}

.mobile-nav__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav__link {
    display: block;
    padding: 0.75rem 0;
    color: var(--color-dark, #212529);
    font-weight: 500;
    border-bottom: 1px solid #eee;
}

.mobile-nav__submenu {
    list-style: none;
    padding: 0 0 0 1rem;
    margin: 0;
}

.mobile-nav__submenu-link {
    display: block;
    padding: 0.5rem 0;
    color: var(--color-gray, #6c757d);
    font-size: 0.9rem;
}

/* Footer Enhancements */
.footer-logo__image {
    max-height: 60px;
    width: auto;
    margin-bottom: 1rem;
}

.footer-logo__text {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.footer-description {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.footer-social {
    display: flex;
    gap: 0.75rem;
}

.footer-social__link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #fff;
    transition: background 0.3s ease;
}

.footer-social__link:hover {
    background: var(--color-primary, #B31B1B);
}

.footer-social__link svg {
    width: 18px;
    height: 18px;
}

.footer-contact__item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.footer-contact__icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.footer-contact__item a {
    color: rgba(255, 255, 255, 0.8);
}

.footer-contact__item a:hover {
    color: #fff;
}

/* Responsive */
@media (max-width: 992px) {
    .archive__grid,
    .related-posts__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1023px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .main-nav {
        display: none;
    }

    .archive__grid,
    .related-posts__grid {
        grid-template-columns: 1fr;
    }

    .single-post__title {
        font-size: 1.75rem;
    }

    .page__title {
        font-size: 1.75rem;
    }
}

/* Submenu Styles */
.main-nav__item--has-children {
    position: relative;
}

.main-nav__submenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    padding: 0.5rem 0;
    list-style: none;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.main-nav__item--has-children:hover .main-nav__submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.main-nav__submenu-link {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--color-dark, #212529);
    font-size: 0.875rem;
}

.main-nav__submenu-link:hover {
    background: #f5f5f5;
    color: var(--color-primary, #B31B1B);
}

/* ==========================================================================
   Hero Swiper Slider Styles
   ========================================================================== */

.hero-swiper {
    width: 100%;
}

.hero-swiper .swiper-wrapper {
    height: 100%;
}

.hero-swiper .swiper-slide {
    height: 100% !important;
    display: flex;
    align-items: center;
}

/* Swiper Navigation Arrows */
.hero-swiper .swiper-button-prev,
.hero-swiper .swiper-button-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    width: 48px;
    height: 48px;
    margin-top: 0;
}

.hero-swiper .swiper-button-prev {
    left: 1rem;
}

.hero-swiper .swiper-button-next {
    right: 1rem;
}

@media (min-width: 1024px) {
    .hero-swiper .swiper-button-prev {
        left: 2rem;
    }
    .hero-swiper .swiper-button-next {
        right: 2rem;
    }
}

/* Hero content - force center on mobile */
@media (max-width: 767px) {
    .hero-swiper .swiper-slide > div > div {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }

    .hero-swiper .swiper-slide h1,
    .hero-swiper .swiper-slide p,
    .hero-swiper .swiper-slide span {
        text-align: center !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

.hero-swiper .swiper-button-prev::after,
.hero-swiper .swiper-button-next::after {
    content: none;
}

/* Swiper Pagination */
.hero-swiper .swiper-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.hero-swiper .swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 1;
    transition: all 0.3s ease;
}

.hero-swiper .swiper-pagination-bullet-active {
    width: 32px;
    border-radius: 6px;
    background: var(--color-primary, #B31B1B);
}

/* Ensure full-width hero banner on all screen sizes */
.block-hero-banner.alignfull,
.block-hero-banner {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    max-width: 100vw;
    width: 100vw;
}

/* Hero banner - pull up to negate main padding (for fixed header) */
.block-hero-banner:first-child {
    margin-top: -100px;
}

@media (min-width: 1024px) {
    .block-hero-banner:first-child {
        margin-top: -140px;
    }
}

/* Blocks have their own containers - removed duplicate wrapper styles */

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */

.breadcrumbs {
    background-color: #f8f9fa;
    padding: 0.75rem 0;
    font-size: 0.875rem;
    border-bottom: 1px solid #e9ecef;
}

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

.breadcrumbs__item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.breadcrumbs__link {
    color: var(--color-primary, #B31B1B);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumbs__link:hover {
    color: var(--color-dark, #212529);
    text-decoration: underline;
}

.breadcrumbs__separator {
    display: flex;
    align-items: center;
    color: #6c757d;
    margin: 0 0.25rem;
}

.breadcrumbs__separator svg {
    width: 14px;
    height: 14px;
}

.breadcrumbs__current {
    color: #6c757d;
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.breadcrumbs__item--current {
    font-weight: 500;
}

@media (max-width: 768px) {
    .breadcrumbs {
        padding: 0.5rem 0;
        font-size: 0.8rem;
    }

    .breadcrumbs__current {
        max-width: 200px;
    }
}

/* ==========================================================================
   Accessibility Improvements - Color Contrast Fixes
   ========================================================================== */

/* Fix text-gray-500 contrast issues (4.6:1 -> 7.0:1) */
/* Use higher specificity to override Tailwind */
body .text-gray-500:not(.text-gray-500-keep),
html .text-gray-500:not(.text-gray-500-keep) {
    --tw-text-opacity: 1 !important;
    color: rgb(75 85 99) !important; /* gray-600 instead of gray-500 */
}

/* Fix text-gray-400 contrast in decorative elements */
body .text-gray-400:not(svg .text-gray-400),
html .text-gray-400:not(svg .text-gray-400) {
    --tw-text-opacity: 1 !important;
    color: rgb(107 114 128) !important; /* gray-500 for better contrast */
}

/* Fix text-gray-400 in content (not decorative icons) */
.breadcrumbs .text-gray-400,
.search-tips .text-gray-400 {
    --tw-text-opacity: 1;
    color: rgb(75 85 99 / var(--tw-text-opacity)) !important; /* gray-600 */
}

/* Fix placeholder contrast - keep gray-400 as it's acceptable for placeholders */
/* Placeholders don't need to meet WCAG contrast requirements */

/* Ensure burgundy links have sufficient contrast on white */
.text-burgundy-600,
.text-burgundy-700,
.text-\[#D81D25\] {
    --tw-text-opacity: 1;
    color: rgb(176 20 25 / var(--tw-text-opacity)) !important; /* burgundy-800 for better contrast */
}

/* ==========================================================================
   Page Layouts
   ========================================================================== */

/* Base layout */
.page-layout {
    margin: 0 auto;
}

/* Content width variants */
.page-layout--full {
    max-width: 100%;
}

.page-layout--wide {
    max-width: 1100px;
}

.page-layout--default {
    max-width: 900px;
}

.page-layout--narrow {
    max-width: 720px;
}

/* Layout with sidebar */
.page-layout--with-sidebar {
    display: grid;
    gap: 3rem;
    max-width: 1200px;
}

.page-layout--with-sidebar.page-layout--sidebar-right {
    grid-template-columns: 1fr 300px;
}

.page-layout--with-sidebar.page-layout--sidebar-left {
    grid-template-columns: 300px 1fr;
}

.page-layout--with-sidebar.page-layout--sidebar-left .page-layout__content {
    order: 2;
}

.page-layout--with-sidebar.page-layout--sidebar-left .page-layout__sidebar {
    order: 1;
}

/* Main content area */
.page-layout__content {
    min-width: 0; /* Prevents content overflow in grid */
}

/* Sidebar */
.page-layout__sidebar {
    position: sticky;
    top: 2rem;
    align-self: start;
}

.page-layout__sidebar .widget {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.page-layout__sidebar .widget:last-child {
    margin-bottom: 0;
}

.page-layout__sidebar .widget-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--color-primary, #B31B1B);
}

.page-layout__sidebar .widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.page-layout__sidebar .widget ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

.page-layout__sidebar .widget ul li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.page-layout__sidebar .widget ul li a {
    color: var(--color-dark, #212529);
    transition: color 0.2s ease;
}

.page-layout__sidebar .widget ul li a:hover {
    color: var(--color-primary, #B31B1B);
}

/* Responsive sidebar */
@media (max-width: 992px) {
    .page-layout--with-sidebar {
        grid-template-columns: 1fr;
    }

    .page-layout--with-sidebar.page-layout--sidebar-right,
    .page-layout--with-sidebar.page-layout--sidebar-left {
        grid-template-columns: 1fr;
    }

    .page-layout--with-sidebar.page-layout--sidebar-left .page-layout__content,
    .page-layout--with-sidebar.page-layout--sidebar-left .page-layout__sidebar {
        order: unset;
    }

    .page-layout__sidebar {
        position: static;
    }
}
