/* ============================================================
   Film & Media Portal — Mexico Gov Wine/Maroon Theme
   ============================================================ */

:root {
    --wine:          #6d1f3e;
    --wine-dk:       #521630;
    --wine-mid:      #7d2348;
    --wine-lt:       #a03060;
    --wine-pale:     #f5edf0;
    --wine-pale2:    #eddde4;
    --rose-btn:      #8c2050;
    --gold:          #c8a84b;
    --page-bg:       #f2f2f0;
    --card-bg:       #ffffff;
    --border-clr:    #e0d0d8;
    --border-dk:     #ccbbc6;
    --txt-main:      #1e1e1e;
    --txt-sub:       #4a3040;
    --txt-muted:     #8a7080;
    --btn-grad:      linear-gradient(135deg, #6d1f3e 0%, #a03060 100%);
    --btn-grad-hov:  linear-gradient(135deg, #521630 0%, #8c2050 100%);
    --card-shadow:   0 2px 10px rgba(109,31,62,0.10);
    --card-shadow-h: 0 6px 22px rgba(109,31,62,0.22);
    --radius:        8px;
    --radius-sm:     6px;
    --radius-xs:     4px;
    --tr:            all 0.24s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC',
                 'Microsoft YaHei', 'Segoe UI', Arial, sans-serif;
    background: var(--page-bg);
    color: var(--txt-main);
    font-size: 15px;
    line-height: 1.55;
    overflow-x: hidden;
}

/* ===== TOP HEADER ===== */
.hdr-topbar {
    background: var(--wine-dk);
    padding: 10px 0;
    border-bottom: 3px solid var(--wine-lt);
}

.hdr-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: nowrap;
}

.hdr-brand-link {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.hdr-site-name {
    font-size: 27px;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: 1px;
    font-style: normal;
    border-bottom: none;
    text-shadow: 0 1px 6px rgba(0,0,0,0.35);
}

.hdr-domain-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: var(--radius-xs);
    padding: 5px 14px;
}

.hdr-domain-lbl {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,255,255,0.72);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    white-space: nowrap;
}

.hdr-domain-url {
    font-size: 18px;
    font-weight: 800;
    color: #ffd580;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

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

.content {
    padding: 8px 0;
}

/* ===== CATEGORY NAV ===== */
.nav-panel {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 8px;
    border: 1px solid var(--border-clr);
    box-shadow: var(--card-shadow);
}

.nav-row-item {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--border-clr);
}

.nav-row-item:last-child { border-bottom: none; }

.nav-zone-lbl {
    font-weight: 700;
    font-size: 13px;
    color: var(--wine);
    white-space: nowrap;
    width: 10%;
    text-align: center;
    border-right: 1px solid var(--border-clr);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 9px 6px;
    flex-shrink: 0;
    background: var(--wine-pale);
}

.nav-zone-links {
    width: 90%;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
    align-items: center;
}

.nav-zone-links a {
    display: inline-block;
    color: var(--txt-sub);
    text-decoration: none;
    padding: 5px 4px;
    border-radius: var(--radius-xs);
    transition: var(--tr);
    background: var(--page-bg);
    border: 1px solid var(--border-clr);
    white-space: nowrap;
    text-align: center;
    font-size: 13px;
    width: calc((100% - 42px) / 8);
    flex-shrink: 0;
    flex-grow: 0;
}

.nav-zone-links a:hover {
    background: var(--wine);
    color: #fff;
    border-color: var(--wine);
    box-shadow: 0 2px 8px rgba(109,31,62,0.25);
}

.nav-zone-links a.active {
    background: var(--wine);
    color: #fff;
    border-color: var(--wine);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(109,31,62,0.25);
}

/* ===== SEARCH MODULE ===== */
.qr-search-wrap {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 11px;
    margin-bottom: 8px;
    border: 1px solid var(--border-clr);
    box-shadow: var(--card-shadow);
}

.qr-search-wrap form {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    align-items: center;
}

.qr-search-wrap input[type="text"] {
    flex: 1;
    min-width: 0;
    padding: 9px 14px;
    border: 1.5px solid var(--border-dk);
    border-radius: 24px;
    background: var(--page-bg);
    color: var(--txt-main);
    font-size: 14px;
    outline: none;
    transition: var(--tr);
}

.qr-search-wrap input[type="text"]:focus {
    border-color: var(--wine-lt);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(109,31,62,0.10);
}

.qr-search-wrap input[type="text"]::placeholder {
    color: var(--txt-muted);
}

.qr-search-wrap button {
    padding: 9px 15px;
    border: none;
    border-radius: 22px;
    background: var(--btn-grad);
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: var(--tr);
    white-space: nowrap;
    flex-shrink: 0;
}

.qr-search-wrap button:hover {
    background: var(--btn-grad-hov);
    box-shadow: 0 4px 12px rgba(109,31,62,0.30);
}

/* ===== HOT TAG CLOUD ===== */
.kw-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    list-style: none;
    padding: 9px 12px;
    background: var(--card-bg);
    border-radius: var(--radius);
    margin-bottom: 8px;
    border: 1px solid var(--border-clr);
    box-shadow: var(--card-shadow);
}

.kw-tag-item {
    padding: 4px 13px;
    background: var(--wine-pale);
    border-radius: 16px;
    color: var(--wine);
    text-decoration: none;
    font-size: 13px;
    transition: var(--tr);
    border: 1px solid var(--wine-pale2);
    white-space: nowrap;
}

.kw-tag-item:hover {
    background: var(--wine);
    color: #fff;
    border-color: var(--wine);
    box-shadow: 0 2px 8px rgba(109,31,62,0.20);
}

/* ===== SECTION BLOCK ===== */
.sect-block {
    margin-bottom: 14px;
}

.sect-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-clr);
    position: relative;
}

.sect-hd::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 44px;
    height: 2px;
    background: var(--wine);
    border-radius: 2px;
}

.sect-ttl {
    font-size: 18px;
    font-weight: 700;
    color: var(--txt-main);
    margin: 0;
}

.sect-ttl a {
    color: var(--txt-main);
    text-decoration: none;
    transition: var(--tr);
}

.sect-ttl a:hover { color: var(--wine); }

/* ===== FILM CARD GRID ===== */
.pic-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 13px;
    list-style: none;
    padding: 0;
}

.pic-grid li { animation: pgIn 0.42s ease backwards; }
.pic-grid li:nth-child(1) { animation-delay: 0.03s; }
.pic-grid li:nth-child(2) { animation-delay: 0.06s; }
.pic-grid li:nth-child(3) { animation-delay: 0.09s; }
.pic-grid li:nth-child(4) { animation-delay: 0.12s; }
.pic-grid li:nth-child(5) { animation-delay: 0.15s; }
.pic-grid li:nth-child(6) { animation-delay: 0.18s; }
.pic-grid li:nth-child(7) { animation-delay: 0.21s; }
.pic-grid li:nth-child(8) { animation-delay: 0.24s; }

@keyframes pgIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.pic-thumb {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-sm);
    aspect-ratio: 600 / 350;
    background: var(--wine-pale);
    border: 1px solid var(--border-clr);
    box-shadow: var(--card-shadow);
    transition: var(--tr);
}

.pic-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    display: block;
}

.pic-thumb:hover {
    box-shadow: var(--card-shadow-h);
    border-color: var(--wine-lt);
    transform: translateY(-2px);
}

.pic-thumb:hover img { transform: scale(1.07); }

.pic-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(82,22,48,0.60) 0%, transparent 58%);
    opacity: 0;
    transition: opacity 0.28s ease;
    pointer-events: none;
}

.pic-thumb:hover::after { opacity: 1; }

.pic-caption { padding: 7px 0 2px; }

.pic-caption h5 {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--txt-sub);
}

.pic-caption h5 a {
    color: var(--txt-sub);
    text-decoration: none;
    transition: var(--tr);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pic-caption h5 a:hover { color: var(--wine); }

/* ===== VIDEO PLAYER ===== */
.video-container {
    width: 100%;
    height: 640px;
    max-height: 640px;
    margin-bottom: 14px;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(109,31,62,0.25);
    position: relative;
}

.video-container iframe,
.video-container video,
.video-container #video-container {
    width: 100%;
    height: 100%;
    border: none;
}

.MacPlayer {
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* ===== TORRENT PREVIEW ===== */
.torrent-capture-grid { width: 100%; margin-top: 10px; }

.torrent-capture-grid picture {
    display: block;
    width: 100%;
}

.torrent-capture-grid img,
.torrent-capture-grid .img_item img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border-clr);
    display: block;
}

.torrent-capture-grid .img_item { width: 100%; }

/* ===== DOWNLOAD BUTTONS ===== */
.dl-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    gap: 10px;
    padding: 14px;
    background: var(--card-bg);
    border-radius: var(--radius);
    margin: 12px 0;
    border: 1px solid var(--border-clr);
    box-shadow: var(--card-shadow);
}

.dl-link {
    display: inline-block;
    padding: 10px 22px;
    background: var(--btn-grad);
    color: #fff;
    text-decoration: none;
    border-radius: 22px;
    font-weight: 600;
    font-size: 14px;
    transition: var(--tr);
    border: none;
    white-space: nowrap;
    flex-shrink: 0;
    cursor: pointer;
}

.dl-link:hover {
    background: var(--btn-grad-hov);
    box-shadow: 0 5px 16px rgba(109,31,62,0.35);
    transform: translateY(-1px);
}

/* ===== SHARE PANEL ===== */
.share-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin: 12px 0;
    border: 1px solid var(--border-clr);
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    gap: 10px;
}

.share-url-display {
    background: var(--page-bg);
    border: 1px solid var(--border-dk);
    border-radius: 22px;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.share-label {
    font-weight: 700;
    font-size: 12px;
    color: var(--wine);
    white-space: nowrap;
    flex-shrink: 0;
}

.share-url {
    font-size: 12px;
    color: var(--txt-muted);
    font-family: 'Courier New', monospace;
    word-break: break-all;
    flex: 1;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
}

.share-copy-btn {
    padding: 9px 18px;
    background: var(--btn-grad);
    color: #fff;
    border: none;
    border-radius: 22px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: var(--tr);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.share-copy-btn:hover {
    background: var(--btn-grad-hov);
    box-shadow: 0 4px 12px rgba(109,31,62,0.30);
}

.share-icon { font-size: 15px; }

/* ===== PAGINATION ===== */
.page_info_div {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    padding: 14px 0;
}

.a_page_info,
.page_info_focus {
    display: inline-block;
    padding: 7px 13px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: var(--tr);
    min-width: 36px;
    text-align: center;
}

.a_page_info {
    background: var(--card-bg);
    color: var(--txt-sub);
    border: 1px solid var(--border-dk);
}

.a_page_info:hover {
    background: var(--wine);
    border-color: var(--wine);
    color: #fff;
}

.page_info_focus {
    background: var(--btn-grad);
    color: #fff;
    border: 1px solid var(--wine);
    cursor: default;
}

/* ===== FOOTER ===== */
.pg-footer {
    padding: 18px 0;
    text-align: center;
    border-top: 2px solid var(--border-clr);
    margin-top: 16px;
    background: var(--card-bg);
}

.pg-footer p {
    margin: 6px 0;
    color: var(--txt-muted);
    font-size: 13px;
}

.pg-footer a {
    color: var(--txt-muted);
    text-decoration: none;
    transition: var(--tr);
}

.pg-footer a:hover { color: var(--wine); }

/* ===== FRIENDLY LINKS ===== */
.friendlink-box {
    padding: 10px 12px;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border-clr);
    box-shadow: var(--card-shadow);
}

.friendlink-box dl { margin: 0; }

.friendlink-box dd {
    display: inline-block;
    margin: 3px 4px;
}

.friendlink-box a {
    color: var(--wine-mid);
    text-decoration: none;
    font-size: 13px;
    transition: var(--tr);
}

.friendlink-box a:hover { color: var(--wine-dk); }

.pd5 { padding: 2px 0; display: inline-block; }

/* ===== UTILITIES ===== */
.clearfix::after { content: ""; display: table; clear: both; }
img[data-original] { background: var(--wine-pale); }

.hide_mobile { display: block; }
.hide_pc     { display: block; }

@media (max-width: 768px)  { .hide_mobile { display: none !important; } }
@media (min-width: 769px)  { .hide_pc     { display: none !important; } }

/* ===== RESPONSIVE — TABLET / LARGE PHONE (<=768px) ===== */
@media (max-width: 768px) {

    .container { padding: 0 8px; }
    .content   { padding: 6px 0; }
    .hdr-topbar { padding: 7px 0; }

    .hdr-site-name  { font-size: 20px; }
    .hdr-domain-lbl { font-size: 10px; }
    .hdr-domain-url { font-size: 15px; }

    /* Nav: label 15%, links 85%, 4 per row x 2 rows */
    .nav-zone-lbl {
        width: 15%;
        font-size: 10px;
        padding: 7px 3px;
    }

    .nav-zone-links {
        width: 85%;
        gap: 4px;
        padding: 6px 5px;
    }

    .nav-zone-links a {
        font-size: 13px;
        padding: 5px 2px;
        width: calc((100% - 12px) / 4);
        flex-shrink: 0;
        flex-grow: 0;
    }

    /* Film grid: 2 columns */
    .pic-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .pic-caption h5 { font-size: 12px; }

    /* Search: single row, no wrap */
    .qr-search-wrap form { flex-wrap: nowrap; gap: 5px; }

    .qr-search-wrap input[type="text"] {
        min-width: 0;
        padding: 8px 10px;
        font-size: 13px;
    }

    .qr-search-wrap button {
        padding: 8px 10px;
        font-size: 12px;
        flex-shrink: 0;
    }

    .sect-ttl { font-size: 16px; }

    .kw-tag-list { gap: 5px; padding: 7px 10px; }
    .kw-tag-item { padding: 4px 10px; font-size: 12px; }

    .dl-bar  { padding: 10px 8px; gap: 7px; }
    .dl-link { padding: 9px 14px; font-size: 13px; }

    .share-section      { padding: 9px 10px; margin: 10px 0; flex-wrap: nowrap; }
    .share-url-display  { padding: 7px 10px; flex: 1; min-width: 0; }
    .share-label        { font-size: 11px; }
    .share-url          { font-size: 10px; }
    .share-copy-btn     { padding: 8px 11px; font-size: 12px; flex-shrink: 0; }
    .share-icon         { font-size: 14px; }

    .video-container { height: 56.25vw; max-height: 400px; margin-bottom: 10px; }

    .page_info_div { padding: 10px 0; gap: 4px; }
    .a_page_info,
    .page_info_focus { padding: 6px 11px; font-size: 12px; min-width: 32px; }
}

/* ===== RESPONSIVE — SMALL PHONE (<=480px) ===== */
@media (max-width: 480px) {

    .hdr-site-name  { font-size: 17px; }
    .hdr-domain-lbl { font-size: 9px; }
    .hdr-domain-url { font-size: 13px; }

    .nav-zone-lbl {
        width: 15%;
        font-size: 10px;
        padding: 6px 2px;
    }

    .nav-zone-links {
        width: 85%;
        gap: 3px;
        padding: 5px 3px;
    }

    .nav-zone-links a {
        font-size: 12px;
        padding: 4px 1px;
        width: calc((100% - 9px) / 4);
    }

    .pic-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .pic-caption h5 { font-size: 12px; }

    .qr-search-wrap input[type="text"] { padding: 7px 8px; font-size: 12px; }
    .qr-search-wrap button             { padding: 7px 8px; font-size: 11px; }

    .sect-ttl { font-size: 15px; }

    .video-container { height: 56.25vw; max-height: 280px; }

    .dl-link { padding: 8px 12px; font-size: 12px; }
    .share-copy-btn { padding: 7px 9px; font-size: 11px; }
    .page_info_div { padding: 8px 0; }
}

/* ===== PC — enforce 4-column grid ===== */
@media (min-width: 769px) {
    .pic-grid { grid-template-columns: repeat(4, 1fr); }
}
