/*
Theme Name: MyBrattyFamily
Theme URI: https://brattysis.video/
Author: Developer
Author URI: https://brattysis.video/
Description: A flexible video tube theme with extensive brand customization. Features: Configurable Adult Gate (age verification) with multiple styles, optional Homepage sections (Models/Categories), algorithmic color palette generator with industry presets, multi-placement banner system, cross-promotion cards, editable text labels, homepage filters (models/categories), lazy load video, LCP optimization, separate templates and taglines for models and categories with variable support, episode numbering format options, 5 card styles (default, minimal, detailed, overlay, bordered), related videos section, AJAX instant search. Multisite-ready.
Version: 6.5.7
License: GNU General Public License v2 or later
Text Domain: mybrattyfamily
*/

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: #050509;
    color: #f5f5f5;
}

a {
    color: #ff6b6b;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.site-header {
    background: #0b0b12;
    padding: 16px;
    border-bottom: 1px solid #20202b;
}

@media (min-width: 600px) {
    .site-header {
        padding: 20px 16px;
    }
}

.site-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.site-title {
    flex-shrink: 0;
}

.site-title a {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
}

@media (min-width: 600px) {
    .site-title a {
        font-size: 22px;
    }
}

@media (min-width: 960px) {
    .site-title a {
        font-size: 24px;
    }
}

.site-tagline {
    font-size: 13px;
    color: #f5f5f5;
    line-height: 1.4;
    flex: 1;
    min-width: 0;
}

.site-tagline strong,
.site-tagline b {
    color: #ff3b6b;
}

@media (max-width: 900px) {
    .site-branding {
        gap: 12px;
    }
    
    .site-tagline {
        font-size: 12px;
    }
}

@media (max-width: 600px) {
    .site-tagline {
        font-size: 11px;
    }
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.main-nav a {
    margin-left: 0;
    font-size: 12px;
    text-transform: uppercase;
    color: #d6d6f0;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(255,255,255,0.05);
}

@media (min-width: 600px) {
    .main-nav a {
        font-size: 13px;
        background: transparent;
        padding: 0;
        margin-left: 16px;
    }
}

@media (min-width: 960px) {
    .main-nav a {
        font-size: 14px;
    }
}

.site-content {
    max-width: 1200px;
    margin: 16px auto 32px;
    padding: 0 12px;
    contain: layout style;
}

@media (min-width: 600px) {
    .site-content {
        margin: 24px auto 40px;
        padding: 0 16px;
    }
}

/* Homepage header with filters */
.homepage-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.homepage-header .page-title {
    margin: 0;
}

.homepage-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-select {
    background: #10101a;
    color: #f5f5f5;
    border: 1px solid #2a2a3a;
    border-radius: 8px;
    padding: 10px 36px 10px 14px;
    font-size: 14px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23999' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    min-width: 160px;
}

.filter-select:hover {
    border-color: #ff6b9d;
}

.filter-select:focus {
    outline: none;
    border-color: #ff6b9d;
}

@media (max-width: 600px) {
    .homepage-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .homepage-filters {
        width: 100%;
    }
    .filter-select {
        flex: 1;
        min-width: 0;
    }
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    margin: 12px 0 20px;
}

/* Model tagline - shown under model name when description is in header */
.model-tagline {
    color: #a0a0b0;
    font-size: 15px;
    line-height: 1.5;
    margin: -12px 0 20px;
    font-style: italic;
}

@media (min-width: 600px) {
    .model-tagline {
        font-size: 16px;
        margin: -16px 0 24px;
    }
}

@media (min-width: 600px) {
    .page-title {
        font-size: 24px;
        margin: 12px 0 24px;
    }
}

@media (min-width: 960px) {
    .page-title {
        font-size: 26px;
    }
}

/* Single title – smaller */
.single-title {
    font-size: 18px;
    line-height: 1.3;
    margin: 10px 0 8px;
}

@media (min-width: 600px) {
    .single-title {
        font-size: 20px;
    }
}

/* Grid layout */

.post-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
    contain: layout style;
}

@media (min-width: 600px) {
    .post-grid {
        gap: 20px;
    }
}

@media (max-width: 900px) {
    .post-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 500px) {
    .post-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }
}

.post-card {
    background: #10101a;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    contain: layout style paint; /* Prevent CLS - isolate layout calculations */
}

/* Reserve space for card content to prevent CLS */
.post-card-link-thumb {
    aspect-ratio: 16 / 9;
}

.post-card-link .post-card-title {
    min-height: 40px; /* ~2 lines */
}

@media (min-width: 600px) {
    .post-card {
        border-radius: 14px;
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
    }
}

/* Optimize rendering for cards below the fold */
.post-card:nth-child(n+5) {
    content-visibility: auto;
    contain-intrinsic-size: auto 350px; /* Estimated card height */
}

.post-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.post-card-link-thumb {
    position: relative;
    display: block;
    overflow: hidden;
    background: #000;
    aspect-ratio: 16 / 9;
    border-radius: var(--card-radius, 12px) var(--card-radius, 12px) 0 0;
}

/* Fallback for browsers without aspect-ratio support */
@supports not (aspect-ratio: 16 / 9) {
    .post-card-link-thumb {
        padding-top: 56.25%; /* 9/16 = 0.5625 */
    }
    .post-card-link-thumb img {
        position: absolute;
        top: 0;
        left: 0;
    }
}

.post-card-link-thumb img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.post-card:hover .post-card-link-thumb img {
    transform: scale(1.04);
}

.post-card-link img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.post-card:hover .post-card-link img {
    transform: scale(1.04);
}

.post-card-link::before {
    content: "▶";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%) scale(0.9);
    font-size: 22px;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    color: #ffffff;
    text-shadow: 0 0 8px rgba(0,0,0,0.7);
    z-index: 2;
    pointer-events: none;
}

.post-card:hover .post-card-link::before {
    opacity: 0.9;
    transform: translateY(-50%) scale(1);
}

/* Legacy support for old class name */
.post-card-thumb {
    position: relative;
    display: block;
    overflow: hidden;
    background: #000;
    aspect-ratio: 16 / 9;
}

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

.post-card:hover .post-card-thumb img {
    transform: scale(1.04);
}

.post-card-thumb::after {
    content: "▶";
    position: absolute;
    right: 10px;
    bottom: 10px;
    font-size: 22px;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.2s ease, transform 0.2s ease;
    color: #ffffff;
    text-shadow: 0 0 8px rgba(0,0,0,0.7);
}

.post-card:hover .post-card-thumb::after {
    opacity: 0.9;
    transform: scale(1);
}

.post-card-views {
    position: absolute !important;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.78);
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #f8f8ff;
    z-index: 5;
}

.post-card-duration {
    position: absolute !important;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.78);
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    color: #f8f8ff;
    font-weight: 500;
    z-index: 5;
}

.post-card-new-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #ff3366;
    background: var(--new-badge-color, #ff3366);
    color: #fff !important;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 10;
    animation: pulse-badge 2s ease-in-out infinite;
    pointer-events: none;
}

@media (max-width: 768px) {
    .post-card-new-badge {
        top: 6px;
        left: 6px;
        padding: 3px 8px;
        font-size: 10px;
    }
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.post-card-badge-category {
    background: var(--brand-color, #ff3b6b);
    color: #fff;
}

/* Title inside link - new structure */
.post-card-link .post-card-title {
    display: block;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: #ffffff;
    background: var(--card-bg, #1a1a2e);
}

.post-card:hover .post-card-link .post-card-title {
    color: #ff9f6b;
}

/* Legacy support for old structure */
.post-card-body {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.post-card-body .post-card-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

.post-card-title a {
    color: #ffffff;
}

.post-card-title a:hover {
    color: #ff9f6b;
}

.post-card-models {
    font-size: 12px;
    color: #cfcfea;
}

.post-card-models a {
    color: #ffb86b;
    text-decoration: none;
}

.post-card-models a:hover {
    text-decoration: underline;
}

.post-card-excerpt {
    padding: 0 12px 8px;
    font-size: 12px;
    color: #a0a0c0;
    line-height: 1.4;
    min-height: 0; /* Allow collapse when empty */
    overflow: hidden;
}

.post-card-excerpt p {
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-meta {
    padding: 0 12px 12px;
    font-size: 12px;
    color: #a0a0c0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    min-height: 28px; /* Prevent CLS */
}

/* Legacy support */
.post-card-meta-row {
    font-size: 12px;
    color: #a0a0c0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

/* Grid ad placeholders */

.grid-ad-item {
    background: #090910;
    border-radius: 14px;
    border: 1px dashed #3d3d55;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    text-align: center;
    font-size: 13px;
    color: #ccccff;
}

/* Pagination */

.pagination {
    margin-top: 26px;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 6px 11px;
    border-radius: 999px;
    border: 1px solid #303049;
    font-size: 13px;
}

.pagination .current {
    background: #ff6b6b;
    border-color: #ff6b6b;
    color: #fff;
}

/* Pagination CTA */
.pagination-cta {
    margin-top: 30px;
    text-align: center;
}

.pagination-cta-btn {
    display: inline-block;
    padding: 16px 40px;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #000;
    background: linear-gradient(135deg, #ffb300 0%, #ff6b6b 100%);
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
    transition: all 0.3s ease;
}

.pagination-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(255, 107, 107, 0.4);
}

@media (max-width: 600px) {
    .pagination-cta-btn {
        padding: 14px 30px;
        font-size: 13px;
    }
}

/* Single layout */

.single-main {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Video + Sidebar Row */
.single-video-row {
    display: block;
}

.single-video-col {
    min-width: 0;
    width: 100%;
}

/* Sidebar next to video */
.single-sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: sticky;
    top: 20px;
}

.single-sidebar-banner {
    display: block;
}

.single-sidebar-banner img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.single-sidebar-download {
    display: block;
    background: linear-gradient(180deg, #c41a1a 0%, #8b0000 100%);
    color: #fff;
    text-align: center;
    padding: 16px 20px;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.single-sidebar-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
    color: #fff;
}

/* CTA Full Width */
.single-cta-fullwidth {
    margin-top: 0;
    max-width: 100% !important;
    width: 100%;
}

/* Content section below CTA */
.single-main-content {
    margin-top: 20px;
}

/* Hide sidebar on mobile */
@media (max-width: 900px) {
    body .single-main .single-video-row,
    body .single-video-row,
    .single-video-row {
        display: block !important;
        grid-template-columns: unset !important;
        gap: 0 !important;
    }
    
    body .single-sidebar,
    .single-sidebar {
        display: none !important;
    }
}

.single-video-wrapper {
    background: #050509;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65);
}

@media (max-width: 600px) {
    .single-video-wrapper {
        margin-left: -16px;
        margin-right: -16px;
        border-radius: 0;
    }
}

.single-video-wrapper video {
    width: 100%;
    height: auto;
    display: block;
    background: #000;
}

/* Lazy load video */
.video-lazy {
    position: relative;
    cursor: pointer;
}

.video-lazy img {
    width: 100%;
    height: auto;
    display: block;
}

.video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #ff6b9d;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.video-play-btn:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 6px 30px rgba(255,107,157,0.5);
}

.video-play-btn svg {
    width: 36px;
    height: 36px;
    color: #fff;
    margin-left: 4px;
}

.single-meta {
    margin-top: 6px;
    font-size: 12px;
    color: #c0c0dd;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.single-meta-item {
    padding: 3px 10px;
    border-radius: 999px;
    background: #11111f;
}

/* CTA - see end of file for main styles */

/* Description shorter */

.single-description {
    margin-top: 20px;
    position: relative;
    font-size: 14px;
    line-height: 1.6;
    color: #dadaf0;
}

.single-description-body {
    max-height: 110px;
    overflow: hidden;
    transition: max-height 0.25s ease;
}

.single-description.is-expanded .single-description-body {
    max-height: 9999px;
}

.single-description-fade {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 34px;
    height: 60px;
    background: linear-gradient(to bottom, rgba(5,5,9,0), #050509);
    pointer-events: none;
}

.single-description.is-expanded .single-description-fade {
    display: none;
}

.single-description-toggle {
    margin-top: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid #303049;
    background: #141420;
    color: #f5f5ff;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
}

.single-description-toggle:hover {
    background: #1f1f30;
}

/* Tags badges */

.single-tags {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.single-tag-label {
    font-size: 12px;
    color: #a0a0c0;
    margin-right: 4px;
}

.tag-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: #151528;
    font-size: 11px;
    color: #f5f5ff;
}

.tag-badge a {
    color: inherit;
    text-decoration: none;
}

.tag-badge a:hover {
    text-decoration: underline;
}

/* Responsive images in ads/banners - prevent CLS while staying responsive */
.banner-placement img,
.post-card-ad img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 6px;
}

/* Latest episodes */

.single-latest-section {
    margin-top: 32px;
}

.single-latest-title {
    font-size: 20px;
    margin: 0 0 16px;
}

/* Footer */

.site-footer {
    border-top: 1px solid #20202b;
    padding: 30px 16px 40px;
    font-size: 12px;
    color: #8a8aa6;
    text-align: center;
    background: #0b0b12;
}

.site-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.site-footer-description {
    max-width: 800px;
    margin: 0 auto 25px;
    padding: 20px 25px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 14px;
    line-height: 1.7;
    color: #9b9bb5;
    text-align: center;
}

.site-footer-description a {
    color: #ff3b6b;
    text-decoration: none;
    transition: color 0.3s ease;
}

.site-footer-description a:hover {
    color: #f5f5f5;
    text-decoration: underline;
}

.site-footer-description strong,
.site-footer-description b {
    color: #f5f5f5;
    font-weight: 600;
}

.site-footer-copy {
    font-size: 13px;
    color: #9b9bb5;
    margin-bottom: 15px;
}

.site-footer-copy a {
    color: #f5f5f5;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.site-footer-copy a:hover {
    color: #ff3b6b;
}

.site-footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 20px;
    margin-bottom: 20px;
}

.site-footer-nav a {
    color: #9b9bb5;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s ease;
}

.site-footer-nav a:hover {
    color: #ff3b6b;
}

.site-footer-rta {
    margin: 15px 0;
    text-align: center;
}

.site-footer-rta a {
    display: inline-block;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.site-footer-rta a:hover {
    opacity: 1;
}

.site-footer-rta img,
.site-footer-rta svg {
    display: inline-block;
    max-height: 40px;
    width: auto;
}

.site-footer-rta .rta-logo-custom {
    max-height: 50px;
    width: auto;
}

.site-footer-disclaimer {
    font-size: 11px;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

@media (max-width: 600px) {
    .site-footer {
        padding: 25px 16px 35px;
    }
    .site-footer-description {
        padding: 15px 18px;
        font-size: 13px;
        margin-bottom: 20px;
    }
    .site-footer-nav {
        gap: 6px 15px;
    }
    .site-footer-nav a {
        font-size: 12px;
    }
}

/* =========================
   Single video – fix player & CTA (v1.8)
   ========================= */

/* 1. Player na mobile – normalne marginesy, bez full-bleed */
@media (max-width: 600px) {
  .single-video-wrapper {
    margin-left: 0;
    margin-right: 0;
    border-radius: 8px;
  }
}

/* Label + text on center */
.single-cta-label {
  text-align: center;
}

.single-cta-button {
  width: 100%;
  text-align: center;
}

/* Mobile tweaks - CTA handled in inline CSS in single.php */


/* === Grid cards: excerpt + meta badges === */

.post-card-excerpt {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.45;
    color: #e3e3f5;
}
.post-card-excerpt p {
    margin: 0;
}

.post-card-meta-row {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 11px;
}

.post-card-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid rgba(200, 100, 150, 0.5);
    background: transparent;
    color: #e0e0f0;
    text-decoration: none;
    white-space: nowrap;
    font-size: 12px;
}

.post-card-badge-model {
    border-color: rgba(200, 100, 150, 0.6);
    color: #e8e8f8;
}

.post-card-badge-date {
    border-color: rgba(150, 150, 180, 0.4);
    color: #c0c0d8;
}

.post-card-badge-more {
    background: rgba(255, 255, 255, 0.08);
    border-style: dashed;
    color: #b8b8d5;
}

.post-card-badge:hover {
    filter: brightness(1.2);
    text-decoration: none;
    border-color: rgba(200, 100, 150, 0.8);
}

/* === CTA under video === */

.single-cta-wrapper {
    margin-top: 16px;
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(90deg, #ffb347, #ff6b6b);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    position: relative;
    z-index: 10;
}

.single-cta-button {
    display: block;
    width: 100%;
    padding: 14px 18px;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #1b1020;
    text-decoration: none;
    background: transparent;
    border: none;
}

.single-cta-button:hover {
    filter: brightness(1.08);
    text-decoration: none;
}

/* === Episode header + meta & taxonomies (single page) === */

.episode-header {
    margin-bottom: 12px;
}

.episode-title {
    margin: 0;
    font-size: 17px;
    line-height: 1.35;
    color: #ffffff;
    font-weight: 600;
}

@media (min-width: 600px) {
    .episode-title {
        font-size: 18px;
    }
}

@media (min-width: 960px) {
    .episode-title {
        font-size: 20px;
    }
}

.episode-meta-row {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
}

.meta-pill {
    padding: 5px 14px;
    border-radius: 999px;
    border: 1px solid rgba(200, 100, 150, 0.5);
    background: transparent;
    color: #e0e0f0;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 12px;
}

.meta-pill-date {
    border-color: rgba(200, 100, 150, 0.5);
}

.meta-pill-views {
    border-color: rgba(200, 100, 150, 0.5);
}

.episode-taxonomies {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.episode-taxonomy-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
}

.episode-taxonomy-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #a0a0c5;
}

.episode-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.episode-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    border: 1px solid rgba(200, 100, 150, 0.5);
    background: transparent;
    color: #e0e0f0;
    text-decoration: none;
    white-space: nowrap;
}

.episode-badge-model {
    border-color: rgba(200, 100, 150, 0.6);
    color: #e8e8f8;
}

.episode-badge-category {
    border-color: rgba(200, 100, 150, 0.6);
    color: #e8e8f8;
}

.episode-badge-extra {
    display: none;
}

.episode-badges.is-expanded .episode-badge-extra {
    display: inline-flex;
}

.episode-badge:hover {
    filter: brightness(1.2);
    text-decoration: none;
    border-color: rgba(200, 100, 150, 0.8);
}

.episode-badges-toggle {
    margin-top: 4px;
    background: transparent;
    border: none;
    padding: 0;
    font-size: 12px;
    color: #9da0ff;
    cursor: pointer;
    display: block;
    text-align: left;
}

.episode-badges-toggle:hover {
    text-decoration: underline;
}


.brand-logo {
    max-width: 240px;
    width: auto;
    height: auto;
    display: block;
    /* Prevent CLS - reserve space for logo */
    min-height: 50px;
    aspect-ratio: 303 / 80;
    object-fit: contain;
}

@media (max-width: 768px) {
    .brand-logo {
        max-width: 160px;
        min-height: 35px;
    }
}

@media (max-width: 480px) {
    .brand-logo {
        max-width: 130px;
        min-height: 30px;
    }
}

/* === Taxonomy Grid (Models & Categories pages) === */

.taxonomy-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

@media (max-width: 1100px) {
    .taxonomy-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .taxonomy-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .taxonomy-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.taxonomy-card {
    display: block;
    background: #10101a;
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.taxonomy-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    text-decoration: none;
}

.taxonomy-card-thumb {
    position: relative;
    aspect-ratio: 16 / 10;
    background: #0a0a14;
    overflow: hidden;
}

.taxonomy-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.taxonomy-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
}

.taxonomy-card-placeholder span {
    font-size: 48px;
    font-weight: 700;
    color: #ff3b6b;
    text-transform: uppercase;
    opacity: 0.7;
}

.taxonomy-card-body {
    padding: 14px 16px 16px;
    text-align: center;
}

.taxonomy-card-title {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 600;
    color: #f5f5f5;
    line-height: 1.3;
}

.taxonomy-card-count {
    font-size: 12px;
    color: #9b9bb5;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Promo Banners - styles generated dynamically by PHP with custom prefix */

/* Cross-Promotion Card in Grid */
.promo-card-cross {
    position: relative;
    background: #10101a;
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    align-self: start;
}

.promo-card-cross:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.promo-card-cross a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.promo-card-cross .post-thumb {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
}

.promo-card-cross .post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.promo-card-cross:hover .post-thumb img {
    transform: scale(1.05);
}

.promo-card-body {
    padding: 14px 16px 18px;
}

.promo-card-subtitle {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #f5f5f5;
    margin-bottom: 4px;
    opacity: 0.9;
}

.promo-card-title {
    display: block;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 6px 0;
}

.promo-card-desc {
    display: block;
    font-size: 13px;
    color: #9b9bb5;
    line-height: 1.4;
}

/* Legacy promo card (keep for backward compatibility) */
.promo-card {
    position: relative;
    background: #10101a;
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    align-self: start;
}

.promo-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.promo-card a {
    display: block;
    text-decoration: none;
}

.promo-card .post-thumb {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
}

.promo-card .post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.promo-card:hover .post-thumb img {
    transform: scale(1.05);
}

.promo-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    padding: 40px 16px 16px;
}

/* Grid Ads */
.post-card-ad {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #10101a;
    border-radius: 14px;
    min-height: 250px;
    overflow: hidden;
    align-self: start;
    aspect-ratio: 16 / 9; /* Prevent CLS */
}

.post-card-ad img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.post-card-ad iframe {
    max-width: 100%;
    border-radius: 14px;
}

/* Legal Pages */
.legal-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 0;
}

.legal-content {
    background: #10101a;
    border-radius: 14px;
    padding: 30px;
    line-height: 1.7;
    color: #f5f5f5;
}

.legal-content h2 {
    font-size: 18px;
    color: #ff3b6b;
    margin: 30px 0 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.legal-content h2:first-of-type {
    margin-top: 10px;
}

.legal-content h3 {
    font-size: 15px;
    color: #f5f5f5;
    margin: 20px 0 10px;
}

.legal-content p {
    margin-bottom: 15px;
    color: #9b9bb5;
}

.legal-content ul,
.legal-content ol {
    margin: 0 0 20px 20px;
    color: #9b9bb5;
}

.legal-content li {
    margin-bottom: 8px;
}

.legal-content a {
    color: #ff3b6b;
    text-decoration: none;
}

.legal-content a:hover {
    text-decoration: underline;
}

.legal-updated {
    font-size: 13px;
    color: #666 !important;
    font-style: italic;
    margin-bottom: 20px !important;
}

.legal-notice {
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    border-left: 3px solid #ff3b6b;
}

.legal-notice p {
    margin-bottom: 5px;
}

.legal-note {
    font-size: 12px;
    color: #888 !important;
    font-style: italic;
    background: rgba(255,179,0,0.1);
    padding: 10px 15px;
    border-radius: 6px;
    margin-top: 30px !important;
}

@media (max-width: 600px) {
    .legal-content {
        padding: 20px 15px;
    }
    .legal-content h2 {
        font-size: 16px;
    }
}

/* Taxonomy Description (models/categories) */
.taxonomy-description {
    max-width: 800px;
    margin: 0 auto 24px;
    padding: 16px 20px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255,255,255,0.7);
}

.taxonomy-description p:last-child {
    margin-bottom: 0;
}

/* ========================================
   Homepage Sections (Models/Categories)
   ======================================== */

.homepage-section {
    margin: 40px 0;
    padding: 30px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.homepage-section:first-of-type {
    margin-top: 20px;
    border-top: none;
    padding-top: 0;
}

.section-title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,0.15), transparent);
}

/* Models Grid */
.models-grid,
.categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 600px) {
    .models-grid,
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

@media (min-width: 900px) {
    .models-grid,
    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1100px) {
    .models-grid,
    .categories-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

.model-card,
.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    background: var(--card-bg-transparent, rgba(255,255,255,0.04));
    border: 1px solid var(--card-border-transparent, rgba(255,255,255,0.08));
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.25s ease;
    text-align: center;
    min-height: 80px;
}

.model-card:hover,
.category-card:hover {
    background: var(--hover-brand, #ff6b6b);
    border-color: var(--hover-brand, #ff6b6b);
    transform: translateY(-3px);
    text-decoration: none;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.model-name,
.category-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--card-text, #fff);
    margin-bottom: 4px;
    line-height: 1.3;
}

.model-count,
.category-count {
    font-size: 12px;
    color: var(--card-text-muted, rgba(255, 255, 255, 0.5));
    transition: color 0.25s ease;
}

.model-card:hover .model-count,
.category-card:hover .category-count {
    color: rgba(255, 255, 255, 0.85);
}

.section-view-all {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #ff6b6b;
    border: 1px solid #ff6b6b;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.section-view-all:hover {
    background: #ff6b6b;
    color: #fff;
    text-decoration: none;
}
