/*
Theme Name: Olive Wilson - Author Theme
Theme URI: https://olivewilson.com
Author: Olive Wilson
Description: A sophisticated Dark Academia author website inspired by Sarah J. Maas, featuring custom book management, series taxonomy, and elegant design with teal and cream accents.
Version: 3.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: olive-wilson
Tags: author, books, dark, elegant, custom-post-type
*/

/* ==========================================================================
   IMPORTS - Google Fonts
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@300;400;500;600;700&family=Montserrat:wght@300;400;500;600;700&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&display=swap');

/* ==========================================================================
   CSS VARIABLES - Color Palette from Book Covers
   ========================================================================== */
:root {
    /* Primary Colors - From Still Yours (Dark Teal/Forest) */
    --color-primary-dark: #0d1f1f;
    --color-primary: #1a3838;
    --color-primary-light: #2d5555;
    
    /* Secondary Colors - From Breathless (Ocean/Cream) */
    --color-secondary: #4a7d7d;
    --color-secondary-light: #6a9d9d;
    --color-cream: #e8dcc4;
    --color-cream-dark: #d4c5a8;
    
    /* Accent Colors */
    --color-gold: #c9a961;
    --color-rose-gold: #d4a574;
    --color-white: #ffffff;
    --color-black: #000000;
    
    /* UI Colors */
    --color-bg-primary: #0d1f1f;
    --color-bg-secondary: #1a3838;
    --color-bg-elevated: #2d5555;
    --color-text-primary: #ffffff;
    --color-text-secondary: #e8dcc4;
    --color-text-muted: #9a8f7f;
    --color-border: rgba(201, 169, 97, 0.15);
    --color-border-hover: rgba(201, 169, 97, 0.4);
    
    /* Typography */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-accent: 'Cormorant Garamond', Georgia, serif;
    
    /* Spacing Scale */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2.5rem;
    --space-xl: 4rem;
    --space-2xl: 6rem;
    --space-3xl: 8rem;
    
    /* Layout */
    --max-width: 1400px;
    --max-width-narrow: 900px;
    --max-width-text: 700px;
    
    /* Transitions */
    --transition-quick: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.25);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.35);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-text-primary);
    background-color: var(--color-bg-primary);
    overflow-x: hidden;
}

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

a {
    color: var(--color-gold);
    text-decoration: none;
    transition: color var(--transition-base);
}

a:hover {
    color: var(--color-rose-gold);
}

ul, ol {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: 0.02em;
    margin-bottom: var(--space-sm);
}

h1 { font-size: clamp(2.5rem, 7vw, 5rem); }
h2 { font-size: clamp(2rem, 5vw, 3.5rem); }
h3 { font-size: clamp(1.5rem, 3.5vw, 2.5rem); }
h4 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }

p { margin-bottom: var(--space-sm); }

.text-accent {
    font-family: var(--font-accent);
    font-style: italic;
    color: var(--color-cream);
}

.text-large {
    font-size: 1.25rem;
    line-height: 1.6;
}

.text-small {
    font-size: 0.875rem;
}

.text-uppercase {
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ==========================================================================
   LAYOUT & CONTAINERS
   ========================================================================== */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.container-narrow {
    max-width: var(--max-width-narrow);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.container-text {
    max-width: var(--max-width-text);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.section {
    padding: var(--space-xl) 0;
}

.section-lg {
    padding: var(--space-2xl) 0;
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(13, 31, 31, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
    transition: background var(--transition-base), box-shadow var(--transition-base);
}

.site-header.scrolled {
    background: rgba(13, 31, 31, 0.98);
    box-shadow: var(--shadow-md);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-sm) var(--space-md);
}

.site-logo {
    display: block;
    line-height: 0;
}

.site-logo img,
.site-logo svg {
    height: 45px;
    width: auto;
    transition: opacity var(--transition-base);
}

.site-logo:hover img,
.site-logo:hover svg {
    opacity: 0.85;
}

.main-navigation {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.menu {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.menu-item {
    position: relative;
}

.menu-item > a {
    color: var(--color-text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: var(--space-xs) 0;
    display: block;
    position: relative;
}

.menu-item > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--color-gold);
    transition: width var(--transition-base);
}

.menu-item > a:hover::after,
.menu-item.current-menu-item > a::after {
    width: 100%;
}

/* Dropdown Menus */
.menu-item-has-children {
    position: relative;
}

.sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    padding: var(--space-sm);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-base);
    margin-top: var(--space-sm);
}

.menu-item-has-children:hover .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sub-menu .menu-item {
    margin-bottom: var(--space-xs);
}

.sub-menu .menu-item:last-child {
    margin-bottom: 0;
}

.sub-menu a {
    padding: var(--space-xs) var(--space-sm);
    display: block;
    transition: background var(--transition-quick);
}

.sub-menu a:hover {
    background: rgba(201, 169, 97, 0.1);
}

/* Social Icons in Nav */
.nav-social {
    display: flex;
    gap: var(--space-sm);
    margin-left: var(--space-md);
    padding-left: var(--space-md);
    border-left: 1px solid var(--color-border);
}

.nav-social a {
    color: var(--color-text-muted);
    transition: color var(--transition-base);
}

.nav-social a:hover {
    color: var(--color-gold);
}

.nav-social svg {
    width: 18px;
    height: 18px;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--color-text-primary);
    font-size: 1.5rem;
    padding: var(--space-xs);
}

/* ==========================================================================
   HERO SECTIONS
   ========================================================================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding-top: 80px;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(13, 31, 31, 0.92) 0%,
        rgba(45, 85, 85, 0.85) 100%
    );
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 900px;
    padding: 0 var(--space-md);
}

.hero-eyebrow {
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-gold);
    margin-bottom: var(--space-sm);
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

.hero-title {
    margin-bottom: var(--space-md);
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.2s forwards;
}

.hero-subtitle {
    font-family: var(--font-accent);
    font-style: italic;
    font-size: 1.5rem;
    line-height: 1.6;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-lg);
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.4s forwards;
}

.hero-cta {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.6s forwards;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2.5rem;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn span {
    position: relative;
    z-index: 1;
}

.btn-primary {
    background: var(--color-gold);
    color: var(--color-primary-dark);
}

.btn-primary:hover {
    background: var(--color-rose-gold);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(201, 169, 97, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--color-text-primary);
    border: 1px solid var(--color-text-primary);
}

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

.btn-ghost {
    background: transparent;
    color: var(--color-gold);
    border: 1px solid var(--color-gold);
}

.btn-ghost:hover {
    background: var(--color-gold);
    color: var(--color-primary-dark);
}

/* ==========================================================================
   WORLD CARDS / BOOK SERIES CARDS
   ========================================================================== */
.worlds-section {
    padding: var(--space-2xl) 0;
}

.section-title {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.worlds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-lg);
}

.world-card {
    position: relative;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-slow);
}

.world-card:hover {
    transform: translateY(-10px);
    border-color: var(--color-border-hover);
    box-shadow: var(--shadow-xl);
}

.world-card-image-wrap {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
}

.world-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.world-card:hover .world-card-image {
    transform: scale(1.05);
}

.world-card-content {
    padding: var(--space-lg);
    text-align: center;
}

.world-card-title {
    font-size: 1.75rem;
    margin-bottom: var(--space-xs);
}

.world-card-subtitle {
    font-family: var(--font-accent);
    font-style: italic;
    color: var(--color-gold);
    font-size: 1rem;
    margin-bottom: var(--space-sm);
}

.world-card-description {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ==========================================================================
   NEWSLETTER SECTION
   ========================================================================== */
.newsletter-section {
    background: linear-gradient(135deg,
        var(--color-bg-secondary) 0%,
        var(--color-bg-elevated) 100%
    );
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-2xl) 0;
}

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

.newsletter-eyebrow {
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--color-gold);
    margin-bottom: var(--space-sm);
}

.newsletter-title {
    margin-bottom: var(--space-sm);
}

.newsletter-description {
    font-family: var(--font-accent);
    font-style: italic;
    font-size: 1.125rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-lg);
    line-height: 1.6;
}

.newsletter-form {
    display: flex;
    gap: var(--space-sm);
    max-width: 500px;
    margin: 0 auto;
}

.newsletter-form input[type="email"] {
    flex: 1;
    padding: 1rem 1.5rem;
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    transition: border-color var(--transition-base);
}

.newsletter-form input[type="email"]::placeholder {
    color: var(--color-text-muted);
}

.newsletter-form input[type="email"]:focus {
    outline: none;
    border-color: var(--color-gold);
}

.newsletter-form button {
    padding: 1rem 2rem;
    background: var(--color-gold);
    color: var(--color-primary-dark);
    border: none;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: all var(--transition-base);
}

.newsletter-form button:hover {
    background: var(--color-rose-gold);
    transform: translateY(-2px);
}

/* ==========================================================================
   ABOUT / AUTHOR SECTION
   ========================================================================== */
.author-section {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: var(--space-xl);
    align-items: center;
}

.author-image-wrapper {
    position: relative;
}

.author-image {
    width: 100%;
    height: auto;
    display: block;
}

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

.author-bio {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-lg);
}

.author-bio em {
    font-family: var(--font-accent);
    font-style: italic;
    color: var(--color-gold);
}

/* FAQ Section */
.faqs-section {
    padding: var(--space-xl) 0;
}

.faqs-header {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.faqs-header h2 {
    font-size: clamp(2.5rem, 5vw, 4rem);
}

.faqs-list {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.faq-item {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    padding: var(--space-lg);
    transition: border-color var(--transition-base);
}

.faq-item:hover {
    border-color: var(--color-border-hover);
}

.faq-question {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: var(--space-sm);
    color: var(--color-text-primary);
}

.faq-answer {
    font-family: var(--font-accent);
    font-style: italic;
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--color-text-secondary);
}

/* ==========================================================================
   BOOKS & SERIES PAGES
   ========================================================================== */
.series-hero {
    text-align: center;
    padding: var(--space-3xl) 0 var(--space-2xl);
    background: linear-gradient(135deg,
        var(--color-bg-primary) 0%,
        var(--color-bg-elevated) 100%
    );
}

.series-tagline {
    font-family: var(--font-accent);
    font-style: italic;
    font-size: 1.5rem;
    color: var(--color-gold);
    margin-bottom: var(--space-md);
}

.series-description {
    max-width: 700px;
    margin: 0 auto var(--space-lg);
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--color-text-secondary);
}

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

.book-card {
    text-align: center;
    transition: transform var(--transition-base);
}

.book-card:hover {
    transform: translateY(-8px);
}

.book-cover-wrapper {
    margin-bottom: var(--space-sm);
}

.book-cover {
    width: 100%;
    height: auto;
    box-shadow: var(--shadow-lg);
    transition: box-shadow var(--transition-base);
}

.book-card:hover .book-cover {
    box-shadow: 0 20px 60px rgba(201, 169, 97, 0.4);
}

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

.book-meta {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-sm);
}

.buy-links {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
    flex-wrap: wrap;
}

.buy-link {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-gold);
    transition: color var(--transition-base);
}

.buy-link:hover {
    color: var(--color-rose-gold);
}

/* ==========================================================================
   FOOTER
   ========================================== ================================ */
.site-footer {
    background: var(--color-bg-primary);
    border-top: 1px solid var(--color-border);
    padding: var(--space-2xl) 0 var(--space-lg);
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-md);
}

.footer-logo-wrapper {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.footer-logo {
    display: inline-block;
}

.footer-logo img,
.footer-logo svg {
    height: 50px;
    width: auto;
    opacity: 0.7;
    transition: opacity var(--transition-base);
}

.footer-logo:hover img,
.footer-logo:hover svg {
    opacity: 1;
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

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

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

.footer-bottom {
    text-align: center;
    padding-top: var(--space-lg);
    border-top: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: 0.8125rem;
}

/* ==========================================================================
   DECORATIVE ELEMENTS
   ========================================================================== */
.decorative-divider {
    text-align: center;
    margin: var(--space-xl) 0;
}

.decorative-star {
    width: 40px;
    height: 40px;
    opacity: 0.3;
    margin: 0 auto;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.8s ease;
}

.fade-in-up {
    animation: fadeInUp 0.8s ease;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1024px) {
    :root {
        --space-xl: 3rem;
        --space-2xl: 4rem;
        --space-3xl: 5rem;
    }
    
    .author-section {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }
    
    .menu {
        gap: var(--space-md);
    }
}

@media (max-width: 768px) {
    :root {
        --space-md: 1rem;
        --space-lg: 1.5rem;
        --space-xl: 2rem;
        --space-2xl: 3rem;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .main-navigation {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        max-width: 320px;
        height: 100vh;
        background: var(--color-bg-secondary);
        flex-direction: column;
        padding: var(--space-2xl) var(--space-md);
        transition: right var(--transition-slow);
        border-left: 1px solid var(--color-border);
        overflow-y: auto;
    }
    
    .main-navigation.active {
        right: 0;
    }
    
    .menu {
        flex-direction: column;
        gap: var(--space-sm);
        width: 100%;
    }
    
    .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        margin-top: var(--space-xs);
        margin-left: var(--space-sm);
    }
    
    .nav-social {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        border-top: 1px solid var(--color-border);
        padding-top: var(--space-md);
        margin-top: var(--space-lg);
        width: 100%;
        justify-content: center;
    }
    
    .hero-cta,
    .newsletter-form {
        flex-direction: column;
    }
    
    .worlds-grid {
        grid-template-columns: 1fr;
    }
    
    .books-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }
}

@media (max-width: 480px) {
    .books-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-nav {
        flex-direction: column;
        gap: var(--space-sm);
    }
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-sm { margin-top: var(--space-sm); }
.mb-sm { margin-bottom: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mb-md { margin-bottom: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-lg { margin-bottom: var(--space-lg); }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}
