/* styles.css - Professional Styles for Law Office of Joel L. Goldenberg, PLLC */

/* CSS Variables */
:root {
    --primary: #8B2942; --primary-dark: #6B1931; --secondary: #1F314C; --accent: #C09E6B; --accent-light: #D4B98C;
    --text: #2D3142; --text-light: #4E5578; --bg-light: #F5F7FA; --bg-cream: #FAF7F2; --white: #FFFFFF;
    --posh-blue: #EAF2F8; /* ADDED: New sophisticated blue for mobile header */
    --glass-bg: rgba(255, 255, 255, 0.94); --glass-bg-dark: rgba(24, 34, 50, 0.97);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 5px 15px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --max-width: 1280px;
}

/* Reset & Base Styles */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-light); color: var(--text);
    line-height: 1.75;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; opacity: 0;
}
body.loaded { opacity: 1; transition: opacity 0.5s ease-out; }

/* Typography */
h1, h2, h3, h4 { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 700; line-height: 1.2; }
p, li, a, span, label, input, select, button, textarea { font-family: 'Inter', sans-serif; }

/* Accessibility */
.skip-link { position: absolute; top: -40px; left: 0; background: var(--primary); color: var(--white); padding: 8px; z-index: 10001; text-decoration: none; }
.skip-link:focus { top: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); border-width: 0; }
*:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 2px;}

/* Layout */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 30px; position: relative; }
.section { padding: 100px 0; position: relative; overflow: hidden; }
.section:nth-child(even) { background: var(--bg-cream); }
.section-title { font-size: clamp(2.4rem, 5vw, 3.2rem); text-align: center; margin-bottom: 1rem; background: linear-gradient(135deg, var(--secondary), var(--primary)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.section-subtitle { text-align: center; font-family: 'Inter', sans-serif; font-size: 1.2rem; color: var(--text-light); max-width: 700px; margin: 0 auto 3.5rem; line-height: 1.6; }

/* --- Header & Navigation --- */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 1000;
    padding: 15px 0;
    transition: var(--transition);
    will-change: background, padding, box-shadow;
}
.main-header.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-sm);
    padding: 10px 0;
}
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 30px;
}
.logo {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.9rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.05em;
    color: var(--secondary);
    position: relative;
    padding-bottom: 5px;
    background: none;
    -webkit-background-clip: initial;
    background-clip: initial;
    transition: color 0.3s ease;
}
.logo::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(to right, var(--accent) 0%, var(--primary) 100%);
    transform: scaleX(1);
}
.logo:hover {
    color: var(--accent);
}

.main-nav { display: flex; gap: 32px; }
.main-nav-link { text-decoration: none; color: var(--text); font-size: 0.9rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; position: relative; padding: 8px 4px; transition: var(--transition); }
.main-nav-link::before { content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 2px; background: linear-gradient(to right, var(--primary), var(--accent)); transition: width 0.3s ease; }
.main-nav-link:hover, .main-nav-link.active {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.main-nav-link:hover::before, .main-nav-link.active::before { width: 100%; }

/* Hero Section */
.hero {
    position: relative;
    height: 100vh;
    min-height: 700px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(to bottom, rgba(31, 49, 76, 0.4), rgba(31, 49, 76, 0.5)), url('https://images.unsplash.com/photo-1518235506717-e1ed3306a89b?q=80&w=2000&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}
@supports (-webkit-touch-callout: none) { .hero { background-attachment: scroll; } }
.hero-content { z-index: 3; padding: 0 20px; }
.title-wrapper { 
    padding: 70px 80px; 
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px); 
    border-radius: 12px; 
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: var(--shadow-lg); 
    transition: var(--transition-slow); 
}
.title-wrapper:hover { transform: translateY(-8px); box-shadow: 0 20px 60px rgba(139, 41, 66, 0.15); }
.hero-title { font-size: clamp(2.8rem, 6vw, 4.5rem); margin-bottom: 0.5rem; line-height: 1.1; }
.title-line-1 { display: block; font-size: 0.6em; font-weight: 500; color: var(--text-light); margin-bottom: 0.2em; animation: titleSlideIn 1s ease-out; }
.title-line-2 { display: block; background: linear-gradient(135deg, var(--primary), var(--secondary)); -webkit-background-clip: text; background-clip: text; color: transparent; animation: titleReveal 1.5s ease-out 0.3s both; }
.hero .tagline { font-family: 'Cormorant Garamond', serif; font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 600; color: var(--secondary); }

/* Form Section */
.cta-container { position: relative; margin-top: -110px; z-index: 20; padding: 80px 0; background-color: var(--bg-light); }
.cta-card { background: var(--white); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 50px; text-align: center; border-top: 4px solid var(--primary); }
.cta-title { font-size: 2.4rem; color: var(--secondary); margin-bottom: 2rem; }
.cta-form { display: flex; flex-direction: column; gap: 20px; max-width: 560px; margin: 0 auto 2rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { position: relative; }
.cta-form input, .cta-form select, .cta-form textarea {
    width: 100%; padding: 16px; border: 1px solid #CFD8DC; border-radius: 6px; font-size: 1rem; background: var(--bg-light); transition: var(--transition);
}
.cta-form select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234E5578' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; }
.cta-form textarea { min-height: 100px; resize: vertical; }
.cta-form input:focus, .cta-form select:focus, .cta-form textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(192, 158, 107, 0.15);
    outline: none;
}
.form-group.error input, .form-group.error select, .form-group.error textarea { border-color: #e74c3c; }
.error-message { color: #e74c3c; font-size: 0.8rem; margin-top: 5px; display: none; text-align: left; }
.form-group.error .error-message { display: block; }
.cta-button { padding: 16px; background: var(--primary); color: var(--white); border: none; border-radius: 6px; font-size: 1.1rem; font-weight: 600; cursor: pointer; transition: var(--transition); }
.cta-button:hover { background: var(--primary-dark); transform: translateY(-2px); }
.cta-button:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.spinner { display: inline-block; width: 20px; height: 20px; border: 3px solid rgba(255, 255, 255, 0.3); border-radius: 50%; border-top-color: var(--white); animation: spin 1s ease-in-out infinite; margin-left: 10px; vertical-align: middle; }
.success-message { text-align: center; padding: 2rem; }
.success-message i { font-size: 3.5rem; color: var(--accent); margin-bottom: 1.5rem; }
.success-message h3 { font-size: 1.8rem; color: var(--secondary); margin-bottom: 1rem; }
.success-message p { font-size: 1.1rem; color: var(--text); }
.cta-narrative { font-family: 'Inter', sans-serif; font-size: 1.1rem; color: var(--text-light); max-width: 700px; margin: 1.5rem auto 0; }

/* --- Practice Area Tabs & Accordion --- */
.practice-tabs { max-width: 1100px; margin: 0 auto; }
.tab-nav { display: flex; border-bottom: 1px solid #DEE2E6; margin-bottom: 2.5rem; }
.tab-button {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-light);
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease;
    flex-grow: 1;
}
.tab-button i { margin-right: 0.8rem; color: var(--primary); transition: color 0.3s ease; }
.tab-button::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--primary);
    transform: scaleX(0);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.tab-button:hover, .tab-button:focus { color: var(--secondary); }
.tab-button.active { color: var(--secondary); }
.tab-button.active i { color: var(--accent); }
.tab-button.active::after { transform: scaleX(1); }
.tab-panel { display: none; animation: fadeInPanel 0.6s ease-in-out; }
.tab-panel.active { display: block; }
.panel-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 4rem; align-items: flex-start; }
.panel-col h4 { font-size: 1.6rem; color: var(--secondary); margin-bottom: 1rem; }
.panel-col p { font-family: 'Inter', sans-serif; font-size: 1.1rem; line-height: 1.7; }
.practice-list { list-style: none; }
.practice-list li {
    position: relative; padding-left: 1.7rem; margin-bottom: 1rem; font-size: 1.1rem;
}
.practice-list li::before {
    content: '•'; color: var(--primary); position: absolute; left: 0; font-size: 1.4rem; line-height: 1; top: 1px;
}

/* About Section */
.about-section { background-color: var(--bg-light); }
.about-container { display: grid; grid-template-columns: 1fr 2fr; gap: 70px; align-items: center; }
.about-image { position: relative; }
.headshot { width: 100%; max-width: 400px; border-radius: 12px; box-shadow: var(--shadow-lg); transition: var(--transition-slow); }
.about-content h2 { font-size: 2.8rem; color: var(--secondary); margin-bottom: 1.8rem; }
.about-content p { font-family: 'Inter', sans-serif; font-size: 1.15rem; margin-bottom: 1.8rem; line-height: 1.75; }
.about-signature { font-family: 'Cormorant Garamond', serif; font-size: 2.2rem; font-weight: 600; font-style: italic; color: var(--primary); }

/* Credentials Section */
.credentials-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 40px; }
.credential-card {
    position: relative;
    background: var(--white);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: var(--transition-slow);
    border-top: 5px solid transparent;
}
.credential-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); border-top-color: var(--primary); }
.credential-card .icon, .credential-card h3, .credential-card p {
    position: relative;
    z-index: 1;
}
.credential-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: radial-gradient(400px circle at var(--x) var(--y), rgba(192, 158, 107, 0.25), transparent 80%);
    opacity: 0;
    transition: opacity 0.4s;
    z-index: 0;
}
.credential-card:hover::before {
    opacity: 1;
}
.credential-card .icon { color: var(--primary); font-size: 2.8rem; margin-bottom: 1.8rem; transition: var(--transition); }
.credential-card:hover .icon { color: var(--accent); }
.credential-card h3 { font-size: 1.8rem; color: var(--secondary); margin-bottom: 1.2rem; }

/* Final CTA & Footer */
.cta-section { background: linear-gradient(135deg, var(--primary), var(--secondary)); padding: 100px 0; color: var(--white); text-align: center; }
.cta-section h2 { font-size: clamp(2.5rem, 5vw, 3.5rem); margin-bottom: 1.8rem; }
.cta-section p { max-width: 750px; margin: 0 auto 2.5rem; opacity: 0.9; font-size: 1.1rem; line-height: 1.7; }
.cta-button-secondary { display: inline-block; background: var(--white); color: var(--primary); padding: 18px 36px; border-radius: 8px; font-size: 1.1rem; font-weight: 600; text-decoration: none; transition: var(--transition); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2); }
.cta-button-secondary:hover { transform: translateY(-5px); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3); }
footer { background: var(--secondary); color: var(--white); padding: 80px 0 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 50px; margin-bottom: 3rem; }
.footer-col h3 { font-size: 1.5rem; margin-bottom: 1.5rem; }
.footer-col a { color: rgba(255, 255, 255, 0.8); text-decoration: none; display: block; margin-bottom: 0.8rem; transition: var(--transition); }
.footer-col a:hover { color: var(--accent); }
.social-icons { margin-top: 1.5rem; display: flex; gap: 15px; }
.social-icons a { color: var(--white); font-size: 1.5rem; }
.footer-bottom { text-align: center; padding: 20px 0; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.disclaimer { background: #111D32; padding: 20px; text-align: center; font-size: 0.9rem; color: rgba(255, 255, 255, 0.6); }
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary);
    color: var(--white);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: var(--shadow-md);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.4s, transform 0.4s, background-color 0.3s;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    background-color: var(--primary-dark);
    transform: translateY(-3px);
}

/* Golden Mountain Divider */
.mountain-divider {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    transform: rotate(180deg);
    z-index: 2;
}
.mountain-divider svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 150px;
    animation: gentle-wave 12s infinite alternate ease-in-out;
}
.mountain-divider .shape-fill {
    fill: url(#gold-gradient);
    opacity: 0.2;
}

/* Animations */
@keyframes fadeInPanel { 
    from { opacity: 0; transform: translateY(15px); } 
    to { opacity: 1; transform: translateY(0); } 
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes titleReveal { 0% { transform: scale(0.95); opacity: 0; clip-path: inset(0 100% 0 0); } 100% { transform: scale(1); opacity: 1; clip-path: inset(0 0 0 0); } }
@keyframes titleSlideIn { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes gentle-wave { from { transform: translateY(0); } to { transform: translateY(15px); } }
.fade-in { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; will-change: opacity, transform; }
.fade-in.active { opacity: 1; transform: translateY(0); }
.fade-in-delay-1 { transition-delay: 0.2s; } .fade-in-delay-2 { transition-delay: 0.4s; } .fade-in-delay-3 { transition-delay: 0.6s; }

/* Responsive & Media Queries */
@media (max-width: 900px) {
    .main-header {
        padding: 0;
        background: var(--posh-blue); /* MODIFIED: Stable, sophisticated blue background */
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: var(--shadow-sm);
    }
    .header-container {
        flex-direction: column;
        padding: 0;
    }
    .logo {
        background-color: transparent;
        width: 100%;
        text-align: center;
        font-size: 2.0rem;
        padding: 20px 10px 15px;
        color: var(--accent);
    }
    .logo:hover {
        color: var(--accent); 
    }
    .main-nav {
        display: flex;
        width: 100%;
        justify-content: center;
        gap: 0;
        background: var(--white); /* MODIFIED: Clean white background */
        padding: 5px 0;
        border-top: 1px solid #e0e6ed;
    }
    .main-nav-link {
        font-size: 0.8rem;
        padding: 10px;
        flex: 1;
        text-align: center;
    }
    .main-nav-link::before {
        height: 3px;
    }
    .about-container { grid-template-columns: 1fr; text-align: center; }
    .about-image { margin: 0 auto 2rem; }
    .social-icons, .footer-col .address { justify-content: center; }
}

@media (max-width: 768px) {
    .section { padding: 80px 0; }
    .title-wrapper { padding: 40px 30px; }
    .hero h1 { font-size: 3rem; }
    .form-row, .panel-grid, .footer-grid { grid-template-columns: 1fr; }
    .panel-grid { gap: 2rem; }
    /* Accordion styles for Practice Areas */
    .tab-nav {
        flex-direction: column;
        border-bottom: none;
        gap: 10px;
    }
    .tab-button {
        width: 100%;
        text-align: left;
        border: 1px solid #DEE2E6;
        border-radius: 8px;
        background-color: var(--white);
        box-shadow: var(--shadow-sm);
        transition: background-color 0.3s ease;
    }
    .tab-button.active { background-color: var(--bg-cream); }
    .tab-button::after { display: none; }
    .tab-button::before { /* Accordion Icon */
        content: '\f078';
        font-family: 'Font Awesome 5 Free';
        font-weight: 900;
        float: right;
        transition: transform 0.3s ease;
    }
    .tab-button.active::before { transform: rotate(180deg); }
    .tab-content { margin-top: 1rem; }
    .tab-panel {
        display: block; /* Always block */
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.5s cubic-bezier(0.25, 0.8, 0.25, 1), padding 0.5s ease;
        padding: 0 1rem;
        border-left: 3px solid transparent;
    }
    .tab-panel.active {
        max-height: 1500px; /* Large enough to fit content */
        padding: 2rem 1rem;
        border-left-color: var(--primary);
        background: var(--white);
        margin-bottom: 1rem;
        border-radius: 0 8px 8px 0;
    }
}

@media (max-width: 576px) {
    .container { padding: 0 20px; }
    .cta-card { padding: 30px 20px; }
    .credentials-grid { grid-template-columns: 1fr; }
    .main-nav-link { font-size: 0.75rem; letter-spacing: 0.05em; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}