/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #ffffff;
    --bg-soft: #f6f6f6;
    --bg-muted: #ebebeb;
    --red: #e8001c;
    --red-dk: #c20018;
    --red-lt: #fff0f2;
    --red-mid: #f0001e;
    --dark: #111111;
    --dark2: #222222;
    --mid: #555555;
    --txt: #111111;
    --txt2: #444444;
    --txt3: #888888;
    --border: #e0e0e0;
    --border2: #cccccc;
    --shadow1: 0 1px 4px rgba(0,0,0,.07);
    --shadow2: 0 3px 12px rgba(0,0,0,.11);
    --shadow3: 0 6px 22px rgba(0,0,0,.16);
    --radius: 3px;
    --radius2: 2px;
    --radius3: 3px;
}

html { font-size: 15px; }

body {
    background: var(--bg-soft);
    color: var(--txt);
    font-family: 'Helvetica Neue','Arial','PingFang SC','Microsoft YaHei',sans-serif;
    line-height: 1.6;
}

a { color: var(--red); text-decoration: none; transition: color .15s; }
a:hover { color: var(--red-dk); }
img { max-width: 100%; display: block; }
ul { list-style: none; }
.ep::after { content: ''; display: table; clear: both; }

/* ===== WRAPPER ===== */
.ep-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 14px;
}

/* ===== SITE HEADER ===== */
.ep-header {
    background: var(--red);
    padding: 10px 0;
}

.ep-header .ep-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: nowrap;
}

.ep-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

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

/* elPeriodico-style: italic white serif site name */
.ep-site-name {
    font-size: 1.44rem;
    font-weight: 900;
    color: #ffffff;
    font-style: italic;
    letter-spacing: -.4px;
    text-decoration: none;
    border-bottom: none;
    font-family: Georgia,'Times New Roman',serif;
    line-height: 1;
}

.ep-domain-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,.18);
    border: 1.5px solid rgba(255,255,255,.35);
    border-radius: var(--radius);
    padding: 4px 13px;
}

.ep-domain-pill .epd-tip {
    font-size: 0.66rem;
    color: rgba(255,255,255,.68);
    white-space: nowrap;
    letter-spacing: .5px;
    text-transform: uppercase;
}

.ep-domain-pill .epd-url {
    font-size: 1.06rem;
    font-weight: 800;
    color: #ffffff;
    white-space: nowrap;
    letter-spacing: .2px;
}

/* ===== BANNER ===== */
.ep-hero {
    margin: 4px 0 3px;
    border-radius: var(--radius);
    overflow: hidden;
}
.ep-hero img { border-radius: var(--radius); width: 100%; }

/* ===== CATEGORY NAV ===== */
.ep-nav-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-top: 3px solid var(--red);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 3px 0;
    box-shadow: var(--shadow1);
}

.ep-nav-row {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--border);
    min-height: 36px;
}

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

.ep-zone-lbl {
    background: var(--dark);
    color: rgba(255,255,255,.75);
    font-size: .64rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 2px;
    width: 60px;
    min-width: 60px;
    border-right: 1px solid rgba(255,255,255,.06);
    text-align: center;
    line-height: 1.3;
    letter-spacing: .3px;
    flex-shrink: 0;
    text-transform: uppercase;
}

.ep-zone-links {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    align-items: center;
    padding: 3px 8px;
    gap: 3px;
    flex: 1;
}

.ep-zone-links a {
    font-size: .79rem;
    color: var(--txt2);
    padding: 3px 4px;
    border-radius: var(--radius2);
    transition: all .15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    border: 1px solid transparent;
    text-decoration: none;
    display: block;
    font-weight: 500;
}

.ep-zone-links a:hover {
    background: var(--red-lt);
    color: var(--red);
    border-color: #f5b0b8;
}

.ep-zone-links a.active {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
    font-weight: 700;
}

/* ===== SEARCH ===== */
.ep-search-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 7px 13px;
    margin: 3px 0;
    box-shadow: var(--shadow1);
}

.ep-search-card form {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: nowrap;
    width: 100%;
}

.ep-search-card input[type="text"] {
    flex: 1;
    min-width: 0;
    height: 36px;
    border: 1.5px solid var(--border2);
    border-radius: var(--radius);
    padding: 0 12px;
    font-size: .86rem;
    color: var(--txt);
    background: var(--bg-soft);
    outline: none;
    transition: border-color .18s;
    font-family: inherit;
}

.ep-search-card input[type="text"]:focus {
    border-color: var(--red);
    background: var(--bg);
    box-shadow: 0 0 0 2px rgba(232,0,28,.09);
}

.ep-search-card button {
    height: 36px;
    padding: 0 12px;
    border: none;
    border-radius: var(--radius);
    background: var(--dark2);
    color: #fff;
    font-size: .79rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
    flex-shrink: 0;
    font-family: inherit;
    letter-spacing: .3px;
    text-transform: uppercase;
}

.ep-search-card button:hover { background: var(--dark); }

.ep-search-card button[value="1"] {
    background: var(--red);
}
.ep-search-card button[value="1"]:hover { background: var(--red-dk); }

.ep-search-card button[value="2"] {
    background: var(--bg);
    color: var(--red);
    border: 1.5px solid var(--red);
}
.ep-search-card button[value="2"]:hover {
    background: var(--red-lt);
}

/* ===== HOT TAGS ===== */
.ep-hot-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 13px;
    margin: 3px 0;
    box-shadow: var(--shadow1);
}

.ep-hot-card h4 {
    font-size: .71rem;
    font-weight: 700;
    color: var(--dark2);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: .7px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ep-hot-card h4::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--red);
    border-radius: 50%;
    flex-shrink: 0;
}

.ep-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.ep-tag-row .ep-tag {
    display: inline-block;
    background: var(--bg-soft);
    color: var(--txt2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2px 10px;
    font-size: .73rem;
    text-decoration: none;
    transition: all .15s;
    font-weight: 500;
}

.ep-tag-row .ep-tag:hover {
    background: var(--red-lt);
    color: var(--red);
    border-color: #f5b0b8;
}

/* ===== CONTENT SECTION ===== */
.ep-section {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 13px 10px;
    margin: 4px 0;
    box-shadow: var(--shadow1);
}

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

.ep-sec-hd::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 34px;
    height: 2px;
    background: var(--red);
}

.ep-sec-hd h3 {
    font-size: .97rem;
    font-weight: 800;
    color: var(--dark);
    text-transform: uppercase;
    letter-spacing: .3px;
}

.ep-sec-hd h3 a { color: var(--dark); }
.ep-sec-hd h3 a:hover { color: var(--red); }

.ep-sec-hd h4 {
    font-size: .95rem;
    font-weight: 800;
    color: var(--dark);
    text-transform: uppercase;
    letter-spacing: .3px;
}

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

.ep-grid li {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-soft);
    transition: box-shadow .18s, transform .18s;
}

.ep-grid li:hover {
    box-shadow: var(--shadow3);
    transform: translateY(-2px);
}

.ep-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 600 / 350;
    overflow: hidden;
    background: var(--bg-muted);
    position: relative;
}

.ep-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .28s;
}

.ep-thumb:hover img { transform: scale(1.05); }

.ep-caption {
    padding: 5px 7px 6px;
    border-top: 2px solid var(--bg-muted);
}

.ep-caption h5 {
    font-size: .77rem;
    font-weight: 700;
    color: var(--txt);
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-family: Georgia,'Times New Roman',serif;
}

.ep-caption h5 a { color: var(--txt); }
.ep-caption h5 a:hover { color: var(--red); }

/* ===== PAGINATION ===== */
.ep-pager {
    margin: 12px 0 4px;
    display: flex;
    justify-content: center;
}

.ep-pager-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    justify-content: center;
}

.ep-pager-row a.epp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    background: var(--bg);
    border: 1.5px solid var(--border2);
    border-radius: var(--radius);
    font-size: .82rem;
    color: var(--txt2);
    text-decoration: none;
    transition: all .15s;
    font-weight: 600;
}

.ep-pager-row a.epp-btn:hover {
    background: var(--red-lt);
    border-color: var(--red);
    color: var(--red);
}

.ep-pager-row a.epp-btn-on {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    background: var(--red);
    border: 1.5px solid var(--red);
    border-radius: var(--radius);
    font-size: .82rem;
    font-weight: 800;
    color: #fff;
    cursor: default;
}

/* ===== FOOTER ===== */
.ep-flink-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 13px;
    margin: 4px 0;
    box-shadow: var(--shadow1);
}

.ep-flinks {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.ep-flinks dd { display: inline; }

.ep-flinks a {
    display: inline-block;
    font-size: .73rem;
    color: var(--txt3);
    padding: 2px 9px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-soft);
    text-decoration: none;
    transition: all .15s;
}

.ep-flinks a:hover {
    color: var(--red);
    border-color: #f5b0b8;
    background: var(--red-lt);
}

.ep-cr {
    text-align: center;
    padding: 7px 0 13px;
    color: var(--txt3);
    font-size: .72rem;
}

/* ===== DETAIL PAGES ===== */
.ep-dtl-title {
    line-height: 1.8;
    text-align: center;
    padding: 12px 16px;
    font-size: .97rem;
    margin: 4px 0;
    word-break: break-all;
    background: var(--bg);
    border: 1px solid var(--border);
    border-top: 4px solid var(--red);
    border-radius: var(--radius);
    box-shadow: var(--shadow1);
    font-family: Georgia,'Times New Roman',serif;
}

.ep-dtl-title a {
    color: var(--red);
    font-weight: 700;
    margin-right: 6px;
    font-family: inherit;
    font-size: .79rem;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.ep-dtl-info {
    font-size: .9rem;
    line-height: 2;
    padding: 14px 18px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow1);
    margin: 4px 0;
    color: var(--txt2);
}

.ep-preview-box {
    display: block;
    width: 100%;
    margin-top: 10px;
}

.ep-preview-box picture,
.ep-preview-box img {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    display: block;
}

/* ===== DL BUTTONS ===== */
.ep-dl-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0;
}

.ep-dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 10px 22px;
    background: var(--red);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .18s, transform .13s;
    text-decoration: none;
    font-family: inherit;
    letter-spacing: .3px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(232,0,28,.25);
}

.ep-dl-btn:hover {
    background: var(--red-dk);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(232,0,28,.35);
}

.ep-cli-hint {
    text-align: center;
    padding: 6px;
    font-size: .8rem;
}

.ep-cli-hint a { color: var(--dark2); font-weight: 600; }
.ep-cli-hint a:hover { color: var(--red); }

/* ===== SHARE ===== */
.ep-share-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-left: 3px solid var(--red);
    border-radius: var(--radius);
    padding: 7px 12px;
    margin: 4px 0;
    flex-wrap: wrap;
}

.ep-share-bar .eps-lbl {
    font-size: .71rem;
    color: var(--txt3);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.ep-share-bar .eps-url {
    font-size: .78rem;
    color: var(--txt2);
    flex: 1;
    min-width: 0;
    word-break: break-all;
}

.ep-share-bar .eps-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 13px;
    background: var(--red);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
    flex-shrink: 0;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.ep-share-bar .eps-btn:hover { background: var(--red-dk); }

/* ===== VIS HELPERS ===== */
.ep-pc { display: block; }
.ep-mb { display: none; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .ep-grid { grid-template-columns: repeat(2, 1fr); gap: 7px; }
    .ep-pc { display: none; }
    .ep-mb { display: block; }
}

@media (max-width: 768px) {
    html { font-size: 14px; }

    .ep-site-name { font-size: 1.1rem; }
    .ep-domain-pill .epd-url { font-size: .9rem; }

    .ep-nav-row { align-items: stretch; }

    .ep-zone-lbl {
        width: 15%;
        min-width: 15%;
        max-width: 15%;
        font-size: 10px;
        padding: 3px 1px;
        letter-spacing: 0;
        line-height: 1.4;
        word-break: break-all;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .ep-zone-links {
        width: 85%;
        flex: 1;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 2px;
        padding: 3px 4px;
        align-items: center;
    }

    .ep-zone-links a {
        font-size: 12px;
        padding: 4px 2px;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }

    /* Search: one row, no wrap */
    .ep-search-card form {
        flex-wrap: nowrap;
        gap: 3px;
    }

    .ep-search-card input[type="text"] {
        height: 33px;
        font-size: .74rem;
        padding: 0 7px;
    }

    .ep-search-card button {
        height: 33px;
        padding: 0 7px;
        font-size: .68rem;
    }

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

    .ep-thumb { aspect-ratio: 600 / 350; }
    .ep-caption h5 { font-size: .71rem; }
    .ep-section { padding: 9px 9px 7px; }
    .ep-dl-btn { padding: 8px 15px; font-size: .83rem; }
}

@media (min-width: 481px) and (max-width: 768px) {
    .ep-zone-lbl { font-size: 10px; }
    .ep-zone-links a { font-size: 13px; }
}

@media (max-width: 380px) {
    .ep-zone-lbl { font-size: 10px; }
    .ep-zone-links a { font-size: 12px; }
    .ep-search-card button { padding: 0 5px; font-size: .63rem; }
}
