/*
 * theme-extras.css
 *
 * Loaded AFTER index.css to supply:
 *   1. @font-face declarations (were inline in the original pages)
 *   2. Homepage-only overrides (hero-card, accent-color override)
 *   3. WP-specific fixes (nav <li> wrappers, admin-bar offset, footer h3)
 *   4. Hard reset of WP default element styles that leak through
 *
 * index.css is the single source of truth for all shared site styles.
 * This file only patches the gaps between "raw index.css" and the
 * pixel-identical original rendering.
 */


/* =====================================================================
   0. HARD RESET — kill any WordPress / block-editor defaults that
      survive our dequeue/deregister calls in enqueue.php.
   ===================================================================== */
html {
    font-size: 16px !important;       /* WP global-styles can override to 62.5% / clamp() */
}

body {
    font-family: var(--font-body);
    color: var(--color-secondary);
    background-color: var(--color-white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    margin: 0;
    padding: 0;
}

/* Prevent horizontal overflow on mobile */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* WP sometimes injects .wp-site-blocks with its own padding/margin */
.wp-site-blocks {
    padding: 0 !important;
    margin: 0 !important;
}

/* Re-assert the universal reset from index.css — WP block styles can
   undo it for elements like <p>, <figure>, <ul>, etc. */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, h5 {
    font-family: var(--font-heading);
    color: var(--color-primary);
    line-height: 1.2;
    font-weight: 700;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; margin-bottom: 1rem; }
h3 { font-size: 1.5rem; margin-bottom: 0.75rem; }
h4 { font-size: 1.25rem; margin-bottom: 0.5rem; }

p { margin-bottom: 1.5rem; }

a {
    text-decoration: none;
    color: inherit;
}

/* Desktop responsive type scale — must re-assert because WP styles
   can override the index.css @media rules */
@media (min-width: 768px) {
    h1 { font-size: 3.5rem; }
    h2 { font-size: 2.5rem; }
}


/* =====================================================================
   1. LOCAL @FONT-FACE  (same as legacy inline style blocks)
   ===================================================================== */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('assets/fonts/inter-v20-latin-regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('assets/fonts/inter-v20-latin-500.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('assets/fonts/inter-v20-latin-600.woff2') format('woff2');
}
@font-face {
    font-family: 'Merriweather';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('assets/fonts/merriweather-v33-latin-regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Merriweather';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('assets/fonts/merriweather-v33-latin-700.woff2') format('woff2');
}


/* =====================================================================
   2. HOMEPAGE-ONLY OVERRIDES
   The original index.php had a full inline <style> that redefined
   --color-accent to #c2410c (the hover shade). Other pages loaded
   index.css which keeps --color-accent at #ea580c.
   WordPress adds body.home on the front page.
   ===================================================================== */
body.home {
    --color-accent: #c2410c;
    --color-accent-hover: #c2410c;
}

/* Hero content — wider container, column layout for card */
.hero .hero-content {
    flex: 1;
    display: flex;
    align-items: stretch;
    padding: 2%;
    max-width: 1400px;
    margin: auto 0;
    width: 100%;
    flex-direction: column;
}

.hero-card {
    background: linear-gradient(135deg, rgba(245,245,245,0.95) 0%, rgba(220,220,220,0.90) 100%);
    backdrop-filter: blur(10px);
    border: 3px solid #c9a761;
    border-radius: 12px;
    padding: 3.5rem;
    max-width: 650px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15), inset 0 0 0 1px rgba(255,255,255,0.5);
}

.hero-card .pre-heading {
    color: #555;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.hero-card h1 {
    color: #1a1a1a;
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero-card p {
    color: #333;
    font-size: 1.15rem;
    line-height: 1.6;
    margin-bottom: 2.5rem;
}


/* =====================================================================
   3. WP NAV MENU FIXES
   WordPress outputs <li class="menu-item"> wrapping each <a>, unlike
   the original which put classes directly on <a> elements.
   ===================================================================== */

/* Reset WP <li> wrappers so the nav matches the original flat <a> list */
.desktop-nav ul {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
    padding: 0;
    margin: 0;
}

.desktop-nav .menu-item {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    line-height: 1;
}

.desktop-nav .menu-item a {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--color-primary);
    text-decoration: none;
}

.desktop-nav .menu-item a:hover {
    color: var(--color-accent);
}

/* CTA button: style the <a> inside the <li> that carries .nav-cta */
li.nav-cta {
    background: none;
    padding: 0;
    border: none;
}
li.nav-cta > a {
    background-color: var(--color-primary);
    color: var(--color-white) !important;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md, 8px);
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}
li.nav-cta > a:hover {
    background-color: var(--color-secondary);
}


/* =====================================================================
   3b. HEADER PHONE NUMBER & MOBILE CALL BUTTON
   ===================================================================== */
.header-phone {
    display: none;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-primary);
    margin-left: auto;
    margin-right: 1.5rem;
    white-space: nowrap;
}
.header-phone .material-symbols-outlined {
    font-size: 1.2rem;
    color: var(--color-accent);
}
.header-phone:hover {
    color: var(--color-accent);
}

@media (min-width: 768px) {
    .header-phone {
        display: inline-flex;
    }
}

/* Mobile sticky call button — fixed bottom-right on small screens */
.mobile-call-btn {
    display: none;
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 9999;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--color-accent);
    color: #fff;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    transition: background-color 0.2s;
}
.mobile-call-btn .material-symbols-outlined {
    font-size: 1.5rem;
}
.mobile-call-btn:hover {
    background-color: var(--color-accent-hover);
}

@media (max-width: 767px) {
    .mobile-call-btn {
        display: flex;
    }
}


/* =====================================================================
   3c. TRUST BAR LINKS
   ===================================================================== */
.trust-bar a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s;
}
.trust-bar a:hover {
    opacity: 0.8;
    text-decoration: underline;
}


/* =====================================================================
   3d. WHY CHOOSE US GRID (homepage)
   ===================================================================== */
.why-choose-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

@media (min-width: 768px) {
    .why-choose-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem;
    }
}

.why-choose-item h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--color-primary);
}

.why-choose-item p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--color-secondary);
}

.why-choose-item a {
    color: var(--color-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.why-choose-item a:hover {
    color: var(--color-accent-hover);
}


/* =====================================================================
   4. FOOTER FIXES
   Footer.php now uses <h4> (matching the majority of original pages).
   index.css already styles .footer-col h4 correctly.
   Keep h3 as a safety net — the original homepage/careers inline CSS
   styled both: .footer-col h3, .footer-col h4
   ===================================================================== */
.footer-col h3 {
    color: var(--color-white);
    margin-bottom: 1.5rem;
}


/* =====================================================================
   5. WP ADMIN BAR OFFSET
   ===================================================================== */
body.admin-bar .site-header {
    top: 32px;
}
@media screen and (max-width: 782px) {
    body.admin-bar .site-header {
        top: 46px;
    }
}


/* =====================================================================
   6. FORM VALIDATION STYLES
   ===================================================================== */
.error-msg {
    display: none;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    color: #ef4444;
}

.form-global-error {
    font-size: 0.9rem;
}

.newsletter-feedback {
    font-size: 0.9rem;
    margin-top: 0.5rem;
}


/* =====================================================================
   9. RESPONSIVE — hero-card
   ===================================================================== */
@media (max-width: 768px) {
    .hero-card {
        padding: 2rem;
    }
    .hero-card h1 {
        font-size: 2rem;
    }
}
