/* =============================================================
   MLA – Monthly Top Ten Movie Location Awards
   Main stylesheet
   ============================================================= */

/* ── RESET & BASE ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

:root {
    --bg:         #0d0f14;
    --surface:    #161920;
    --surface2:   #1e2130;
    --border:     #2a2e40;
    --gold:       #c9a84c;
    --gold-dim:   #7a6228;
    --text:       #e8e4d8;
    --text-muted: #8a8ea6;
    --accent:     #e05c3a;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    overflow-x: hidden;
}


/* ── HERO ── */
.hero {
    min-height: 100svh;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 48px 24px 64px;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1;
}

.hero > *:not(.hero-overlay) {
    position: relative;
    z-index: 2;
}

.hero .mla-logo {
    display: block;
    margin: 0 auto 48px;
    max-width: 420px;
    width: 70%;
}

.hero h3 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(18px, 3vw, 30px);
    font-weight: 700;
    color: var(--gold);
    letter-spacing: -0.3px;
    line-height: 1.2;
    margin: 0 0 20px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.hero .subtext {
    max-width: 600px;
    font-size: clamp(13px, 1.4vw, 16px);
    color: #ffffff;
    line-height: 1.7;
    text-align: center;
    text-shadow: none;
}


/* ── MONTH NAV ── */
.month-nav {
    background: #12141c;
    border-bottom: 2px solid var(--gold);
    position: sticky;
    top: 0;
    z-index: 500;
}

.month-nav-years {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.month-nav-years::-webkit-scrollbar { display: none; }

.month-nav-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--gold);
    font-weight: 700;
    white-space: nowrap;
    margin-right: 16px;
}

.month-nav-year-tab {
    font-family: 'Playfair Display', serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 12px 20px;
    cursor: pointer;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.month-nav-year-tab:hover { color: var(--text); }

.month-nav-year-tab.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
}

.month-nav-months {
    display: none;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 24px;
}

.month-nav-months.active { display: flex; }

.month-nav-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.month-nav-pill:hover {
    background: var(--gold);
    color: #12141c;
    border-color: var(--gold);
    text-decoration: none;
}


/* ── MONTH SECTIONS ── */
.month-section {
    scroll-margin-top: 90px;
    padding: 56px 0 72px;
    background: #1a1d2e;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.month-section:nth-child(even) {
    background: #0d0f14;
}

.month-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(24px, 3.5vw, 42px);
    font-weight: 900;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 auto 24px;
    width: 80%;
    line-height: 1.1;
}


/* ── VIDEO ── */
.youtube-video-container {
    position: relative;
    width: 80%;
    margin: 0 auto 28px;
    padding-top: calc(80vw / 16 * 9);
    border: 2px solid #6a7090;
    border-radius: 10px;
    overflow: hidden;
}

.youtube-video-container iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}


/* ── RESULTS TABLE ── */
.top-10-table {
    width: 80%;
    margin: 0 auto;
    border-collapse: collapse;
    table-layout: auto;
    background: #ffffff;
    border: 1px solid #ccc;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
    color: #222;
}

.top-10-table th {
    background: #1a1e30;
    color: #e8c76a;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 1.4px;
    font-weight: 700;
    padding: 16px;
    text-align: left;
    border-bottom: 3px solid var(--gold);
}

.top-10-table td {
    padding: 10px 16px;
    border-bottom: 1px solid #ddd;
    vertical-align: middle;
    color: #222;
    font-size: 14px;
}

.top-10-table tbody tr:last-child td { border-bottom: none; }
.top-10-table tbody tr:hover { background: #dce0ea !important; }

/* Rank column */
.top-10-table td:first-child {
    font-family: 'Playfair Display', serif;
    font-size: 2em;
    font-weight: 900;
    color: #999;
    text-align: center;
    width: 56px;
}

/* Medal rows */
.top-10-table tr.gold      { background: #fff8dc; }
.top-10-table tr.silver    { background: #eef0f5; }
.top-10-table tr.bronze    { background: #fdf0e6; }
.top-10-table tr.white     { background: #ffffff; }
.top-10-table tr.white-alt { background: #f2f4f7; }

.top-10-table tr.gold   td:first-child { color: #b8860b; }
.top-10-table tr.silver td:first-child { color: #778899; }
.top-10-table tr.bronze td:first-child { color: #a0522d; }

/* Photo cell */
.top-10-table td.photo-cell {
    width: 90px;
    min-width: 80px;
    text-align: center;
}

.top-10-table td.photo-cell img.thumbnail {
    width: 90px;
    height: 68px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
    display: block;
    transition: opacity 0.2s;
}

.top-10-table td.photo-cell img.thumbnail:hover { opacity: 0.8; }

/* Movie cell */
.top-10-table td.movie-cell {
    min-width: 140px;
    max-width: 180px;
}

.movie-cell-inner {
    display: flex;
    align-items: center;
    gap: 10px;
}

.top-10-table td.movie-cell img.thumbnail {
    width: 54px;
    height: 81px;
    object-fit: cover;
    border-radius: 5px;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.top-10-table td.movie-cell span {
    font-size: 0.88em;
    font-weight: 500;
    color: var(--text);
    line-height: 1.35;
    overflow-wrap: break-word;
    word-break: normal;
    min-width: 0;
}

.top-10-table td.movie-cell a,
.top-10-table td.movie-cell a:visited {
    color: #7a5c1e;
    text-decoration: none;
    font-weight: 600;
}

.top-10-table td.movie-cell a:hover { text-decoration: underline; }

/* Person / location cells */
.top-10-table td.person-cell {
    font-weight: 600;
    font-size: 0.95em;
    word-break: normal;
    overflow-wrap: break-word;
    white-space: normal;
    line-height: 1.3;
    color: #222;
    min-width: 80px;
    max-width: 120px;
}

.top-10-table td.location-cell {
    font-size: 0.9em;
    color: #555;
}

/* Map popup thumbnail */
.popup-thumbnail {
    width: 120px;
    height: auto;
    margin-top: 8px;
    border-radius: 5px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
}


/* ── COUNTRIES SECTION ── */
.countries-section {
    padding: 56px 60px;
    border-top: 1px solid var(--border);
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    color: var(--gold);
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.countries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 16px;
}

.country-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 10px;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s;
}

.country-card:hover {
    transform: translateY(-3px);
    border-color: var(--gold-dim);
}

.country-card img {
    width: 56px;
    height: auto;
    border-radius: 3px;
    border: 1px solid var(--border);
    display: block;
    margin: 0 auto 8px;
}

.country-card .country-name {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.3;
    margin-bottom: 4px;
}

.country-card .country-count {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    color: var(--gold);
    font-weight: 700;
}

 .lb-caption {
     color: #ffcc00 !important;  /* Yellow text */
     font-size: 18px !important;  /* Adjust text size */
     padding: 5px !important;  /* Add spacing */
     display: block !important;
     width: 100% !important;
     line-height: normal !important;  /* Reset any inherited values */
     line-height: 1.5em !important;  /* Force it to apply */
     font-weight: normal !important;  /* Make it stand out */
     font-family: Arial, sans-serif !important;  /* Ensure a clean font */
     text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.7) !important; /* Optional: Glow effect */
 }

 .caption-rank {
     color: #fff !important;  /* Yellow for ranking */
     font-size: 16px !important;
 }
 
 .caption-reeler {
     color: #ffcc00 !important;  /* Green for name and location */
     font-size: 16px !important;
 }
 
 .caption-movie {
     color: #ffcc00 !important;  /* Red for movie title */
     font-size: 20px !important;
     font-weight: bold;
 }


/* ── MAP ── */
.map-section {
    padding: 0 60px 56px;
    border-top: 1px solid var(--border);
}

.map-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 14px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    margin-top: 32px;
}

.map-controls label {
    font-size: 12px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.map-controls select {
    background: var(--surface2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    outline: none;
    cursor: pointer;
}

.map-controls select:focus {
    border-color: var(--gold-dim);
}

.map-btn-group {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.map-btn {
    background: var(--surface2);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 14px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.map-btn:hover {
    background: var(--gold-dim);
    color: var(--gold);
    border-color: var(--gold-dim);
}

#map {
    height: 520px;
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 0 0 10px 10px;
    position: relative;
    overflow: hidden;
}

#legend-container {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: rgba(13, 15, 20, 0.92);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 16px;
    z-index: 1000;
    max-height: 240px;
    overflow-y: auto;
    font-size: 12px;
    color: var(--text);
}

#legend-container strong {
    display: block;
    margin-bottom: 6px;
    color: var(--gold);
    font-size: 11px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
}

.legend-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}


/* ── FOOTER ── */
footer.footer {
    border-top: 1px solid var(--border);
    padding: 24px 60px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    background: var(--surface);
}


/* =============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================= */

/* ── 1536px+: Large desktop / 4K ── */
@media (min-width: 1536px) {
    .youtube-video-container { width: 55%; padding-top: calc(55% / 16 * 9); }
    .top-10-table, .month-title { width: 55%; }
}

/* ── 1280px–1535px: Standard desktop ── */
@media (min-width: 1280px) and (max-width: 1535px) {
    .youtube-video-container { width: 70%; padding-top: calc(70% / 16 * 9); }
    .top-10-table, .month-title { width: 70%; }
}

/* ── Up to 1024px: Laptop / large tablet ── */
@media (max-width: 1024px) {
    .youtube-video-container { width: 90%; padding-top: calc(90% / 16 * 9); }
    .top-10-table, .month-title { width: 90%; }
    .countries-section, .map-section { padding-left: 24px; padding-right: 24px; }
    #map { height: 60vh; }
}

/* ── Up to 768px: Tablet / large phone ── */
@media (max-width: 768px) {
    .youtube-video-container { width: 100%; padding-top: calc(100% / 16 * 9); border-radius: 0; }

    .table-scroll-wrap {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .top-10-table {
        width: 100%;
        border-radius: 0;
        min-width: 0;
    }

    .month-title { width: 92%; }
    .top-10-table td:first-child { font-size: 1.4em; width: auto; }
    .countries-section, .map-section { padding-left: 16px; padding-right: 16px; }
    .map-controls { flex-direction: column; align-items: flex-start; }
    .map-btn-group { margin-left: 0; flex-wrap: wrap; }
}

/* ── Up to 480px: Mobile portrait ── */
@media (max-width: 480px) {
    .hero h3     { font-size: 18px; }
    .month-title { font-size: 22px; }

    .month-section { scroll-margin-top: 120px; }

    .month-nav-label { display: none; }

    .month-nav-years { padding: 0 12px; }

    .month-nav-months { padding: 8px 12px; gap: 4px; }

    .month-nav-pill { font-size: 11px; padding: 3px 9px; }

    /* Fixed layout so columns can't blow out the viewport */
    .top-10-table {
        table-layout: fixed;
        width: 100%;
    }

    /* Column widths: Rank(8%) + Photo(22%) + Reeler(25%) + Movie(45%) = 100% */
    .top-10-table th:nth-child(1),
    .top-10-table td:nth-child(1) { width: 8%; }

    .top-10-table th:nth-child(2),
    .top-10-table td:nth-child(2) { width: 22%; }

    .top-10-table th:nth-child(3),
    .top-10-table td:nth-child(3) { width: 25%; }

    /* Location column hidden — col 4 */
    .top-10-table thead th:nth-child(4),
    .top-10-table tbody td:nth-child(4) { display: none; }

    .top-10-table th:nth-child(5),
    .top-10-table td:nth-child(5) { width: 45%; }

    /* Tighten padding and text */
    .top-10-table td { padding: 8px 5px; font-size: 12px; }
    .top-10-table th { padding: 10px 5px; font-size: 10px; letter-spacing: 0.6px; }

    .top-10-table td:first-child { font-size: 1.1em; padding: 8px 2px; text-align: center; }

    /* Photo thumbnail */
    .top-10-table td.photo-cell { padding: 6px 4px; }
    .top-10-table td.photo-cell img.thumbnail { width: 100%; height: auto; aspect-ratio: 4/3; object-fit: cover; }

    /* Reeler name */
    .top-10-table td.person-cell { font-size: 0.82em; overflow-wrap: break-word; }

    /* Movie cell: poster left, title right, text wraps naturally */
    .top-10-table td.movie-cell { padding: 6px 4px; }
    .movie-cell-inner { flex-direction: row; align-items: center; gap: 6px; }
    .top-10-table td.movie-cell img.thumbnail { width: 36px; height: 54px; flex-shrink: 0; }
    .top-10-table td.movie-cell span { font-size: 0.76em; text-align: left; overflow-wrap: break-word; word-break: normal; min-width: 0; flex: 1; }

    .month-title { width: 96%; font-size: 20px; }
    .month-section { padding: 36px 0 48px; }

    .countries-section, .map-section { padding-left: 12px; padding-right: 12px; }

    .map-controls { gap: 10px; }
    .map-btn { font-size: 12px; padding: 5px 10px; }

    footer.footer { padding: 20px 16px; }
}