/* =========================================
   THE REGAN METHOD - MASTER STYLESHEET
   ========================================= */

/* =========================================
   1. GLOBAL RESET & BASE STRUCTURE 
      (This replaces the bloated site.css)
   ========================================= */
*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --font-serif: "Georgia", Times, serif;
    --font-sans: "Helvetica Neue", Arial, sans-serif;
    --lightAccent-hsl: 36, 33%, 89%; 
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
    background-color: #F5F0E8; /* Default stone background */
    color: #1a1a1a;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Core Typography Resets */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: normal;
    margin-top: 0;
}

p {
    font-family: var(--font-sans);
    line-height: 1.6;
    margin: 0 0 1em 0;
}

/* Page Layout Engine */
.page-section {
    position: relative;
    display: block;
    width: 100%;
}

.full-bleed-section {
    width: 100vw;
    margin-left: calc(50% - 50vw);
}

/* Backgrounds & Image Overlays */
.section-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.section-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.section-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.section-background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

/* Content Containers */
.content-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    margin: 0 auto;
}

.content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* =========================================
   2. CORE GRID SYSTEM
   ========================================= */
.regan-custom-grid {
    display: grid;
    grid-template-columns: repeat(24, 1fr);
    column-gap: 11px;
    row-gap: 11px;
}

/* Form Inputs */
/* =========================================
   SOFT & LUXURY FORM INPUTS
   ========================================= */

.regan-input, 
.regan-textarea {
    width: 100%;
    padding: 18px 24px; /* Generous breathing room so it doesn't feel cramped */
    margin-bottom: 15px; /* Spacing between rows */
    
    /* The "Frosted Glass" Look */
    background-color: rgba(255, 255, 255, 0.05); /* A very faint, translucent white wash */
    border: 1px solid rgba(255, 255, 255, 0.2); /* A delicate, soft border */
    color: #ffffff; /* Keeps the text white when they type */
    
    /* The Softening Factor */
    border-radius: 8px; /* Gently rounded corners */
    font-family: sans-serif;
    font-size: 14px;
    box-sizing: border-box;
    transition: all 0.3s ease; /* Makes interactions smooth */
}

/* Adjust the height for the message boxes so they aren't too small */
.regan-textarea {
    min-height: 120px;
    resize: vertical; /* Lets the user gently drag the box taller if needed */
}

/* Soften the placeholder text (the "First Name" hint) so it isn't shouting */
.regan-input::placeholder, 
.regan-textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 300;
}

/* The "Focus" State: What happens when they click inside the box to type */
.regan-input:focus, 
.regan-textarea:focus {
    outline: none; /* Removes the ugly default blue browser glow */
    background-color: rgba(255, 255, 255, 0.1); /* Gets slightly brighter */
    border-color: rgba(255, 255, 255, 0.6); /* Border becomes more visible */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); /* Adds a subtle drop shadow */
}

/* =========================================
   3. HEADER & NAVIGATION
   ========================================= */
.regan-split-header {
    position: absolute;
    top: 40px;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    z-index: 999;
    padding: 30px 4vw;
}

.regan-nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.regan-nav-group {
    display: flex;
    gap: 3vw;
    flex: 1 1 0;
    min-width: 0;
    align-items: center;
}

.regan-nav-group.left { justify-content: flex-start; }
.regan-nav-group.right { justify-content: flex-end; }

.regan-logo {
    flex: 0 0 auto;
    text-align: center;
    padding: 0 2vw;
}

.regan-logo img {
    max-height: 168px;
    display: block;
}

/* Bulletproof Desktop Nav Links */
header .regan-nav-container .regan-nav-item {
    color: #ffffff !important;
    text-transform: uppercase;
    text-decoration: none !important;
    font-family: var(--font-sans), sans-serif;
    font-size: 18px;
    letter-spacing: 0.05em;
    white-space: nowrap;
    transition: opacity 0.3s ease;
}

header .regan-nav-container .regan-nav-item:hover {
    text-decoration: underline !important;
    text-underline-offset: 6px !important;
    opacity: 0.7;
}

header .regan-nav-container .regan-nav-item.active {
    font-weight: bold !important;
    text-decoration: underline !important;
    text-underline-offset: 6px !important;
}

/* =========================================
   4. PAGE SPECIFIC LAYOUTS
   ========================================= */
/* Blog Alternating Layout */
.blog-list {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 4vw;
}

.blog-card {
    display: flex;
    flex-direction: row;
    gap: 60px;
    margin-bottom: 100px;
    align-items: center;
}

.blog-card:nth-child(even) {
    flex-direction: row-reverse;
}

.blog-image-col {
    flex: 1;
    position: relative;
}

.blog-image-offset {
    position: absolute;
    top: 20px;
    left: -20px;
    width: 100%;
    height: 100%;
    background-color: hsla(var(--lightAccent-hsl), 1);
    z-index: 0;
}

.blog-card:nth-child(even) .blog-image-offset { left: 20px; }

.blog-image-col img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

.blog-text-col { flex: 1; }

/* Testimonials Masonry Layout */
.testimonial-masonry {
    column-count: 2;
    column-gap: 40px;
    margin-top: 40px;
}

.testimonial-card {
    break-inside: avoid;
    margin-bottom: 40px;
    padding: 40px;
    border-top: 3px solid #C5A059;
}

.bg-stone .testimonial-card { background: #ffffff; }
.bg-white .testimonial-card { background: #F5F0E8; }

/* =========================================
   5. ANIMATIONS
   ========================================= */
.regan-block {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    will-change: opacity, transform;
}

.regan-block.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   6. MOBILE RESPONSIVENESS
   ========================================= */
.mobile-menu-btn {
    display: none;
    color: #ffffff !important;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #16241E;
    z-index: 2000;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 40px;
}

.mobile-menu-overlay.is-active { display: flex; }

/* Bulletproof Mobile Menu Links */
#mobileMenu a {
    color: #ffffff !important;
    font-family: var(--font-sans), sans-serif;
    font-size: 1.5rem;
    text-decoration: none !important;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

#mobileMenu a:hover {
    text-decoration: underline !important;
    text-underline-offset: 6px !important;
}

#mobileMenu a.active {
    font-weight: bold !important;
    text-decoration: underline !important;
    text-underline-offset: 6px !important;
}

.mobile-close-btn {
    position: absolute;
    top: 30px;
    right: 5vw;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 40px;
    cursor: pointer;
    font-weight: 300;
}

@media (max-width: 900px) {
    .regan-nav-group { display: none; }

    .regan-split-header {
        position: relative;
        background-color: #16241E;
        margin-top: 38px;
        padding: 20px 4vw;
        top: 0;
    }

    .regan-nav-container {
        justify-content: center;
        position: relative;
    }

    .regan-logo { padding: 0; }
    .regan-logo img { max-height: 80px; }

    .mobile-menu-btn {
        display: block;
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        padding: 10px;
    }

    .regan-custom-grid {
        display: flex !important;
        flex-direction: column;
        gap: 40px;
        padding: 0 4vw;
    }

    .regan-block[style*="background-color: hsla(var(--lightAccent-hsl), 1)"] {
        display: none !important;
    }

    .content-wrapper { padding: 60px 0 !important; }

    h1 { font-size: 2.5rem !important; }
    h2 { font-size: 2rem !important; }

    .regan-block img {
        width: 100%;
        height: auto;
        max-height: 50vh;
        border-radius: 2px;
    }

    .blog-card, .blog-card:nth-child(even) {
        flex-direction: column;
        gap: 40px;
    }

    .blog-image-offset, .blog-card:nth-child(even) .blog-image-offset {
        top: 15px;
        left: 15px;
    }

    .testimonial-masonry { column-count: 1; }
}

/* =========================================
   7. EDITORIAL BLOG POST STYLES
   ========================================= */
body:has(.blog-post-content) { background-color: #16241E; }

.blog-post-header {
    padding: 18vmax 4vw 0vmax 4vw;
    text-align: center;
    background-color: #16241E; 
}

.blog-post-meta {
    font-family: var(--font-sans), sans-serif;
    font-size: 0.9rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.7);
    margin-bottom: 20px;
}

.blog-post-title {
    font-family: var(--font-serif), serif;
    font-size: 3.5rem;
    line-height: 1.2;
    color: #C5A059;
    max-width: 900px;
    margin: 0 auto 40px auto;
}

.blog-post-hero-image {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 4vw;
}

.blog-post-hero-image img {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: cover;
    display: block;
}

.blog-post-content {
    max-width: 800px;
    margin: 80px auto;
    padding: 0 4vw;
    font-family: var(--font-serif), serif;
    font-size: 1.2rem;
    line-height: 1.8;
    color: #ffffff;
}

.blog-post-content p { margin-bottom: 30px; }

.blog-post-content h2,
.blog-post-content h3 {
    font-family: var(--font-sans), sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 60px;
    margin-bottom: 25px;
    color: #ffffff !important;
}

.blog-post-content blockquote {
    font-size: 1.5rem;
    font-style: italic;
    color: #C5A059;
    border-left: 3px solid #C5A059;
    padding-left: 30px;
    margin: 50px 0;
}

@media (max-width: 900px) {
    .blog-post-title { font-size: 2.2rem; }
    .blog-post-content { margin: 40px auto; }
    .blog-post-content blockquote {
        font-size: 1.2rem;
        padding-left: 20px;
    }
}
/* =========================================
   8. AUTO-CENTERING SPLIT LAYOUT 
   (No more hardcoded grid rows!)
   ========================================= */
.regan-split-section {
    display: flex;
    align-items: center; /* This is the magic rule that vertically centers the image! */
    gap: 8%; /* Creates perfect spacing between text and image */
    padding: 0 4vw;
}

/* Use this class if you want the image on the LEFT */
.regan-split-section.reverse {
    flex-direction: row-reverse;
}

.regan-split-text {
    flex: 1; /* Takes up half the space */
}

.regan-split-image {
    flex: 1; /* Takes up half the space */
    position: relative;
}

.regan-image-offset {
    position: absolute;
    top: 20px;
    left: -20px;
    width: 100%;
    height: 100%;
    background-color: hsla(var(--lightAccent-hsl), 1);
    z-index: 0;
}

/* Flips the beige shadow box to the right side if the image is on the left */
.regan-split-section.reverse .regan-image-offset {
    left: 20px;
}

.regan-split-image img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

/* Mobile view stacking */
@media (max-width: 900px) {
    .regan-split-section, 
    .regan-split-section.reverse {
        flex-direction: column;
        gap: 60px;
    }
    .regan-image-offset, 
    .regan-split-section.reverse .regan-image-offset {
        top: 15px;
        left: 15px;
    }
}

/* =========================================
   IMAGE FADE REVEAL ANIMATION
   ========================================= */
@keyframes fadeOutReveal {
    0% { opacity: 1; }      /* Starts fully visible */
    15% { opacity: 1; }     /* Holds for a moment so they can register it */
    100% { opacity: 0; }    /* Fades entirely to invisible */
}

.image-fade-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* 3s duration, 1s delay before starting, "forwards" keeps it invisible forever */
    animation: fadeOutReveal 3s ease-in-out 1s forwards; 
}

/* =========================================
   TRUE CROSSFADE ANIMATION (GRID OVERLAP)
   ========================================= */
.regan-crossfade-container {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* Base styles for both images */
.regan-image-leave,
.regan-image-enter {
    grid-area: 1 / 1 / 2 / 2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Image 1 starts fully visible */
.regan-image-leave {
    z-index: 2;
}

/* Image 2 starts completely invisible */
.regan-image-enter {
    z-index: 1;
    opacity: 0; 
}

/* --- THE SCROLL TRIGGER MAGIC --- */
/* These animations ONLY fire when the user scrolls to the section */

.is-visible .regan-image-leave {
    /* 4s duration, ease-in-out pacing, 1s delay before starting */
    animation: crossfadeOut 4s ease-in-out 1s forwards;
}

.is-visible .regan-image-enter {
    /* 4s duration, ease-in-out pacing, 1s delay before starting */
    animation: crossfadeIn 4s ease-in-out 1s forwards;
}

/* Image 1 Animation */
@keyframes crossfadeOut {
    0%   { opacity: 1; }
    20%  { opacity: 1; }
    50%  { opacity: 0; }
    100% { opacity: 0; }
}

/* Image 2 Animation */
@keyframes crossfadeIn {
    0%   { opacity: 0; }
    20%  { opacity: 0; }
    50%  { opacity: 1; }
    100% { opacity: 1; }
}

/* =========================================
   DYNAMIC TEXT FADER BOXES
   ========================================= */
.regan-fader-box {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    min-height: 450px;
    background-color: #16241E; /* Deep Regan Green/Black */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 10%;
    box-sizing: border-box;
}

.regan-fader-text {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-style: italic;
    color: #ffffff;
    text-align: center;
    line-height: 1.6;
    opacity: 1;
    transition: opacity 1s ease-in-out;
    margin: 0;
}

/* Added by Javascript to trigger the fade */
.regan-fader-text.fade-out {
    opacity: 0;
}

/* =========================================
   IMAGE THEFT PREVENTION & HIGHLIGHTING
   ========================================= */
img {
    /* Prevents dragging the image to the desktop */
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    
    /* Prevents users from highlighting the image like text */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* =========================================
   RANDOM 15-IMAGE BLINK GRID
   ========================================= */
.regan-image-grid {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    min-height: 400px; /* Adjusted height for a wider aspect ratio */
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 5 Columns wide */
    grid-template-rows: repeat(3, 1fr);    /* 3 Rows tall */
    gap: 8px; /* The space between the images */
}

.grid-cell {
    width: 100%;
    height: 100%;
    background-color: transparent;
    
    /* THE FIX: Forces the cell to strictly obey the grid sizing, not the image sizing */
    min-height: 0; 
    min-width: 0;
    position: relative;
    overflow: hidden;
}

.grid-blink-img {
    /* Absolute positioning completely removes the image's ability to stretch the grid */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    
    opacity: 0; 
    transition: opacity 1.5s ease-in-out; 
}

/* This class is applied by JavaScript to trigger the fade in */
.grid-blink-img.is-flashing {
    opacity: 1;
}

/* =========================================
   MOBILE OVERRIDE FOR BLINK GRID
   ========================================= */
@media (max-width: 768px) {
    .regan-image-grid {
        /* Force the grid to become a single large box */
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
    }

    .grid-cell {
        /* Force all 15 invisible cells to occupy that exact same single spot */
        grid-column: 1;
        grid-row: 1;
    }
}

/* =========================================
   COMPACT FORM ROWS
   ========================================= */

.regan-form-row {
    display: flex;
    gap: 15px; /* The space between the inputs */
    width: 100%;
}

.regan-form-row .regan-input {
    flex: 1; /* Makes fields in a row perfectly equal in width */
}

/* Specific rule for the 3-item row (City gets more space than State or Zip) */
.regan-row-3 input[name="city"] {
    flex: 2; 
}
.regan-row-3 input[name="state"],
.regan-row-3 input[name="zip"] {
    flex: 1; 
}

/* MOBILE OVERRIDE: Stack them vertically on phones so they aren't squished */
@media (max-width: 600px) {
    .regan-form-row {
        flex-direction: column;
        gap: 0; 
    }
}

/* =========================================
   PERSONAL CORNER ANCHOR TRANSITION
   ========================================= */

.corner-gate-link:hover {
    color: #a0846c !important; /* Text deepens to a crisp tone */
    border-bottom-color: #1a1a1a !important; /* Underline becomes solid and prominent */
    letter-spacing: 0.25em !important; /* Gentle typographic expansion */
}

/* Subtle adjustment for dark themes if needed */
.bg-dark-adjust .corner-gate-link:hover {
    color: #ffffff !important;
    border-bottom-color: #ffffff !important;
}