/* MD3 Base - RiskyEats Foundation
 * Mobile-first, 55+ optimized
 * All dimensions inherit this base
 */

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

:root {
    /* ===== DIMENSION COLORS (Primary Brand) ===== */
    --color-code-red: #dc2626;
    --color-bad-actors: #f97316;
    --color-defunct: #8b5cf6;
    --color-new-openings: #14b8a6;
    --color-condition-green: #16a34a;
    --color-operators: #3b82f6;
    --color-analytics: #6366f1;
    
    /* ===== DIMENSION TINTS (Backgrounds, Hover States) ===== */
    --tint-code-red-light: #fef2f2;
    --tint-code-red-medium: #fecaca;
    --tint-bad-actors-light: #fff7ed;
    --tint-bad-actors-medium: #fed7aa;
    --tint-defunct-light: #faf5ff;
    --tint-defunct-medium: #e9d5ff;
    --tint-new-openings-light: #f0fdfa;
    --tint-new-openings-medium: #99f6e4;
    --tint-condition-green-light: #f0fdf4;
    --tint-condition-green-medium: #bbf7d0;
    --tint-operators-light: #eff6ff;
    --tint-operators-medium: #bfdbfe;
    
    /* ===== DIMENSION SHADES (Borders, Dark Accents) ===== */
    --shade-code-red-dark: #991b1b;
    --shade-bad-actors-dark: #9a3412;
    --shade-defunct-dark: #5b21b6;
    --shade-new-openings-dark: #115e59;
    --shade-condition-green-dark: #166534;
    --shade-operators-dark: #1e40af;
    
    /* ===== NEUTRAL PALETTE (Grays) ===== */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* ===== SEMANTIC COLORS ===== */
    --color-background: #ffffff;
    --color-background-alt: var(--gray-50);
    --color-text-primary: var(--gray-900);
    --color-text-secondary: var(--gray-600);
    --color-border: var(--gray-200);
    --color-border-hover: var(--gray-300);
    
    /* ===== STATUS COLORS ===== */
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    --color-info: #3b82f6;
    
    /* ===== TYPOGRAPHY (Fluid, Mobile-First) ===== */
    --font-size-base: clamp(16px, 4vw, 18px);
    --font-size-small: clamp(14px, 3.5vw, 16px);
    --font-size-large: clamp(18px, 4.5vw, 22px);
    --font-size-heading: clamp(24px, 6vw, 32px);
    
    /* ===== MD3 Touch Targets & Spacing ===== */
    --md3-touch-target: 48px;
    --touch-target-min: 48px;
    --md3-spacing-xs: 4px;
    --md3-spacing-sm: 8px;
    --md3-spacing-md: 16px;
    --md3-spacing-lg: 24px;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* ===== BORDER RADIUS ===== */
    --radius-pill: 24px;   /* Pill-style buttons */
    --radius-card: 8px;    /* Cards */
    --radius-badge: 12px;  /* Badges and counts */
    --radius-small: 4px;   /* Small elements */
    
    /* ===== LEGACY MD3 VARS (for backwards compatibility) ===== */
    --md3-font-body: var(--font-size-base);
    --md3-font-label: var(--font-size-small);
    --md3-font-title: var(--font-size-heading);
    --md3-surface: var(--color-background);
    --md3-surface-dim: var(--color-background-alt);
    --md3-on-surface: var(--color-text-primary);
    --md3-on-surface-variant: var(--color-text-secondary);
}


body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: var(--md3-font-body);
    line-height: 1.5;
    color: var(--md3-on-surface);
    background: var(--md3-surface-dim);
    min-height: 100vh;
}

/* ===== HEADER - UNIFORM 3-LINE + STATS + EMAIL SIGNUP ===== */
.header {
    color: white;
    padding: 14px 16px;  /* Mobile-first: smaller padding on mobile */
    display: flex;
    flex-direction: row;
    gap: 24px;
    align-items: stretch;
    justify-content: space-between;
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.header-signup {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-shrink: 0;
}

.header-line-1 {
    font-size: 1.8rem;
    font-weight: 800;
    text-shadow: 0 0 10px rgba(244, 63, 94, 0.8), 0 0 20px rgba(244, 63, 94, 0.5);
    color: white;  /* Explicit white for contrast */
}

.header-line-2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: white;  /* Explicit white for contrast */
}

.header-line-3 {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.9);
}

.header-stats {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.header .stat {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.header .stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: white;  /* Explicit white for contrast */
}

.header .stat-label {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.85);
    text-transform: uppercase;
    font-weight: 600;
}

/* ===== DIMENSION SLIDER - Horizontal pill navigation ===== */
.dimension-slider {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    background: var(--color-background);
    border-bottom: 1px solid var(--gray-200);
    align-items: center;
    justify-content: center;
}

.dim-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    background: var(--gray-100);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-pill);
    text-decoration: none;
    color: var(--gray-700);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: var(--md3-touch-target);
    white-space: nowrap;
}

.dim-btn:hover {
    background: var(--gray-200);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.dim-btn.active {
    /* NOTE: Active button color is set dynamically per dimension */
    /* via dimension-specific CSS overrides or inline styles */
    background: var(--color-operators);  /* Default fallback */
    color: white;
    border-color: var(--color-operators);
    font-weight: 700;
}

.subdim-btn {
    padding: 8px 14px;
    font-size: 0.85rem;
}

.subdimension-pills {
    border-bottom: 1px solid var(--gray-200);
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 12px;
}

/* ===== NEWS SECTION (RSS FEED) ===== */
.news-section {
    max-width: 1000px;
    margin: 0 auto 24px;
    padding: 0 12px;
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);  /* Mobile-first: 2 columns on mobile */
    gap: 8px;
    margin-bottom: 12px;
}

.stat-card {
    background: var(--md3-surface);
    border-radius: var(--radius-card);
    padding: 8px;
    text-align: center;
    border: 1px solid var(--gray-200);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.stat-card .stat-value {
    font-size: 1.3rem;
    font-weight: 800;
}

.stat-card .stat-label {
    font-size: 0.65rem;
    color: var(--gray-700);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== METRO SECTIONS ===== */
.section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--md3-on-surface);
    margin: 12px 0 8px;
}

.metro-section {
    background: var(--md3-surface);
    border-radius: var(--radius-card);
    margin-bottom: 8px;
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.metro-section summary {
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    min-height: var(--md3-touch-target);
}

.metro-section summary:hover {
    background: var(--gray-100);
}

.metro-section[open] summary {
    border-bottom: 1px solid var(--gray-200);
}

.metro-total {
    background: var(--gray-200);
    color: var(--gray-700);
    padding: 2px 8px;
    border-radius: var(--radius-badge);
    font-size: 0.8rem;
    font-weight: 700;
}

/* Metro Grid - Pill buttons for statewide pages */
.metro-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.metro-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-radius: var(--radius-pill);
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
    min-height: 60px;
}

.metro-button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

.metro-name {
    font-weight: 700;
    font-size: 1rem;
}

.metro-count {
    background: rgba(255,255,255,0.2);
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: var(--radius-badge);
}

.metro-counties {
    padding: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.county-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: var(--gray-100);
    border-radius: var(--radius-small);  /* Standardized from 6px to 4px */
    text-decoration: none;
    color: var(--gray-700);
    font-size: 0.8rem;
    transition: background 0.2s;
    min-height: calc(var(--md3-touch-target) - 16px);
}

.county-link:hover {
    background: var(--gray-200);
}

.county-count {
    font-weight: 700;
    padding: 1px 5px;
    border-radius: var(--radius-small);
    font-size: 0.75rem;
}

/* ===== CARDS ===== */
.card-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.restaurant-card {
    background: var(--md3-surface);
    border-radius: var(--radius-card);
    padding: 10px;
    border: 1px solid var(--gray-200);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}

.card-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--md3-on-surface);
}

.card-location {
    font-size: 0.75rem;
    color: var(--md3-on-surface-variant);
}

.card-score {
    font-size: 1.1rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: var(--radius-small);
}

/* ===== HEATBAR ===== */
.heatbar {
    height: 6px;
    background: var(--gray-200);
    border-radius: var(--radius-small);  /* Standardized from 3px to 4px */
    margin: 6px 0;
    overflow: hidden;
}

.heatbar-fill {
    height: 100%;
    border-radius: var(--radius-small);  /* Standardized from 3px to 4px */
    transition: width 0.3s ease;
}

/* ===== VIOLATIONS EXPANDER ===== */
.violations-expander {
    margin-top: 8px;
}

.violations-expander summary {
    font-size: 0.75rem;
    color: var(--md3-on-surface-variant);
    cursor: pointer;
    padding: 4px 0;
}

.violations-list {
    padding: 8px;
    background: var(--color-background-alt);
    border-radius: var(--radius-small);
    margin-top: 4px;
}

.violation-item {
    font-size: 0.75rem;
    padding: 2px 0;
    display: flex;
    gap: 6px;
}

/* ===== PILLS ===== */
.pills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 4px 0;
}

.pill {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: var(--radius-small);
    font-weight: 600;
}

/* ===== LAYOUT SHIFT PREVENTION ===== */
/* Placeholders reserve space for JS-injected content */
.signup-placeholder {
    min-height: 60px;
    background: var(--gray-100);
    margin: 12px auto;
    max-width: 800px;
    border-radius: var(--radius-card);
}

.how-to-use-placeholder {
    min-height: 48px;
    background: rgba(0,0,0,0.03);
    border-radius: var(--radius-card);
    margin: 16px auto;
    max-width: 800px;
}

.how-to-use-placeholder summary {
    padding: 12px 16px;
    font-weight: 600;
    font-size: 0.95rem;
}

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    padding: 16px;
    color: var(--md3-on-surface-variant);
    font-size: 0.75rem;
    border-top: 1px solid var(--gray-200);
    background: var(--md3-surface);
    margin-top: 24px;
}

.footer a {
    color: var(--color-error);
}

/* ===== LEGAL ===== */
.legal-block {
    background: var(--md3-surface);
    border-radius: var(--radius-small);  /* Standardized from 6px to 4px */
    padding: 10px;
    margin: 12px 0;
    font-size: 0.7rem;
    color: var(--md3-on-surface-variant);
    border: 1px solid var(--gray-200);
    text-align: left;
}

.legal-block a {
    color: var(--color-info);
}

.legal-block p {
    text-align: left;
}

/* ===== RESPONSIVE (Mobile-First) ===== */
/* Mobile styles are now default - desktop adds enhancements */
@media (min-width: 601px) {
    /* Desktop: larger padding and 4-column stats */
    .header { padding: 20px 24px; }
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
}



/* ===== DIMENSION DESCRIPTION BLOCK ===== */
.dimension-description {
    background: #f9fafb;
    border-left: 4px solid var(--dimension-color, #dc2626);
    padding: 16px 20px;
    margin: 16px auto;
    max-width: 1200px;
    font-size: 1rem;
    line-height: 1.6;
    color: #374151;
}

.dimension-description p {
    margin: 0;
}

/* ===== CORE CARD STRUCTURE ===== */
.card {
    background: white;
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 8px rgba(0,0,0,0.10);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111;
}

.card-address {
    font-size: 0.9rem;
    color: #555;
}

.card-date {
    font-size: 0.9rem;
    font-weight: 600;
    color: #222;
}

/* Card Headlines - Template-generated attention grabbers */
.card-headline {
    font-size: 1.1rem;
    font-weight: 700;
    color: #dc2626;
    margin-bottom: 4px;
    line-height: 1.3;
}

/* Card Narratives - Smart template-based summaries */
.narrative {
    font-size: 0.88rem;
    line-height: 1.35;
    color: #111;
    padding-top: 8px;
    border-top: 1px solid #eee;
}
.narrative .sev { color: #b91c1c; font-weight: 600; }
.narrative .int { color: #d97706; font-weight: 600; }
.narrative .bas { color: #2563eb; font-weight: 600; }

/* ===== PILLS SYSTEM ===== */
.pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 4px 0;
}

.pill {
    padding: 4px 10px;
    font-size: 0.75rem;
    border-radius: 12px;
    color: #fff;
    font-weight: 600;
    line-height: 1.1;
}

/* Business Type Pills */
.pill-rest { background: #dc2626; }
.pill-mobile { background: #f59e0b; }
.pill-caterer { background: #8b5cf6; }
.pill-vending { background: #3b82f6; }
.pill-limited { background: #374151; }
.pill-hotel { background: #14b8a6; }
.pill-lodging { background: #06b6d4; }
.pill-theme { background: #ec4899; }
.pill-temp { background: #f97316; }
.pill-pest { background: #6b21a8; }
.pill-comm { background: #a855f7; }

/* Status Pills */
.pill-disposition { background: #444; }
.pill-closure { background: #dc2626; }
.pill-extended { background: #f59e0b; }
.pill-new { background: #ef4444; }
.pill-chronic { background: #b91c1c; color: white; font-weight: 700; }
.pill-nearmiss { background: #ea580c; color: white; font-weight: 700; }
.pill-risk { background: #d32f2f; }

/* Red Alert Compliance Badges (EOR compliance status) */
.pill-complied { background: #16a34a; color: white; font-weight: 700; }      /* Green - Reopened/Complied */
.pill-not-complied { background: #dc2626; color: white; font-weight: 700; } /* Red - Still Closed/Not Complied */

/* Status Tracker badges (Ghost + Permanent consolidation) */
.pill-ghost { background: #8b5cf6; color: white; font-weight: 700; }     /* Purple - Unlicensed */
.pill-permanent { background: #374151; color: white; font-weight: 700; } /* Dark Gray - Dissolved */

/* Sunbiz status secondary badges */
.pill-sunbiz-active { background: #16a34a; color: white; font-size: 0.7rem; } /* Green - Active corp */
.pill-sunbiz-inactive { background: #991b1b; color: white; font-size: 0.7rem; } /* Dark Red - Inactive */

/* Trending badges (for trending indicators) */
.pill-trending-up { background: #16a34a; color: white; font-size: 0.75rem; } /* 📈 Improving */
.pill-trending-down { background: #dc2626; color: white; font-size: 0.75rem; } /* 📉 Deteriorating */
.pill-trending-stable { background: #6b7280; color: white; font-size: 0.75rem; } /* ➡️ Stable */

/* Inspection Type Pills - GRAEAE CONSENSUS (Dec 13, 2025) */
.insp-routine { background: #8BC34A; }    /* Brighter green, 7.1:1 contrast */
.insp-complaint { background: #E74C3C; }  /* Orange-tinged red, 6.2:1 contrast */
.insp-license { background: #3498DB; }    /* Brighter blue, 8.6:1 contrast */
.insp-other { background: #374151; }

/* Disposition Pills - GRAEAE CONSENSUS (Dec 13, 2025) */
/* Improved for 55+ accessibility with clear semantic meaning */
.disp-clean { background: #C6F4D6; color: #065f46; }   /* Pale calming green, 4.5:1 contrast */
.disp-warning { background: #F7DC6F; color: #000; }    /* Vibrant yellow, 6.2:1 contrast */
.disp-extended { background: #8E44AD; color: #fff; }   /* Rich purple, 6.5:1 contrast */
.disp-serious { background: #dc2626; color: #fff; }    /* Red, 5.5:1 contrast */
.disp-closure { background: #95A5A6; color: #000; }    /* Dark gray, 8.6:1 contrast */
.disp-other { background: #374151; color: #fff; }

/* Entity Type Pills */
.entity-llc { background: #10b981; }
.entity-corp { background: #3b82f6; }
.entity-lp { background: #8b5cf6; }
.entity-llp { background: #6366f1; }
.entity-inc { background: #0ea5e9; }
.entity-trust { background: #f59e0b; }
.entity-np { background: #ec4899; }
.entity-other { background: #374151; }

/* ===== HEATBAR ===== */
.heatbar {
    display: flex;
    height: 10px;
    border-radius: 6px;
    overflow: hidden;
    margin-top: 6px;
    margin-bottom: 4px;
}
.heatbar-severe { background: #b91c1c; }
.heatbar-pest { background: #6b21a8; }
.heatbar-intermediate { background: #d97706; }
.heatbar-basic { background: #fbbf24; }

/* ===== VIOLATION COUNTS ===== */
.counts-row {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    margin: 8px 0;
    flex-wrap: wrap;
}
.score-display {
    font-weight: 700;
    font-size: 1.1rem;
    color: #dc2626;
    background: #fee2e2;
    padding: 4px 12px;
    border-radius: 8px;
}
.breakdown {
    color: #4b5563;
    font-size: 0.85rem;
}
.breakdown .sev { color: #dc2626; font-weight: 600; }
.breakdown .int { color: #f59e0b; font-weight: 500; }
.breakdown .bas { color: #374151; }
.breakdown .pest { color: #6b21a8; font-weight: 600; }
.breakdown .pest-severe {
    color: #991b1b;
    font-weight: 700;
    background: #fee2e2;
    padding: 2px 6px;
    border-radius: 4px;
    animation: pulse-pest 2s infinite;
}
@keyframes pulse-pest {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}
.counts-row .clean {
    color: #16a34a;
    font-weight: 600;
}

/* Legacy counts styling */
.counts-row span.legacy {
    padding: 4px 8px;
    border-radius: 999px;
    background: #f1f1f1;
}
.counts-row .sev { background: #fee2e2; color: #991b1b; }
.counts-row .int { background: #ffedd5; color: #9a3412; }
.counts-row .bas { background: #dbeafe; color: #1e40af; }

/* ===== PEST ALERT ===== */
.pest-alert {
    background: #faf5ff;
    border: 1px solid #e9d5ff;
    color: #6b21a8;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ===== BUSINESS INFO BLOCK ===== */
.business-info {
    background: #f9fafb;
    border-radius: 8px;
    padding: 12px;
    font-size: 0.85rem;
}
.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}
.info-label { font-weight: 600; color: #374151; }
.info-value { color: #374151; text-align: right; }

/* ===== CARD LINKS ===== */
.card-links {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.card-link {
    background: #f3f4f6;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #111;
    text-decoration: none;
    font-weight: 600;
}
.card-link:hover { background: #e5e7eb; }

/* ===== ALERT BADGES ===== */
.alert-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.alert-critical { background: #fee2e2; color: #991b1b; }
.alert-warning { background: #fef3c7; color: #92400e; }
.alert-new { background: #fee2e2; color: #dc2626; }
.alert-resolved { background: #dcfce7; color: #166534; }

/* ===== COUNTY GRID ===== */
.county-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
    margin-bottom: 24px;
}

.county-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-radius: 24px;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    transition: all 0.2s ease;
    min-height: 48px;
    font-weight: 600;
}

.county-button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

.county-button .count {
    background: rgba(255,255,255,0.2);
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
}

/* ===== V2.0 TIER BADGES ===== */
.tier-badge {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 8px;
    font-family: 'Courier New', monospace;
}
.tier-critical { background: #fee2e2; color: #991b1b; }
.tier-high-risk { background: #fed7aa; color: #92400e; }
.tier-caution { background: #fef3c7; color: #78350f; }
.tier-good { background: #dcfce7; color: #166534; }
.tier-excellent { background: #d1fae5; color: #065f46; }


/* Home Dimension Overrides */
/* Colors loaded from config/dimensions.json */

body {
    background: #f9fafb;
}

.header {
    background: linear-gradient(135deg, var(--gray-700) 0%, var(--gray-800) 100%);
}

.dim-btn.active {
    background: var(--gray-700);
    color: white;
}

.stat-card .stat-value {
    color: var(--gray-700);
}

.metro-total {
    background: var(--gray-700)20;
    color: var(--gray-700);
}

.county-count {
    background: var(--gray-100);
    color: var(--gray-700);
}

.card-score {
    background: var(--gray-100);
    color: var(--gray-700);
}

.heatbar-fill {
    background: var(--gray-700);
}

.restaurant-card {
    border-left: 4px solid var(--gray-700);
}


/* ========== ACCESSIBILITY FEATURES (WCAG 2.1) ========== */




/* ===== LANDING PAGE SPECIFIC STYLES ===== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.stat-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.stat-card .stat-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: #1f2937;
}

.stat-card .stat-label {
    font-size: 0.65rem;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1f2937;
    margin: 12px 0 8px;
}

.dimension-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.dimension-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 10px;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.dimension-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.dimension-card.red { border-left: 4px solid #dc2626; }
.dimension-card.orange { border-left: 4px solid #ea580c; }
.dimension-card.yellow { border-left: 4px solid #eab308; }
.dimension-card.blue { border-left: 4px solid #3b82f6; }
.dimension-card.purple { border-left: 4px solid #8b5cf6; }
.dimension-card.green { border-left: 4px solid #16a34a; }
.dimension-card.teal { border-left: 4px solid #14b8a6; }
.dimension-card.indigo { border-left: 4px solid #6366f1; }
.dimension-card.gray { border-left: 4px solid #6b7280; }

.dimension-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.dimension-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1f2937;
}

.dimension-count {
    font-size: 0.85rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
}

.dimension-card.red .dimension-count { background: #fee2e2; color: #991b1b; }
.dimension-card.orange .dimension-count { background: #ffedd5; color: #9a3412; }
.dimension-card.yellow .dimension-count { background: #fef9c3; color: #854d0e; }
.dimension-card.blue .dimension-count { background: #dbeafe; color: #1e40af; }
.dimension-card.purple .dimension-count { background: #ede9fe; color: #5b21b6; }
.dimension-card.green .dimension-count { background: #dcfce7; color: #166534; }
.dimension-card.teal .dimension-count { background: #ccfbf1; color: #115e59; }
.dimension-card.indigo .dimension-count { background: #e0e7ff; color: #3730a3; }
.dimension-card.gray .dimension-count { background: #e5e7eb; color: #374151; }

.dimension-desc {
    font-size: 0.7rem;
    color: #374151;
    line-height: 1.3;
}

.legal-block {
    background: #ffffff;
    border-radius: 6px;
    padding: 10px;
    margin: 12px 0;
    font-size: 0.7rem;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.legal-block a {
    color: #2563eb;
}

.footer {
    text-align: center;
    padding: 12px;
    color: #374151;
    font-size: 0.75rem;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
}

.footer a {
    color: #dc2626;
}

/* ===== RSS FEED SECTION ===== */
.feed-section {
    background: #fef2f2;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid #fecaca;
    border-left: 4px solid #dc2626;
}

.feed-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #991b1b;
    margin: 0 0 8px;
}

.feed-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.feed-item {
    background: #ffffff;
    border-radius: 4px;
    padding: 6px 8px;
    border-left: 3px solid #f87171;
}

.feed-item-date {
    font-size: 0.65rem;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.feed-item-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #1f2937;
    margin-top: 2px;
    line-height: 1.3;
}

.feed-item-desc {
    font-size: 0.7rem;
    color: #4b5563;
    margin-top: 2px;
    line-height: 1.2;
}

/* ===== NEWS SECTION ===== */
.news-section {
    background: #fef2f2;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 12px;
    border: 1px solid #fecaca;
    border-left: 4px solid #dc2626;
}

.news-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #991b1b;
    margin-bottom: 8px;
}

.dirty-dining-feed {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
}

.dirty-dining-feed .news-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dirty-dining-feed .news-item {
    padding: 6px 0;
    border-bottom: 1px solid #fecaca;
}

.dirty-dining-feed .news-item:last-child {
    border-bottom: none;
}

.dirty-dining-feed .news-item a {
    color: #991b1b;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.8rem;
    display: block;
    line-height: 1.3;
}

.dirty-dining-feed .news-item a:hover {
    color: #dc2626;
    text-decoration: underline;
}

.dirty-dining-feed .news-meta {
    font-size: 0.65rem;
    color: #374151;
    margin-top: 2px;
    display: block;
}

.dirty-dining-feed .news-source {
    color: #dc2626;
}

.dirty-dining-feed .no-news {
    color: #374151;
    font-style: italic;
    margin: 0;
}

/* ===== TOP 10 WORST SECTION (Red - Highest Risk) ===== */
.top-10-section {
    background: #ffffff;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #dc2626;
}

.top-10-header {
    font-size: 1rem;
    font-weight: 700;
    color: #991b1b;
    margin-bottom: 8px;
}

.top-10-description {
    font-size: 0.8rem;
    color: #6b7280;
    line-height: 1.4;
    margin-bottom: 12px;
    font-style: italic;
}

.top-10-list {
    width: 100%;
}

.loading-text, .no-data {
    color: #6b7280;
    font-size: 0.85rem;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Table styling for Top 10 lists */
.top-10-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.top-10-table thead {
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

.top-10-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
}

.top-10-table tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s;
}

.top-10-table tbody tr:hover {
    background-color: #fef2f2;
}

.top-10-table tbody tr:last-child {
    border-bottom: none;
}

.top-10-table td {
    padding: 12px;
}

.top-10-table td.rank {
    font-weight: 800;
    color: #dc2626;
    font-size: 1.1rem;
    width: 60px;
    text-align: center;
}

.top-10-table td.name {
    font-weight: 600;
    color: #1f2937;
    max-width: 200px;
}

.top-10-table td.name .city-inline {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 400;
    margin-top: 4px;
}

.top-10-table td.address {
    color: #4b5563;
    font-size: 0.8rem;
    max-width: 250px;
}

.top-10-table td.violations {
    white-space: nowrap;
}

.top-10-table td.violations .viol-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-right: 4px;
}

.top-10-table td.violations .viol-badge.hp {
    background: #fee2e2;
    color: #991b1b;
}

.top-10-table td.violations .viol-badge.int {
    background: #ffedd5;
    color: #9a3412;
}

.top-10-table td.violations .viol-badge.bas {
    background: #fef9c3;
    color: #854d0e;
}

.top-10-table td.date {
    color: #6b7280;
    font-size: 0.8rem;
    white-space: nowrap;
}

.top-10-table td.score {
    font-weight: 800;
    color: #dc2626;
    font-size: 1.1rem;
    text-align: center;
    background: #fee2e2;
    border-radius: 4px;
    padding: 6px 12px;
    min-width: 60px;
}

/* ===== TOP 10 VIOLATORS SECTION (Orange - Most Violations) ===== */
.top-10-violators-section {
    background: #ffffff;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #ea580c;
}

.top-10-violators-section .top-10-header {
    color: #9a3412;
}

.top-10-violators-section .top-10-description {
    color: #6b7280;
}

.top-10-violators-section .top-10-table td.rank {
    color: #ea580c;
}

.top-10-violators-section .top-10-table td.score {
    color: #ea580c;
    background: #ffedd5;
}

.top-10-violators-section .top-10-table tbody tr:hover {
    background-color: #fff7ed;
}

@media (max-width: 600px) {
    .header { padding: 10px 12px; }
    .header h1 { font-size: 1.2rem; }
    .header-row {
        flex-direction: column;
        gap: 6px;
        text-align: center;
    }
    .header-title {
        font-size: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    .header-title .brand { font-size: 1.1rem; }
    .header-row > .sep { display: none; }
    .header .stats { justify-content: center; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .dimension-grid { grid-template-columns: 1fr; }

    .top-10-item {
        flex-direction: column;
        align-items: stretch;
    }

    .top-10-score {
        width: 100%;
    }
}
