/* ============================================
   Juniper Insurance Agency - Stylesheet
   ============================================ */

/* CSS Variables */
:root {
    --navy: #1a3a52;
    --teal: #2d7d8e;
    --cream: #f8f6f1;
    --gold: #d4a574;
    --charcoal: #2c2c2c;
    --white: #ffffff;
    --light-gray: #e8e6e0;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--cream);
    color: var(--charcoal);
    line-height: 1.7;
    overflow-x: hidden;
}

/* ============================================
   Header Styles
   ============================================ */

header {
    background: var(--white);
    padding: 1.5rem 0;
    box-shadow: 0 2px 20px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Crimson Pro', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--navy);
    text-decoration: none;
    position: relative;
    display: flex;
    align-items: center;
}

.logo-img {
    height: 60px;
    width: auto;
    display: block;
}

.logo::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--gold);
    display: none; /* Hide decorative line when using image */
}

nav a {
    color: var(--navy);
    text-decoration: none;
    margin-left: 2rem;
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    transition: color 0.3s ease;
}

nav a:hover,
nav a:focus {
    color: var(--teal);
    outline: none;
}

/* ============================================
   Hero Section
   ============================================ */

.hero {
    background: linear-gradient(135deg, var(--navy) 0%, var(--teal) 100%);
    color: var(--white);
    padding: 3rem 2rem 2rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(212, 165, 116, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    opacity: 0;
    animation: fadeInUp 1s ease-out 0.3s forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero h1 {
    font-family: 'Crimson Pro', serif;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 1.5rem;
}

.hero .tagline {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    font-weight: 400;
    opacity: 0.95;
    margin-bottom: 3rem;
    max-width: 600px;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ============================================
   Button Styles
   ============================================ */

.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 1rem;
    letter-spacing: 0.02em;
}

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

.btn-primary:hover,
.btn-primary:focus {
    background: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    outline: 2px solid var(--gold);
}

.btn-secondary {
    background: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

.btn-secondary:hover,
.btn-secondary:focus {
    background: var(--white);
    color: var(--navy);
    outline: 2px solid var(--white);
}

/* ============================================
   Services Section
   ============================================ */

.services {
    padding: 3rem 2rem;
    background: var(--white);
}

.section-title {
    font-family: 'Crimson Pro', serif;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    text-align: center;
    color: var(--navy);
    margin-bottom: 1rem;
    position: relative;
}

.section-subtitle {
    text-align: center;
    color: var(--teal);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.services-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--cream);
    padding: 2rem;
    border-radius: 8px;
    border-left: 4px solid var(--gold);
    transition: all 0.4s ease;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.service-card:nth-child(1) { animation-delay: 0.1s; }
.service-card:nth-child(2) { animation-delay: 0.2s; }
.service-card:nth-child(3) { animation-delay: 0.3s; }
.service-card:nth-child(4) { animation-delay: 0.4s; }
.service-card:nth-child(5) { animation-delay: 0.5s; }
.service-card:nth-child(6) { animation-delay: 0.6s; }

.service-card:hover,
.service-card:focus-within {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.1);
    border-left-color: var(--teal);
}

.service-card h3 {
    font-family: 'Crimson Pro', serif;
    font-size: 1.5rem;
    color: var(--navy);
    margin-bottom: 0.8rem;
}

.service-card p {
    color: var(--charcoal);
    font-size: 0.95rem;
}

/* ============================================
   About Section
   ============================================ */

.about {
    padding: 3rem 2rem;
    background: var(--cream);
}

.about-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.about-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 0.75rem;
    color: var(--charcoal);
}

.about-content a {
    color: var(--teal);
    text-decoration: none;
    transition: color 0.3s ease;
}

.about-content a:hover,
.about-content a:focus {
    color: var(--navy);
    text-decoration: underline;
}

/* ============================================
   Contact Section
   ============================================ */

.contact {
    padding: 3rem 2rem;
    background: var(--white);
}

.contact-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.contact-info {
    background: linear-gradient(135deg, var(--navy) 0%, var(--teal) 100%);
    color: var(--white);
    padding: 2rem;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.contact-info::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.contact-info h3 {
    font-family: 'Crimson Pro', serif;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.contact-item {
    margin-bottom: 1.25rem;
    position: relative;
    padding-left: 2rem;
}

.contact-item::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--gold);
    font-weight: bold;
}

.contact-item h4 {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gold);
    margin-bottom: 0.3rem;
}

.contact-item p {
    font-size: 1.1rem;
}

.contact-item p strong {
    display: block;
    margin-bottom: 0.3rem;
    font-weight: 600;
}

.contact-item p a {
    display: inline-block;
    margin-right: 0.5rem;
}

.contact-item a {
    color: var(--white);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-item a:hover,
.contact-item a:focus {
    color: var(--gold);
    outline: none;
    text-decoration: underline;
}

/* ============================================
   Contact Form Styles
   ============================================ */

.contact-form {
    background: var(--cream);
    padding: 2rem;
    border-radius: 8px;
}

.contact-form h3 {
    font-family: 'Crimson Pro', serif;
    font-size: 2rem;
    color: var(--navy);
    margin-bottom: 1.25rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--navy);
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--light-gray);
    border-radius: 4px;
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--white);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(45, 125, 142, 0.1);
}

.form-group input:invalid,
.form-group textarea:invalid {
    border-color: var(--light-gray);
}

.form-group input:valid,
.form-group textarea:valid {
    border-color: var(--light-gray);
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.submit-btn {
    width: 100%;
    padding: 1.2rem;
    background: var(--navy);
    color: var(--white);
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-family: 'DM Sans', sans-serif;
}

.submit-btn:hover,
.submit-btn:focus {
    background: var(--teal);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    outline: 2px solid var(--teal);
}

.submit-btn:active {
    transform: translateY(0);
}

/* ============================================
   Footer Styles
   ============================================ */

footer {
    background: var(--navy);
    color: var(--white);
    text-align: center;
    padding: 2rem;
}

footer p {
    opacity: 0.8;
    font-size: 0.9rem;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .logo-img {
        height: 50px;
    }

    nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    nav a {
        margin: 0.5rem;
    }

    .hero {
        padding: 2rem 1.5rem 1.5rem;
    }

    .contact-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 480px) {
    .logo-img {
        height: 40px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .service-card,
    .contact-info,
    .contact-form {
        padding: 1.5rem;
    }
}

/* ============================================
   Accessibility Improvements
   ============================================ */

/* Skip to main content link (for screen readers) */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--navy);
    color: var(--white);
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Focus visible styles for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 2px;
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn {
        border: 2px solid currentColor;
    }
    
    .service-card {
        border: 2px solid var(--navy);
    }
}

/* Print styles */
@media print {
    header {
        position: relative;
    }
    
    .hero,
    .contact-form,
    footer {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    a {
        text-decoration: underline;
    }
    
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
}
