/*
Theme Name: Adult Gallery Theme
Theme URI: https://example.com/adult-gallery
Author: Developer
Description: High performance, Core Web Vitals optimized adult gallery theme built for speed, SEO, and native media formats. Zero framework.
Version: 1.1.0
Text Domain: adult-gallery
*/

:root {
    --bg-color: #ffffff;
    --bg-secondary: #f3f4f6;
    --text-color: #111827;
    --text-muted: #6b7280;
    --accent-color: #ec4899;
    --accent-hover: #db2777;
    --accent-glow: rgba(236, 72, 153, 0.15);
    --border-color: #e5e7eb;
    --card-bg: #f9fafb;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --card-shadow-hover: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
    --font-heading: 'Inter', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --header-blur: rgba(255, 255, 255, 0.85);
    --search-bg: #f3f4f6;
    --tag-bg: #f3f4f6;
    --tag-color: #374151;
}

html[data-theme="dark"] {
    --bg-color: #0a0e1a;
    --bg-secondary: #111827;
    --text-color: #f1f5f9;
    --text-muted: #94a3b8;
    --accent-color: #f472b6;
    --accent-hover: #ec4899;
    --accent-glow: rgba(244, 114, 182, 0.2);
    --border-color: #1e293b;
    --card-bg: #1e293b;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --card-shadow-hover: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
    --header-blur: rgba(10, 14, 26, 0.85);
    --search-bg: #1e293b;
    --tag-bg: #1e293b;
    --tag-color: #cbd5e1;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
}

/* ═══════════════════════════════════════
   CRITICAL: Prevent CLS on ALL images
   Forces aspect-ratio and containment on
   every image in post content, even those
   lacking width/height attributes.
   ═══════════════════════════════════════ */
img, video {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Force CLS prevention on content images that have no explicit dimensions */
.entry-content img:not([width]),
.entry-content img[width="0"],
.myrpf-xphto {
    width: 100%;
    height: auto;
    aspect-ratio: 2/3;
    object-fit: contain;
    background: var(--bg-secondary);
    contain: layout;
}

/* If width/height IS present, respect it and just ensure responsive */
.entry-content img[width] {
    max-width: 100%;
    height: auto;
}

/* ═══════════════════════════════════════
   HEADER - Glassmorphism sticky header
   ═══════════════════════════════════════ */
.site-header {
    background: var(--header-blur);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background 0.3s ease;
}

/* WP admin bar offset */
.admin-bar .site-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar .site-header {
        top: 46px;
    }
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.site-branding {
    display: flex;
    align-items: center;
}

.site-logo img {
    max-height: 50px;
    width: auto;
    display: block;
}

.site-branding .site-title {
    font-size: 1.4rem;
    font-weight: 800;
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
    color: var(--text-color);
    transition: color 0.2s;
}

.site-branding .site-title:hover {
    color: var(--accent-color);
}

/* ═══════════════════════════════════════
   NAVIGATION & MOBILE MENU
   ═══════════════════════════════════════ */
.site-navigation {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    width: 40px;
    height: 40px;
    position: relative;
    z-index: 101;
}

.hamburger, .hamburger::before, .hamburger::after {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-color);
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1), background-color 0.3s;
    position: absolute;
    left: 8px;
}

.hamburger {
    top: 19px;
}

.hamburger::before {
    content: '';
    top: -6px;
    left: 0;
}

.hamburger::after {
    content: '';
    top: 6px;
    left: 0;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger {
    background: transparent;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger::before {
    transform: rotate(45deg);
    top: 0;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger::after {
    transform: rotate(-45deg);
    top: 0;
}

.nav-menu,
.site-navigation ul {
    display: flex;
    list-style: none;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
}

.nav-menu li a,
.site-navigation ul li a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 8px;
    transition: all 0.2s;
    text-decoration: none;
}

.nav-menu li a:hover,
.nav-menu .current-menu-item a,
.site-navigation ul li a:hover,
.site-navigation ul .current_page_item a {
    color: var(--accent-color);
    background: var(--accent-glow);
}

/* Search form in header */
.header-search {
    position: relative;
}

.header-search input[type="search"] {
    background: var(--search-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    width: 180px;
    transition: width 0.3s ease, border-color 0.2s;
    outline: none;
    font-family: var(--font-body);
}

.header-search input[type="search"]:focus {
    width: 240px;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.header-search::before {
    content: "🔍";
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    pointer-events: none;
}

/* Theme Toggle */
.theme-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.5rem 0.75rem;
    border-radius: 9999px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: all 0.2s;
    font-family: var(--font-body);
}

.theme-toggle:hover {
    background: var(--accent-glow);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* ═══════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════ */
.site-main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    min-height: 80vh;
}

/* ═══════════════════════════════════════
   GRID for archive / home
   ═══════════════════════════════════════ */
.model-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

.model-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border: 1px solid var(--border-color);
}

.model-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--card-shadow-hover);
}

.model-card a {
    color: inherit;
}

.model-thumbnail {
    aspect-ratio: 3/4;
    width: 100%;
    object-fit: cover;
}

.model-info {
    padding: 0.75rem 1rem;
}

.model-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ═══════════════════════════════════════
   SINGLE POST
   ═══════════════════════════════════════ */
.single-header {
    margin-bottom: 2rem;
    text-align: center;
    padding: 1rem 0;
}

.single-title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    .single-title {
        font-size: 1.4rem;
    }
}

/* Category / tag labels */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.post-tags a {
    display: inline-block;
    background: var(--tag-bg);
    color: var(--tag-color);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid var(--border-color);
}

.post-tags a:hover {
    background: var(--accent-glow);
    color: var(--accent-color);
    border-color: var(--accent-color);
}

/* ═══════════════════════════════════════
   ENTRY CONTENT — Post body images
   ═══════════════════════════════════════ */
.entry-content {
    max-width: 900px;
    margin: 0 auto;
}

/* Style the inline post content image wrappers */
.entry-content .myrpf-xph {
    margin-bottom: 0.75rem;
}

.entry-content .myrpf-xphto {
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease;
}

.entry-content .myrpf-xphto:hover {
    transform: scale(1.01);
}

.entry-content p {
    margin-bottom: 1rem;
    font-size: 1rem;
    line-height: 1.7;
}

/* Hide duplicate nested entry-content from plugins */
.entry-content .entry-content {
    max-width: none;
    margin: 0;
}

/* ═══════════════════════════════════════
   PHOTO GALLERY (attachment-based)
   ═══════════════════════════════════════ */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
    margin: 2rem auto;
    max-width: 900px;
}

.gallery-item img {
    border-radius: 8px;
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease;
}

.gallery-item img:hover {
    transform: scale(1.02);
}

/* ═══════════════════════════════════════
   VIDEO GALLERY
   ═══════════════════════════════════════ */
.video-gallery {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin: 2rem auto;
    max-width: 900px;
}

.video-item video {
    width: 100%;
    max-height: 80vh;
    border-radius: 12px;
    background: #000;
    box-shadow: var(--card-shadow);
}

/* ═══════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════ */
.nav-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 3rem;
    padding: 1rem 0;
}

.nav-links a,
.nav-links span {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
}

.nav-links a:hover {
    background: var(--accent-glow);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* ═══════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════ */
.site-footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ═══════════════════════════════════════
   UTILITY: Hide ads/adace stuff cleanly
   ═══════════════════════════════════════ */
.adace-slot-wrapper {
    margin: 1.5rem 0;
}

/* SNAX voting cleanup */
.snax-voting-container {
    text-align: center;
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

/* ═══════════════════════════════════════
   MOBILE RESPONSIVE
   ═══════════════════════════════════════ */
/* ═══════════════════════════════════════
   BREADCRUMB (Yoast)
   ═══════════════════════════════════════ */
.breadcrumb {
    max-width: 1200px;
    margin: 0 auto 1rem;
    padding: 0 1rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--text-muted);
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--accent-color);
}

.breadcrumb p {
    margin: 0;
}

/* ═══════════════════════════════════════
   POST META (date, author)
   ═══════════════════════════════════════ */
.post-meta {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.post-date {
    color: var(--text-muted);
}

/* ═══════════════════════════════════════
   ARCHIVE HEADER
   ═══════════════════════════════════════ */
.archive-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.archive-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.archive-description {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
    max-width: 700px;
}

.archive-description p {
    margin: 0;
}

/* ═══════════════════════════════════════
   RELATED POSTS
   ═══════════════════════════════════════ */
.related-posts {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.related-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: -0.01em;
}

/* ═══════════════════════════════════════
   SEARCH FORM (standalone)
   ═══════════════════════════════════════ */
.search-form {
    display: flex;
    gap: 0.5rem;
    max-width: 500px;
    margin: 0 auto;
}

.search-form .search-field {
    flex: 1;
    background: var(--search-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
    font-family: var(--font-body);
    outline: none;
    transition: border-color 0.2s;
}

.search-form .search-field:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-form .search-submit {
    background: var(--accent-color);
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-body);
    transition: background 0.2s;
}

.search-form .search-submit:hover {
    background: var(--accent-hover);
}

/* ═══════════════════════════════════════
   PAGINATION (numbered)
   ═══════════════════════════════════════ */
.pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    text-decoration: none;
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}

/* ═══════════════════════════════════════
   MOBILE RESPONSIVE
   ═══════════════════════════════════════ */
@media (max-width: 640px) {
    .header-inner {
        flex-wrap: wrap;
    }

    .site-navigation {
        width: 100%;
        justify-content: space-between;
    }

    .header-search input[type="search"] {
        width: 140px;
    }

    .header-search input[type="search"]:focus {
        width: 180px;
    }

    .model-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }

    .photo-gallery {
        grid-template-columns: 1fr;
    }

    .archive-title {
        font-size: 1.4rem;
    }

    .related-title {
        font-size: 1.2rem;
    }
}

/* Mobile Navigation */
@media screen and (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
        margin-left: auto;
    }
    
    .site-navigation {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 350px;
        height: 100vh;
        background: var(--bg-color);
        flex-direction: column;
        align-items: flex-start;
        padding: 5rem 2rem 2rem;
        gap: 1.5rem;
        box-shadow: -10px 0 30px rgba(0,0,0,0.5);
        transition: right 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
        z-index: 100;
        overflow-y: auto;
    }
    
    .site-navigation.is-open {
        right: 0;
    }
    
    .nav-menu,
    .site-navigation ul {
        flex-direction: column;
        width: 100%;
    }
    
    .nav-menu li,
    .site-navigation ul li {
        width: 100%;
    }
    
    .nav-menu li a,
    .site-navigation ul li a {
        padding: 1rem 0;
        font-size: 1.1rem;
        border-bottom: 1px solid var(--border-color);
        border-radius: 0;
    }
    
    .nav-menu li a:hover,
    .nav-menu .current-menu-item a,
    .site-navigation ul li a:hover,
    .site-navigation ul .current_page_item a {
        background: transparent;
        padding-left: 0.5rem;
    }
    
    .header-search, .header-search input[type="search"] {
        width: 100%;
    }
    
    .header-inner {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
    }
    
    .site-branding {
        flex: 1;
    }
}

/* ═══════════════════════════════════════
   BANNER AD SLOTS (300×300)
   ═══════════════════════════════════════ */

/* Base ad container — centered, CLS-safe */
.ag-ad-slot {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 1rem 0;
    overflow: hidden;
}

.ag-ad-inner {
    width: 300px;
    min-height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-secondary);
    border: 1px solid rgba(255,255,255,0.06);
}

/* Allow ad content to fill container */
.ag-ad-inner img,
.ag-ad-inner iframe,
.ag-ad-inner ins {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ── Header Ad: below site header ── */
.ag-ad-ad_header {
    padding: 0.75rem 0;
    background: linear-gradient(180deg, var(--bg-color) 0%, transparent 100%);
}

/* ── Before Content Ad ── */
.ag-ad-ad_before_content {
    margin: 1rem 0;
}

/* ── Mid-Content Ad (injected via filter) ── */
.ag-ad-ad_mid_content {
    margin: 1.5rem 0;
    clear: both;
}

/* ── After Content Ad ── */
.ag-ad-ad_after_content {
    margin: 1.5rem 0;
}

/* ── Grid/Sidebar Ad: spans full grid row ── */
.ag-ad-ad_sidebar {
    grid-column: 1 / -1;
    padding: 1rem 0;
}

.ag-ad-ad_sidebar .ag-ad-inner {
    background: transparent;
    border: none;
}

/* ── Footer Ad: above footer ── */
.ag-ad-ad_footer {
    padding: 1rem 0;
    background: linear-gradient(0deg, var(--bg-color) 0%, transparent 100%);
}

/* Mobile: scale down if ad overflows */
@media (max-width: 350px) {
    .ag-ad-inner {
        width: 100%;
        min-height: 200px;
    }
}
