/* ============================================
   Morgan Vineyard — Custom Styles
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    overflow-x: hidden;
}

::selection {
    background: #2D5A3D;
    color: #fdfcfa;
}

/* --- Utility: sr-only --- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link:focus {
    z-index: 9999;
}

/* --- Section Padding --- */
.section-padding {
    padding-top: 8rem;
    padding-bottom: 8rem;
}

@media (max-width: 768px) {
    .section-padding {
        padding-top: 5rem;
        padding-bottom: 5rem;
    }
}

/* --- Navigation --- */
.site-header {
    background: transparent;
    transition: background-color 0.5s ease, box-shadow 0.5s ease, backdrop-filter 0.5s ease;
}

.site-header.scrolled {
    background: rgba(13, 26, 18, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: #d4a84b;
    transition: width 0.3s ease;
}

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

/* Mobile menu */
#mobile-menu.open {
    opacity: 1;
    pointer-events: all;
}

.mobile-link {
    position: relative;
}

.mobile-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 1px;
    background: #d4a84b;
    transition: width 0.3s ease;
}

.mobile-link:hover::after {
    width: 60%;
}

/* Hamburger animation */
#menu-toggle[aria-expanded="true"] .menu-line:nth-child(1) {
    transform: translateY(4px) rotate(45deg);
}

#menu-toggle[aria-expanded="true"] .menu-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

#menu-toggle[aria-expanded="true"] .menu-line:nth-child(3) {
    transform: translateY(-4px) rotate(-45deg);
    width: 1.5rem;
}

/* --- Hero --- */
.hero {
    position: relative;
}

.hero-bg {
    transition: transform 8s ease-out;
}

.hero-img {
    transition: transform 10s ease-out;
}

.hero-loaded .hero-bg {
    transform: scale(1);
}

.hero-loaded .hero-img {
    transform: scale(1);
}

/* --- Buttons --- */
.btn-primary {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* --- Cards --- */
.card-elevated {
    transition: transform 0.5s ease, box-shadow 0.5s ease, border-color 0.5s ease;
}

.card-elevated:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* --- Input Fields --- */
.input-field {
    background: #fdfcfa;
    border: 1px solid #dce8df;
    border-radius: 4px;
    padding: 0.75rem 1rem;
    font-family: 'Lato', system-ui, sans-serif;
    font-size: 0.9375rem;
    color: #1a3a26;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    outline: none;
    width: 100%;
}

.input-field::placeholder {
    color: #8fb88e;
}

.input-field:hover {
    border-color: #8fb88e;
}

.input-field:focus {
    border-color: #2D5A3D;
    box-shadow: 0 0 0 3px rgba(45, 90, 61, 0.1);
    background: #ffffff;
}

.input-field:focus + .input-label,
.input-field:focus ~ label {
    color: #2D5A3D;
}

.input-field.error {
    border-color: #b91c1c;
    box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.1);
}

/* --- Scroll Reveal Base --- */
.reveal-text,
.reveal-image,
.reveal-card {
    opacity: 1;
    transform: none;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

/* --- Scroll Reveal (enhanced with JS) --- */
.reveal-text.revealed,
.reveal-image.revealed,
.reveal-card.revealed {
    opacity: 1;
    transform: none;
}

/* Default state for reduced motion — always visible */
@media (prefers-reduced-motion: reduce) {
    .reveal-text,
    .reveal-image,
    .reveal-card {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* --- CTA Section --- */
.cta-bg {
    transition: transform 10s ease-out;
}

.cta-img {
    transition: transform 12s ease-out;
}

.cta-loaded .cta-bg {
    transform: scale(1);
}

.cta-loaded .cta-img {
    transform: scale(1);
}

/* --- Decorative Divider --- */
.divider-ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: #8fb88e;
}

.divider-ornament::before,
.divider-ornament::after {
    content: '';
    flex: 1;
    max-width: 120px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #dce8df, transparent);
}

/* --- Footer hover states --- */
footer a {
    position: relative;
}

footer a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: #d4a84b;
    transition: width 0.3s ease;
}

footer a:hover::after {
    width: 100%;
}

/* --- Image container hover --- */
.overflow-hidden {
    overflow: hidden;
}

/* --- Subtle animations --- */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* --- Print styles --- */
@media print {
    .site-header,
    .hero-scroll,
    #menu-toggle {
        display: none !important;
    }

    body {
        color: #000;
        background: #fff;
    }

    .hero {
        min-height: auto;
        padding: 2rem 0;
    }

    .hero-bg,
    .hero-scrim {
        display: none;
    }

    .hero-title,
    .hero-subtitle {
        color: #1a3a26 !important;
    }
}

/* --- Focus visible for keyboard nav --- */
*:focus-visible {
    outline: 2px solid #2D5A3D;
    outline-offset: 2px;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid #d4a84b;
    outline-offset: 2px;
}
