/* ═══════════════════════════════════════════════
   WP Anime Index — Frontend CSS
   ═══════════════════════════════════════════════ */

/* ── Reset del contenedor del tema en singles ── */
.wai-single-page {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

/* ── Banner ── */
.wai-banner {
    width: 100%;
    height: 260px;
    background-size: cover;
    background-position: center 20%;
    background-color: var(--wai-surface2);
}

/* ── Wrapper interior ── */
.wai-single-wrap {
    max-width: 1080px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}

/* ── Layout: aside + main ── */
.wai-single-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 40px;
    align-items: start;
}
@media (max-width: 720px) {
    .wai-single-layout { grid-template-columns: 1fr; }
}

/* ── Portada ── */
.wai-single-cover {
    margin-bottom: 16px;
}
.wai-single-cover img {
    width: 100%;
    max-width: 220px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,.25);
    display: block;
}

/* ── Tabla de metadatos ── */
.wai-meta-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 14px;
    margin-bottom: 12px;
}
.wai-meta-table th,
.wai-meta-table td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--wai-border);
    text-align: left;
    vertical-align: top;
}
.wai-meta-table th {
    color: var(--wai-text-muted);
    font-weight: 600;
    white-space: nowrap;
    width: 90px;
}

/* ── Géneros ── */
.wai-genres { margin: 8px 0 16px; }
.wai-tag {
    display: inline-block;
    margin: 3px 3px 0 0;
    background: var(--wai-surface2);
    color: var(--wai-text);
    padding: 3px 10px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 12px;
    transition: background .15s;
}
.wai-tag:hover { background: var(--wai-accent); color: var(--wai-header-text, #fff); }

/* ── Franquicia ── */
.wai-franchise {
    margin-top: 20px;
    border-top: 1px solid var(--wai-border);
    padding-top: 12px;
}
.wai-franchise h4 {
    font-size: 13px;
    color: var(--wai-text-muted);
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.wai-franchise-item {
    display: block;
    font-size: 13px;
    padding: 4px 0;
    text-decoration: none;
    color: var(--wai-link);
    border-bottom: 1px dotted var(--wai-border);
}
.wai-franchise-item:hover { color: var(--wai-accent); }

/* ── Columna principal ── */
.wai-single-title {
    margin: 0 0 4px;
    font-size: 28px;
    line-height: 1.2;
}
.wai-alt-title {
    font-size: 15px;
    color: var(--wai-text-muted);
    margin: 0 0 2px;
}
.wai-native-title {
    font-size: 13px;
    color: var(--wai-text-muted);
    margin: 0 0 20px;
}

/* ── Editorial ── */
.wai-editorial {
    margin-top: 24px;
    font-size: 16px;
    line-height: 1.8;
    color: var(--wai-text);
}
.wai-editorial h2 {
    font-size: 18px;
    border-bottom: 2px solid #e63946;
    padding-bottom: 6px;
    margin-bottom: 16px;
}

/* ── Trailer ── */
.wai-trailer { margin-top: 32px; }
.wai-trailer h2 {
    font-size: 18px;
    border-bottom: 2px solid #e63946;
    padding-bottom: 6px;
    margin-bottom: 16px;
}
.wai-trailer__wrap {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    background: #000;
}
.wai-trailer__wrap iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}

/* ══════════════════════════════════════════════
   ÍNDICE / GRID
   ══════════════════════════════════════════════ */

/* ── Filtros ── */
.wai-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    align-items: center;
}
.wai-filters input[type="text"],
.wai-filters select {
    padding: 8px 12px;
    border: 1px solid var(--wai-border);
    border-radius: 4px;
    font-size: 14px;
    flex: 1 1 140px;
}
.wai-filters button {
    padding: 8px 20px;
    background: var(--wai-accent);
    color: var(--wai-header-text, #fff);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}
.wai-filters button:hover { background: var(--wai-accent-h); }
.wai-filters a { padding: 8px 12px; color: var(--wai-text-muted); font-size: 14px; text-decoration: none; }

/* ── Grid ── */
.wai-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}

/* ── Card ── */
.wai-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
    transition: transform .2s, box-shadow .2s;
    background: var(--wai-surface);
}
.wai-card:hover { transform: translateY(-4px); box-shadow: 0 6px 16px rgba(0,0,0,.18); }
.wai-card__thumb {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
    background: var(--wai-surface2);
}
.wai-card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wai-card__no-img { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 40px; }
.wai-card__score {
    position: absolute; bottom: 6px; left: 6px;
    background: rgba(0,0,0,.7); color: var(--wai-gold);
    font-size: 12px; font-weight: 700;
    padding: 2px 6px; border-radius: 4px;
}
.wai-card__info { padding: 10px 12px; flex: 1; }
.wai-card__info h3 { margin: 0 0 4px; font-size: 14px; line-height: 1.3; }
.wai-card__meta, .wai-card__genres { margin: 0; font-size: 12px; color: var(--wai-text-muted); }

.wai-empty { color: var(--wai-text-muted); font-style: italic; }

/* ── Paginación AJAX del directorio ───────────────────────── */
.wai-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 32px 0 16px;
    flex-wrap: wrap;
}
.wai-page-btn {
    padding: 8px 18px;
    border: 1px solid currentColor;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    transition: opacity .2s;
}
.wai-page-btn:disabled { opacity: .35; cursor: default; }
#wai-page-info { font-size: 14px; opacity: .75; }
#wai-index-grid { transition: opacity .2s; }
