/* ==========================================================================
   Russo Petrullo Law Group - Mobile-First Fully Optimized Styles
   ========================================================================== */

:root {
    --color-navy: #1a2744;
    --color-navy-dark: #0f1829;
    --color-gold: #c9a962;
    --color-gold-light: #e4d4a8;
    --color-cream: #faf8f5;
    --color-warm-white: #fffef9;
    --color-text: #2d3748;
    --color-text-muted: #5a6478;
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Montserrat', -apple-system, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    background: var(--color-cream);
    color: var(--color-text);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a {
    text-decoration: none;
    color: inherit;
}

/* Text overflow prevention for mobile */
h1, h2, h3, h4, p, li, a, span {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Ensure long words don't break layout */
.content-section p,
.content-section li {
    hyphens: auto;
    -webkit-hyphens: auto;
}

/* ==========================================================================
   Header - Mobile First
   ========================================================================== */

header {
    background: var(--color-navy);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0,0,0,0.15);
}

.header-top {
    background: var(--color-navy-dark);
    padding: 10px 15px;
    text-align: center;
    border-bottom: 1px solid rgba(201, 169, 98, 0.2);
}

.header-top a {
    color: var(--color-gold);
    text-decoration: none;
    font-size: 0.75rem;
    letter-spacing: 0.3px;
    font-weight: 500;
}

.header-main {
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-img {
    height: 45px;
    width: 45px;
    border-radius: 4px;
    object-fit: cover;
}

.logo-text-wrap {
    display: flex;
    flex-direction: column;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-warm-white);
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.logo-tagline {
    font-size: 0.6rem;
    color: var(--color-gold);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 2px;
    display: none;
}

/* Mobile Menu Toggle */
.mobile-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 10px;
    background: none;
    border: none;
    z-index: 1001;
}

.mobile-toggle span {
    width: 24px;
    height: 2px;
    background: var(--color-warm-white);
    transition: all 0.3s ease;
    display: block;
}

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

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

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

/* Navigation - Mobile */
nav {
    position: fixed;
    top: 0;
    left: -100%;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    background: var(--color-navy-dark);
    transition: left 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    padding-top: 80px;
    -webkit-overflow-scrolling: touch;
}

nav.active {
    left: 0;
}

.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

nav > ul > li {
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

nav > ul > li > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    color: var(--color-warm-white);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

nav > ul > li > a:hover,
nav > ul > li > a:active {
    background: rgba(201, 169, 98, 0.1);
    color: var(--color-gold);
}

.dropdown-arrow {
    font-size: 0.65rem;
    transition: transform 0.3s ease;
    padding: 5px;
}

.dropdown-arrow.active {
    transform: rotate(180deg);
}

/* Dropdown - Mobile */
.dropdown {
    display: none;
    background: rgba(0,0,0,0.2);
    list-style: none;
}

.dropdown.active {
    display: block;
}

.dropdown li a {
    display: block;
    padding: 14px 20px 14px 35px;
    color: rgba(255,255,255,0.8);
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.dropdown li a:hover,
.dropdown li a:active {
    background: rgba(201, 169, 98, 0.1);
    color: var(--color-gold);
}

/* Header CTA Button */
.header-cta {
    display: none;
}

.cta-button {
    background: var(--color-gold);
    color: var(--color-navy-dark);
    padding: 14px 24px;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    border: 2px solid var(--color-gold);
    display: inline-block;
    text-align: center;
    border-radius: 2px;
}

.cta-button:hover,
.cta-button:active {
    background: transparent;
    color: var(--color-gold);
}

/* ==========================================================================
   Page Hero - Mobile First
   ========================================================================== */

.page-hero {
    margin-top: 85px;
    background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-navy-dark) 100%);
    padding: 45px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c9a962' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.page-hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.page-hero h1 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    color: var(--color-warm-white);
    margin-bottom: 12px;
    line-height: 1.2;
}

.page-hero .subtitle {
    font-size: 0.95rem;
    color: var(--color-gold);
    font-weight: 500;
    letter-spacing: 0.5px;
    line-height: 1.5;
}

/* ==========================================================================
   Content Sections - Mobile First
   ========================================================================== */

.content-section {
    padding: 45px 20px;
}

.content-section.alt-bg {
    background: var(--color-warm-white);
}

.content-inner {
    max-width: 1100px;
    margin: 0 auto;
}

.section-label {
    font-size: 0.7rem;
    color: var(--color-gold);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
    font-weight: 600;
    display: block;
}

.content-section h2 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: var(--color-navy);
    margin-bottom: 20px;
    line-height: 1.25;
}

.content-section p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    margin-bottom: 16px;
    line-height: 1.75;
}

.content-section p:last-child {
    margin-bottom: 0;
}

/* Two Column Layout - Mobile First (stacked) */
.two-column {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.content-images {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.content-images img {
    width: 100%;
    height: auto;
    box-shadow: 0 6px 25px rgba(26, 39, 68, 0.1);
    border-radius: 4px;
}

/* Feature List */
.feature-list {
    list-style: none;
    margin: 20px 0;
}

.feature-list li {
    padding: 12px 0;
    padding-left: 28px;
    position: relative;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(26, 39, 68, 0.08);
    line-height: 1.6;
}

.feature-list li:last-child {
    border-bottom: none;
}

.feature-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--color-gold);
    font-weight: 700;
    font-size: 0.95rem;
}

/* ==========================================================================
   CTA Section - Mobile First
   ========================================================================== */

.cta-section {
    background: var(--color-gold);
    padding: 45px 20px;
    text-align: center;
}

.cta-section h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--color-navy-dark);
    margin-bottom: 10px;
    line-height: 1.2;
}

.cta-section p {
    color: var(--color-navy);
    font-size: 0.95rem;
    margin-bottom: 25px;
    opacity: 0.9;
    line-height: 1.6;
}

.cta-section .cta-button {
    background: var(--color-navy);
    color: var(--color-warm-white);
    border-color: var(--color-navy);
    padding: 16px 35px;
    font-size: 0.85rem;
    width: 100%;
    max-width: 280px;
}

.cta-section .cta-button:hover,
.cta-section .cta-button:active {
    background: var(--color-navy-dark);
    border-color: var(--color-navy-dark);
}

.cta-section .phone {
    display: block;
    font-family: var(--font-display);
    font-size: 1.6rem;
    color: var(--color-navy-dark);
    margin-top: 20px;
    text-decoration: none;
    font-weight: 600;
}

/* ==========================================================================
   Footer - Mobile First
   ========================================================================== */

footer {
    background: var(--color-navy-dark);
    padding: 45px 20px 25px;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.footer-brand .logo-text {
    font-size: 1.2rem;
    margin-bottom: 12px;
    display: block;
    color: var(--color-warm-white);
    font-family: var(--font-display);
}

.footer-brand p {
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    line-height: 1.7;
}

.footer-links h4,
.footer-contact h4 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    color: var(--color-gold);
    margin-bottom: 15px;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.3s ease;
    display: inline-block;
    padding: 3px 0;
}

.footer-links a:hover,
.footer-links a:active {
    color: var(--color-gold);
}

.footer-contact p {
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    margin-bottom: 6px;
    line-height: 1.6;
}

.footer-contact a {
    color: var(--color-gold);
    text-decoration: none;
}

.footer-bottom {
    margin-top: 35px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    color: rgba(255,255,255,0.5);
    font-size: 0.75rem;
}

/* ==========================================================================
   Contact Page - Mobile First
   ========================================================================== */

.contact-grid {
    display: flex;
    flex-direction: column;
    gap: 35px;
}

.contact-form {
    background: var(--color-warm-white);
    padding: 25px 20px;
    box-shadow: 0 8px 35px rgba(26, 39, 68, 0.1);
    border-radius: 4px;
}

.contact-form h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--color-navy);
    margin-bottom: 22px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-navy);
    margin-bottom: 7px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 14px 15px;
    border: 1px solid rgba(26, 39, 68, 0.15);
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 16px; /* Prevents iOS zoom */
    background: var(--color-cream);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-gold);
    box-shadow: 0 0 0 3px rgba(201, 169, 98, 0.2);
}

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

.form-group select {
    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='%231a2744' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

.submit-btn {
    background: var(--color-navy);
    color: var(--color-warm-white);
    padding: 16px 28px;
    border: none;
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.3s ease;
    width: 100%;
    -webkit-appearance: none;
}

.submit-btn:hover,
.submit-btn:active {
    background: var(--color-gold);
    color: var(--color-navy-dark);
}

.contact-info {
    padding: 15px 0;
}

.contact-info h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--color-navy);
    margin-bottom: 22px;
}

.info-item {
    display: flex;
    gap: 15px;
    margin-bottom: 22px;
    padding-bottom: 22px;
    border-bottom: 1px solid rgba(26, 39, 68, 0.1);
}

.info-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.info-icon {
    width: 42px;
    height: 42px;
    background: var(--color-navy);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 4px;
}

.info-icon svg {
    width: 18px;
    height: 18px;
    fill: var(--color-gold);
}

.info-content h4 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    color: var(--color-navy);
    margin-bottom: 4px;
}

.info-content p {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.5;
}

.info-content a {
    color: var(--color-gold);
    text-decoration: none;
    font-weight: 500;
}

/* Map Container */
.map-container {
    margin-top: 25px;
    height: 220px;
    background: var(--color-navy-dark);
    border-radius: 4px;
    overflow: hidden;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ==========================================================================
   Animations
   ========================================================================== */

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

.page-hero-content {
    animation: fadeInUp 0.5s ease-out forwards;
}

/* ==========================================================================
   Small Phones (min-width: 375px)
   ========================================================================== */

@media (min-width: 375px) {
    .logo-text {
        font-size: 1.1rem;
    }

    .logo-tagline {
        display: block;
    }

    .page-hero h1 {
        font-size: 2.2rem;
    }

    .content-section h2 {
        font-size: 1.9rem;
    }
}

/* ==========================================================================
   Tablet Styles (min-width: 600px)
   ========================================================================== */

@media (min-width: 600px) {
    .header-top a {
        font-size: 0.8rem;
    }

    .header-main {
        padding: 15px 25px;
    }

    .logo-img {
        height: 50px;
        width: 50px;
    }

    .logo-text {
        font-size: 1.25rem;
    }

    .logo-tagline {
        font-size: 0.65rem;
        letter-spacing: 1.5px;
    }

    .page-hero {
        margin-top: 95px;
        padding: 55px 30px;
    }

    .page-hero h1 {
        font-size: 2.6rem;
    }

    .page-hero .subtitle {
        font-size: 1.05rem;
    }

    .content-section {
        padding: 60px 30px;
    }

    .content-section h2 {
        font-size: 2.1rem;
    }

    .content-section p {
        font-size: 1rem;
    }

    .content-images {
        flex-direction: row;
    }

    .content-images img {
        flex: 1;
        min-width: 0;
    }

    .cta-section {
        padding: 60px 30px;
    }

    .cta-section h2 {
        font-size: 2.2rem;
    }

    .cta-section .cta-button {
        width: auto;
    }

    .cta-section .phone {
        font-size: 1.9rem;
    }

    .footer-inner {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 35px;
    }

    .contact-form {
        padding: 35px 30px;
    }

    .contact-form h3,
    .contact-info h3 {
        font-size: 1.7rem;
    }

    .map-container {
        height: 280px;
    }
}

/* ==========================================================================
   Desktop Styles (min-width: 992px)
   ========================================================================== */

@media (min-width: 992px) {
    /* Header - Desktop */
    .mobile-toggle {
        display: none;
    }

    .nav-overlay {
        display: none !important;
    }

    nav {
        position: static;
        width: auto;
        height: auto;
        background: transparent;
        padding-top: 0;
        overflow: visible;
    }

    nav > ul {
        display: flex;
        gap: 28px;
    }

    nav > ul > li {
        border-bottom: none;
        position: relative;
    }

    nav > ul > li > a {
        padding: 5px 0;
        font-size: 0.82rem;
        position: relative;
    }

    nav > ul > li > a::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        width: 0;
        height: 2px;
        background: var(--color-gold);
        transition: width 0.3s ease;
    }

    nav > ul > li > a:hover::after {
        width: 100%;
    }

    /* Desktop Dropdown */
    .dropdown {
        position: absolute;
        top: 100%;
        left: 0;
        background: var(--color-navy-dark);
        min-width: 210px;
        padding: 12px 0;
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: all 0.3s ease;
        box-shadow: 0 10px 30px rgba(0,0,0,0.2);
        border-top: 2px solid var(--color-gold);
        display: block;
    }

    nav > ul > li:hover .dropdown {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .dropdown li a {
        padding: 10px 22px;
    }

    .dropdown li a:hover {
        padding-left: 28px;
    }

    .header-cta {
        display: block;
    }

    .header-main {
        max-width: 1200px;
        margin: 0 auto;
        padding: 15px 40px;
    }

    .logo-img {
        height: 55px;
        width: 55px;
    }

    .logo-text {
        font-size: 1.45rem;
    }

    .logo-tagline {
        font-size: 0.6rem;
        letter-spacing: 2.5px;
    }

    /* Page Hero - Desktop */
    .page-hero {
        margin-top: 108px;
        padding: 75px 40px;
    }

    .page-hero h1 {
        font-size: 3.2rem;
    }

    .page-hero .subtitle {
        font-size: 1.1rem;
    }

    /* Content - Desktop */
    .content-section {
        padding: 75px 40px;
        max-width: 1100px;
        margin: 0 auto;
    }

    .content-section.alt-bg {
        max-width: 100%;
    }

    .content-section.alt-bg .content-inner {
        max-width: 1100px;
        margin: 0 auto;
    }

    .section-label {
        font-size: 0.72rem;
        letter-spacing: 3.5px;
    }

    .content-section h2 {
        font-size: 2.4rem;
    }

    .content-section p {
        font-size: 1.02rem;
    }

    .two-column {
        flex-direction: row;
        gap: 55px;
        align-items: center;
    }

    .two-column .content-text {
        flex: 1.2;
    }

    .two-column .content-images {
        flex: 1;
        flex-direction: column;
    }

    .two-column.reverse {
        flex-direction: row-reverse;
    }

    .feature-list li {
        font-size: 0.98rem;
        padding: 14px 0 14px 32px;
    }

    /* CTA - Desktop */
    .cta-section {
        padding: 75px 40px;
    }

    .cta-section h2 {
        font-size: 2.6rem;
    }

    .cta-section .phone {
        font-size: 2.1rem;
    }

    /* Footer - Desktop */
    footer {
        padding: 55px 40px 30px;
    }

    .footer-inner {
        max-width: 1100px;
        margin: 0 auto;
        grid-template-columns: 1.5fr 1fr 1fr;
        gap: 55px;
    }

    .footer-brand .logo-text {
        font-size: 1.35rem;
    }

    /* Contact - Desktop */
    .contact-grid {
        flex-direction: row;
        gap: 55px;
    }

    .contact-grid > * {
        flex: 1;
    }

    .contact-form {
        padding: 45px;
    }

    .contact-form h3,
    .contact-info h3 {
        font-size: 1.8rem;
    }

    .map-container {
        height: 320px;
    }
}

/* ==========================================================================
   Large Desktop (min-width: 1200px)
   ========================================================================== */

@media (min-width: 1200px) {
    nav > ul {
        gap: 35px;
    }

    .page-hero h1 {
        font-size: 3.6rem;
    }

    .content-section h2 {
        font-size: 2.6rem;
    }
}

/* ==========================================================================
   Touch Device Optimizations
   ========================================================================== */

@media (hover: none) and (pointer: coarse) {
    .cta-button:active {
        transform: scale(0.98);
    }

    nav > ul > li > a:active {
        background: rgba(201, 169, 98, 0.1);
    }

    .dropdown li a:active {
        background: rgba(201, 169, 98, 0.15);
    }

    /* Larger touch targets */
    nav > ul > li > a {
        min-height: 48px;
        display: flex;
        align-items: center;
    }

    .dropdown li a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    header,
    .cta-section,
    .mobile-toggle,
    nav {
        display: none !important;
    }

    .page-hero {
        margin-top: 0;
        background: none !important;
        color: #000;
        padding: 20px 0;
    }

    .page-hero h1,
    .page-hero .subtitle {
        color: #000 !important;
    }

    body {
        background: #fff;
    }

    .content-section {
        padding: 20px 0;
    }
}
