/* PROJECT: pornai.chat 
   STYLE SYSTEM: Dark Premium Adult AI SaaS (FIXED)
*/

:root {
    --bg-main: #0D0D12;
    --bg-section: #111118;
    --bg-card: #161622;
    --border-color: #232336;
    --accent-primary: #FF2E88;
    --accent-hover: #FF4DA1;
    --accent-glow: rgba(255, 46, 136, 0.3);
    --text-main: #CFCFE6;
    --text-muted: #9C9CB5;
    --white: #FFFFFF;
}

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

html {
    scroll-behavior: smooth;
    scroll-margin-top: 100px;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.7;
    font-size: 18px;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Typography --- */

h1 {
    font-size: 48px;
    line-height: 1.2;
    color: var(--white);
    margin-bottom: 24px;
    font-weight: 800;
}

h2 {
    font-size: 32px;
    color: var(--white);
    margin: 48px 0 24px;
    font-weight: 700;
}

p {
    margin-bottom: 24px;
}

/* --- Buttons --- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 28px;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 16px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
    color: var(--white);
    box-shadow: 0 4px 15px rgba(255, 46, 136, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px var(--accent-glow);
}

.btn-secondary {
    background: #1B1B2A;
    color: var(--white);
    border: 1px solid var(--accent-primary);
}

.btn-secondary:hover {
    background: var(--accent-primary);
    color: var(--white);
}

/* --- Header --- */

header {
    height: 80px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: rgba(13, 13, 18, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--white);
    text-decoration: none;
}

.logo span { color: var(--accent-primary); }

nav a {
    color: var(--text-muted);
    text-decoration: none;
    margin-right: 24px;
    font-size: 15px;
    transition: color 0.3s;
}

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

/* --- Hero --- */

.hero {
    padding: 100px 0;
    display: grid;
    /* Увеличиваем текстовую колонку и уменьшаем расстояние */
    grid-template-columns: 1.3fr 1fr; 
    gap: 40px; /* Уменьшили с 80px до 40px — это визуально свяжет блоки */
    align-items: center;
    max-width: 1200px; /* Ограничиваем общую ширину, чтобы не разъезжались на 4K */
    margin: 0 auto;
}

.hero-image {
    display: flex;
    justify-content: flex-start; /* Прижимаем картинку ближе к тексту */
}

.hero-image img {
    width: 100%;
    max-width: 440px;
    height: auto;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.15); /* Явный бортик */
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 46, 136, 0.1); /* Глубокая тень + легкое свечение */
}

/* Воздух для списков и кнопок */
.hero-content h1 {
    margin-bottom: 32px !important;
}

.hero-content ul {
    list-style: none;
    margin: 0 0 48px 0 !important; /* Четкий отступ до кнопок */
    padding: 0;
}

.hero-content li {
    margin-bottom: 12px;
}

/* Related фиксим отступ */
.related h3 {
    margin-bottom: 40px !important;
}

/* --- Content & TOC --- */

.content-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 60px;
    padding: 80px 0;
}

.toc-wrapper {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.toc-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.toc-card h3 {
    color: var(--white);
    margin-bottom: 16px;
    font-size: 18px;
}

.toc-card ul {
    list-style: none;
}

.toc-card li {
    margin-bottom: 12px;
}

.toc-card a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 15px;
    transition: color 0.3s;
}

.toc-card a:hover { color: var(--accent-primary); }

/* --- Gallery --- */

.gallery {
    padding: 120px 0;
    background: var(--bg-section);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.gallery-item {
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
    position: relative;
}

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

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-item.wide { grid-column: span 2; }

.gallery-caption {
    padding: 12px;
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
}

/* --- FAQ --- */

.faq {
    padding: 120px 0;
    background: var(--bg-section);
}

.faq-item {
    border-bottom: 1px solid var(--border-color);
    padding: 24px 0;
}

.faq-question {
    font-weight: 600;
    color: var(--white);
    margin-bottom: 12px;
    cursor: pointer;
}

/* --- FAQ (FIXED) --- */

.faq {
    padding: 120px 0;
    background: var(--bg-section);
}

.faq-item {
    border-bottom: 1px solid var(--border-color);
    padding: 24px 0;
}

.faq-question {
    font-weight: 600;
    color: var(--white);
    margin-bottom: 0; /* Убрал отступ, чтобы не было дырки при закрытом состоянии */
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.3s;
}

.faq-question:hover {
    color: var(--accent-primary);
}

.faq-answer {
    display: none; /* Твой косяк со раскрытым списком исправлен здесь */
    padding-top: 16px;
    color: var(--text-muted);
    line-height: 1.6;
}

.faq-answer p {
    margin-bottom: 0;
}

/* Состояние когда аккордеон открыт (через .active в scripts.js) */
.faq-item.active .faq-answer {
    display: block;
}

.faq-item.active .faq-question {
    color: var(--accent-primary);
    margin-bottom: 12px;
}

/* --- Related --- */

.related {
    padding: 80px 0;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.tag-item {
    padding: 10px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-main);
    text-decoration: none;
    transition: all 0.3s;
}

.tag-item:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* --- Footer --- */

footer {
    padding: 60px 0;
    background: #0A0A0F;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
}

.footer-nav { margin-bottom: 24px; }
.footer-nav a {
    color: var(--text-muted);
    text-decoration: none;
    margin: 0 12px;
}

/* --- Lightbox UI Fix (Final) --- */
.lightbox {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

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

.lightbox img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 16px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.8);
    display: block;
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    color: var(--white);
    font-size: 44px;
    cursor: pointer !important;
    line-height: 1;
    z-index: 2001;
    transition: color 0.3s;
}

.lb-nav-area {
    position: absolute;
    top: 50%;
    left: -100px;
    right: -100px;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    pointer-events: none; /* Пропускает клики к фону */
}

.lb-prev, .lb-next {
    color: var(--white);
    font-size: 60px;
    cursor: pointer !important;
    pointer-events: auto; /* А кнопки кликаются */
    padding: 20px;
    user-select: none;
    transition: color 0.3s, transform 0.2s;
}

.lb-prev:hover, .lb-next:hover, .lightbox-close:hover {
    color: var(--accent-primary);
    transform: scale(1.1);
}

.lb-info {
    margin-top: 25px;
    text-align: center;
    width: 100%;
}

.lb-cta {
    margin-top: 20px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Адаптив: на планшетах и мобилках заносим стрелки внутрь */
@media (max-width: 1100px) {
    .lb-nav-area {
        left: 15px;
        right: 15px;
    }
    .lb-prev, .lb-next {
        font-size: 40px;
        background: rgba(0,0,0,0.6);
        border-radius: 50%;
        width: 50px;
        height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .lightbox-close {
        top: -60px;
        right: 10px;
    }
}

/* --- Responsive --- */

@media (max-width: 1024px) {
    .hero, .content-grid { grid-template-columns: 1fr; }
    .toc-wrapper { display: none; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
    h1 { font-size: 36px; }
}

@media (max-width: 600px) {
    .gallery-grid { grid-template-columns: 1fr; }
    .gallery-item.wide { grid-column: span 1; }
    h1 { font-size: 28px; }
    .hero { padding: 60px 0; }
}

/* 1. Стили только для ГИПЕРССЫЛОК внутри текста */
.seo-text p a {
    color: #ff3366 !important; /* Яркий розовый */
    text-decoration: underline !important;
    font-weight: 600 !important;
    transition: color 0.3s ease !important;
}

.seo-text p a:hover {
    color: #ff5c85 !important;
    text-shadow: 0 0 8px rgba(255, 51, 102, 0.5) !important;
}

/* 2. ПРИНУДИТЕЛЬНАЯ ЗАЩИТА КНОПОК (CTA) */
.btn, .btn-primary, .btn-secondary, a[class*="btn"] {
    color: #ffffff !important; /* Текст ВСЕГДА белый */
    text-decoration: none !important;
    font-weight: 700 !important;
    text-shadow: none !important;
}

/* Ховер для кнопок, чтобы не вылезал розовый текст */
.btn:hover, .btn-primary:hover {
    color: #ffffff !important;
    opacity: 0.9 !important;
}

/* --- Mid-Content CTA Box --- */

.cta-box {
    padding: 40px;
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    margin: 40px 0;
    text-align: center;
}

.cta-box h3 {
    color: var(--white);
    font-size: 24px;
    margin-bottom: 20px;
}

/* --- Final CTA Section --- */

.final-cta {
    padding: 60px;
    background: var(--bg-card);
    border-radius: 24px;
    border: 1px solid var(--border-color);
    text-align: center;
    max-width: 800px;
    margin: 0 auto 80px;
}

.final-cta h2 {
    margin-top: 0;
}

.final-cta p {
    color: var(--text-muted);
    font-size: 18px;
    margin-bottom: 32px;
}

.cta-group {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.seo-text ul a {
    color: var(--accent-primary);
}
.seo-text ul a:visited {
    color: var(--accent-primary);
}

/* ======== MOBILE BURGER + FIXED CTA ======== */
.burger { display: none; }
.mobile-cta { display: none; }

@media (max-width: 768px) {
  /* Burger */
  header nav { display: none; }
  header nav.open { display: flex; position: fixed; top: 56px; left: 0; width: 100%; background: #0d0d12; border-bottom: 1px solid rgba(255,255,255,0.1); flex-direction: column; padding: 16px 20px; gap: 12px; z-index: 9998; }
  header .btn.btn-primary { display: none; }
  .burger { display: block; background: none; border: none; color: #fff; font-size: 28px; cursor: pointer; padding: 8px; }

  /* Fixed CTA */
  .mobile-cta { display: block; position: fixed; bottom: 0; left: 0; width: 100%; padding: 12px; background: #0d0d12; border-top: 1px solid rgba(255,255,255,0.1); z-index: 9999; text-align: center; }
  .mobile-cta .btn { width: 100%; display: block; }
  body { padding-bottom: 80px; }

  /* Hero */
  .hero { flex-direction: column; }
  .hero-image { order: -1; }
  .hero-image img { max-width: 100%; height: auto; }
  .hero-cta { display: flex; flex-direction: row; gap: 12px; width: 100%; }
  .hero-cta .btn { flex: 1; text-align: center; font-size: 14px; padding: 14px 12px; white-space: nowrap; }

  /* Layout */
  .content-grid { grid-template-columns: 1fr; }
  .toc-wrapper { display: none; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-item.wide { grid-column: span 2; }
  .tag-cloud { justify-content: center; }

  /* Inline grid overrides */
  [style*="grid-template-columns: repeat(3"] { grid-template-columns: repeat(2, 1fr) !important; max-width: 100% !important; }
  [style*="grid-template-columns: repeat(auto-fill"] { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-item.wide { grid-column: span 1; }
  [style*="grid-template-columns: repeat(3"],
  [style*="grid-template-columns: repeat(2"],
  [style*="grid-template-columns: repeat(auto-fill"] { grid-template-columns: 1fr !important; }
}