/*
Theme Name: Heritage Theme
Theme URI: https://heritagehomemi.com/
Author: Heritage Home Construction
Author URI: https://heritagehomemi.com/
Description: Custom WordPress theme designed for premium custom home renovations and historical preservation. Built to work seamlessly with Elementor.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: custom-colors, custom-menu, featured-images, translation-ready, accessibility-ready, grid-layout
Text Domain: heritage-theme
*/

/* Google Fonts & Material Symbols are enqueued in functions.php. (A duplicate
   @import here used to block rendering while loading the same files twice.) */

/* --- Design System CSS Variables --- */
:root {
    /* Color Palette */
    --color-primary: #040d17;
    --color-primary-container: #1a232e;
    --color-secondary: #79582e;
    --color-secondary-container: #ffd29e;
    --color-tertiary: #1a0703;
    --color-tertiary-container: #341c15;
    --color-surface: #faf9f6;
    --color-surface-dim: #dbdad7;
    --color-surface-bright: #faf9f6;
    --color-surface-container: #efeeeb;
    --color-surface-container-high: #e9e8e5;
    --color-surface-container-highest: #e3e2e0;
    --color-surface-container-low: #f4f3f0;
    --color-surface-container-lowest: #ffffff;
    --color-on-surface: #1a1c1a;
    --color-on-surface-variant: #44474b;
    --color-charcoal-ink: #1A1A1A;
    --color-copper-heritage: #9E7E56;
    --color-cream-surface: #F9F8F5;
    --color-warm-gray: #828282;
    --color-oak-tint: #E5D3B3;
    --color-outline: #75777c;
    --color-outline-variant: #c5c6cc;

    /* Fonts */
    --font-headline: 'EB Garamond', serif;
    --font-body: 'Atkinson Hyperlegible Next', sans-serif;
    --font-label: 'Hanken Grotesk', sans-serif;

    /* Spacing Units */
    --spacing-unit: 8px;
    --container-max: 1280px;
    --gutter: 24px;
    --margin-mobile: 20px;
    --margin-desktop: 64px;
    --section-gap: 40px;

    /* Border Radius */
    --radius-default: 0.125rem;
    --radius-lg: 0.25rem;
    --radius-button: 4px;
    --radius-xl: 0.5rem;
    --radius-full: 0.75rem;
}

/* --- Theme Defaults & Layouts --- */
body {
    background-color: var(--color-surface);
    color: var(--color-charcoal-ink);
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-headline);
    color: var(--color-charcoal-ink);
    font-weight: 500;
}

a:not([class*="bg-"]):not([class*="border-charcoal-ink"]) {
    transition: color 0.3s ease;
}

/* Plain text links turn copper on hover. CTA links keep their authored text color
   (e.g. white) so they remain legible against their hover background. */
a:not([class*="bg-charcoal-ink"]):not([class*="bg-copper-heritage"]):not([class*="border-charcoal-ink"]):hover {
    color: var(--color-copper-heritage);
}

/* --- Buttons --- */
/* All CTA buttons share font-button; combined with a filled/bordered marker
   this targets every primary, secondary, hero, pricing, and page CTA link/button. */
.font-button.bg-charcoal-ink,
.font-button.bg-copper-heritage,
.font-button.border-charcoal-ink,
button.font-button {
    border-radius: var(--radius-button);
}

/* --- Custom Layout & Interactive Styles --- */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    display: inline-block;
    vertical-align: middle;
}

/* Hero Background Gradients */
.hero-gradient-overlay {
    background: linear-gradient(to bottom, rgba(4, 13, 23, 0.4), rgba(4, 13, 23, 0.7));
}

.hero-gradient-light {
    background: linear-gradient(to right, rgba(250, 249, 246, 1) 35%, rgba(250, 249, 246, 0.4) 70%, rgba(250, 249, 246, 0) 100%);
}

@media (max-width: 768px) {
    .hero-gradient-light {
        background: linear-gradient(to bottom, rgba(250, 249, 246, 1) 60%, rgba(250, 249, 246, 0.7) 85%, rgba(250, 249, 246, 0.2) 100%);
    }
}

/* --- Elementor Image Height Fix --- */
/* Elementor's frontend.css ships `.elementor img { height: auto; max-width: 100% }`,
   whose class+element specificity (0-1-1) outranks Tailwind's .h-full / .h-64
   utilities (0-1-0). That collapses cover images (hero backgrounds, service
   and step cards) to their natural aspect ratio, leaving the hero shorter
   than its section. Restore the utilities at matching-or-higher specificity. */
.elementor img.h-full {
    height: 100%;
}

.elementor img.h-64 {
    height: 16rem;
}

/* Custom Navigation Blur */
.header-navigation {
    background-color: rgba(250, 249, 246, 0.9);
    backdrop-filter: blur(12px);
}

/* Timeline Custom Elements */
.timeline-track {
    position: relative;
}

.timeline-track::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: var(--color-oak-tint);
    transform: translateX(-50%);
}

@media (max-width: 768px) {
    .timeline-track::before {
        left: 20px;
        transform: none;
    }
}

.timeline-marker {
    position: relative;
    z-index: 10;
}

/* Tab Layouts */
.tab-active {
    border-bottom: 2px solid var(--color-copper-heritage);
    color: var(--color-charcoal-ink) !important;
}

.tab-inactive {
    color: var(--color-warm-gray);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Custom Micro-Animations */
.card-hover-translate {
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
}

.card-hover-translate:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

/* Custom font styles matching tailwind extended properties for general use */
.font-label-caps {
    font-family: var(--font-label);
    font-size: 14px;
    font-weight: 700;
    line-height: 20px;
    letter-spacing: 0.1em;
}

.font-display-lg {
    font-family: var(--font-headline);
    font-size: 48px;
    font-weight: 600;
    line-height: 56px;
    letter-spacing: -0.02em;
}

.font-headline-md {
    font-family: var(--font-headline);
    font-size: 32px;
    font-weight: 500;
    line-height: 40px;
}

.font-headline-sm {
    font-family: var(--font-headline);
    font-size: 24px;
    font-weight: 500;
    line-height: 32px;
}

.font-body-lg {
    font-family: var(--font-body);
    font-size: 20px;
    font-weight: 400;
    line-height: 30px;
}

.font-body-md {
    font-family: var(--font-body);
    font-size: 18px;
    font-weight: 400;
    line-height: 28px;
}

.font-button {
    font-family: var(--font-label);
    font-size: 18px;
    font-weight: 600;
    line-height: 24px;
}

/* --- Discovery Call Form (Contact Form 7) --- */
/* Scoped to the heritage-form-card wrapper emitted by the
   Heritage Discovery Form Elementor widget. */
.heritage-form-card .wpcf7-form fieldset.heritage-form-fieldset {
    border: 0;
    padding: 0;
    margin: 0 0 2.5rem;
}

.heritage-form-card .wpcf7-form fieldset.heritage-form-fieldset legend {
    font-family: var(--font-label);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-copper-heritage);
    padding: 0;
    margin: 0 0 1.5rem;
}

.heritage-form-card .wpcf7-form label {
    display: block;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    color: var(--color-on-surface-variant);
    margin-bottom: 1.25rem;
}

.heritage-form-card .wpcf7-form input[type="text"],
.heritage-form-card .wpcf7-form input[type="email"],
.heritage-form-card .wpcf7-form input[type="tel"],
.heritage-form-card .wpcf7-form select,
.heritage-form-card .wpcf7-form textarea {
    display: block;
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    color: var(--color-charcoal-ink);
    background-color: #ffffff;
    border: 1px solid var(--color-oak-tint);
    border-radius: 4px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
}

.heritage-form-card .wpcf7-form select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 -960 960 960' width='24px' fill='%239E7E56'%3E%3Cpath d='M480-344 240-584l56-56 184 184 184-184 56 56-240 240Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 22px;
    padding-right: 2.75rem;
}

.heritage-form-card .wpcf7-form textarea {
    resize: vertical;
    min-height: 8rem;
}

.heritage-form-card .wpcf7-form input:focus,
.heritage-form-card .wpcf7-form select:focus,
.heritage-form-card .wpcf7-form textarea:focus {
    outline: none;
    border-color: var(--color-copper-heritage);
    box-shadow: 0 0 0 3px rgba(158, 126, 86, 0.15);
}

/* Checkbox + radio rows: render as a wrap of pill-style options */
.heritage-form-card .wpcf7-form .wpcf7-checkbox,
.heritage-form-card .wpcf7-form .wpcf7-radio {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    margin-top: 0.5rem;
}

.heritage-form-card .wpcf7-form .wpcf7-list-item {
    margin: 0;
}

.heritage-form-card .wpcf7-form .wpcf7-list-item label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0.5rem 1rem;
    background-color: #ffffff;
    border: 1px solid var(--color-oak-tint);
    border-radius: 2rem;
    font-size: 15px;
    cursor: pointer;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.heritage-form-card .wpcf7-form .wpcf7-list-item label:hover {
    border-color: var(--color-copper-heritage);
}

/* Checked option: copper-tinted fill */
.heritage-form-card .wpcf7-form .wpcf7-list-item label:has(input:checked) {
    border-color: var(--color-copper-heritage);
    background-color: rgba(158, 126, 86, 0.12);
    font-weight: 600;
    color: var(--color-charcoal-ink);
}

.heritage-form-card .wpcf7-form .wpcf7-list-item input[type="checkbox"],
.heritage-form-card .wpcf7-form .wpcf7-list-item input[type="radio"] {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--color-copper-heritage);
    flex-shrink: 0;
}

/* Submit button matches the site's primary CTA treatment */
.heritage-form-card .heritage-form-submit {
    margin-top: 0.5rem;
}

.heritage-form-card .wpcf7-form .wpcf7-submit {
    display: inline-block;
    width: 100%;
    padding: 1rem 2rem;
    font-family: var(--font-label);
    font-size: 18px;
    font-weight: 600;
    line-height: 24px;
    color: var(--color-surface-bright);
    background-color: var(--color-charcoal-ink);
    border: 0;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

.heritage-form-card .wpcf7-form .wpcf7-submit:hover {
    background-color: var(--color-copper-heritage);
}

.heritage-form-card .wpcf7-form .wpcf7-submit:active {
    transform: scale(0.98);
}

/* Validation + submission feedback */
.heritage-form-card .wpcf7-not-valid-tip {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--color-error, #ba1a1a);
    margin-top: 0.25rem;
}

.heritage-form-card .wpcf7-form .wpcf7-response-output {
    font-family: var(--font-body);
    font-size: 16px;
    margin: 1.5rem 0 0;
    padding: 1rem 1.25rem;
    border-radius: 4px;
}

.heritage-form-card .wpcf7-form.invalid .wpcf7-response-output {
    border: 1px solid var(--color-error, #ba1a1a);
    color: var(--color-error, #ba1a1a);
    background-color: rgba(186, 26, 26, 0.05);
}

.heritage-form-card .wpcf7-form.sent .wpcf7-response-output {
    border: 1px solid var(--color-copper-heritage);
    color: var(--color-on-secondary, #79582e);
    background-color: rgba(158, 126, 86, 0.1);
}

/* Placeholder text */
.heritage-form-card .wpcf7-form ::placeholder {
    color: var(--color-warm-gray);
    opacity: 1;
}

@media (max-width: 1024px) {
    .heritage-form-card .wpcf7-form .wpcf7-submit {
        font-size: 16px;
    }
}

/* --- Plain Page Content (Privacy Policy, etc.) --- */
/* Tailwind's preflight strips default typography, so editor content on
   non-Elementor pages needs explicit styles. Scoped to .heritage-prose,
   which index.php wraps around the_content(). */
.heritage-prose {
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.7;
    color: var(--color-on-surface-variant);
}

.heritage-prose h2 {
    font-family: var(--font-headline);
    font-size: 30px;
    line-height: 1.25;
    font-weight: 500;
    color: var(--color-charcoal-ink);
    margin: 2.75rem 0 1rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--color-oak-tint);
}

.heritage-prose h2:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.heritage-prose h3 {
    font-family: var(--font-headline);
    font-size: 23px;
    line-height: 1.3;
    font-weight: 500;
    color: var(--color-charcoal-ink);
    margin: 2rem 0 0.75rem;
}

.heritage-prose p,
.heritage-prose ul,
.heritage-prose ol {
    margin: 0 0 1.25rem;
}

.heritage-prose ul {
    list-style: disc;
    padding-left: 1.5rem;
}

.heritage-prose ol {
    list-style: decimal;
    padding-left: 1.5rem;
}

.heritage-prose li {
    margin-bottom: 0.5rem;
}

.heritage-prose li::marker {
    color: var(--color-copper-heritage);
}

.heritage-prose strong {
    font-weight: 600;
    color: var(--color-charcoal-ink);
}

.heritage-prose a {
    color: var(--color-copper-heritage);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.heritage-prose a:hover {
    color: var(--color-charcoal-ink);
}

@media (max-width: 768px) {
    .heritage-prose h2 {
        font-size: 26px;
    }
}

/* --- Mobile Spacing --- */
/* Every section uses the 64px desktop gutter (px-margin-desktop) with no
   responsive variant, which squeezes content to ~240px on phones. Swap in the
   20px mobile gutter below the md breakpoint. The extra `html body` specificity
   is needed because the Tailwind CDN injects its utilities after this file.
   Elementor's default 10px column padding is also removed on phones so
   section backgrounds run edge to edge. */
@media (max-width: 767px) {
    html body .px-margin-desktop {
        padding-left: var(--margin-mobile);
        padding-right: var(--margin-mobile);
    }

    html body .elementor-column-gap-default > .elementor-column > .elementor-element-populated {
        padding: 0;
    }
}

/* Texting-consent checkbox: a plain disclosure, not one of the pill toggles above. */
.heritage-form-card .heritage-sms-consent {
    margin: -0.25rem 0 1.25rem;
    padding: 1rem 1.25rem;
    background-color: var(--color-cream-surface);
    border-left: 2px solid var(--color-copper-heritage);
}

.heritage-form-card .heritage-sms-consent .wpcf7-acceptance {
    display: block;
    margin: 0;
}

.heritage-form-card .heritage-sms-consent .wpcf7-list-item label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
    font-size: 14px;
    line-height: 1.5;
    font-weight: 400;
    color: var(--color-on-surface-variant);
}

.heritage-form-card .heritage-sms-consent .wpcf7-list-item label:has(input:checked) {
    background: none;
    font-weight: 400;
}

.heritage-form-card .heritage-sms-consent .wpcf7-list-item input[type="checkbox"] {
    margin-top: 0.2rem;
}

.heritage-form-card .heritage-sms-consent a {
    color: var(--color-copper-heritage);
    text-decoration: underline;
}

/* Helper text under a form field (e.g. the Investment Guide link). */
.heritage-form-card .heritage-field-hint {
    margin: -0.75rem 0 1.25rem;
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-on-surface-variant);
}

.heritage-form-card .heritage-field-hint a {
    color: var(--color-copper-heritage);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.heritage-form-card .heritage-field-hint a:hover {
    color: var(--color-charcoal-ink);
}

/* Cloudflare Turnstile spam check, placed just above the submit button. */
.heritage-form-card .heritage-turnstile {
    margin: 0 0 1.25rem;
    min-height: 0;
}
