/* ================================================== 
   CSS VARIABLES & RESET
================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
    --navy: #0D1B3D;
    --gold: #B89B5E;
    --ivory: #F8F7F4;
    --charcoal: #222222;
    --font-head: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
    --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background-color: var(--ivory);
    color: var(--charcoal);
    line-height: 1.7;
    overflow-x: hidden;
}

/* ================================================== 
   TYPOGRAPHY & UTILITIES
================================================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-head);
    color: var(--navy);
    font-weight: 700;
}

h1 { font-size: 4rem; line-height: 1.15; margin-bottom: 1.2rem; }
h2 { font-size: 2.8rem; margin-bottom: 1.5rem; }
h3 { font-size: 1.75rem; margin-bottom: 1rem; }

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.text-center { text-align: center; }
.text-navy { color: var(--navy); }
.text-gold { color: var(--gold); }
.text-ivory { color: var(--ivory); }
.bg-navy { background-color: var(--navy); }
.bg-charcoal { background-color: var(--charcoal); }
.bg-ivory { background-color: var(--ivory); }

.section-padding { padding: 6rem 0; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 2.2rem;
    font-family: var(--font-body);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.85rem;
    border-radius: 2px;
}

.btn-gold {
    background-color: var(--gold);
    color: var(--ivory);
}

.btn-gold:hover {
    background-color: #9A804B;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(184, 155, 94, 0.3);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--gold);
    color: var(--gold);
}

.btn-outline:hover {
    background-color: var(--gold);
    color: var(--ivory);
    transform: translateY(-3px);
}

.btn-navy {
    background-color: var(--navy);
    color: var(--ivory);
}

.btn-navy:hover {
    background-color: #081126;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(13, 27, 61, 0.2);
}

/* ================================================== 
   HEADER, NAVIGATION & LOGO
================================================== */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: rgba(248, 247, 244, 0.98);
    backdrop-filter: blur(15px);
    z-index: 1000;
    padding: 1.8rem 0;
    transition: var(--transition);
    border-bottom: 1px solid rgba(13, 27, 61, 0.05);
}

header.scrolled {
    padding: 1rem 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Upgraded Logo */
.logo img {
    height: 50px; /* Adjust as needed */
    width: auto;
    display: block;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--navy);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1.5px;
    transition: var(--transition);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--gold);
    transition: var(--transition);
}

.nav-links a:hover::after, .nav-links a.active::after {
    width: 100%;
}

.hamburger {
    display: none;
    cursor: pointer;
    z-index: 1001; /* Keeps it above mobile menu */
}

.hamburger span {
    display: block;
    width: 30px;
    height: 2px;
    background-color: var(--navy);
    margin: 6px 0;
    transition: var(--transition);
}

/* ================================================== 
   COMMON HERO SECTIONS (Inner Pages)
================================================== */
.page-hero {
    padding: 14rem 0 7rem;
    background-color: var(--navy);
    color: var(--ivory);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at center, rgba(184, 155, 94, 0.1) 0%, transparent 70%);
}

.page-hero h1 {
    color: var(--ivory);
    font-size: 3.5rem;
    position: relative;
    z-index: 2;
}

/* ================================================== 
   HOME PAGE SPECIFICS & HERO IMAGE UPGRADE
================================================== */
.home-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 100px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 5rem;
    align-items: center;
}

.tagline {
    font-family: var(--font-head);
    font-style: italic;
    font-size: 1.6rem;
    color: var(--charcoal);
    margin-bottom: 2rem;
    line-height: 1.5;
    opacity: 0.9;
}

/* Upgraded Hero Image */
.hero-image {
    position: relative;
    padding-right: 20px;
    padding-bottom: 20px;
}

.hero-image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: -20px 20px 0px rgba(184, 155, 94, 0.15), 0 25px 50px rgba(0,0,0,0.1);
    border: 1px solid rgba(184, 155, 94, 0.2);
    transition: var(--transition);
    position: relative;
    z-index: 2;
}

.hero-image img:hover {
    transform: translateY(-10px);
    box-shadow: -10px 10px 0px rgba(184, 155, 94, 0.3), 0 35px 60px rgba(0,0,0,0.15);
}

.book-showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2.5rem;
}

.book-card {
    background: white;
    padding: 2.5rem 2rem;
    text-align: center;
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 4px;
}

.book-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 20px 40px rgba(13, 27, 61, 0.08);
    border-color: rgba(184, 155, 94, 0.5);
}

.book-card img {
    max-width: 160px;
    margin-bottom: 1.5rem;
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
    transition: var(--transition);
}

.book-card:hover img {
    transform: scale(1.05);
}

/* ================================================== 
   FAQ ACCORDION UPGRADE
================================================== */
.faq-item {
    border-bottom: 1px solid rgba(255,255,255,0.15);
    padding: 1.5rem 0;
}

.faq-question {
    font-family: var(--font-head);
    font-size: 1.4rem;
    color: var(--gold);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.faq-question:hover {
    color: var(--ivory);
}

/* Animated Plus Icon */
.faq-question span {
    font-size: 1.8rem;
    font-family: var(--font-body);
    font-weight: 300;
    transition: transform 0.4s ease;
    display: inline-block;
}

.faq-item.active .faq-question {
    color: var(--ivory);
}

.faq-item.active .faq-question span {
    transform: rotate(45deg);
    color: var(--gold);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.faq-answer p {
    padding-top: 1rem;
    color: rgba(248, 247, 244, 0.8);
    font-size: 1.05rem;
}

/* ================================================== 
   FOOTER UPGRADE
================================================== */
footer {
    background-color: var(--charcoal);
    color: var(--ivory);
    padding: 6rem 0 2rem;
    border-top: 5px solid var(--gold);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1.5fr;
    gap: 4rem;
    margin-bottom: 4rem;
}

.footer-grid h3 {
    color: var(--gold);
    font-size: 1.5rem;
    letter-spacing: 1px;
}

.footer-grid ul {
    list-style: none;
}

.footer-grid li {
    margin-bottom: 0.8rem;
}

.footer-grid a {
    color: rgba(248, 247, 244, 0.7);
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    display: inline-block;
}

.footer-grid a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: var(--gold);
    transition: var(--transition);
}

.footer-grid a:hover {
    color: var(--ivory);
}

.footer-grid a:hover::after {
    width: 100%;
}

/* Upgraded Newsletter Input */
.newsletter-form {
    display: flex;
    gap: 0;
    margin-top: 1.5rem;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
}

.newsletter-form input {
    flex: 1;
    padding: 1rem 1.5rem;
    background: rgba(255,255,255,0.05);
    border: none;
    color: var(--ivory);
    font-family: var(--font-body);
    outline: none;
    transition: background 0.3s;
}

.newsletter-form input:focus {
    background: rgba(255,255,255,0.1);
}

.newsletter-form button {
    border-radius: 0;
    margin: 0;
}

/* ================================================== 
   ANIMATIONS
================================================== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ================================================== 
   COMPREHENSIVE MEDIA QUERIES
================================================== */

/* Tablet & Smaller Laptops */
@media (max-width: 1024px) {
    h1 { font-size: 3.2rem; }
    h2 { font-size: 2.4rem; }
    .hero-grid, .about-grid { gap: 3rem; }
    .footer-grid { gap: 2rem; }
    .page-hero { padding: 12rem 0 5rem; }
}

/* Mobile Landscape & Standard Tablets */
@media (max-width: 768px) {
    h1 { font-size: 2.8rem; }
    h2 { font-size: 2.2rem; }
    .section-padding { padding: 4rem 0; }
    
    /* Layout Grids Stacking */
    .hero-grid, .about-grid, .library-item, .contact-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .hero-content { text-align: center; }
    
    .hero-image { 
        max-width: 80%; 
        margin: 0 auto; 
    }
    
    /* Off-Canvas Mobile Menu */
    .hamburger { display: block; }
    
    .hamburger.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active span:nth-child(2) { opacity: 0; }
    .hamburger.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background-color: var(--navy);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 3rem;
        transition: right 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links a {
        color: var(--ivory);
        font-size: 1.5rem;
    }
    
    /* Footer Stacking */
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }
    
    .footer-grid a::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .newsletter-form {
        flex-direction: column;
        border: none;
        background: transparent;
        gap: 10px;
    }
    
    .newsletter-form input {
        border-radius: 4px;
        border: 1px solid rgba(255,255,255,0.2);
    }
    
    .newsletter-form button {
        border-radius: 4px;
        width: 100%;
    }
}

/* Mobile Portrait */
@media (max-width: 480px) {
    h1 { font-size: 2.2rem; }
    .tagline { font-size: 1.3rem; }
    .hero-image { max-width: 100%; padding-right: 10px; padding-bottom: 10px; }
    .hero-image img { box-shadow: -10px 10px 0px rgba(184, 155, 94, 0.15); }
    
    .btn { 
        width: 100%; 
        margin-bottom: 15px; 
    }
    
    .btn-outline {
        margin-left: 0 !important;
    }
    
    .book-card { padding: 1.5rem; }
    .faq-question { font-size: 1.2rem; }
}

/* Filter controls stacking on library/blog pages */
@media (max-width: 600px) {
    .filter-controls {
        flex-direction: column;
        gap: 0.5rem;
    }
    .filter-btn {
        width: 100%;
        border-bottom: 1px solid #ddd;
        padding: 1rem;
    }
    .filter-btn.active {
        border-bottom: 2px solid var(--gold);
    }
}

/* ================================================== 
   ABOUT PAGE SPECIFICS
================================================== */
.about-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
}

.philosophy-quote {
    background: var(--navy);
    color: var(--ivory);
    padding: 2.5rem;
    font-family: var(--font-head);
    font-style: italic;
    font-size: 1.25rem;
    border-left: 4px solid var(--gold);
}

.timeline {
    border-left: 2px solid var(--gold);
    padding-left: 2rem;
    list-style: none;
}

.timeline li {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline li::before {
    content: '';
    position: absolute;
    left: -2.4rem;
    top: 5px;
    width: 12px;
    height: 12px;
    background: var(--navy);
    border: 2px solid var(--gold);
    border-radius: 50%;
}

.competencies-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.comp-badge {
    background: transparent;
    border: 1px solid var(--gold);
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--navy);
}

/* ================================================== 
   BOOKS PAGE SPECIFICS
================================================== */
.filter-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: none;
    border: none;
    font-family: var(--font-body);
    text-transform: uppercase;
    font-weight: 600;
    color: var(--charcoal);
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.filter-btn:hover, .filter-btn.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
}

.library-item {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    margin-bottom: 4rem;
    padding-bottom: 4rem;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.library-item:last-child {
    border-bottom: none;
}

.lib-cover img {
    width: 100%;
    max-width: 300px;
    box-shadow: 10px 10px 0 var(--gold);
}

.lib-meta {
    font-family: var(--font-head);
    color: var(--gold);
    font-style: italic;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

/* ================================================== 
   BLOG PAGE SPECIFICS
================================================== */
.blog-search {
    display: flex;
    max-width: 600px;
    margin: 0 auto 3rem;
}

.blog-search input {
    flex: 1;
    padding: 1rem;
    border: 1px solid #ccc;
    font-family: var(--font-body);
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.article-card {
    background: white;
    border: 1px solid #eee;
    transition: var(--transition);
}

.article-card:hover {
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.article-img {
    height: 200px;
    background-color: var(--navy);
}

.article-content {
    padding: 1.5rem;
}

.article-tag {
    color: var(--gold);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ================================================== 
   CONTACT PAGE SPECIFICS
================================================== */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ccc;
    font-family: var(--font-body);
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--gold);
}

.error-msg {
    color: red;
    font-size: 0.8rem;
    display: none;
    margin-top: 0.3rem;
}

.form-group.error input, .form-group.error textarea {
    border-color: red;
}

.form-group.error .error-msg {
    display: block;
}

/* ==========================================
   LARGE TABLETS
========================================== */
@media (max-width: 1024px) {

    .container {
        width: 92%;
    }

    h1 {
        font-size: 3rem;
    }

    h2 {
        font-size: 2.4rem;
    }

    .hero-grid,
    .about-grid,
    .contact-grid {
        gap: 2.5rem;
    }

    .footer-grid {
        gap: 2rem;
    }
}

/* ==========================================
   TABLETS
========================================== */
@media (max-width: 768px) {

    header {
        padding: 1rem 0;
    }

    .logo img {
        height: 42px;
    }

    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    .section-padding {
        padding: 4rem 0;
    }

    .home-hero {
        min-height: auto;
        padding-top: 140px;
        padding-bottom: 60px;
    }

    .hero-grid,
    .about-grid,
    .library-item,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .hero-content {
        text-align: center;
        order: 2;
    }

    .hero-image {
        order: 1;
        max-width: 350px;
        margin: 0 auto;
        padding: 0;
    }

    .hero-image img {
        box-shadow: 0 20px 40px rgba(0,0,0,0.12);
    }

    .tagline {
        font-size: 1.3rem;
    }

    .hamburger {
        display: block;
    }

    .nav-links {
        position: fixed;
        inset: 0;
        background: var(--navy);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transform: translateX(100%);
        transition: .4s ease;
    }

    .nav-links.active {
        transform: translateX(0);
    }

    .nav-links a {
        color: white;
        font-size: 1.2rem;
    }

    .book-showcase-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .newsletter-form {
        flex-direction: column;
        gap: 10px;
    }

    .newsletter-form input,
    .newsletter-form button {
        width: 100%;
    }
}

/* ==========================================
   MOBILE PHONES
========================================== */
@media (max-width: 576px) {

    h1 {
        font-size: 2.1rem;
        line-height: 1.2;
    }

    h2 {
        font-size: 1.8rem;
    }

    h3 {
        font-size: 1.3rem;
    }

    p {
        font-size: 0.95rem;
    }

    .home-hero {
        padding-top: 120px;
    }

    .tagline {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }

    .hero-image {
        max-width: 280px;
    }

    .btn {
        width: 100%;
        margin-bottom: 12px;
    }

    .btn-outline {
        margin-left: 0 !important;
    }

    .book-showcase-grid {
        grid-template-columns: 1fr;
    }

    .book-card {
        padding: 1.5rem;
    }

    .book-card img {
        max-width: 140px;
    }

    .faq-question {
        font-size: 1.1rem;
    }

    .page-hero {
        padding: 9rem 0 4rem;
    }

    .page-hero h1 {
        font-size: 2.2rem;
    }
}

/* ==========================================
   SMALL PHONES (320px - 375px)
========================================== */
@media (max-width: 375px) {

    .container {
        width: 94%;
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.6rem;
    }

    .hero-image {
        max-width: 240px;
    }

    .logo img {
        height: 36px;
    }

    .nav-links a {
        font-size: 1rem;
    }

    .book-card {
        padding: 1.2rem;
    }

    .newsletter-form input {
        padding: 0.9rem;
    }
}