/* ============================================
   John Anthony Church Vineyard — Custom Styles
   ============================================ */

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

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

body {
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #0b1120;
}
::-webkit-scrollbar-thumb {
    background: #1a2744;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #273c6d;
}

/* Selection */
::selection {
    background: rgba(200, 164, 90, 0.3);
    color: #f0f3f9;
}

/* Skip Link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    padding: 0.75rem 1.5rem;
    background: #c8a45a;
    color: #1a2744;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 4px 4px;
    transition: top 0.3s;
}
.skip-link:focus {
    top: 0;
}

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

/* ============================================
   Navigation
   ============================================ */
#site-header {
    background: transparent;
    transition: background 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

#site-header.scrolled {
    background: rgba(11, 17, 32, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 rgba(200, 164, 90, 0.1);
}

.nav-link {
    position: relative;
}

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

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

/* Mobile menu */
#mobile-menu {
    padding: 2rem;
}

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

.mobile-nav-link {
    position: relative;
}

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

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

/* Hamburger animation */
#menu-toggle[aria-expanded="true"] #bar1 {
    transform: translateY(6px) rotate(45deg);
}
#menu-toggle[aria-expanded="true"] #bar2 {
    opacity: 0;
    transform: scaleX(0);
}
#menu-toggle[aria-expanded="true"] #bar3 {
    transform: translateY(-6px) rotate(-45deg);
}

/* ============================================
   Reveal Animations (progressive enhancement)
   ============================================ */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                    transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }

    /* Staggered delays handled by inline style-transition-delay */
}

/* Always visible for reduced-motion users */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ============================================
   Hero
   ============================================ */
#hero {
    position: relative;
}

#hero::after {
    content: '';
    position: absolute;
    top: 0;
    right: 50%;
    width: 1px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(200, 164, 90, 0.2), transparent);
}

/* ============================================
   Buttons & Links
   ============================================ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #c8a45a;
    outline-offset: 2px;
    border-radius: 2px;
}

/* ============================================
   Form Styles
   ============================================ */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236783bf' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* ============================================
   Image hover effects
   ============================================ */
img {
    display: block;
    max-width: 100%;
}

/* ============================================
   Responsive adjustments
   ============================================ */
@media (max-width: 1023px) {
    #hero::after {
        display: none;
    }
}

@media (max-width: 639px) {
    .font-serif {
        line-height: 1.15;
    }
}
