/* ==========================================
   HR1 SNAP Work Requirements Visual Explainer
   Mobile-first responsive design
   ========================================== */

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

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: #1a202c;
    background-color: #f7fafc;
    font-feature-settings: 'tnum'; /* Tabular numbers */
}

/* ==========================================
   Typography
   ========================================== */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2rem; /* 32px */
    color: #2c5282;
}

h2 {
    font-size: 1.5rem; /* 24px */
    color: #2c5282;
}

h3 {
    font-size: 1.25rem; /* 20px */
    color: #2d3748;
}

h4 {
    font-size: 1.125rem; /* 18px */
    color: #2d3748;
}

p {
    margin-bottom: 1rem;
}

a {
    color: #319795;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover,
a:focus {
    color: #2c7a7b;
    text-decoration: underline;
}

ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

li {
    margin-bottom: 0.5rem;
}

strong {
    font-weight: 600;
    color: #2d3748;
}

/* ==========================================
   Layout Containers
   ========================================== */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ==========================================
   Hero Section
   ========================================== */
.hero {
    background: linear-gradient(135deg, #2c5282 0%, #2d3748 100%);
    color: white;
    padding: 3rem 1rem;
    text-align: center;
}

.hero h1 {
    color: white;
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.hero .subtitle {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

/* ==========================================
   Summary Section
   ========================================== */
.summary-section {
    padding: 2rem 0;
    text-align: center;
}

.summary-text {
    font-size: 1.125rem;
    max-width: 700px;
    margin: 0 auto;
}

.card-explainer {
    background: #f7fafc;
    border-left: 4px solid #319795;
    padding: 1rem 1.25rem;
    margin-top: 1.5rem;
    border-radius: 4px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.card-explainer p {
    margin: 0;
    font-size: 0.95rem;
    color: #2d3748;
}

/* ==========================================
   Change Cards
   ========================================== */
.change-card {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.change-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.card-header {
    display: flex;
    align-items: center;
    padding: 1.25rem;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.card-header:hover,
.card-header:focus {
    background-color: #f7fafc;
}

.card-header:focus {
    outline: 2px solid #319795;
    outline-offset: -2px;
}

.card-title-group {
    flex: 1;
}

.card-title {
    margin-bottom: 0.25rem;
    font-size: 1.25rem;
}

.card-summary {
    color: #718096;
    margin: 0;
    font-size: 0.938rem;
}

.share-card-btn {
    background: none;
    border: none;
    color: #319795;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: auto;
    margin-right: 0.5rem;
    opacity: 0.7;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.share-card-btn:hover {
    opacity: 1;
}

.share-card-btn svg {
    display: block;
}

.expand-icon {
    font-size: 1.5rem;
    color: #718096;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.card-header[aria-expanded="true"] .expand-icon {
    transform: rotate(45deg);
}

.copy-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: #2d3748;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s;
}

.copy-toast.fade-out {
    opacity: 0;
}

/* Capture states for share-as-image */
.share-card-btn.sharing {
    opacity: 0.3;
    pointer-events: none;
}

.capturing-card .share-card-btn,
.capturing-card .expand-icon {
    visibility: hidden !important;
}

.capture-watermark {
    display: none;
    text-align: right;
    font-size: 0.75rem;
    color: #a0aec0;
    padding: 0.5rem 1.25rem;
}

.capturing-card .capture-watermark {
    display: block;
}

.card-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

.card-content[aria-hidden="false"] {
    max-height: 5000px; /* Large enough for content */
    padding: 1.5rem 1.25rem;
    border-top: 1px solid #e2e8f0;
}

/* ==========================================
   Visualizations
   ========================================== */
.viz-container {
    margin-bottom: 2rem;
}

.visualization {
    margin: 1rem 0;
    min-height: 150px;
}

.viz-caption {
    color: #4a5568;
    font-size: 0.938rem;
    text-align: center;
    margin-top: 1rem;
}

/* Age visualization specific */
#age-viz {
    min-height: 200px;
}

/* Parent visualization specific */
#parent-viz {
    min-height: 200px;
}

/* Exemptions table */
#exemptions-viz table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

#exemptions-viz th,
#exemptions-viz td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

#exemptions-viz th {
    background-color: #f7fafc;
    font-weight: 600;
    color: #2d3748;
}

#exemptions-viz td {
    color: #4a5568;
}

#exemptions-viz .status-yes {
    color: #38a169;
    font-weight: 600;
}

#exemptions-viz .status-no {
    color: #e53e3e;
    font-weight: 600;
}

/* ==========================================
   Detail Sections
   ========================================== */
.detail-section {
    margin-top: 2rem;
}

.detail-section h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #2c5282;
}

/* ==========================================
   Positive Change Callout
   ========================================== */
.positive-change-callout {
    background: #c6f6d5;
    border-left: 4px solid #38a169;
    padding: 1.25rem;
    margin: 1.5rem 0;
    border-radius: 6px;
}

.positive-change-callout h4 {
    color: #22543d;
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
}

.positive-change-callout p {
    color: #22543d;
    margin: 0;
}

/* ==========================================
   Additional Changes Note
   ========================================== */
.additional-changes-note {
    background: #edf2f7;
    border-left: 4px solid #4a5568;
    padding: 1.25rem;
    margin: 2rem auto;
    border-radius: 6px;
    max-width: 900px;
}

.additional-changes-note p {
    margin: 0;
    font-size: 0.95rem;
    color: #2d3748;
}

/* ==========================================
   Timeline Section
   ========================================== */
.timeline-section {
    background-color: white;
    border-radius: 12px;
    padding: 2rem 1.25rem;
    margin: 2rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.timeline-section h2 {
    text-align: center;
    margin-bottom: 2rem;
}

#timeline-viz {
    min-height: 250px;
    margin-bottom: 2rem;
}

.timeline-details {
    margin: 2rem 0;
}

.timeline-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    border-left: 3px solid #319795;
}

.timeline-date {
    font-weight: 700;
    color: #2c5282;
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.timeline-item p {
    color: #4a5568;
    margin: 0;
}

.state-exceptions {
    margin-top: 2rem;
    padding: 1.25rem;
    background-color: #edf2f7;
    border-radius: 8px;
}

.state-exceptions h3 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
}

.states-list {
    color: #2d3748;
    padding-left: 1.5rem;
    margin: 0.5rem 0;
}

.states-list li {
    margin-bottom: 0.4rem;
}

/* ==========================================
   What Happens Next Section
   ========================================== */
.what-next-section {
    padding: 2rem 0;
}

.what-next-section h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.info-block {
    background-color: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.info-block h3 {
    color: #2c5282;
    margin-bottom: 1rem;
}

.info-block-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.info-block-header h3 {
    margin-bottom: 0;
    flex: 1;
}

.info-block .note {
    font-size: 0.938rem;
    color: #718096;
    font-style: italic;
}

.cta-block {
    background-color: #edf2f7;
    border: 2px solid #319795;
}

.cta-block h3 {
    color: #2c7a7b;
}

/* ==========================================
   Sources Section
   ========================================== */
.sources-section {
    padding: 2rem 0 3rem;
}

.sources-section h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.sources-block,
.methodology-block {
    background-color: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sources-block h3,
.methodology-block h3 {
    color: #2c5282;
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.sources-block ul {
    list-style-type: none;
    margin-left: 0;
}

.sources-block li {
    margin-bottom: 1rem;
}

.methodology-block p {
    font-size: 0.938rem;
    line-height: 1.7;
}

/* ==========================================
   Footer
   ========================================== */
.footer {
    background-color: #2d3748;
    color: #cbd5e0;
    padding: 2rem 1rem;
    text-align: center;
    margin-top: 3rem;
}

.footer p {
    font-size: 0.938rem;
    margin-bottom: 0.5rem;
}

.footer a {
    color: #81e6d9;
}

.footer a:hover,
.footer a:focus {
    color: #4fd1c5;
}

/* ==========================================
   Federal Definition Tooltips
   ========================================== */
.def-tooltip {
    position: relative;
    border-bottom: 1px dotted #718096;
    cursor: help;
}

.def-tooltip::after {
    content: attr(data-tip);
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 6px;
    width: 280px;
    max-width: 80vw;
    background: #2d3748;
    color: #fff;
    font-size: 0.813rem;
    font-weight: 400;
    line-height: 1.5;
    padding: 0.625rem 0.75rem;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

/* Only show on devices that support hover */
@media (hover: hover) {
    .def-tooltip:hover::after,
    .def-tooltip:focus::after {
        opacity: 1;
        visibility: visible;
    }
}

/* Keyboard accessibility */
.def-tooltip:focus {
    outline: 2px solid #319795;
    outline-offset: 2px;
    border-radius: 2px;
}

.def-tooltip:focus::after {
    opacity: 1;
    visibility: visible;
}

/* ==========================================
   Responsive Design - Tablet and Up
   ========================================== */
@media (min-width: 640px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .card-title {
        font-size: 1.5rem;
    }

    .timeline-item {
        flex-direction: row;
        align-items: baseline;
    }

    .timeline-date {
        min-width: 180px;
        margin-right: 1rem;
        margin-bottom: 0;
    }
}

/* ==========================================
   Responsive Design - Desktop
   ========================================== */
@media (min-width: 1024px) {
    .container {
        padding: 0 2rem;
    }

    .hero {
        padding: 4rem 2rem;
    }

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

    .summary-section {
        padding: 3rem 0;
    }
}

/* ==========================================
   Accessibility - Reduced Motion
   ========================================== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==========================================
   Print Styles
   ========================================== */
@media print {
    .hero,
    .footer {
        display: none;
    }

    .card-content {
        max-height: none !important;
        display: block !important;
    }

    body {
        background-color: white;
    }

    .change-card {
        page-break-inside: avoid;
    }
}
