/* Custom CSS */
:root {
    --primary: #1B466E;
    --primary-dark: #143859;
    --primary-light: #2A5C86;
    --secondary: #F2AB1A;
    --secondary-light: #FFD166;
    --tertiary: #FF8302;
    --tertiary-light: #FFA64B;
    --light-bg: #F9F7F2;
}

body {
    font-family: 'Architects Daughter', cursive;
    background-color: var(--primary);
    color: white;
    overflow-x: hidden;
}

.bg-primary { background-color: var(--primary); }
.bg-secondary { background-color: var(--secondary); }
.bg-tertiary { background-color: var(--tertiary); }
.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-tertiary { color: var(--tertiary); }
.border-secondary { border-color: var(--secondary); }

/* ========== SIMPLIFIED SECTION BACKGROUNDS ========== */

/* Home and Contact - NO CSS backgrounds, handled in PHP with inline styles */
#home,
#contact {
    position: relative;
    overflow: hidden;
}

/* Remove ALL ::before elements for home and contact */
#home::before,
#contact::before,
#contact.contact-bg::before {
    display: none !important;
    content: none !important;
}

/* Services Section - Direct blueprint background */
#services {
    position: relative;
    background-color: var(--primary);
    background-image: linear-gradient(rgba(42, 92, 134, 0.3) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(42, 92, 134, 0.3) 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: -1px -1px;
    background-attachment: scroll;
}

/* Remove services ::before */
#services::before {
    display: none !important;
    content: none !important;
}

/* Merchandise Section - Direct blueprint background */
#merchandise,
.merchandise-section {
    position: relative;
    background-color: var(--primary);
    background-image: linear-gradient(rgba(42, 92, 134, 0.3) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(42, 92, 134, 0.3) 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: -1px -1px;
    background-attachment: scroll;
}

/* Remove merchandise ::before */
#merchandise::before,
.merchandise-section::before {
    display: none !important;
    content: none !important;
}

/* Any other blue sections - Direct blueprint background */
section:not(#home):not(#contact):not(.bright-section):not(.faq-bg) {
    position: relative;
    background-color: var(--primary);
    background-image: linear-gradient(rgba(42, 92, 134, 0.3) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(42, 92, 134, 0.3) 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: -1px -1px;
    background-attachment: scroll;
}

/* Remove all other ::before elements that might cause conflicts */
section:not(#home):not(#contact):not(.bright-section):not(.faq-bg)::before {
    display: none !important;
    content: none !important;
}

/* Bright sections (keep these as they are working) */
.bright-section {
    background: none;
    position: relative;
    color: var(--primary);
    z-index: 1;
}

.bright-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-attachment: scroll;
    background-color: #F9F7F2;
    background-image: url("data:image/svg+xml,%3Csvg width='52' height='26' viewBox='0 0 52 26' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23F2AB1A' fill-opacity='0.1'%3E%3Cpath d='M10 10c0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6h2c0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4v2c-3.314 0-6-2.686-6-6 0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6zm25.464-1.95l8.486 8.486-1.414 1.414-8.486-8.486 1.414-1.414z' /%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* FAQ sections (keep these as they are working) */
.faq-bg {
    background: none;
    position: relative;
}

.faq-bg::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-attachment: scroll;
    background-color: #FFD166;
    background-image: url("data:image/svg+xml,%3Csvg width='200' height='200' viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23FF8302' fill-opacity='0.2'%3E%3Cpath d='M80 70c0-11 9-20 20-20s20 9 20 20-9 20-20 20c0 5 0 10 0 15h-5c0-5 0-10 0-15h-5c0-5.5 4.5-10 10-10 5.5 0 10-4.5 10-10s-4.5-10-10-10-10 4.5-10 10h-10zm15 45v10h10v-10h-10z'/%3E%3Cpath d='M30 20c0-5.5 4.5-10 10-10s10 4.5 10 10-4.5 10-10 10c0 2.5 0 5 0 7.5h-2.5c0-2.5 0-5 0-7.5h-2.5c0-2.75 2.25-5 5-5 2.75 0 5-2.25 5-5s-2.25-5-5-5-5 2.25-5 5h-5zm7.5 22.5v5h5v-5h-5z'/%3E%3Cpath d='M150 150c0-5.5 4.5-10 10-10s10 4.5 10 10-4.5 10-10 10c0 2.5 0 5 0 7.5h-2.5c0-2.5 0-5 0-7.5h-2.5c0-2.75 2.25-5 5-5 2.75 0 5-2.25 5-5s-2.25-5-5-5-5 2.25-5 5h-5zm7.5 22.5v5h5v-5h-5z'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 200px 200px;
}

/* ========== DECORATIVE ELEMENTS ========== */

/* Background knife image */
.knife-background {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    max-width: 800px;
    background-image: url('/images/logo-knife-only.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: contain;
    opacity: 0.1;
    z-index: 0;
}

.home-content {
    position: relative;
    z-index: 2;
}

.decoration {
    position: absolute;
    opacity: 0.15;
    pointer-events: none;
}

/* Section transitions */
section {
    position: relative;
}

section::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.03), transparent);
    z-index: 2;
}

/* ========== TYPOGRAPHY ========== */

/* FIXED: Universal Text Styling - Proper centering */
.text-brand-title {
    font-size: 5.5rem !important;
    font-weight: 800 !important;
    color: var(--secondary) !important;
    letter-spacing: 2px !important;
    line-height: 1.1 !important;
    display: block !important;
    padding: 0 !important; /* Remove horizontal padding that can affect centering */
    margin: 0 auto !important; /* Center the element itself */
    margin-bottom: 0 !important;
    text-align: center !important;
    width: 100% !important; /* Ensure full width for proper centering */
    
    /* PREVENT HYPHENATION BUT ALLOW WRAPPING ON LARGER SCREENS */
    -webkit-hyphens: none !important;
    hyphens: none !important;
    word-break: keep-all !important;
    /* Remove white-space: nowrap for larger screens to prevent overflow */
    
    /* Font rendering */
    -webkit-text-size-adjust: 100% !important;
    -webkit-font-smoothing: antialiased !important;
    text-rendering: optimizeLegibility !important;
}

.text-brand-subtitle {
    font-size: 3.5rem !important;
    color: var(--tertiary) !important;
    letter-spacing: 1px !important;
    margin-top: -10px !important;
}

.text-shadow-brand {
    text-shadow: 
        3px 3px 0px var(--tertiary),
        -1px -1px 0px rgba(255, 255, 255, 0.3),
        0px 4px 6px rgba(0, 0, 0, 0.4) !important;
}

.text-shadow-light {
    text-shadow: 
        2px 2px 0px var(--primary-dark),
        0px 2px 4px rgba(0, 0, 0, 0.3) !important;
}

/* Font Family Assignments */
p, 
.text-sm,
.text-lg,
.text-xl:not(h1):not(h2):not(h3):not(h4):not(h5):not(h6),
.gallery-img-caption p,
li:not(.menu-item),
.entry-content {
    font-family: 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
}

h1, h2, h3, h4, h5, h6,
.btn,
.nav-link,
.menu-item {
    font-family: 'Architects Daughter', cursive;
}

/* ========== NAVIGATION ========== */

.nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--secondary);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link:hover {
    color: var(--secondary);
    transform: translateY(-2px);
}

/* Navigation alignment */
nav .container.mx-auto {
    max-width: 100% !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

.md\:flex.space-x-8 {
    margin-left: auto;
    padding-right: 0;
}

nav a[href*="home"] {
    margin-right: auto;
}

.mobile-nav {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.mobile-nav.active {
    transform: translateX(0);
}

/* ========== BUTTONS ========== */

.btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    background-color: rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    z-index: -1;
}

.btn:hover::after {
    height: 100%;
}

.btn:hover {
    transform: translateY(-2px);
}

/* ========== CARDS & COMPONENTS ========== */

.service-card {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: var(--secondary);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.service-icon {
    width: auto !important;
    height: auto !important;
    max-width: 60px !important;
    max-height: 60px !important;
    object-fit: contain !important;
}

/* ========== GALLERY ========== */

.gallery-img {
    transition: all 0.3s ease;
    cursor: pointer;
}

.gallery-img:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.gallery-showcase {
    position: relative;
    padding: 0 20px;
    margin-bottom: 40px;
}

.center-image-wrapper {
    width: 100%;
    height: 400px;
    overflow: hidden;
}

.center-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#prev-image-container .gallery-img,
#next-image-container .gallery-img {
    transition: all 0.3s ease;
    opacity: 0.7;
    height: 150px;
    overflow: hidden;
}

#prev-image-container .gallery-img:hover,
#next-image-container .gallery-img:hover {
    opacity: 0.9;
    transform: scale(1.05);
    cursor: pointer;
}

#gallery-prev, #gallery-next {
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#gallery-prev:hover, #gallery-next:hover {
    background-color: rgba(27, 70, 110, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.dot {
    transition: all 0.3s ease;
    margin: 0 4px;
    cursor: pointer;
}

.dot:hover {
    transform: scale(1.2);
}

/* ========== LIGHTBOX ========== */

.sl-overlay {
    background: #000;
    opacity: 0.8;
}

.sl-wrapper .sl-navigation button {
    color: #fff;
}

.sl-wrapper .sl-close {
    color: #fff;
}

.sl-spinner {
    border-color: #fff;
}

.sl-wrapper .sl-counter {
    color: #fff;
}

/* ========== FAQ ========== */

.faq-item {
    margin-bottom: 1rem;
    background-color: white;
    border-radius: 0.5rem;
    overflow: hidden;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    cursor: pointer;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.faq-question.active {
    border-bottom-color: #eee;
    background-color: rgba(242, 171, 26, 0.05);
}

.faq-question h3 {
    margin: 0;
    font-weight: bold;
    color: var(--primary);
}

.arrow {
    transition: transform 0.3s ease;
    color: var(--tertiary);
}

.rotate-90 {
    transform: rotate(90deg);
}

.faq-answer {
    padding: 0 1rem 1rem;
    font-family: 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
}

/* ========== CONTACT FORMS ========== */

.wpcf7 label {
    display: block;
    color: #F2AB1A;
    font-family: 'Architects Daughter', cursive;
    margin-bottom: 0.5rem;
}

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 select,
.wpcf7 textarea {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 0.5rem !important;
    padding: 0.75rem 1rem !important;
    color: white !important;
    margin-bottom: 1rem;
}

.wpcf7 textarea {
    height: 150px;
}

.wpcf7 select option {
    background-color: #1B466E !important;
    color: white !important;
}

.wpcf7 select:focus {
    border-color: #F2AB1A !important;
}

.wpcf7 select option:checked,
.wpcf7 select option:hover {
    background-color: #2A5C86 !important;
}

.wpcf7 input[type="submit"] {
    background-color: #F2AB1A !important;
    color: #1B466E !important;
    font-family: 'Architects Daughter', cursive !important;
    font-weight: bold;
    padding: 0.75rem 2rem !important;
    border-radius: 0.5rem !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    overflow: hidden !important;
    z-index: 1 !important;
}

.wpcf7 input[type="submit"]:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2) !important;
}

.wpcf7 input[type="submit"]::after {
    content: '' !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 0 !important;
    background-color: rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease !important;
    z-index: -1 !important;
}

.wpcf7 input[type="submit"]:hover::after {
    height: 100% !important;
}

.wpcf7-not-valid-tip {
    color: #ffc107 !important;
    font-size: 0.8em;
    margin-top: 0.25em;
}

.wpcf7-response-output {
    margin: 2em 0 !important;
    padding: 0.75em 1em !important;
    border-radius: 0.5rem !important;
    color: white !important;
    border-width: 1px !important;
    background-color: rgba(0, 0, 0, 0.2);
}

/* ========== LOGOS ========== */

.home-logo-container img {
    max-width: 400px !important;
    width: 100%;
    height: auto;
    position: relative;
    z-index: 1;
}

.header-logo, 
header .custom-logo {
    width: 70px !important;
    height: auto !important;
}

.footer-logo, 
footer .custom-logo {
    width: 150px !important;
    height: auto !important;
}

/* ========== ANIMATIONS ========== */

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.active {
    opacity: 1;
    transform: translateY(0);
}

.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }

/* ========== RESPONSIVE DESIGN ========== */

/* FIXED: Mobile text scaling - Prevent hyphenation by making text smaller */
@media (max-width: 768px) {
    .text-brand-title {
        font-size: 2.8rem !important;
        letter-spacing: 1px !important;
        padding: 0 10px !important;
        white-space: nowrap !important; /* Keep on one line for mobile only */
        -webkit-hyphens: none !important;
        hyphens: none !important;
        word-break: keep-all !important;
    }
    
    .text-brand-subtitle {
        font-size: 2.5rem !important;
    }
    
    /* Adjust background patterns on mobile */
    #services,
    #merchandise,
    .merchandise-section,
    section:not(#home):not(#contact):not(.bright-section):not(.faq-bg) {
        background-size: 15px 15px;
    }
}

@media (max-width: 480px) {
    .text-brand-title {
        font-size: 2.2rem !important;
        letter-spacing: 0.5px !important;
        padding: 0 5px !important;
        white-space: nowrap !important;
        -webkit-hyphens: none !important;
        hyphens: none !important;
    }
    
    .text-brand-subtitle {
        font-size: 1.8rem !important;
        line-height: 1.2 !important;
        margin-top: 0 !important;
    }
    
    #home p {
        font-size: 1rem !important;
        line-height: 1.5 !important;
        margin-bottom: 20px !important;
    }
    
    .btn {
        margin: 5px !important;
        display: block !important;
        width: 100% !important;
    }
    
    section {
        padding-top: 40px !important;
        padding-bottom: 40px !important;
    }
    
    .container {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
    
    .knife-background {
        opacity: 0.05 !important;
    }
}

@media (max-width: 375px) {
    .text-brand-title {
        font-size: 1.9rem !important;
        letter-spacing: 0 !important;
        padding: 0 !important;
        white-space: nowrap !important;
        -webkit-hyphens: none !important;
        hyphens: none !important;
    }
    
    .text-brand-subtitle {
        font-size: 1.5rem !important;
    }
    
    #home {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}

/* Additional fix: Ensure the container doesn't restrict centering */
.container.mx-auto {
    width: 100% !important;
    max-width: 1200px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}