/**
 * PRACTICE AREA PAGES — SHARED UI ENHANCEMENTS
 * Applied to all practice area detail pages (business-law, tax-law, etc.)
 * Enhances typography, card interactions, FAQ animations, and spacing
 * without modifying the monochrome color palette.
 *
 * Each page uses a unique prefix (biz-, tax-, hc-, etc.) for its inline styles.
 * This file layers generic, unprefixed enhancements over those page-specific rules.
 */

/* ===== ENHANCED BREADCRUMB ===== */
[class$="-breadcrumb"] {
    position: relative;
}
[class$="-breadcrumb"]::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, rgba(0,0,0,0.08), transparent 80%);
}

/* ===== HERO SECTION POLISH ===== */
[class$="-hero"] {
    position: relative;
    overflow: hidden;
}

/* Subtle grain texture overlay on hero */
[class$="-hero"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.015;
    pointer-events: none;
    z-index: 0;
}

/* Hero title — refined kerning & weight */
[class$="-hero-title"] {
    font-feature-settings: 'kern' 1, 'liga' 1;
    text-wrap: balance;
}

/* Hero badge — micro-interaction */
[class$="-badge"] {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.3s ease;
}
[class$="-badge"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Meta items — left-border grow animation */
[class$="-meta-item"] {
    transition: border-left-width 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                padding-left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
[class$="-meta-item"]:hover {
    border-left-width: 3px;
    padding-left: 16px;
}

/* ===== SECTION HEADERS ===== */
[class$="-section-tag"] {
    position: relative;
    padding-bottom: 8px;
}
[class$="-section-tag"]::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 24px;
    height: 2px;
    background: currentColor;
    opacity: 0.3;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Section title — improved typography */
[class$="-section-title"] {
    font-feature-settings: 'kern' 1, 'liga' 1;
    text-wrap: balance;
}

/* ===== CARDS — ENHANCED INTERACTIONS ===== */
/* Practice pillar cards */
[class$="-card"] {
    transition: border-color 0.3s ease,
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

@media (hover: hover) and (pointer: fine) {
    [class$="-card"]:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 32px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.04);
    }
}

[class$="-card"]:active {
    transform: translateY(-1px) scale(0.995);
    transition-duration: 0.1s;
}

/* Card number badge — subtle animation */
[class$="-card-num"] {
    transition: letter-spacing 0.3s ease;
}
[class$="-card"]:hover [class$="-card-num"] {
    letter-spacing: 2px;
}

/* Card title — underline grow on hover */
[class$="-card-title"] {
    position: relative;
    display: inline;
    background-image: linear-gradient(currentColor, currentColor);
    background-position: 0% 100%;
    background-repeat: no-repeat;
    background-size: 0% 1px;
    transition: background-size 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
[class$="-card"]:hover [class$="-card-title"] {
    background-size: 100% 1px;
}

/* Card tags — stagger fade on hover */
[class$="-card-tag"] {
    transition: transform 0.25s ease, opacity 0.25s ease;
}
[class$="-card"]:hover [class$="-card-tag"] {
    transform: translateY(-1px);
}

/* ===== TABLE ENHANCEMENTS ===== */
.table-responsive {
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    overflow: hidden;
}

[class$="-table"] th {
    position: relative;
}

[class$="-table"] td {
    transition: background-color 0.2s ease, padding-left 0.2s ease;
}

[class$="-table"] tr:hover td {
    padding-left: 24px;
}

/* ===== TIMELINE CARDS ===== */
[class$="-timeline-card"] {
    transition: border-color 0.3s ease,
                box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

@media (hover: hover) and (pointer: fine) {
    [class$="-timeline-card"]:hover {
        border-color: #0a0a0a;
        box-shadow: 0 6px 24px rgba(0,0,0,0.05);
        transform: translateY(-3px);
    }
}

/* Timeline step number — grow on hover */
[class$="-timeline-step"] {
    transition: letter-spacing 0.3s ease, color 0.3s ease;
}
[class$="-timeline-card"]:hover [class$="-timeline-step"] {
    letter-spacing: 2px;
    color: #0a0a0a;
}

/* ===== FAQ ACCORDIONS — SMOOTH ANIMATIONS ===== */
[class$="-faq-item"] {
    transition: border-color 0.3s ease,
                box-shadow 0.3s ease;
    overflow: hidden;
}

[class$="-faq-item"][open] {
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}

[class$="-faq-summary"] {
    transition: padding-left 0.25s ease;
    user-select: none;
    -webkit-user-select: none;
}

[class$="-faq-summary"]:hover {
    padding-left: 30px;
}

/* FAQ icon rotation — smoother */
[class$="-faq-icon"] {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-block;
}

/* FAQ answer — slide-in animation */
[class$="-faq-answer"] {
    animation: faqSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes faqSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== CTA BANNER ===== */
[class$="-cta-banner"] {
    position: relative;
    overflow: hidden;
}

/* Subtle animated grain on dark CTA */
[class$="-cta-banner"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.04;
    pointer-events: none;
    z-index: 0;
}

[class$="-cta-banner"] > * {
    position: relative;
    z-index: 1;
}

/* CTA buttons — enhanced hover */
[class^="btn-cta-"] {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

[class^="btn-cta-"]:active {
    transform: translateY(0) scale(0.97);
    transition-duration: 0.1s;
}

/* Primary action buttons — refined */
[class$="-primary"],
[class$="-outline"] {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

[class$="-primary"]:active,
[class$="-outline"]:active {
    transform: scale(0.97);
    transition-duration: 0.1s;
}

/* ===== IMPROVED SECTION DIVIDERS ===== */
[class$="-section"],
[class$="-section-alt"] {
    position: relative;
}

/* ===== MOBILE REFINEMENTS ===== */
@media (max-width: 768px) {
    /* Better touch targets on mobile */
    [class$="-faq-summary"] {
        min-height: 52px;
    }
    
    /* Card padding consistency */
    [class$="-card"] {
        padding: 24px 18px;
    }
    
    /* Timeline cards — stack nicely */
    [class$="-timeline-card"] {
        padding: 22px 18px;
    }
    
    /* Hero lead — more line-height on mobile */
    [class$="-hero-lead"] {
        line-height: 1.8;
    }
    
    /* Meta items — full-width on small screens */
    [class$="-hero-meta"] {
        gap: 14px;
    }
    
    /* CTA buttons — full-width stacked */
    [class$="-cta-actions"] {
        flex-direction: column;
        align-items: center;
    }
    
    [class$="-cta-actions"] a {
        width: 100%;
        max-width: 320px;
        text-align: center;
        justify-content: center;
    }
    
    /* Disable hover padding shift on touch */
    [class$="-faq-summary"]:hover {
        padding-left: inherit;
    }
    
    [class$="-table"] tr:hover td {
        padding-left: 20px;
    }
}

/* ===== TABLET REFINEMENTS ===== */
@media (min-width: 769px) and (max-width: 1024px) {
    [class$="-hero"] {
        padding: 60px 0 40px;
    }
    
    [class$="-section"],
    [class$="-section-alt"] {
        padding: 60px 0;
    }
    
    [class$="-grid-3"] {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    [class$="-hero"]::before,
    [class$="-cta-banner"]::before {
        display: none;
    }
    
    [class$="-card"],
    [class$="-timeline-card"],
    [class$="-faq-item"] {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    [class$="-card"],
    [class$="-timeline-card"],
    [class$="-faq-icon"],
    [class$="-faq-answer"],
    [class$="-badge"],
    [class$="-meta-item"],
    [class$="-card-title"],
    [class$="-card-num"],
    [class$="-card-tag"],
    [class$="-faq-summary"],
    [class^="btn-cta-"],
    [class$="-primary"],
    [class$="-outline"] {
        transition: none !important;
        animation: none !important;
    }
}
