/* ========================================
   Second Needle — Erotic Fiction Publisher
   Restrained Adult Theme Stylesheet
   ======================================== */

/* CSS Variables */
:root {
    /* Colors - Deep, sophisticated palette */
    --color-bg: #0d0b0e;
    --color-bg-elevated: #16131a;
    --color-bg-card: #1c1820;
    --color-surface: #241f29;
    
    --color-text: #e8e4ec;
    --color-text-muted: #9a929f;
    --color-text-subtle: #6b6370;
    
    --color-accent: #c4a87c;
    --color-accent-hover: #d4bc94;
    --color-accent-muted: rgba(196, 168, 124, 0.15);
    
    --color-border: rgba(255, 255, 255, 0.08);
    --color-border-hover: rgba(255, 255, 255, 0.15);
    
    /* Typography */
    --font-serif: 'Cormorant Garamond', Georgia, serif;
    --font-sans: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    --space-4xl: 6rem;
    
    /* Layout */
    --container-max: 1200px;
    --container-narrow: 800px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
    
    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    font-weight: 400;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.no-scroll {
    overflow: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition-fast);
}

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

/* Container */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: 500;
    line-height: 1.2;
    color: var(--color-text);
}

h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 400;
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 500;
}

h3 {
    font-size: 1.5rem;
}

p {
    color: var(--color-text-muted);
}

em {
    font-style: italic;
    color: var(--color-accent);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-sm) var(--space-lg);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

.btn-primary {
    background: var(--color-accent);
    color: var(--color-bg);
    border-color: var(--color-accent);
}

.btn-primary:hover {
    background: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
    color: var(--color-bg);
}

.btn-secondary {
    background: transparent;
    color: var(--color-text-muted);
    border-color: var(--color-border);
}

.btn-secondary:hover {
    color: var(--color-text);
    border-color: var(--color-border-hover);
}

.btn-nav {
    background: transparent;
    color: var(--color-accent);
    border-color: var(--color-accent);
    padding: var(--space-xs) var(--space-md);
}

.btn-nav:hover {
    background: var(--color-accent);
    color: var(--color-bg);
}

.btn-book {
    background: transparent;
    color: var(--color-accent);
    border-color: var(--color-accent);
    width: 100%;
    margin-top: auto;
}

.btn-book:hover {
    background: var(--color-accent);
    color: var(--color-bg);
}

.btn-large {
    padding: var(--space-md) var(--space-2xl);
    font-size: 1rem;
}

/* Age Gate */
.age-gate {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    opacity: 1;
    transition: opacity var(--transition-slow);
}

.age-gate.hidden {
    opacity: 0;
    pointer-events: none;
}

.age-gate-content {
    text-align: center;
    max-width: 480px;
}

.age-gate-content h2 {
    margin-bottom: var(--space-md);
}

.age-gate-content p {
    margin-bottom: var(--space-xl);
}

.age-gate-buttons {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(13, 11, 14, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}

.logo {
    text-decoration: none;
}

.logo-text {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--color-text);
    letter-spacing: 0.02em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
    list-style: none;
}

.nav-links a {
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.nav-links a:hover {
    color: var(--color-text);
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    transition: all var(--transition-fast);
}

/* Hero */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-4xl) var(--space-lg);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 20% 80%, rgba(196, 168, 124, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(139, 92, 102, 0.06) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.hero h1 {
    margin-bottom: var(--space-lg);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-2xl);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to top, var(--color-bg), transparent);
    pointer-events: none;
}

/* Section Styles */
.section-header {
    text-align: center;
    margin-bottom: var(--space-3xl);
}

.section-header h2 {
    margin-bottom: var(--space-md);
}

.section-header p {
    max-width: 600px;
    margin: 0 auto;
}

/* Books Section */
.books-section {
    padding: var(--space-4xl) 0;
    background: var(--color-bg-elevated);
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: var(--space-xl);
}

.book-card {
    display: flex;
    flex-direction: column;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
}

.book-card:hover {
    border-color: var(--color-border-hover);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.book-cover {
    aspect-ratio: 2/3;
    background: var(--color-surface);
    overflow: hidden;
}

.book-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-bg-card) 100%);
    color: var(--color-text-subtle);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.book-info {
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    flex: 1;
}

.book-title {
    font-size: 1.375rem;
    margin-bottom: var(--space-xs);
    color: var(--color-text);
}

.book-author {
    font-size: 0.875rem;
    color: var(--color-accent);
    font-style: italic;
    margin-bottom: var(--space-md);
}

.book-summary {
    font-size: 0.9375rem;
    line-height: 1.7;
    margin-bottom: var(--space-md);
    flex: 1;
}

.book-themes {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.theme-tag {
    font-size: 0.75rem;
    padding: var(--space-xs) var(--space-sm);
    background: var(--color-accent-muted);
    color: var(--color-accent);
    border-radius: var(--radius-sm);
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* Gallery Section */
.gallery-section {
    padding: var(--space-4xl) 0;
    background: var(--color-bg);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 200px;
    gap: var(--space-md);
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--transition-base);
}

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

.gallery-item-tall {
    grid-row: span 2;
}

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

.gallery-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-bg-card) 100%);
    color: var(--color-text-subtle);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.gallery-item::after {
    content: attr(data-caption);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--space-md);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: var(--color-text);
    font-size: 0.875rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all var(--transition-base);
}

.gallery-item:hover::after {
    opacity: 1;
    transform: translateY(0);
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-close {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    background: none;
    border: none;
    color: var(--color-text);
    font-size: 2rem;
    cursor: pointer;
    padding: var(--space-sm);
    line-height: 1;
    transition: color var(--transition-fast);
}

.lightbox-close:hover {
    color: var(--color-accent);
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    text-align: center;
}

.lightbox-image-container {
    max-width: 100%;
    max-height: 80vh;
}

.lightbox-placeholder {
    width: 600px;
    height: 400px;
    max-width: 90vw;
}

.lightbox-caption {
    margin-top: var(--space-lg);
    font-family: var(--font-serif);
    font-size: 1.125rem;
    font-style: italic;
    color: var(--color-text-muted);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--color-text);
    font-size: 3rem;
    cursor: pointer;
    padding: var(--space-lg);
    transition: color var(--transition-fast);
}

.lightbox-nav:hover {
    color: var(--color-accent);
}

.lightbox-prev {
    left: var(--space-md);
}

.lightbox-next {
    right: var(--space-md);
}

/* About Section */
.about-section {
    padding: var(--space-4xl) 0;
    background: var(--color-bg-elevated);
}

.about-content {
    max-width: var(--container-narrow);
    margin: 0 auto;
    text-align: center;
}

.about-content h2 {
    margin-bottom: var(--space-xl);
}

.about-content p {
    font-size: 1.125rem;
    line-height: 1.8;
    margin-bottom: var(--space-lg);
}

.about-content p:last-child {
    margin-bottom: 0;
}

/* Newsletter Section */
.newsletter-section {
    padding: var(--space-4xl) 0;
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
}

.newsletter-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.newsletter-content h2 {
    margin-bottom: var(--space-md);
}

.newsletter-content > p {
    margin-bottom: var(--space-xl);
}

.newsletter-note {
    margin-top: var(--space-lg);
    font-size: 0.875rem;
    color: var(--color-text-subtle);
}

/* Footer */
.footer {
    padding: var(--space-3xl) 0 var(--space-xl);
    background: var(--color-bg-card);
    border-top: 1px solid var(--color-border);
}

.footer-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-xl);
    margin-bottom: var(--space-2xl);
}

.footer-brand p {
    margin-top: var(--space-sm);
    font-size: 0.875rem;
}

.footer-nav {
    display: flex;
    gap: var(--space-lg);
}

.footer-nav a {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

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

.footer-social {
    display: flex;
    gap: var(--space-md);
}

.footer-social a {
    color: var(--color-text-muted);
    transition: color var(--transition-fast);
}

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

.footer-bottom {
    padding-top: var(--space-xl);
    border-top: 1px solid var(--color-border);
    text-align: center;
}

.footer-bottom p {
    font-size: 0.875rem;
    color: var(--color-text-subtle);
}

.footer-disclaimer {
    margin-top: var(--space-sm);
    font-size: 0.75rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        bottom: 0;
        flex-direction: column;
        justify-content: flex-start;
        padding: var(--space-xl);
        gap: var(--space-lg);
        background: var(--color-bg);
        border-top: 1px solid var(--color-border);
        transform: translateX(100%);
        transition: transform var(--transition-base);
    }
    
    .nav-links.active {
        transform: translateX(0);
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .books-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 150px;
    }
    
    .gallery-item-wide {
        grid-column: span 1;
    }
    
    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .footer-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 200px;
    }
    
    .gallery-item-tall {
        grid-row: span 1;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .age-gate-buttons {
        flex-direction: column;
    }
    
    .lightbox-nav {
        font-size: 2rem;
        padding: var(--space-sm);
    }
}
