/* ─── GLOBAL RESET & VARIABLES ──────────────────────────────────── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #1A1A1A;
    --yellow: #F4C430;
    --yellow-dark: #d4a020;
    --text-light: #f0f0f0;
    --text-muted: #aaaaaa;
    --card-bg: #2a2a2a;
    --border-color: #333;
    --font-sans: 'Montserrat', sans-serif;
    --font-serif: 'Garamond', serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: var(--font-serif);
    line-height: 1.7;
    margin: 0;
    padding: 0;
}

a {
    color: var(--yellow);
    text-decoration: none;
}
a:hover {
    color: var(--yellow-dark);
    text-decoration: underline;
}

/* ─── HEADER – AUTHOR STYLE ────────────────────────────────────── */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 2rem;
    background: var(--bg-dark, #1A1A1A);
    border-bottom: 2px solid rgba(244, 196, 48, 0.1);
    flex-wrap: wrap;
}

.logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.logo a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--yellow, #F4C430);
    font-family: var(--font-sans, 'Montserrat', sans-serif);
    font-weight: 900;
    font-size: 1.6rem;
    letter-spacing: 1px;
}
.logo .tagline {
    font-size: 0.75rem;
    color: #7a6b5e;
    font-weight: 400;
    margin-top: 0.1rem;
    letter-spacing: 0.3px;
    font-style: italic;
}

nav ul {
    display: flex;
    gap: 1.8rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
nav ul li a {
    color: #c4b5a5;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}
nav ul li a:hover {
    color: var(--yellow, #F4C430);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}
.hamburger-line {
    width: 28px;
    height: 3px;
    background: #c4b5a5;
    border-radius: 3px;
    transition: 0.3s;
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    nav {
        display: none;
        width: 100%;
        margin-top: 1rem;
    }
    nav.open {
        display: block;
    }
    nav ul {
        flex-direction: column;
        gap: 0.8rem;
        align-items: center;
    }
    header {
        flex-wrap: wrap;
    }
    .logo .tagline {
        font-size: 0.65rem;
    }
}

.cart-link {
    background: var(--yellow);
    color: #111 !important;
    padding: 0.3rem 0.9rem;
    border-radius: 30px;
    font-weight: 700;
    font-size: clamp(0.75rem, 1.2vw, 0.9rem);
    transition: all 0.3s;
    white-space: nowrap;
    margin-left: 0.5rem;
}
.cart-link:hover {
    background: var(--yellow-dark);
    transform: scale(1.05);
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(244, 196, 48, 0.3);
}

/* ─── RESPONSIVE NAVBAR ──────────────────────────────────────────── */
@media (max-width: 768px) {
    header {
        padding: 0.3rem 0.8rem;
        flex-wrap: wrap;
    }
    .hamburger {
        display: flex;
        order: 3;
        margin-left: auto;
    }
    nav {
        order: 4;
        flex: 1 1 100%;
        display: none;
        margin-top: 0.3rem;
        background: rgba(17, 17, 17, 0.98);
        border-radius: 8px;
        padding: 0.5rem 0;
        box-shadow: 0 8px 20px rgba(0,0,0,0.6);
    }
    nav.open {
        display: block;
    }
    nav ul {
        flex-direction: column;
        align-items: stretch;
        gap: 0.2rem;
        padding: 0 0.5rem;
    }
    nav ul li a {
        display: block;
        padding: 0.5rem 0.8rem;
        font-size: 1rem;
        border-radius: 4px;
        text-align: center;
    }
    .cart-link {
        order: 5;
        margin-left: 0.5rem;
    }
}

@media (max-width: 480px) {
    .logo a {
        font-size: 0.9rem;
    }
    .logo-icon {
        font-size: 1.2rem;
    }
    .cart-link {
        font-size: 0.7rem;
        padding: 0.2rem 0.6rem;
    }
}

/* Responsive header: logo left, cart right, nav wraps */
@media (max-width: 768px) {
    header {
        padding: 0.6rem 1rem;
    }
    .logo {
        order: 1;
        flex: 0 1 auto;
    }
    nav {
        order: 2;
        flex: 1 1 100%;
        margin: 0.3rem 0;
    }
    nav ul {
        gap: 0.4rem 0.8rem;
        justify-content: center;
    }
    .cart-link {
        order: 3;
        margin-left: auto;
    }
}

@media (max-width: 480px) {
    nav ul li a {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }
    .cart-link {
        font-size: 0.75rem;
        padding: 0.3rem 0.7rem;
    }
}

/* ─── MAIN ────────────────────────────────────────────────────── */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    min-height: 60vh;
}

h1, h2, h3, h4 {
    font-family: var(--font-sans);
    font-weight: 700;
    margin-bottom: 1rem;
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); color: var(--yellow); }
h2 { font-size: clamp(1.6rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 3vw, 1.8rem); }
h4 { font-size: clamp(1rem, 2.5vw, 1.4rem); }

/* ─── FLASH MESSAGES ───────────────────────────────────────────── */
.flash-messages {
    margin-bottom: 1.5rem;
}
.flash {
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-weight: 600;
    animation: slideDown 0.3s ease;
}
.flash.success { background: #2e7d32; color: #fff; }
.flash.warning { background: #b26a00; color: #fff; }
.flash.error { background: #b71c1c; color: #fff; }
.flash.info { background: #0d47a1; color: #fff; }

/* ─── BUTTONS ───────────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    font-family: var(--font-sans);
    font-weight: 700;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
}
.btn.primary {
    background: var(--yellow);
    color: #111;
}
.btn.primary:hover {
    background: var(--yellow-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 196, 48, 0.3);
    text-decoration: none;
}
.btn.secondary {
    background: transparent;
    color: var(--yellow);
    border: 2px solid var(--yellow);
}
.btn.secondary:hover {
    background: var(--yellow);
    color: #111;
    transform: translateY(-2px);
    text-decoration: none;
}
.btn.small {
    padding: 0.4rem 1.2rem;
    font-size: 0.9rem;
}
.btn.danger {
    background: #b71c1c;
    color: #fff;
}
.btn.danger:hover {
    background: #d32f2f;
}

/* ─── HERO ────────────────────────────────────────────────────── */
.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 3rem;
    flex-wrap: wrap;
}
.hero-content {
    flex: 1 1 60%;
}
.hero-content h1 {
    font-size: 3.5rem;
    line-height: 1.2;
}
.hero-content .subtitle {
    font-size: 1.4rem;
    font-style: italic;
    color: var(--text-muted);
    margin: 0.5rem 0 1rem;
}
.hero-content .tagline {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}
.hero-actions .btn {
    margin-right: 1rem;
    margin-bottom: 0.5rem;
}
.hero-icon {
    font-size: 8rem;
    opacity: 0.4;
    flex: 0 0 20%;
    text-align: center;
}

/* ─── CONTACT PAGE ────────────────────────────────────────────── */
.contact-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    padding: 2rem 1rem;
}

.contact-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    max-width: 620px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(4px);
}

.contact-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    border-color: var(--yellow);
}

.contact-header {
    text-align: center;
    margin-bottom: 2rem;
}

.contact-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.5rem;
}

.contact-header h1 {
    font-size: 2.2rem;
    margin-bottom: 0.25rem;
    color: var(--yellow);
}

.contact-subtitle {
    color: #c4b5a5;
    font-size: 1.05rem;
    line-height: 1.6;
}

/* ─── CENTRED FORM FIELDS ────────────────────────────────────── */
.contact-form {
    width: 100%;
}

.contact-form .form-group {
    margin-bottom: 1.5rem;
    text-align: center; /* centers labels and inputs */
}

.contact-form label {
    display: block;
    font-family: var(--font-sans);
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 0.3rem;
    font-size: 0.95rem;
}

.contact-form input,
.contact-form textarea {
    width: 90%;           /* slightly narrower to centre better */
    max-width: 480px;
    padding: 0.8rem 1rem;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 10px;
    color: var(--text-light);
    font-family: var(--font-serif);
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    margin: 0 auto;        /* centres the input */
    display: block;        /* required for auto margins */
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: #555;
    opacity: 0.7;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--yellow);
    outline: none;
    box-shadow: 0 0 0 3px rgba(244, 196, 48, 0.15);
}

.contact-form .form-actions {
    text-align: center;
    margin-top: 0.5rem;
}

.contact-form .btn {
    min-width: 200px;
    padding: 0.8rem 2.5rem;
    font-size: 1.1rem;
}

.contact-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    color: #7a6b5e;
    font-size: 0.95rem;
}

.contact-footer a {
    color: var(--yellow);
    text-decoration: none;
    font-weight: 600;
}

.contact-footer a:hover {
    text-decoration: underline;
}

/* ─── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 768px) {
    .contact-card {
        padding: 1.8rem 1.2rem;
    }
    .contact-header h1 {
        font-size: 1.8rem;
    }
    .contact-form .btn {
        min-width: 100%;
    }
    .contact-form input,
    .contact-form textarea {
        width: 95%;
    }
}

/* ─── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 768px) {
    .contact-card {
        padding: 1.8rem 1.2rem;
    }
    .contact-header h1 {
        font-size: 1.8rem;
    }
    .contact-form .btn {
        min-width: 100%;
    }
}

/* ─── BOOKS PAGE ────────────────────────────────────────────── */
.books-page {
    text-align: center;
}
.books-page h1 {
    margin-bottom: 0.25rem;
}
.books-subtitle {
    color: #c4b5a5;
    margin-bottom: 2rem;
}
/* Reset grid sections to left-align their content */
.book-series,
.other-books {
    text-align: left; /* revert to default for grids */
}
.book-series .series-title,
.book-series .series-description {
    text-align: center;
}
.book-series .series-bundle {
    text-align: center;
}

/* ─── BOOK GRID ───────────────────────────────────────────────── */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(clamp(150px, 25vw, 220px), 1fr));
    gap: clamp(1rem, 2vw, 2rem);
    margin: 2rem 0;
}
.book-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #333;
}
.book-card:hover {
    transform: translateY(-6px);
    border-color: var(--yellow);
    box-shadow: 0 12px 30px rgba(0,0,0,0.5);
}
.book-cover img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    background: #ddd;
}
.book-card h3 {
    font-size: 1.1rem;
    margin: 0.8rem 0 0.2rem;
}
.book-card .subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
}
.book-card .price {
    font-weight: 700;
    color: var(--yellow);
    margin: 0.5rem 0;
}

/* Book Series */
.series-description {
    color: #c4b5a5;
    margin-bottom: 1.5rem;
}

.series-card {
    border-color: var(--yellow);
    background: rgba(244, 196, 48, 0.04);
}

.bundle-note {
    color: #7a6b5e;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* ─── FEATURED BOOKS ──────────────────────────────────────────── */
.featured-books {
    margin: 3rem 0;
}
.view-all {
    text-align: center;
    margin-top: 1.5rem;
}
.view-all a {
    font-family: var(--font-sans);
    font-weight: 700;
}

/* ─── CTA ────────────────────────────────────────────────────── */
.call-to-action {
    background: linear-gradient(135deg, #111 0%, #1a1a1a 100%);
    border: 2px solid var(--yellow);
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    margin: 3rem 0;
}
.cta-box h2 {
    font-size: 2.2rem;
}
.cta-box .btn {
    margin: 0.5rem;
}

/* ─── BOOK DETAIL ────────────────────────────────────────────── */
.book-detail {
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
}
.book-cover-large {
    flex: 0 0 300px;
}
.book-cover-large img {
    width: 100%;
    border-radius: 8px;
}
.book-info {
    flex: 1;
}
.book-info .subtitle {
    font-size: 1.3rem;
    color: var(--text-muted);
    font-style: italic;
}
.book-info .price {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--yellow);
}
.synopsis {
    margin: 1.5rem 0;
    line-height: 1.8;
}

/* ─── ARTICLES ───────────────────────────────────────────────── */
.article-list .article-summary {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
}
.article-summary h2 a {
    color: var(--text-light);
    text-decoration: none;
}
.article-summary h2 a:hover {
    color: var(--yellow);
}
.article-summary .date {
    color: var(--text-muted);
    font-size: 0.9rem;
}
.read-more {
    font-weight: 700;
}

/* ─── ABOUT ───────────────────────────────────────────────────── */
.about-content {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}
.author-image {
    flex: 0 0 200px;
}
.author-image img {
    width: 100%;
    border-radius: 50%;
    border: 4px solid var(--yellow);
}
.author-bio {
    flex: 1;
}
.other-sites {
    margin-top: 2rem;
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 8px;
}
.other-sites ul {
    list-style: none;
    padding: 0;
}
.other-sites ul li {
    margin: 0.3rem 0;
}


/* ─── FOOTER ────────────────────────────────────────────────── */
footer {
    background: #111;
    border-top: 2px solid var(--yellow);
    padding: 2rem;
    margin-top: 3rem;
}
.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}
.footer-section h3, .footer-section h4 {
    font-family: var(--font-sans);
    color: var(--yellow);
    margin-bottom: 0.5rem;
}
.footer-section ul {
    list-style: none;
    padding: 0;
}
.footer-section ul li {
    margin: 0.3rem 0;
}
.footer-section ul li a {
    color: var(--text-muted);
    text-decoration: none;
}
.footer-section ul li a:hover {
    color: var(--yellow);
}

/* ─── SOCIAL LINKS (footer) ─────────────────────────────────────── */
.footer-section .social-links {
    display: flex;
    gap: 0.8rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.footer-section .social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    text-decoration: none;
}

.footer-section .social-links a:hover {
    background: var(--yellow);
    color: #111;
    border-color: var(--yellow);
    transform: translateY(-3px);
    box-shadow: 0 4px 14px rgba(244, 196, 48, 0.3);
}

.footer-section .social-links a:focus-visible {
    outline: 2px solid var(--yellow);
    outline-offset: 2px;
}

/* ─── BACK TO TOP ────────────────────────────────────────────── */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--yellow);
    color: #111;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(244, 196, 48, 0.3);
    z-index: 999;
}
.back-to-top.show {
    opacity: 1;
    visibility: visible;
}
.back-to-top:hover {
    transform: translateY(-3px);
    background: var(--yellow-dark);
}

/* ─── RESPONSIVE ────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .hero {
        flex-direction: column;
        text-align: center;
    }
    .hero-icon {
        font-size: 4rem;
        margin-top: 1rem;
    }
    .book-detail {
        flex-direction: column;
    }
    .book-cover-large {
        flex: 1;
        max-width: 300px;
        margin: 0 auto;
    }
    .about-content {
        flex-direction: column;
        align-items: center;
    }
    .btn {
        padding: 0.6rem 1.2rem;
    }
    .call-to-action .btn {
        display: block;
        width: 100%;
        margin: 0.5rem 0;
    }
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* ─── REDUCED MOTION ────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ─── SHOP / PRODUCT GRID (global fallback) ────────────────────── */
.product-grid,
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(clamp(140px, 22vw, 220px), 1fr));
    gap: clamp(0.8rem, 1.5vw, 2rem);
}

/* ─── ANIMATIONS ────────────────────────────────────────────────── */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}
