/*
 * Global style sheet for Tau Maintenance & Farm Consulting
 *
 * Colours and fonts have been selected to reflect the brand’s bold red and
 * monochrome palette. The layout is responsive using flex and grid
 * structures and adapts gracefully from large desktops to mobile devices.
 */

/* CSS Variables for consistent theming */
:root {
    --primary-color: #c40513; /* vibrant red inspired by the company logo */
    --secondary-color: #1f1f1f; /* deep grey for contrasting elements */
    --light-color: #ffffff;
    --background-color: #f7f7f7;
    --text-color: #333333;
    --heading-font: 'Montserrat', sans-serif;
    --body-font: 'Montserrat', sans-serif;
    --transition-fast: 0.3s ease;
    --border-radius: 6px;
}

/* Global resets */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--body-font);
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Navigation */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background-color: var(--light-color);
    border-bottom: 1px solid #eaeaea;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
}
.logo {
    /* Increase logo height for better visibility */
    height: 80px;
    margin-right: 0.5rem;
}
.site-name {
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--secondary-color);
}

.nav-links {
    display: flex;
    gap: 2rem;
}
.nav-links li {
    position: relative;
}
.nav-links a {
    font-weight: 500;
    transition: color var(--transition-fast);
}
.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

/* Dropdown menu for Divisions */
/* Style the list item containing a submenu to indicate a dropdown */
.nav-links li.has-submenu > a::after {
    content: ' \25BE'; /* downward caret symbol */
    margin-left: 0.25rem;
    font-size: 0.75rem;
}
/* Hidden submenu by default */
.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--light-color);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--border-radius);
    padding: 0.5rem 0;
    list-style: none;
    min-width: 180px;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.submenu li a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--secondary-color);
    white-space: nowrap;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}
.submenu li a:hover {
    background-color: var(--primary-color);
    color: var(--light-color);
}
/* Show submenu on hover for desktop */
.nav-links li.has-submenu:hover > .submenu {
    display: block;
}

/* Hamburger toggle for mobile */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    border: none;
    background: none;
    cursor: pointer;
}
.nav-toggle .bar {
    height: 3px;
    width: 100%;
    background-color: var(--secondary-color);
    border-radius: 2px;
    transition: transform var(--transition-fast);
}

/* Hero Section */
/* Hero uses a direct relative path from the CSS file.  The CSS file resides in
 * website/static/css/ and assets live in website/assets/.  The correct
 * relative reference therefore traverses two directories up. */
.hero {
    position: relative;
    height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--light-color);
    text-align: center;
    background: url('../../assets/mining.jpg') center/cover no-repeat;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}
.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    padding: 2rem;
}
.hero h1 {
    font-family: var(--heading-font);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}
.hero .tagline {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: #f3f3f3;
}
.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}
.btn.primary {
    background-color: var(--primary-color);
    color: var(--light-color);
}
.btn.primary:hover {
    background-color: #a3020f;
}
.btn.secondary {
    background-color: var(--light-color);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}
.btn.secondary:hover {
    background-color: var(--primary-color);
    color: var(--light-color);
}

/* Hero Slider Styles */
.hero-slider {
    position: relative;
    height: 90vh;
    overflow: hidden;
    display: block;
    color: var(--light-color);
    text-align: center;
}
.hero-slider .slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}
.hero-slider .slide.active {
    opacity: 1;
}
.hero-slider .slide .hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}
.hero-slider .hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    top: 50%;
    transform: translateY(-50%);
}

/* Section styling */
.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-align: center;
    color: var(--secondary-color);
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    /* Center the text content within all page sections for a balanced layout */
    text-align: center;
}

/* Ensure lists and contact information remain left-aligned for readability */
.service-text ul,
.about-section .why-list,
.why-section .why-list,
.contact-info p {
    text-align: left;
    margin-left: auto;
    margin-right: auto;
}

/* Center content in key page sections */
.mission-vision,
.services-overview,
.why-us,
.service-section,
.contact-section,
.about-section,
.mission-vision-section,
.footprint-section,
.team-section,
.why-section {
    text-align: center;
}

/* Mission & Vision on home */
.mission-vision {
    background-color: var(--light-color);
    border-top: 1px solid #e6e6e6;
    border-bottom: 1px solid #e6e6e6;
}
.mv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}
.mv-item {
    background-color: var(--background-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    text-align: center;
}
.icon-wrapper {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Simple decorative dot used instead of external icons */
.icon-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--primary-color);
    margin: 0 auto 0.5rem;
}

/* Services overview */
.services-overview {
    background-color: var(--light-color);
    border-bottom: 1px solid #e6e6e6;
}
.services-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}
.service-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform var(--transition-fast);
    color: var(--light-color);
}
.service-card:hover {
    transform: translateY(-5px);
}
.card-img {
    height: 180px;
    background-size: cover;
    background-position: center;
    position: relative;
}
.card-content {
    padding: 1rem;
    background-color: var(--secondary-color);
    min-height: 150px;
}
.card-content h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}
.card-content p {
    font-size: 0.95rem;
    line-height: 1.4;
    color: #eee;
}

/* Why us section */
.why-us {
    background-color: var(--light-color);
    border-top: 1px solid #e6e6e6;
    border-bottom: 1px solid #e6e6e6;
}
.why-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}
.why-item {
    background-color: var(--background-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.why-item i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}
.why-item h3 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    color: var(--secondary-color);
}
.why-item p {
    font-size: 0.95rem;
    color: var(--text-color);
}

/* Footer */
footer {
    background-color: var(--secondary-color);
    color: var(--light-color);
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
    text-align: center;
}
.footer-col h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}
.footer-col p,
.footer-col li {
    font-size: 0.9rem;
    line-height: 1.4;
}
.contact-list li {
    margin-bottom: 0.5rem;
}
.contact-list i {
    /* hide imported icons on footer; we'll use pseudo elements for bullets instead */
    display: none;
}

/* Use colored bullets for footer contact list */
.contact-list li::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--primary-color);
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* Centre footer columns while keeping lists readable */
.footer-col ul {
    display: inline-block;
    text-align: left;
    margin: 0 auto;
}

/* Footer links and nested submenu styling */
.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-links li {
    margin-bottom: 0.3rem;
}
.footer-links .submenu-footer {
    list-style: none;
    padding: 0;
    margin: 0.3rem 0 0 1rem;
}
.footer-links .submenu-footer li {
    margin-bottom: 0.25rem;
}
.footer-links .submenu-footer a {
    font-size: 0.85rem;
}
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 1rem 0;
    text-align: center;
    font-size: 0.85rem;
}
.citations {
    font-size: 0.75rem;
    padding: 1rem 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #ccc;
}

/*
 * Generic tagline styling
 *
 * Define consistent vertical spacing for taglines across the site.
 * This rule adds space above and below tagline elements, overriding
 * previous margins set on specific hero taglines. The margin of
 * 20px on top and bottom provides balanced separation from other
 * components while maintaining clean alignment.
 */
.tagline {
    margin: 20px 0px;
}

/* Page hero variations */
.page-hero {
    position: relative;
    height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--light-color);
    background-size: cover;
    background-position: center;
}
/* Page hero backgrounds also require double directory traversal. */
.page-hero.about-hero {
    background-image: url('../../assets/construction.jpg');
}
.page-hero.services-hero {
    background-image: url('../../assets/mining.jpg');
}
.page-hero.contact-hero {
    background-image: url('../../assets/solar.jpg');
}
.page-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}
.page-hero-content {
    position: relative;
    z-index: 1;
    max-width: 600px;
    padding: 1rem;
}
.page-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}
.page-hero p {
    font-size: 1rem;
}

/* About page specifics */
.about-section p {
    margin-bottom: 1rem;
}
.mission-vision-section, .footprint-section, .team-section, .why-section {
    margin-top: 2rem;
}
.why-section ul {
    list-style: disc;
    padding-left: 1.5rem;
}
.why-section li {
    margin-bottom: 0.5rem;
}

/* Services page specifics */
.service-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2rem;
    /* Center service sections horizontally within their container */
    justify-content: center;
}
.service-grid.reverse {
    flex-direction: row-reverse;
}
.service-text {
    flex: 1 1 500px;
}
.service-text h2 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}
.service-text ul {
    list-style: square;
    padding-left: 1.5rem;
    margin-top: 0.5rem;
}
.service-text li {
    margin-bottom: 0.5rem;
}
.service-image {
    flex: 1 1 400px;
    height: 300px;
    background-size: cover;
    background-position: center;
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.service-image .img-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    transition: background-color var(--transition-fast);
}
.service-image:hover .img-overlay {
    background: rgba(0, 0, 0, 0.15);
}

/* Contact page specifics */
.contact-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-top: 2rem;
}
.contact-info, .contact-form-wrapper {
    flex: 1 1 350px;
    background-color: var(--light-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.contact-info h2, .contact-form-wrapper h2 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}
.branch {
    margin-bottom: 1rem;
}
.branch h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--secondary-color);
}
.contact-form .form-group {
    margin-bottom: 1rem;
}
.contact-form label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
}
.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
    font-family: var(--body-font);
    font-size: 0.95rem;
}
.contact-form textarea {
    resize: vertical;
}
.form-response {
    margin-top: 1rem;
    color: green;
    font-weight: 600;
}

/* About page gallery section */
.gallery-section {
    margin-top: 3rem;
}
.gallery-section h2 {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--primary-color);
}
.gallery-section p {
    text-align: center;
    margin-bottom: 2rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}
.gallery-grid img {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    object-fit: cover;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Media Queries */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 60px;
        right: 0;
        background-color: var(--light-color);
        flex-direction: column;
        width: 200px;
        transform: translateX(100%);
        transition: transform var(--transition-fast);
        box-shadow: -2px 0 5px rgba(0,0,0,0.1);
        height: calc(100vh - 60px);
        padding: 1rem;
        gap: 1rem;
    }
    .nav-links.open {
        transform: translateX(0);
    }
    .nav-toggle {
        display: flex;
    }
    .service-grid {
        flex-direction: column;
    }
    .service-grid.reverse {
        flex-direction: column;
    }
    .hero h1 {
        font-size: 2rem;
    }
    .hero {
        height: 70vh;
    }
    .page-hero {
        height: 40vh;
    }

    /* Dropdown submenu styling for mobile */
    /* When the mobile nav is opened, display submenu items stacked beneath the parent. */
    .nav-links.open .submenu {
        display: block;
        position: static;
        border: none;
        background-color: transparent;
        box-shadow: none;
        padding-left: 1rem;
    }
    .submenu li a {
        padding: 0.25rem 0;
        color: var(--secondary-color);
    }
    /* Hide the caret arrow on mobile to simplify the menu */
    .nav-links li.has-submenu > a::after {
        content: '';
    }
}