:root {
    --title-black: #111827;
    --primary-red: #d32027;
    --bg-page: #f8fafc;
    --card-radius: 14px;
}

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

body {
    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        sans-serif;
    background-color: var(--bg-page);
    color: #1f2937;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}

/* TOP NAVIGATION */
.site-nav {
    background-color: #111;
    color: #fff;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--primary-red);
}

.site-logo {
    font-family: "Anton", sans-serif;
    font-weight: 100;
    font-size: 22px;
    letter-spacing: 1px;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-logo span {
    color: #ff3333;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-nav {
    background-color: transparent;
    color: #ddd;
    border: 1px solid #444;
    padding: 6px 14px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-nav:hover {
    background-color: #222;
    color: #fff;
}

.btn-nav-primary {
    background-color: var(--primary-red);
    border-color: var(--primary-red);
    color: #fff;
}

.btn-nav-primary:hover {
    background-color: #b91c1c;
}

/* MAIN CONTAINER */
.gallery-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 35px 20px 70px;
}

/* HEADER TITLE (COMICS E HISTORIETAS) */
.gallery-header {
    margin-bottom: 25px;
}

.main-headline {
    font-family: "Anton", Impact, sans-serif;
    font-size: 2.4rem;
    letter-spacing: 1px;
    color: var(--title-black);
    text-transform: uppercase;
    line-height: 1;
}

/* SEARCH BAR */
.search-container {
    max-width: 480px;
    margin: 18px 0 35px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 10px 16px 10px 38px;
    font-size: 14px;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    background: #fff;
    outline: none;
    transition:
        border-color 0.2s,
        box-shadow 0.2s;
}

.search-input:focus {
    border-color: var(--title-black);
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.1);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    font-size: 14px;
}

/* COMICS LIST / PANELS */
.comics-grid {
    display: flex;
    flex-direction: column;
    gap: 36px;
}

/* INDIVIDUAL COMIC STRIP CARD */
.comic-card {
    background: #ffffff;
    border: 2.5px solid #0f172a;
    border-radius: var(--card-radius);
    padding: 18px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
    transition:
        transform 0.2s,
        box-shadow 0.2s;
}

.comic-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}

.comic-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 8px;
    border-bottom: 2px dashed #e2e8f0;
    padding-bottom: 10px;
}

.comic-card-title {
    font-size: 1.25rem;
    font-weight: 100;
    color: #0f172a;
}

.comic-card-author {
    font-size: 0.85rem;
    font-weight: 700;
    color: #475569;
    background: #f1f5f9;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid #cbd5e1;
}

/* HORIZONTAL STRIP OF PANELS */
.comic-panels-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
    background: #f8fafc;
    padding: 12px;
    border-radius: 12px;
    border: 1.5px solid #cbd5e1;
}

.comic-panel-box {
    position: relative;
    background: #fff;
    border: 1.5px solid #0f172a;
    border-radius: 8px;
    overflow: hidden;
    cursor: zoom-in;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    transition:
        transform 0.2s,
        box-shadow 0.2s;
}

.comic-panel-box:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-red);
}

.comic-panel-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.panel-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(15, 23, 42, 0.82);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 12px;
    pointer-events: none;
    backdrop-filter: blur(2px);
}

/* LIGHTBOX MODAL WITH PREV/NEXT ARROWS */
.lightbox-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.94);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.lightbox-content {
    position: relative;
    max-width: 96vw;
    max-height: 94vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-img {
    max-width: 100%;
    max-height: 86vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    margin-top: 10px;
    text-align: center;
}

.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.4);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10000;
}

.lightbox-nav-btn:hover {
    background: var(--primary-red);
    border-color: var(--primary-red);
    color: #fff;
}

.lightbox-prev {
    left: -60px;
}
.lightbox-next {
    right: -60px;
}

.lightbox-close {
    position: absolute;
    top: -42px;
    right: 0;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.lightbox-close:hover {
    color: #ff4444;
}

/* NO RESULTS */
.no-results {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 12px;
    border: 1px dashed #cbd5e1;
}

@media (max-width: 850px) {
    .lightbox-prev {
        left: 10px;
    }
    .lightbox-next {
        right: 10px;
    }
}

@media (max-width: 768px) {
    .main-headline {
        font-size: 1.85rem;
    }
    .comic-card {
        padding: 12px;
    }
    .gallery-wrapper {
        padding: 20px 14px 40px;
    }
}
