/*
Theme Name: Oliver Books
Theme URI: https://oliverbooks.co.uk
Author: Oliver J. Grant
Author URI: https://oliverbooks.co.uk
Description: A refined, literary-inspired theme for an economics book shop. Features a distinctive British publishing aesthetic with exceptional typography and WooCommerce integration.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: oliver-books
Tags: e-commerce, blog, custom-menu, featured-images, threaded-comments, translation-ready, woocommerce

Oliver Books Theme, Copyright 2026 Oliver J. Grant
Oliver Books is distributed under the terms of the GNU GPL v2 or later.
*/

/* ==========================================================================
   CSS Variables - Design System
   ========================================================================== */

:root {
    /* Colors - British Editorial Palette */
    --color-primary: #1a3a52;        /* Deep Navy - main text */
    --color-secondary: #c17a5c;      /* Terracotta - accents */
    --color-accent: #8b7355;         /* Warm Brown - highlights */
    --color-background: #faf8f5;     /* Warm Off-White */
    --color-surface: #ffffff;
    --color-text-primary: #1a3a52;
    --color-text-secondary: #5a5a5a;
    --color-text-light: #8a8a8a;
    --color-border: #e5dfd7;
    --color-success: #4a7c59;
    
    /* Typography */
    --font-serif: 'Crimson Pro', 'Georgia', serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Fraunces', 'Georgia', serif;
    
    /* Spacing System */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2.5rem;
    --space-xl: 4rem;
    --space-2xl: 6rem;
    
    /* Layout */
    --container-width: 1280px;
    --content-width: 800px;
    --radius-sm: 2px;
    --radius-md: 4px;
    --radius-lg: 8px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.4s ease;
}

/* ==========================================================================
   Global Styles
   ========================================================================== */

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

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

body {
    font-family: var(--font-serif);
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--color-text-primary);
    background: var(--color-background);
}

::selection {
    background: var(--color-secondary);
    color: white;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
    color: var(--color-primary);
    margin-bottom: var(--space-md);
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -0.01em;
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

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

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

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

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

/* ==========================================================================
   Layout Components
   ========================================================================== */

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

.content-wrapper {
    max-width: var(--content-width);
    margin: 0 auto;
}

/* Header */
.site-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

/* Header Background Option */
.site-header.has-background {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.site-header.has-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: -1;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) 0;
    gap: var(--space-lg);
}

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

.site-logo {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.site-logo:hover {
    color: var(--color-secondary);
}

/* Cart Icon */
.cart-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    color: var(--color-text-secondary);
    transition: color var(--transition-base);
    padding: 0.5rem;
}

.cart-icon:hover {
    color: var(--color-primary);
}

.cart-icon svg {
    width: 24px;
    height: 24px;
}

.cart-icon .cart-count {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--color-secondary);
    color: white;
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1;
}

/* Navigation */
.main-navigation {
    position: relative;
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: var(--space-lg);
    align-items: center;
    margin: 0;
    flex-wrap: nowrap;
}

.main-navigation li {
    flex-shrink: 0;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--color-primary);
    transition: all var(--transition-base);
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

.main-navigation a {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-secondary);
    transition: all var(--transition-base);
    position: relative;
    white-space: nowrap;
}

.main-navigation a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-secondary);
    transition: width var(--transition-base);
}

.main-navigation a:hover {
    color: var(--color-primary);
}

.main-navigation a:hover::after {
    width: 100%;
}

/* Hero Section */
.hero-section {
    padding: var(--space-2xl) 0;
    text-align: center;
    background: linear-gradient(135deg, #faf8f5 0%, #f5f0e8 100%);
    border-bottom: 1px solid var(--color-border);
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    margin-bottom: var(--space-md);
    font-size: clamp(2.5rem, 5vw, 3.5rem);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-xl);
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
    padding: var(--space-lg) 0;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
}

.stat-number {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-secondary);
    line-height: 1;
}

.stat-label {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-light);
}

.hero-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
}

/* About Preview Section */
.about-preview-section {
    padding: var(--space-2xl) 0;
    background: var(--color-surface);
}

.about-preview-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: var(--space-2xl);
    align-items: center;
}

.about-preview-text h2 {
    font-size: 2rem;
    margin-bottom: var(--space-lg);
    color: var(--color-primary);
}

.about-preview-text p {
    font-size: 1.125rem;
    line-height: 1.8;
    margin-bottom: var(--space-md);
    color: var(--color-text-secondary);
}

.about-preview-text strong {
    color: var(--color-primary);
    font-weight: 600;
}

.about-preview-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.trust-badges {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.badge {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--color-background);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.badge:hover {
    border-color: var(--color-secondary);
    transform: translateX(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.badge svg {
    color: var(--color-secondary);
    flex-shrink: 0;
}

.badge span {
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-primary);
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .about-preview-content {
        grid-template-columns: 1fr;
    }
    
    .trust-badges {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .badge {
        flex: 1;
        min-width: 250px;
    }
}

@media (max-width: 768px) {
    .hero-stats {
        grid-template-columns: 1fr;
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .hero-actions .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .trust-badges {
        flex-direction: column;
    }
}

/* Buttons */
.btn {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.875rem 2rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.btn-primary:hover {
    background: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 58, 82, 0.2);
}

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

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

/* Product Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-lg);
    padding: var(--space-xl) 0;
}

.product-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-base);
    position: relative;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: var(--color-accent);
}

.product-image {
    aspect-ratio: 2/3;
    overflow: hidden;
    background: var(--color-background);
}

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

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

.product-info {
    padding: var(--space-md);
}

.product-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
    color: var(--color-primary);
}

.product-author {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-sm);
}

.product-price {
    font-family: var(--font-sans);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-secondary);
}

/* Blog Posts */
.blog-grid {
    display: grid;
    gap: var(--space-xl);
    padding: var(--space-xl) 0;
}

.post-card {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: var(--space-lg);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-base);
}

.post-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    border-color: var(--color-accent);
}

.post-thumbnail {
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--color-background);
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-content {
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.post-meta {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.post-title {
    font-size: 1.75rem;
    margin-bottom: var(--space-sm);
}

.post-excerpt {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-md);
}

/* Footer */
.site-footer {
    background: var(--color-primary);
    color: rgba(255, 255, 255, 0.8);
    padding: var(--space-xl) 0 var(--space-md);
    margin-top: var(--space-2xl);
    position: relative;
}

/* Footer Background Option */
.site-footer.has-background {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.site-footer.has-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 58, 82, 0.95);
    z-index: 0;
}

.site-footer > .container {
    position: relative;
    z-index: 1;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.footer-section h3 {
    color: white;
    font-size: 1.125rem;
    margin-bottom: var(--space-md);
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: var(--space-xs);
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    transition: color var(--transition-base);
}

.footer-section a:hover {
    color: var(--color-secondary);
}

.footer-social {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.footer-social li {
    margin-bottom: 0;
}

.footer-social a {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) 0;
    transition: all var(--transition-base);
}

.footer-social a:hover {
    color: var(--color-secondary);
    transform: translateX(4px);
}

.footer-social svg {
    flex-shrink: 0;
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-md);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-family: var(--font-sans);
    font-size: 0.9rem;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .header-inner {
        flex-wrap: nowrap;
        position: relative;
    }
    
    .site-branding {
        flex: 1;
        min-width: 0;
    }
    
    .site-logo {
        font-size: 1.5rem;
    }
    
    .nav-toggle {
        display: flex;
        order: 3;
        flex-shrink: 0;
        z-index: 1001;
        margin-left: var(--space-sm);
    }
    
    .main-navigation {
        order: 4;
    }
    
    .main-navigation ul {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background: white;
        flex-direction: column;
        gap: 0;
        padding: var(--space-2xl) var(--space-md);
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        transition: left var(--transition-base);
        overflow-y: auto;
    }
    
    .main-navigation.active ul {
        left: 0;
    }
    
    .main-navigation li {
        width: 100%;
        padding: var(--space-sm) 0;
        border-bottom: 1px solid var(--color-border);
    }
    
    .main-navigation li:last-child {
        border-bottom: none;
    }
    
    .main-navigation a {
        display: block;
        width: 100%;
        font-size: 1rem;
    }
    
    .main-navigation a::after {
        display: none;
    }
    
    .cart-icon {
        order: 2;
        flex-shrink: 0;
    }
    
    /* Mobile menu overlay */
    .main-navigation.active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .post-card {
        grid-template-columns: 1fr;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: var(--space-md);
    }
    
    .about-preview-content {
        grid-template-columns: 1fr;
    }
    
    .trust-badges {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .badge {
        flex: 1;
        min-width: 200px;
    }
}

@media (max-width: 480px) {
    .trust-badges {
        flex-direction: column;
    }
    
    .badge {
        width: 100%;
    }
    
    .hero-stats {
        grid-template-columns: 1fr;
    }
    
    .site-logo {
        font-size: 1.25rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.text-center {
    text-align: center;
}

.mt-lg {
    margin-top: var(--space-lg);
}

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

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: var(--space-xl);
    position: relative;
    padding-bottom: var(--space-md);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--color-secondary);
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    color: white;
    padding: var(--space-2xl) 0;
    margin-top: var(--space-2xl);
    text-align: center;
}

.cta-section h2 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
}

.cta-section p {
    font-size: 1.25rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto var(--space-lg);
}

.cta-content {
    max-width: 700px;
    margin: 0 auto;
}

/* Featured Posts Section */
.featured-posts-section {
    padding: var(--space-2xl) 0;
    background: var(--color-surface);
}

/* FAQ Section */
.faq-section {
    padding: var(--space-2xl) 0;
    background: var(--color-background);
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--space-lg);
    max-width: 1100px;
    margin: 0 auto;
}

.faq-item {
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-base);
}

.faq-item.active {
    border-color: var(--color-secondary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.faq-question {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-primary);
    margin: 0;
    padding: var(--space-lg);
    line-height: 1.4;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-base);
    user-select: none;
}

.faq-question::after {
    content: '+';
    position: absolute;
    right: var(--space-lg);
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    font-weight: 300;
    color: var(--color-secondary);
    transition: transform var(--transition-base);
}

.faq-item.active .faq-question::after {
    content: '−';
    transform: translateY(-50%) rotate(180deg);
}

.faq-question:hover {
    color: var(--color-secondary);
    background: var(--color-background);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    padding: 0 var(--space-lg);
}

.faq-item.active .faq-answer {
    max-height: 500px;
    padding: 0 var(--space-lg) var(--space-lg);
}

.faq-answer p {
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin: 0;
}

/* Read More Link */
.read-more {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all var(--transition-base);
    display: inline-block;
}

.read-more:hover {
    color: var(--color-secondary);
    transform: translateX(5px);
}
