/*
    CIGGA Most Wanted - Stylesheet
    Federal parody aesthetic: deep navy, serif body, sober grid layout
    Paper texture background, red accents, grayscale images optional

    Responsive breakpoints:
    - Desktop (≥1200px): 4 columns
    - Tablet-landscape (900-1199px): 3 columns
    - Tablet-portrait (600-899px): 2 columns
    - Mobile (<600px): 1 column
*/

/* ============================================
   CSS RESET & BASE STYLES
============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
    line-height: 1.6;
    color: #1a1a1a;
    background-color: #e8e6e1;
    background-image: url('../assets/ui/paper-texture.png');
    background-repeat: repeat;
    background-size: 300px 300px;
}

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

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

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

ul {
    list-style: none;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-muted {
    color: #666;
    font-size: 0.9rem;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   HEADER
============================================ */
.site-header {
    background: linear-gradient(180deg, #001f3f 0%, #003366 100%);
    color: #ffffff;
    padding: 20px 0 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px 20px;
    gap: 20px;
}

.seal-container {
    flex-shrink: 0;
}

.header-seal {
    width: 80px;
    height: 80px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.header-title {
    text-align: center;
}

.header-title h1 {
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.header-subtitle {
    font-size: 1rem;
    font-weight: 400;
    opacity: 0.9;
    letter-spacing: 0.3px;
}

/* Navigation */
.main-nav {
    background-color: #003d70;
    border-top: 2px solid #0059a3;
}

.nav-list {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
    padding: 0;
}

.nav-list li {
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-list li:last-child {
    border-right: none;
}

.nav-link {
    display: block;
    padding: 14px 20px;
    color: #ffffff;
    font-family: ui-sans-serif, system-ui, sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link:focus {
    background-color: #0059a3;
    outline: none;
}

.nav-link-primary {
    background-color: #c41e3a;
    font-weight: 700;
}

.nav-link-primary:hover,
.nav-link-primary:focus {
    background-color: #a01628;
}

.nav-link-secondary {
    background-color: #004d80;
}

.nav-link-secondary:hover,
.nav-link-secondary:focus {
    background-color: #006bb3;
}

.contract-btn {
    padding: 14px 20px;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 500;
}

/* ============================================
   MAIN CONTENT
============================================ */
.main-content {
    min-height: 60vh;
    padding: 40px 0;
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 40px 0;
    background-color: rgba(255, 255, 255, 0.6);
    border-bottom: 3px solid #001f3f;
    margin-bottom: 40px;
}

.page-title {
    font-family: ui-sans-serif, system-ui, sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #001f3f;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.page-subtitle {
    font-size: 1.1rem;
    color: #333;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ============================================
   ERROR & WARNING BANNERS
============================================ */
.error-banner,
.warning-banner {
    padding: 16px 20px;
    margin-bottom: 24px;
    border-radius: 4px;
    border-left: 4px solid;
}

.error-banner {
    background-color: #fff3cd;
    border-color: #c41e3a;
    color: #721c24;
}

.warning-banner {
    background-color: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.error-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.error-content strong {
    flex-shrink: 0;
}

.error-content p {
    flex: 1;
    margin: 0;
}

.error-close {
    margin-left: auto;
    font-size: 1.5rem;
    font-weight: 700;
    color: #721c24;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 8px;
    line-height: 1;
}

.error-close:hover,
.error-close:focus {
    color: #000;
    outline: 2px solid #721c24;
}

/* ============================================
   WANTED SECTION - CARD GRID
============================================ */
.wanted-section {
    padding: 20px 0 60px;
}

.loading-message {
    text-align: center;
    font-size: 1.2rem;
    color: #666;
    padding: 60px 20px;
    font-style: italic;
}

.wanted-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
    margin-top: 32px;
}

/* Responsive grid columns */
@media (min-width: 1200px) {
    .wanted-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 900px) and (max-width: 1199px) {
    .wanted-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 600px) and (max-width: 899px) {
    .wanted-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 599px) {
    .wanted-grid {
        grid-template-columns: 1fr;
    }
}

/* Wanted Card */
.wanted-card {
    background-color: #ffffff;
    border: 2px solid #001f3f;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    overflow: hidden;
}

.wanted-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
    border-color: #0059a3;
}

.wanted-card:focus,
.wanted-card:focus-within {
    outline: 3px solid #0059a3;
    outline-offset: 2px;
}

.wanted-card:active {
    transform: translateY(-2px);
}

/* Most Wanted Badge */
.wanted-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background-color: #c41e3a;
    color: #ffffff;
    padding: 6px 12px;
    font-family: ui-sans-serif, system-ui, sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

/* Card Image */
.card-image-container {
    width: 100%;
    height: 320px;
    overflow: hidden;
    background-color: #f0f0f0;
    border-bottom: 2px solid #001f3f;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Optional: grayscale effect for authentic mugshot look */
    /* filter: grayscale(100%); */
}

/* Card Content */
.card-content {
    padding: 20px;
}

.card-name {
    font-family: ui-sans-serif, system-ui, sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #001f3f;
    margin-bottom: 4px;
    line-height: 1.2;
}

.card-alias {
    font-size: 0.95rem;
    color: #666;
    font-style: italic;
    margin-bottom: 16px;
}

.card-crimes-title {
    font-family: ui-sans-serif, system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #c41e3a;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
}

.card-crimes-list {
    margin: 0 0 16px 20px;
    padding: 0;
    list-style: disc;
}

.card-crimes-list li {
    margin-bottom: 4px;
    font-size: 0.9rem;
    color: #333;
}

.card-bio {
    font-size: 0.95rem;
    color: #1a1a1a;
    line-height: 1.6;
    border-top: 1px solid #ddd;
    padding-top: 12px;

    /* Line clamp for consistent card height */
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   EVIDENCE SECTION (formerly Updates)
============================================ */
.updates-section {
    padding: 60px 0;
    background-color: rgba(255, 255, 255, 0.7);
    border-top: 3px solid #001f3f;
}

.section-title {
    font-family: ui-sans-serif, system-ui, sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #001f3f;
    margin-bottom: 24px;
    text-align: center;
}

.evidence-intro {
    max-width: 1000px;
    margin: 0 auto 40px;
    text-align: center;
}

.classification-notice {
    background-color: #c41e3a;
    color: #ffffff;
    padding: 12px 20px;
    font-family: ui-sans-serif, system-ui, sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 16px;
    display: inline-block;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.updates-intro {
    font-size: 1rem;
    color: #333;
    line-height: 1.7;
    max-width: 900px;
    margin: 0 auto;
}

.evidence-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 32px;
    max-width: 1200px;
    margin: 0 auto;
}

.evidence-item {
    background-color: #ffffff;
    border: 2px solid #001f3f;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.evidence-header {
    background: linear-gradient(180deg, #001f3f 0%, #003366 100%);
    color: #ffffff;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #c41e3a;
}

.evidence-label {
    font-family: ui-sans-serif, system-ui, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.evidence-date {
    font-family: ui-monospace, "Courier New", monospace;
    font-size: 0.85rem;
    opacity: 0.9;
}

.evidence-video {
    position: relative;
    width: 100%;
    background-color: #000000;
}

.evidence-video iframe,
.evidence-video video {
    display: block;
    width: 100%;
    max-width: 100%;
}

.evidence-video iframe {
    aspect-ratio: 16 / 9;
    height: auto;
}

.evidence-description {
    padding: 20px;
    font-size: 0.95rem;
    color: #1a1a1a;
    line-height: 1.6;
    border-top: 1px solid #ddd;
    background-color: #f9f9f9;
}

/* Placeholder styling */
.evidence-placeholder {
    border: 2px dashed #003d70;
    background-color: #f9f9f9;
}

.evidence-video-placeholder {
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #e8e6e1 0%, #d0cec9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.placeholder-content {
    text-align: center;
    color: #666;
}

.placeholder-content p:first-child {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.placeholder-content p:nth-child(2) {
    font-family: ui-sans-serif, system-ui, sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #001f3f;
    margin-bottom: 8px;
}

.placeholder-note {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .evidence-grid {
        grid-template-columns: 1fr;
    }

    .evidence-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
}

/* ============================================
   FOOTER
============================================ */
.site-footer {
    background: linear-gradient(180deg, #001f3f 0%, #000d1a 100%);
    color: #ffffff;
    padding: 40px 0;
    margin-top: 60px;
    border-top: 3px solid #c41e3a;
}

.footer-content {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.footer-disclaimer {
    font-size: 0.9rem;
    line-height: 1.7;
    margin-bottom: 16px;
    padding: 16px;
    background-color: rgba(196, 30, 58, 0.1);
    border: 1px solid rgba(196, 30, 58, 0.3);
    border-radius: 4px;
}

.footer-copyright {
    font-size: 0.85rem;
    opacity: 0.8;
}

.footer-link {
    color: #88c0ff;
    text-decoration: underline;
}

.footer-link:hover,
.footer-link:focus {
    color: #ffffff;
    outline: 1px dotted #ffffff;
}

/* ============================================
   MODALS (CONTRACT & CAT DETAIL)
============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    overflow-y: auto;
}

.modal-content {
    background-color: #ffffff;
    border: 3px solid #001f3f;
    padding: 32px;
    max-width: 600px;
    width: 100%;
    position: relative;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 2rem;
    font-weight: 700;
    color: #001f3f;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 8px;
    line-height: 1;
}

.modal-close:hover,
.modal-close:focus {
    color: #c41e3a;
    outline: 2px solid #001f3f;
}

.modal-title {
    font-family: ui-sans-serif, system-ui, sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: #001f3f;
    margin-bottom: 20px;
}

.contract-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: #f9f9f9;
    border: 2px solid #ddd;
    padding: 16px;
    margin-bottom: 12px;
}

.contract-text {
    flex: 1;
    font-family: ui-monospace, "Courier New", monospace;
    font-size: 0.9rem;
    color: #1a1a1a;
    word-break: break-all;
}

.copy-btn {
    padding: 8px 16px;
    background-color: #003d70;
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.copy-btn:hover,
.copy-btn:focus {
    background-color: #0059a3;
    outline: 2px solid #001f3f;
}

.modal-note {
    font-size: 0.85rem;
    color: #666;
    text-align: center;
}

/* ============================================
   CAT DETAIL MODAL
============================================ */
.cat-modal-content {
    background-color: #ffffff;
    border: 3px solid #001f3f;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.cat-detail-header {
    display: flex;
    gap: 32px;
    padding: 32px;
    background: linear-gradient(180deg, #001f3f 0%, #003366 100%);
    color: #ffffff;
    border-bottom: 3px solid #c41e3a;
}

.cat-detail-image-container {
    flex-shrink: 0;
    width: 250px;
    height: 250px;
    border: 3px solid #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    background-color: #f0f0f0;
}

.cat-detail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cat-detail-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cat-detail-name {
    font-family: ui-sans-serif, system-ui, sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.2;
}

.cat-detail-alias {
    font-size: 1.3rem;
    font-style: italic;
    opacity: 0.9;
    margin-bottom: 20px;
}

.cat-detail-status {
    margin-top: auto;
}

.status-badge {
    display: inline-block;
    background-color: #c41e3a;
    color: #ffffff;
    padding: 8px 16px;
    font-family: ui-sans-serif, system-ui, sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.cat-detail-body {
    padding: 40px 32px;
}

.detail-section {
    margin-bottom: 32px;
}

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

.detail-section-title {
    font-family: ui-sans-serif, system-ui, sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #001f3f;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #003d70;
}

.detail-bio {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #1a1a1a;
}

.detail-crimes-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.detail-crime-item {
    padding: 12px 16px;
    margin-bottom: 8px;
    background-color: #f9f9f9;
    border-left: 4px solid #c41e3a;
    font-size: 1rem;
    color: #333;
}

.detail-crime-item::before {
    content: "▸ ";
    color: #c41e3a;
    font-weight: 700;
    margin-right: 8px;
}

.detail-warning {
    background-color: #fffbea;
    border: 2px solid #ffc107;
    padding: 20px;
    border-radius: 4px;
}

.detail-warning .detail-section-title {
    color: #856404;
    border-bottom-color: #ffc107;
}

.detail-warning p {
    font-size: 0.95rem;
    color: #856404;
    line-height: 1.7;
    margin: 0;
}

/* Responsive adjustments for cat modal */
@media (max-width: 768px) {
    .cat-detail-header {
        flex-direction: column;
        padding: 24px;
        gap: 20px;
    }

    .cat-detail-image-container {
        width: 100%;
        max-width: 300px;
        height: 300px;
        margin: 0 auto;
    }

    .cat-detail-name {
        font-size: 2rem;
    }

    .cat-detail-alias {
        font-size: 1.1rem;
    }

    .cat-detail-body {
        padding: 24px 20px;
    }

    .detail-section-title {
        font-size: 1.1rem;
    }
}

/* ============================================
   NOSCRIPT BANNER
============================================ */
.noscript-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #c41e3a;
    color: #ffffff;
    padding: 16px;
    text-align: center;
    font-weight: 700;
    z-index: 3000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
============================================ */
@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        text-align: center;
    }

    .header-title h1 {
        font-size: 1.5rem;
    }

    .header-subtitle {
        font-size: 0.9rem;
    }

    .nav-list {
        flex-direction: column;
    }

    .nav-list li {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

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

    .page-title {
        font-size: 1.8rem;
    }

    .page-subtitle {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .updates-log {
        padding: 20px;
    }
}

/* ============================================
   ACCESSIBILITY ENHANCEMENTS
============================================ */
a:focus,
button:focus {
    outline: 2px solid #0059a3;
    outline-offset: 2px;
}

/* High contrast focus for keyboard navigation */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
