/*
 * Dwayne Riner Coaching - Main Stylesheet (FINAL VERSION)
 * This file controls the visual appearance, colors, fonts, and layout
 * for the entire website, based on your brand guide.
 *
 * UPDATE:
 * - Changed .topics-grid to use Flexbox for better alignment of an odd number of items.
 */

/* --- Google Font Import --- */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,700;1,400&family=Montserrat:wght@400;600;700;800&display=swap');

/* --- CSS Variables (Brand Palette) --- */
:root {
    --prussian-blue: #003153;
    --forest-green: #0B4228;
    --ochre-accent: #CC7722;
    --gold-highlight: #D4AF37; 
    --off-white: #F8F9FA;
    --light-gray: #E9ECEF;
    --charcoal-text: #343A40;
    --white: #FFFFFF;
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Lora', serif;
}

/* --- Global Styles & Resets --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.7;
    color: var(--charcoal-text);
    background-color: var(--white);
    overflow-x: hidden; /* Prevents horizontal scroll from animations */
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--prussian-blue);
    line-height: 1.2;
}

h1 { font-size: 3.2rem; font-weight: 800; margin-bottom: 1rem; }
h2 { font-size: 2.5rem; margin-bottom: 3rem; text-align: center; position: relative; }
/* Underline effect for titles */
h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--ochre-accent);
    border-radius: 2px;
}
h3 { font-size: 1.5rem; margin-bottom: 1rem; }

p { margin-bottom: 1rem; }
a { color: var(--ochre-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Utility Classes --- */
.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
}

section {
    padding: 100px 0;
    position: relative;
}

/* --- Scroll Animation Classes --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.6s ease-out;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Header & Navigation --- */
.main-header {
    background: var(--white);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: box-shadow 0.3s ease;
}
.main-header.scrolled {
    box-shadow: 0 4px 15px rgba(0,0,0,0.07);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--prussian-blue);
    text-decoration: none;
}
.logo:hover { text-decoration: none; }

.logo img {
    height: 50px; /* Adjust height as needed */
    width: auto;
    display: block;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.main-nav a {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    color: var(--prussian-blue);
    transition: color 0.3s ease;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
}

.main-nav a:hover, .main-nav a.active {
    color: var(--ochre-accent);
    text-decoration: none;
    border-bottom-color: var(--ochre-accent);
}

/* --- Buttons --- */
.cta-button {
    display: inline-block;
    background-color: var(--ochre-accent);
    color: var(--white);
    font-family: var(--font-heading);
    font-weight: 700;
    padding: 15px 35px;
    border-radius: 50px;
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    border: 2px solid var(--ochre-accent);
    box-shadow: 0 4px 10px rgba(204, 119, 34, 0.3);
    cursor: pointer;
}

.cta-button:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 15px rgba(204, 119, 34, 0.4);
    background-color: #e08b3a;
    text-decoration: none;
}

.cta-button.secondary {
    background-color: transparent;
    color: var(--prussian-blue);
    border: 2px solid var(--prussian-blue);
    box-shadow: none;
}
.cta-button.secondary:hover {
    background-color: var(--prussian-blue);
    color: var(--white);
    box-shadow: 0 4px 10px rgba(0, 49, 83, 0.2);
}

/* --- Hero Section --- */
.hero {
    background: linear-gradient(45deg, var(--prussian-blue), #00406b);
    color: var(--white);
    padding: 120px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    bottom: -150px;
    left: -100px;
    width: 400px;
    height: 400px;
    background: var(--forest-green);
    border-radius: 50%;
    opacity: 0.9;
    filter: blur(10px);
}
.hero::after {
    content: '';
    position: absolute;
    top: -200px;
    right: -150px;
    width: 450px;
    height: 450px;
    border: 3px solid var(--gold-highlight);
    border-radius: 50%;
    opacity: 0.2;
}

.hero .container { position: relative; z-index: 2; }
.hero h1 { color: var(--white); }
.hero .subtitle {
    font-size: 1.25rem;
    max-width: 700px;
    margin: 0 auto 2rem auto;
    opacity: 0.9;
    font-family: var(--font-body);
}

/* --- About Section --- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
}

.about-image-container {
    position: relative;
    padding-top: 110%; /* Creates aspect ratio for the container */
    border-radius: 10px;
    overflow: hidden;
}

.about-image-container .bio-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    border-radius: 10px;
}

.about-image-container .bio-slide.active {
    opacity: 1;
}

/* Decorative element behind image */
.about-image-container::after {
    content: '';
    position: absolute;
    bottom: -20px;
    right: -20px;
    width: 100%;
    height: 100%;
    background-color: var(--forest-green);
    border-radius: 10px;
    z-index: -1;
    transition: all 0.4s ease;
}
.about-grid:hover .about-image-container::after {
    transform: rotate(3deg);
}

/* --- Services Section --- */
#services {
    background-color: var(--off-white);
    overflow: hidden;
    padding-bottom: 50px; /* Reduced padding to connect with Topics */
}
/* Background design element */
#services::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150px;
    width: 300px;
    height: 300px;
    border: 2px solid var(--gold-highlight);
    border-radius: 50%;
    opacity: 0.1;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
}

.service-card {
    background: var(--white);
    padding: 2.5rem 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.04);
    text-align: center;
    border-top: 5px solid var(--prussian-blue);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.service-card:hover {
     transform: translateY(-10px);
     box-shadow: 0 15px 35px rgba(0,0,0,0.08);
     border-top-color: var(--ochre-accent);
}

.service-card .icon {
    color: var(--ochre-accent);
    margin-bottom: 1.5rem;
}
.service-card .icon svg {
    width: 50px;
    height: 50px;
}

/* --- Key Topics Section --- */
#topics {
    background-color: var(--off-white);
    padding-top: 50px; /* Reduced padding to connect with Services */
}

/* UPDATED to use Flexbox */
.topics-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2.5rem;
}

/* UPDATED to use Flexbox sizing */
.topic-card {
    background-color: var(--white);
    border-left: 5px solid var(--forest-green);
    padding: 2rem;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 5px 25px rgba(0,0,0,0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex: 0 1 calc(50% - 1.25rem); /* This controls the width and allows wrapping */
}
.topic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}
.topic-card h3 {
    color: var(--forest-green);
}

/* --- Clients Section --- */
#clients {
    padding: 60px 0;
    background-color: var(--white);
}
#clients h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #999;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 2rem;
}
#clients h2::after { display: none; } /* Remove underline for this heading */

.clients-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 3rem;
}
.clients-grid img {
    height: 40px;
    max-width: 150px;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: filter 0.3s ease, opacity 0.3s ease;
}
.clients-grid img:hover {
    filter: grayscale(0%);
    opacity: 1;
}

/* --- Testimonials Section --- */
#testimonials {
    background: linear-gradient(135deg, var(--prussian-blue) 0%, var(--forest-green) 100%);
    color: var(--white);
}
#testimonials h2 { color: var(--white); }
#testimonials h2::after { background-color: var(--gold-highlight); }

.testimonial-slider-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 50px; /* Space for arrows */
}

.testimonial-slide {
    display: none; /* Hidden by default */
    background-color: rgba(255, 255, 255, 0.05);
    padding: 3rem;
    border-radius: 10px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    position: relative;
}

.testimonial-slide.active {
    display: block;
    animation: fadeIn 0.6s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}


.testimonial-slide::before {
    content: '“';
    font-family: var(--font-heading);
    font-size: 8rem;
    color: rgba(255, 255, 255, 0.1);
    position: absolute;
    top: -1rem;
    left: 1rem;
    line-height: 1;
    z-index: 1;
}

.testimonial-slide blockquote {
    font-size: 1.4rem;
    font-style: italic;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
}

.testimonial-slide cite {
    font-family: var(--font-heading);
    font-weight: 700;
    font-style: normal;
    color: var(--gold-highlight);
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease;
}
.slider-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}
.slider-btn.prev {
    left: 0;
}
.slider-btn.next {
    right: 0;
}
.slider-btn svg {
    width: 24px;
    height: 24px;
    stroke: var(--white);
}

/* --- Final CTA Section --- */
#cta {
    background: var(--prussian-blue);
    color: var(--white);
    text-align: center;
}
#cta h2 { color: var(--white); }
#cta p {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.9;
}

/* --- Footer --- */
.main-footer {
    background: var(--charcoal-text);
    color: var(--light-gray);
    padding: 40px 0;
    text-align: center;
}

.main-footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.footer-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

.footer-nav a { color: var(--white); }
.copyright { font-size: 0.9rem; }

/* --- Responsive Design --- */
@media(max-width: 992px) {
    .topic-card {
        flex: 0 1 100%; /* On smaller screens, make topics take full width */
    }
}

@media(max-width: 768px) {
    body { font-size: 16px; }
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    section { padding: 60px 0; }

    .main-nav { display: none; }

    .about-grid { grid-template-columns: 1fr; }
    
    .about-image-container { grid-row: 1; margin-bottom: 3rem; }
    .about-image-container::after { right: -10px; bottom: -10px; }

    .hero { padding: 80px 0; }
    .hero::before, .hero::after { display: none; }
    
    .testimonial-slider-container { padding: 0; }
    .slider-btn {
        top: auto;
        bottom: -60px;
        transform: translateY(0);
    }
    .slider-btn.prev { left: 30%; }
    .slider-btn.next { right: 30%; }
    #testimonials .container { padding-bottom: 60px; }
}
