/****** Global Styles & Variables *******/
:root {
    --primary-color: #272624; /* Dark Gray/Black for text, headers */
    --secondary-color: #8A7968; /* Muted Brown/Taupe for accents, buttons */
    --accent-color: #D4C8B0; /* Light Beige/Cream for subtle highlights */
    --background-light: #F5F1E6; /* Very Light Beige/Off-White for backgrounds */
    --background-white: #FFFFFF;
    --text-light: #FFFFFF;
    --text-dark: #272624;
    --font-primary: 'Montserrat', Arial, sans-serif;
    --font-serif-display: 'Times New Roman', Times, serif; /* Example serif for high-end feel */
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-primary);
    background-color: var(--background-light);
    color: var(--text-dark);
    line-height: 1.8;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden; /* Prevent horizontal scroll */
    width: 100%;
    box-sizing: border-box;
}

*, *:before, *:after {
    box-sizing: inherit;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3 {
    font-family: var(--font-serif-display); /* Using a serif font for headings */
    color: var(--primary-color);
    font-weight: 300; /* Lighter weight for elegance */
}

h1 {
    font-size: 3rem; /* 48px */
    margin-bottom: 1rem;
    line-height: 1.2;
}

h2 {
    font-size: 2.25rem; /* 36px */
    margin-bottom: 1rem;
    line-height: 1.3;
}

h3 {
    font-size: 1.75rem; /* 28px */
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

img {
    max-width: 100%;
    height: auto;
    display: block; /* Prevent image spacing issues */
}

/****** Header *******/
.main-header {
    background-color: var(--background-white);
    padding: 20px 0;
    border-bottom: 1px solid var(--accent-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow wrapping on small screens */
}

.logo-text {
    font-family: var(--font-serif-display);
    font-size: 1.8rem; /* 28.8px */
    font-weight: 500; /* Slightly bolder for logo */
    color: var(--primary-color);
    letter-spacing: 1px;
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap; /* Allow nav items to wrap */
    justify-content: center;
}

.main-nav ul li {
    margin-left: 30px;
}

.main-nav ul li a {
    font-size: 1rem; /* 16px */
    font-weight: 500;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
    transition: color 0.3s ease, border-bottom-color 0.3s ease;
    white-space: nowrap; /* Prevent text wrapping within links */
}

.main-nav ul li a:hover,
.main-nav ul li a.active {
    color: var(--secondary-color);
    border-bottom-color: var(--secondary-color);
}

/****** Hero Section *******/
.hero {
    background-color: var(--background-light); /* Or a subtle image/gradient */
    padding: 80px 0;
    text-align: center;
    width: 100%;
}

.hero h1 {
    color: var(--primary-color);
}

.hero .tagline {
    font-size: 1.3rem; /* 20.8px */
    color: var(--secondary-color);
    margin-bottom: 30px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    font-style: italic;
    font-family: var(--font-primary);
}

.cta-button, .cta-button-secondary {
    display: inline-block;
    background-color: var(--secondary-color);
    color: var(--text-light);
    padding: 15px 35px;
    border-radius: 5px; /* Subtle rounding */
    font-size: 1.1rem; /* 17.6px */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border: 2px solid var(--secondary-color);
    text-align: center;
}

.cta-button:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

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

.cta-button-secondary:hover {
    background-color: var(--secondary-color);
    color: var(--text-light);
    transform: translateY(-2px);
}

/****** Introduction Section *******/
.introduction, .consultation-promo {
    padding: 60px 0;
    background-color: var(--background-white);
    text-align: center;
    width: 100%;
}

.introduction .container p, .consultation-promo .container p {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.consultation-promo {
    background-color: var(--background-light);
}

/****** Footer *******/
.main-footer {
    background-color: var(--primary-color);
    color: var(--accent-color); /* Lighter text for dark background */
    padding: 40px 0;
    text-align: center;
    font-size: 0.9rem;
    width: 100%;
}

.main-footer p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.main-footer a {
    color: var(--background-light);
}

.main-footer a:hover {
    color: var(--accent-color);
}


/****** Tool Selector Page Specific (bespoke_selector_tool_page.html) *******/
/* Styles from user's provided HTML for bespoke_selector_tool_page.html */
/* Add a wrapper or ensure these styles are scoped if needed */

.tool-selector-body {
    font-family: 'Montserrat', Arial, sans-serif;
    line-height: 1.6;
    color: #272624;
    margin: 0;
    padding: 0;
    background-color: #F5F1E6;
    width: 100%;
}

.tool-selector-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
    width: 100%;
}

.tool-selector-header {
    text-align: center;
    margin-bottom: 40px;
    width: 100%;
}

.tool-selector-body h1 {
    font-weight: 300;
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #272624;
    font-family: 'Montserrat', Arial, sans-serif; /* Overriding serif for this page for now, can be harmonized */
}

.tool-selector-tagline {
    font-style: italic;
    color: #8A7968;
    font-size: 1.2rem;
    margin-bottom: 30px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
    width: 100%;
}

.tool-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column; /* Ensure content flows correctly */
    width: 100%;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.tool-header {
    background: #272624;
    color: white;
    padding: 20px;
}

.tool-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 500;
    font-family: 'Montserrat', Arial, sans-serif; /* Overriding serif for this page for now */
}

.tool-content {
    padding: 25px;
    flex-grow: 1; /* Make content area grow */
    display: flex;
    flex-direction: column; /* Align items vertically */
}

.tool-description {
    margin-bottom: 15px;
    font-size: 0.95rem;
    flex-grow: 1; /* Allow description to take available space */
}

.tool-features {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #555;
}

.tool-features li {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

.tool-features li::before {
    content: "\2022"; /* Bullet character */
    color: var(--secondary-color);
    font-weight: bold;
    display: inline-block; 
    width: 1em;
    margin-left: -1.2em; /* Adjust for custom bullet */
    position: absolute;
    left: 10px;
}

.tool-cta {
    display: inline-block;
    background: var(--secondary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-align: center;
    font-weight: 500;
    margin-top: auto; /* Push to bottom */
    align-self: flex-start; /* Align to left */
    transition: background-color 0.3s ease;
    width: 100%; /* Make button full width */
}

.tool-cta:hover {
    background: var(--primary-color);
}

.help-section {
    text-align: center;
    padding: 40px 20px;
    background: var(--background-white);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    width: 100%;
}

.help-section h3 {
    font-family: 'Montserrat', Arial, sans-serif; /* Overriding serif for this page for now */
    margin-bottom: 15px;
}

.help-cta {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 12px 25px;
    border-radius: 5px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.help-cta:hover {
    background: var(--secondary-color);
}

/* Gallery Page Styles */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 40px;
    margin-bottom: 70px;
    width: 100%;
}

.gallery-item {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.gallery-image {
    width: 100%;
    height: auto;
    min-height: 200px;
}

.gallery-cta {
    width: 100%;
}

/* Tool Pages Styles */
.quiz-box {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 15px;
    width: 100%;
}

.result-card {
    width: 100%;
}

/* Enhanced Responsive Styles */
@media (max-width: 1024px) {
    .container {
        width: 95%;
    }
    
    h1 { font-size: 2.7rem; }
    h2 { font-size: 2rem; }
    
    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

/* iPad-specific fixes */
@media only screen and (min-width: 768px) and (max-width: 1024px) {
    body {
        width: 100vw;
        overflow-x: hidden;
    }
    
    .container {
        width: 90%;
        max-width: 95%;
        padding: 0 15px;
    }
    
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tool-card {
        min-height: 450px;
    }
    
    .tool-content {
        padding: 20px;
    }
    
    .tool-description {
        font-size: 0.9rem;
    }
    
    .tool-features li {
        font-size: 0.85rem;
    }
    
    .options-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Ensure quiz options fit properly */
    .option {
        padding: 15px;
    }
    
    /* Ensure results display properly */
    .pros-cons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .main-header .container {
        flex-direction: column;
        text-align: center;
    }
    
    .logo-text {
        margin-bottom: 15px;
    }
    
    .main-nav {
        width: 100%;
    }
    
    .main-nav ul {
        margin-top: 15px;
        flex-wrap: wrap; /* Allow nav items to wrap */
        justify-content: center;
    }
    
    .main-nav ul li {
        margin: 5px 10px; /* Adjust spacing for wrapped items */
    }
    
    h1 { font-size: 2.3rem; }
    h2 { font-size: 1.8rem; }
    h3 { font-size: 1.5rem; }
    
    .hero {
        padding: 60px 0;
    }
    
    .hero .tagline {
        font-size: 1.1rem;
    }
    
    .tools-grid {
        grid-template-columns: 1fr; /* Stack cards on smaller screens */
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .cta-button, .cta-button-secondary {
        padding: 12px 25px;
        font-size: 1rem;
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .container {
        width: 100%;
        padding: 0 15px;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.6rem; }
    h3 { font-size: 1.3rem; }
    p { font-size: 1rem; }
    
    .hero {
        padding: 40px 0;
    }
    
    .introduction, .consultation-promo {
        padding: 40px 0;
    }
    
    .tool-card {
        margin-bottom: 20px;
    }
    
    .tool-content {
        padding: 20px;
    }
    
    .help-section {
        padding: 30px 15px;
    }
    
    .main-footer {
        padding: 30px 0;
    }
}
