/* ========================================
   The Book Barn — Styles
   Palette: Deep Navy + Warm Gold + Pastel Airy Tones
======================================== */

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

:root {
    --navy: #1a3a5c;
    --navy-dark: #0f2740;
    --navy-light: #2a5278;
    --gold: #d4a843;
    --gold-light: #e8c96a;
    --gold-pale: #f5e6b8;
    --cream: #faf8f4;
    --cream-dark: #f0ebe0;
    --blush: #f5ebe4;
    --sage: #e8efe8;
    --sky: #e8eef5;
    --text-dark: #1a1a1a;
    --text-mid: #4a4a4a;
    --text-light: #6b6b6b;
    --white: #ffffff;
    --shadow-sm: 0 1px 3px rgba(26, 58, 92, 0.08);
    --shadow-md: 0 4px 16px rgba(26, 58, 92, 0.1);
    --shadow-lg: 0 8px 32px rgba(26, 58, 92, 0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-dark);
    background: var(--cream);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', Georgia, serif;
    line-height: 1.25;
    color: var(--navy);
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Section Tag --- */
.section-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 12px;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 50px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gold);
    color: var(--navy-dark);
}

.btn-primary:hover {
    background: var(--gold-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: transparent;
    color: var(--white);
    border: 1.5px solid rgba(255, 255, 255, 0.5);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--white);
    transform: translateY(-2px);
}

/* --- Navigation --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(250, 248, 244, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(26, 58, 92, 0.08);
    transition: all var(--transition);
}

.navbar.scrolled {
    background: rgba(250, 248, 244, 0.97);
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--navy);
}

.nav-logo .logo-icon {
    color: var(--gold);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-mid);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gold);
    transition: width var(--transition);
}

.nav-links a:hover {
    color: var(--navy);
}

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

.nav-cta {
    background: var(--navy);
    color: var(--white) !important;
    padding: 10px 22px;
    border-radius: 50px;
    font-size: 0.88rem;
}

.nav-cta::after {
    display: none;
}

.nav-cta:hover {
    background: var(--navy-light);
    color: var(--white) !important;
    transform: translateY(-1px);
}

/* Mobile Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--navy);
    border-radius: 2px;
    transition: all var(--transition);
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Hero --- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(15, 39, 64, 0.82) 0%,
        rgba(26, 58, 92, 0.72) 50%,
        rgba(42, 82, 120, 0.65) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    padding: 0 24px;
}

.hero-tag {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold-light);
    margin-bottom: 20px;
    padding: 8px 20px;
    border: 1px solid rgba(212, 168, 67, 0.4);
    border-radius: 50px;
    background: rgba(212, 168, 67, 0.1);
}

.hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 700;
    color: var(--white);
    margin-bottom: 20px;
    line-height: 1.15;
}

.hero-sub {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 36px;
    line-height: 1.7;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-scroll {
    position: absolute;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    color: rgba(255, 255, 255, 0.6);
    animation: float 2.5s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

/* --- About --- */
.about {
    padding: 120px 0;
    background: var(--cream);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
}

.about-image {
    position: relative;
}

.about-image img {
    border-radius: var(--radius-lg);
    width: 100%;
    height: 500px;
    object-fit: cover;
    box-shadow: var(--shadow-lg);
}

.about-image-accent {
    position: absolute;
    bottom: -20px;
    right: -20px;
    width: 120px;
    height: 120px;
    background: var(--gold-pale);
    border-radius: var(--radius-md);
    z-index: -1;
}

.about-content h2 {
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    margin-bottom: 20px;
}

.about-content p {
    color: var(--text-mid);
    margin-bottom: 16px;
    font-size: 1.02rem;
}

.about-stats {
    display: flex;
    gap: 40px;
    margin-top: 36px;
    padding-top: 36px;
    border-top: 1px solid rgba(26, 58, 92, 0.1);
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-number {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--navy);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
}

/* --- Services --- */
.services {
    padding: 120px 0;
    background: linear-gradient(180deg, var(--sky) 0%, var(--cream) 100%);
}

.section-header {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 64px;
}

.section-header h2 {
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    margin-bottom: 16px;
}

.section-header p {
    color: var(--text-mid);
    font-size: 1.05rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.service-card {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 36px 28px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    border: 1px solid rgba(26, 58, 92, 0.05);
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(212, 168, 67, 0.2);
}

.service-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-light);
    margin-bottom: 20px;
}

.service-card h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--navy);
}

.service-card p {
    color: var(--text-mid);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* --- Events --- */
.events {
    padding: 120px 0;
    background: var(--cream);
}

.events-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.event-card {
    display: flex;
    align-items: center;
    gap: 28px;
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 28px 32px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    border: 1px solid rgba(26, 58, 92, 0.05);
}

.event-card:hover {
    transform: translateX(6px);
    box-shadow: var(--shadow-md);
    border-color: rgba(212, 168, 67, 0.25);
}

.event-date {
    flex-shrink: 0;
    text-align: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    border-radius: var(--radius-sm);
    min-width: 90px;
}

.event-month {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold-light);
}

.event-day {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--white);
    margin-top: 2px;
}

.event-info {
    flex: 1;
}

.event-info h3 {
    font-size: 1.15rem;
    margin-bottom: 6px;
    color: var(--navy);
}

.event-info p {
    color: var(--text-mid);
    font-size: 0.92rem;
    line-height: 1.6;
}

.event-link {
    flex-shrink: 0;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--gold);
    transition: color var(--transition);
}

.event-link:hover {
    color: var(--navy);
}

/* --- Visit --- */
.visit {
    padding: 120px 0;
    background: linear-gradient(180deg, var(--cream) 0%, var(--blush) 100%);
}

.visit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: start;
}

.visit-info h2 {
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    margin-bottom: 16px;
}

.visit-description {
    color: var(--text-mid);
    font-size: 1.05rem;
    margin-bottom: 36px;
}

.visit-details {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.visit-detail {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.detail-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--navy);
    box-shadow: var(--shadow-sm);
}

.visit-detail strong {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    color: var(--navy);
    margin-bottom: 2px;
}

.visit-detail p {
    color: var(--text-mid);
    font-size: 0.92rem;
    line-height: 1.6;
}

.visit-detail a {
    color: var(--gold);
}

.visit-detail a:hover {
    color: var(--navy);
    text-decoration: underline;
}

.visit-map {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.map-link {
    position: relative;
    display: block;
}

.map-link img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.map-overlay {
    position: absolute;
    inset: 0;
    background: rgba(26, 58, 92, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--white);
    font-weight: 500;
    transition: background var(--transition);
}

.map-link:hover .map-overlay {
    background: rgba(26, 58, 92, 0.75);
}

.map-overlay svg {
    color: var(--gold-light);
}

/* --- CTA --- */
.cta {
    padding: 100px 0;
    background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 60%, var(--navy-light) 100%);
    text-align: center;
}

.cta-content {
    max-width: 640px;
    margin: 0 auto;
}

.cta .section-tag {
    color: var(--gold-light);
}

.cta h2 {
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    color: var(--white);
    margin-bottom: 16px;
}

.cta p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.05rem;
    margin-bottom: 36px;
}

.cta-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-actions .btn-secondary {
    border-color: rgba(255, 255, 255, 0.35);
}

.cta-actions .btn-secondary:hover {
    border-color: var(--white);
    background: rgba(255, 255, 255, 0.15);
}

/* --- Footer --- */
.footer {
    background: var(--navy-dark);
    padding: 64px 0 0;
    color: rgba(255, 255, 255, 0.7);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 48px;
    padding-bottom: 48px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 14px;
}

.footer-logo-icon {
    color: var(--gold);
}

.footer-brand p {
    font-size: 0.92rem;
    line-height: 1.7;
    max-width: 280px;
}

.footer-links h4,
.footer-contact h4 {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold-light);
    margin-bottom: 16px;
}

.footer-links ul,
.footer-contact ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links a {
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.6);
}

.footer-links a:hover {
    color: var(--white);
}

.footer-contact ul li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9rem;
}

.footer-contact svg {
    flex-shrink: 0;
    margin-top: 3px;
    color: var(--gold);
}

.footer-contact a {
    color: rgba(255, 255, 255, 0.6);
}

.footer-contact a:hover {
    color: var(--white);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.45);
}

.footer-bottom a {
    color: rgba(255, 255, 255, 0.45);
}

.footer-bottom a:hover {
    color: var(--gold-light);
}

/* --- Scroll Reveal --- */
.reveal {
    opacity: 1;
    transform: none;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
    opacity: 1;
    transform: none;
}

.reveal[data-reveal] {
    opacity: 0;
    transform: translateY(24px);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        background: rgba(250, 248, 244, 0.98);
        backdrop-filter: blur(12px);
        flex-direction: column;
        padding: 24px;
        gap: 20px;
        border-bottom: 1px solid rgba(26, 58, 92, 0.08);
        transform: translateY(-120%);
        opacity: 0;
        transition: all var(--transition);
        pointer-events: none;
    }

    .nav-links.active {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }

    .nav-toggle {
        display: flex;
    }

    .about-grid,
    .visit-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .about-image {
        order: -1;
    }

    .about-image img {
        height: 320px;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .event-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .event-date {
        width: 100%;
        flex-direction: row;
        gap: 8px;
        justify-content: flex-start;
        padding: 10px 16px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .about-stats {
        flex-direction: column;
        gap: 20px;
    }

    .cta-actions {
        flex-direction: column;
        align-items: center;
    }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
    .reveal[data-reveal] {
        opacity: 1;
        transform: none;
    }
    .hero-scroll { animation: none; }
}
