/*
Theme Name: Nairobi by Night
Description: A fully custom, standalone WordPress theme built from scratch for "Yoga for Back Pain". Features the Peachy Pink wellness palette and Playfair Display typography.
Author: Coding Partner
Version: 1.0.2
Text Domain: nairobi-by-night
*/

/* ==========================================================================
   1. GOOGLE FONTS IMPORT (Option A)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&family=Playfair+Display:ital,wght@0,600;0,700;1,600&display=swap');

/* ==========================================================================
   2. CSS VARIABLES (Peachy Pink Palette - Solid Fills)
   ========================================================================== */
:root {
    --primary: #d11f3f;       /* Deep Crimson - Headings, Logos, Branding */
    --accent: #ff615d;        /* Bright Coral - Main Call-To-Action Buttons */
    --accent-light: #ffa583;  /* Peachy Orange - Icons, Highlights, Hover States */
    --bg-sand: #dad8c0;       /* Warm Sand - Footer, Borders, Alternating Sections */
    --bg-light: #eaf0f1;      /* Cool Off-White - Main Website Background */
    
    --text-main: #333333;     /* Dark Slate - Easy-to-read Body Text */
    --text-muted: #666666;    /* Muted Slate - Subtitles */
    --white: #ffffff;         /* Pure White - Card Backgrounds & Button Text */
    --border-color: #dad8c0;  /* Sand-colored borders for soft framing */
}

/* ==========================================================================
   3. GLOBAL RESET & BASE TYPOGRAPHY
   ========================================================================== */
body { 
    background: var(--bg-light); 
    color: var(--text-main); 
    font-family: 'Lato', sans-serif; /* Clean body text */
    overflow-x: hidden; 
    margin: 0;
}

h1, h2, h3, h4 { 
    font-family: 'Playfair Display', serif; /* Elegant headings */
    font-weight: 700; 
    letter-spacing: -0.01em; 
    line-height: 1.2; 
    color: var(--primary); 
    margin-top: 0; 
}

p { 
    font-family: 'Lato', sans-serif;
    line-height: 1.8; 
    color: var(--text-main); 
    margin-bottom: 1.5rem; 
    font-size: 1.05rem;
}

/* ==========================================================================
   4. LAYOUT & WHITESPACE UTILITIES
   ========================================================================== */
.lp-container { max-width: 1200px; margin: 0 auto; padding: 0 40px; }
.lp-container-narrow { max-width: 800px; margin: 0 auto; padding: 0 40px; }
/* NEW: Wide container specifically for 4-column desktop grids */
.lp-container-wide { max-width: 1440px; margin: 0 auto; padding: 0 40px; }
.section-padding { padding: 120px 0; }
.bg-sand { background: var(--bg-sand); }
.bg-light { background: var(--bg-light); }
.text-center { text-align: center; }

/* ==========================================================================
   5. NAVIGATION (Sticky Glassmorphism)
   ========================================================================== */
.lp-nav { 
    position: fixed; 
    top: 0; width: 100%; 
    z-index: 1000; 
    background: rgba(234, 240, 241, 0.95); /* Off-white glass */
    backdrop-filter: blur(15px); 
    border-bottom: 1px solid var(--border-color); 
}
.nav-flex { display: flex; justify-content: space-between; align-items: center; height: 80px; }
.lp-logo { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 1.8rem; color: var(--primary); text-decoration: none; }
.lp-logo span { color: var(--accent); font-style: italic; }
.nav-links { display: flex; list-style: none; gap: 30px; align-items: center; margin: 0; padding: 0; }
.nav-links a { font-family: 'Lato', sans-serif; text-decoration: none; color: var(--text-main); font-weight: 700; transition: 0.3s; }
.nav-links a:hover { color: var(--accent); }

/* --- POLYLANG FLAG STYLING --- */
.nav-links .lang-item {
    display: flex;
    align-items: center;
}
.nav-links .lang-item a {
    display: flex;
    align-items: center;
    gap: 8px; /* Adds a nice space if you show flags AND text */
}
.nav-links .lang-item img {
    width: 18px !important; /* Forces the flag to a clean, modern size */
    height: auto !important;
    border-radius: 2px; /* Softens the corners of the flag slightly */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Adds a premium subtle shadow */
    margin: 0 !important;
    vertical-align: middle;
}

/* ==========================================================================
   6. BUTTONS & UI ELEMENTS (Solid Fills)
   ========================================================================== */
.btn-main { 
    background: var(--accent); 
    color: var(--white); 
    padding: 18px 38px; 
    border-radius: 50px; 
    font-weight: 700; 
    text-decoration: none; 
    display: inline-block; 
    transition: all 0.3s ease; 
    border: none;
    font-size: 1rem;
}
.btn-main:hover { 
    background: var(--primary); 
    color: var(--white); 
    transform: translateY(-2px); 
    box-shadow: 0 8px 15px rgba(209, 31, 63, 0.2); 
}
.nav-btn { background: var(--primary); color: var(--white) !important; padding: 12px 25px; }
.nav-btn:hover { background: var(--accent); }

/* ==========================================================================
   7. HERO SECTION (Solid Color Overlays)
   ========================================================================== */
.full-hero { height: 100vh; position: relative; display: flex; align-items: center; justify-content: center; text-align: center; }
.hero-bg-image { position: absolute; inset: 0; background-size: cover; background-position: center; z-index: 1; }

/* Replaced Gradient with a warm, solid semi-transparent tint */
.hero-overlay { position: absolute; inset: 0; background: rgba(234, 240, 241, 0.85); z-index: 2; }

.hero-content { position: relative; z-index: 3; max-width: 900px; margin-top: 50px; }
.hero-title { font-size: clamp(3rem, 6vw, 5.5rem); margin-bottom: 25px; color: var(--primary); line-height: 1.1; }

/* ==========================================================================
   8. CARDS & GRIDS (UX Optimized for Desktop, Tablet, Mobile)
   ========================================================================== */
.modern-grid { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 30px; 
    align-items: stretch; 
}

.service-card { 
    background: var(--white); 
    padding: 40px 30px; 
    border-radius: 16px; 
    box-shadow: 0 4px 20px rgba(0,0,0,0.03); /* Extremely soft shadow for flat look */
    border: 1px solid var(--border-color); 
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.service-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 15px 35px rgba(209, 31, 63, 0.08); 
    border-color: var(--accent-light);
}

/* Icon Styling */
.service-card i { 
    width: 48px; 
    height: 48px; 
    margin-bottom: 20px; 
    background: var(--bg-sand);
    color: var(--primary);
    padding: 12px;
    border-radius: 50%; /* Soft circular icons */
}
.service-card h3 { margin-bottom: 15px; font-size: 1.6rem; }
.service-card p { font-size: 1rem; color: var(--text-muted); margin-bottom: 25px; }

/* Push button to bottom */
.service-card .btn-main { margin-top: auto; width: 100%; text-align: center; box-sizing: border-box; }

/* ==========================================================================
   9. ACCORDIONS (Curriculum Modules)
   ========================================================================== */
.modern-module { background: var(--white); border-radius: 12px; margin-bottom: 15px; border: 1px solid var(--border-color); overflow: hidden; }
.modern-module summary { padding: 25px; list-style: none; display: flex; align-items: center; cursor: pointer; font-weight: 700; font-size: 1.1rem; color: var(--primary); }
.modern-module summary::-webkit-details-marker { display: none; }
.m-index { margin-right: 20px; color: var(--accent); font-weight: 700; font-family: 'Lato', sans-serif;}
.m-text { flex-grow: 1; font-family: 'Playfair Display', serif; font-size: 1.3rem;}
.m-body { padding: 0 25px 25px 90px; color: var(--text-muted); border-top: 1px solid var(--border-color); margin-top: 10px; padding-top: 20px; }

/* ==========================================================================
   10. FOOTER (Warm Sand)
   ========================================================================== */
.full-footer { padding: 100px 0 20px 0; background: var(--bg-sand); color: var(--text-main); text-align: center;}
.full-footer h2 { color: var(--primary); }
.full-footer p { color: var(--text-main); }
.footer-links { display: flex; justify-content: center; gap: 80px; margin: 40px 0; }
.footer-links h4 { color: var(--primary); font-size: 1.3rem; }
.footer-links a { display: block; color: var(--text-muted); text-decoration: none; margin-bottom: 10px; font-weight: 700;}
.footer-links a:hover { color: var(--accent); }

/* ==========================================================================
   11. ANIMATIONS & PROGRESS BAR
   ========================================================================== */
#progress-container { position: fixed; top: 80px; left: 0; width: 100%; height: 4px; z-index: 1001; }
#progress-bar { height: 100%; background: var(--accent); width: 0%; transition: width 0.1s; }
.reveal { transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1); opacity: 0; }

/* ==========================================================================
   12. RESPONSIVE MEDIA QUERIES
   ========================================================================== */
@media (min-width: 1200px) {
    .modern-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; }
}
@media (max-width: 900px) {
    .nav-links { display: none; }
    .hero-title { font-size: 3rem; }
    .section-padding { padding: 80px 0; }
    .lp-container { padding: 0 20px; }
    .modern-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .service-card { padding: 30px 20px; }
    .m-body { padding: 0 20px 20px 20px; }
    .footer-links { flex-direction: column; gap: 40px; }
}
@media (max-width: 600px) {
    .modern-grid { grid-template-columns: 1fr; gap: 20px; }
    .service-card { padding: 35px 25px; }
    .service-card .btn-main { padding: 18px 25px; font-size: 1rem; }
}

/* ==========================================================================
   MOBILE NAVIGATION MENU
   ========================================================================== */

/* Hide the hamburger button on Desktop */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 9999;
}

/* Style the 3 lines of the hamburger */
.hamburger-line {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--primary);
    transition: all 0.3s ease-in-out;
    border-radius: 3px;
}

/* TABLET & MOBILE VIEW */
@media screen and (max-width: 768px) {
    
    /* 1. Show the hamburger button */
    .mobile-menu-toggle {
        display: block;
    }

    /* 2. Hide the normal horizontal menu and turn it into a dropdown */
    .nav-links {
        position: absolute;
        top: 80px; /* Adjust this if your header is taller/shorter */
        left: 0;
        width: 100%;
        background-color: #ffffff;
        
        /* THE FIXES: */
        display: flex; /* Forces the links to render */
        z-index: 9999; /* Forces the menu ON TOP of the page content */
        
        flex-direction: column; 
        align-items: center;
        padding: 30px 0;
        box-shadow: 0 20px 40px rgba(0,0,0,0.1); /* Slightly stronger shadow */
        border-top: 1px solid var(--border-color);
        
        /* Hides the menu by default on mobile */
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.3s ease;
    }

    /* Space out the links so they are easy to tap with a finger */
    .nav-links li {
        margin: 15px 0;
    }

    /* 3. The "Active" state that JS will trigger to show the menu */
    .nav-links.nav-active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}


/* ==========================================================================
   WOOCOMMERCE CART & BUTTON OVERRIDES
   ========================================================================== */

/* 1. Target all WooCommerce buttons (Cart, Checkout, Empty Cart) */
.woocommerce a.button, 
.woocommerce button.button, 
.woocommerce input.button, 
.woocommerce #respond input#submit {
    background-color: var(--primary) !important;
    color: #ffffff !important;
    border-radius: 8px !important; /* Softens the corners to match modern UI */
    border: none !important;
    padding: 12px 24px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

/* 2. The Hover State */
.woocommerce a.button:hover, 
.woocommerce button.button:hover, 
.woocommerce input.button:hover, 
.woocommerce #respond input#submit:hover {
    background-color: var(--accent) !important;
    color: #ffffff !important;
    opacity: 0.9;
}

/* 3. Specific emphasis on the "Return to Shop" button */
.woocommerce a.button.wc-backward {
    margin-top: 20px !important;
    display: inline-block !important;
}

/* 4. Fix the WooCommerce Message bars (The green checkmark bars) */
.woocommerce-message {
    border-top-color: var(--primary) !important;
}
.woocommerce-message::before {
    color: var(--primary) !important;
}


/* --- LANGUAGE SWITCHER CUSTOM STYLING --- */

/* 1. Style the main menu item */
.menu-item-language a {
    display: flex;
    align-items: center;
    gap: 8px; /* Space between flag and text */
    transition: all 0.3s ease;
}

/* 2. Style the flags (make them slightly rounded and consistent) */
.menu-item-language img {
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    width: 18px !important;
    height: auto !important;
}

/* 3. The Dropdown Menu (The box that appears on hover) */
.menu-item-language-dropdown .sub-menu {
    background-color: #ffffff !important;
    border-top: 3px solid var(--primary) !important; /* Peachy top border */
    box-shadow: 0 10px 30px rgba(0,0,0,0.08) !important;
    border-radius: 0 0 12px 12px !important;
    padding: 10px 0 !important;
}

/* 4. Hover state for languages in the dropdown */
.menu-item-language-dropdown .sub-menu li a:hover {
    background-color: #fff9f8 !important; /* Very light peach tint */
    color: var(--primary) !important;
}


/* --- GENERAL MENU HOVER --- */
#primary-menu li a:hover,
.current-menu-item a {
    color: var(--primary) !important;
}

/* Optional: Add a subtle underline to the active page */
.current-menu-item a::after {
    content: '';
    display: block;
    width: 20px;
    height: 2px;
    background: var(--primary);
    margin: 4px auto 0;
    border-radius: 10px;
}

/* 4. Fixed Header Implementation */

header.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999; /* Stay on top of everything */
    background-color: #ffffff;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    height: 80px; /* Adjust this to your actual header height */
    display: flex;
    align-items: center;
}

/* Push the page content down so it starts AFTER the header */
body {
    padding-top: 80px !important; /* Must match the header height above */
}

/* For Mobile: If your header height changes on smaller screens */
@media (max-width: 768px) {
    header.main-header {
        height: 60px;
    }
    body {
        padding-top: 60px !important;
    }
}   



/* ==========================================================================
   MasterStudy Grid Color Overrides (Removing Default Blue)
   ========================================================================== */

/* 1. Change the Course Title Color to your dark text color */
.masterstudy-custom-grid .stm_lms_courses__single--title h5,
.masterstudy-custom-grid .stm_lms_courses__single--title h4 {
    color: var(--text-main) !important;
    transition: color 0.3s ease;
}

/* 2. Change the Title Color when the user hovers over the course card */
.masterstudy-custom-grid .stm_lms_courses__single:hover .stm_lms_courses__single--title h5,
.masterstudy-custom-grid .stm_lms_courses__single:hover .stm_lms_courses__single--title h4 {
    color: var(--primary) !important; /* Changes to your primary brand color */
}

/* 3. Change the Price Color (Often defaults to blue) */
.masterstudy-custom-grid .stm_lms_courses__single--price,
.masterstudy-custom-grid .stm_lms_courses__single--price strong {
    color: var(--accent) !important; 
}

/* 4. Change the "Category" or "Status" tags if they are blue */
.masterstudy-custom-grid .stm_lms_courses__single--terms a {
    color: var(--text-muted) !important;
    transition: color 0.3s ease;
}

.masterstudy-custom-grid .stm_lms_courses__single--terms a:hover {
    color: var(--primary) !important;
}

/* ==========================================================================
   WooCommerce Cart Overrides
   ========================================================================== */

/* Style the Cart Table */
.custom-woo-wrapper table.shop_table {
    border: none !important;
    border-radius: 8px;
    overflow: hidden;
}

.custom-woo-wrapper table.shop_table th {
    background-color: var(--primary) !important;
    color: white !important;
    border: none !important;
    padding: 15px !important;
}

.custom-woo-wrapper table.shop_table td {
    border-bottom: 1px solid var(--border-color) !important;
    padding: 15px !important;
    vertical-align: middle;
}

/* Style the Links and Text */
.custom-woo-wrapper table.shop_table td.product-name a {
    color: var(--text-main) !important;
    font-weight: bold;
    text-decoration: none;
}

.custom-woo-wrapper table.shop_table td.product-name a:hover {
    color: var(--primary) !important;
}

/* Style the Buttons (Update Cart & Proceed to Checkout) */
.custom-woo-wrapper .button {
    background-color: var(--primary) !important;
    color: white !important;
    border-radius: 8px !important;
    padding: 15px 30px !important;
    font-weight: bold !important;
    transition: opacity 0.3s ease !important;
    border: none !important;
}

.custom-woo-wrapper .button:hover {
    opacity: 0.8 !important;
    background-color: var(--primary) !important;
}

/* Cart Totals Section */
.custom-woo-wrapper .cart_totals h2 {
    color: var(--primary) !important;
    font-size: 2rem !important;
    margin-bottom: 20px;
}

/* Remove the Coupon Field (Unless Cynthia explicitly wants to run promos right now) */
/* .custom-woo-wrapper .coupon {
    display: none !important;
} */