/* -------------------------------
   Dynamic Theme Variables
---------------------------------- */
:root {
    /* Primary color defined as hex */
    --primary-color: #663300;
    /* These HSL values will be updated dynamically via JS */
    --primary-hue: 30;
    --primary-saturation: 100%;
    --primary-lightness: 20%;
    /* Derived colors based on the primary color */
    --secondary-color: hsl(var(--primary-hue), 30%, 70%);
    --text-color: hsl(var(--primary-hue), 40%, 20%);
    --background-color: #fff;
    --gradient-start: var(--primary-color);
    --gradient-end: hsl(var(--primary-hue), 100%, 40%);
    --border-color: hsl(var(--primary-hue), 20%, 90%);
}

/* -------------------------------
   Global Styles
---------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* -------------------------------
   Header & Navigation
---------------------------------- */
header {
    background: var(--secondary-color);
    padding: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.logo {
    max-width: 150px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

    .menu-toggle .hamburger {
        display: block;
        width: 25px;
        height: 3px;
        margin: 5px 0;
        background: var(--text-color);
    }

.nav-menu {
/*    background: var(--primary-color);*/
}

    .nav-menu ul {
        list-style: none;
        display: flex;
        margin: 0;
        padding: 0;
    }

        .nav-menu ul li {
            margin-left: 20px;
        }

            .nav-menu ul li a {
                text-decoration: none;
                color: var(--primary-color);
                font-weight: bold;
                transition: color 0.3s, background-color 0.3s;
            }

                .nav-menu ul li a:hover,
                .nav-menu ul li a.active {
                    background-color: var(--primary-color);
                    color:var(--background-color);
                    padding: 0.5em 1em;
                    border-radius: 4px;
                }

/* -------------------------------
   Hero Sections (Index, About, Products, News)
---------------------------------- */
#hero-section,
.about-hero,
.product-hero,
.news-hero {
    position: relative;
    height: 600px;
    background: var(--gradient-start); /* fallback if no image */
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.overlay-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    font-weight: bold;
    background-color: rgba(0,0,0,0.5);
    padding: 20px 40px;
    border-radius: 8px;
    color: var(--background-color);
}
/* Extra styling for About hero */
.about-hero {
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Responsive Hero Sections */
@media (max-width: 768px) {
    #hero-section,
    .about-hero,
    .product-hero,
    .news-hero {
        height: 400px;
    }

    .overlay-text {
        font-size: 2rem;
        padding: 15px 30px;
    }
}

/* -------------------------------
   Grid Layout Classes
---------------------------------- */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.grid-5 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.grid-10 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

/* -------------------------------
   Index Page Sections
---------------------------------- */
/* Featured Items */
#featured-section {
    padding: 50px 0;
    background: var(--background-color);
    text-align: center;
}

    #featured-section h2 {
        margin-bottom: 30px;
        font-size: 2.5rem;
        color: var(--primary-color);
    }

.featured-item {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.3s;
}

    .featured-item:hover {
        transform: translateY(-5px);
    }

    .featured-item img {
        width: 100%;
        height: auto;
        display: block;
    }

    .featured-item .item-info {
        padding: 15px;
    }

        .featured-item .item-info h3 {
            font-size: 1.5rem;
            margin-bottom: 10px;
            color: var(--primary-color);
        }

        .featured-item .item-info p {
            font-size: 1rem;
            color: var(--text-color);
        }

/* -------------------------------
   Medium Items
---------------------------------- */
#medium-section {
    padding: 50px 0;
    background: hsl(var(--primary-hue), 70%, 95%);
    text-align: center;
}

    #medium-section h2 {
        margin-bottom: 30px;
        font-size: 2.5rem;
        color: var(--primary-color);
    }

.medium-item {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.3s;
    text-align: left;
}

    .medium-item:hover {
        transform: translateY(-5px);
    }

    .medium-item img {
        width: 100%;
        height: auto;
        display: block;
    }

    .medium-item .item-info {
        padding: 10px 15px;
    }

        .medium-item .item-info h3 {
            font-size: 1.3rem;
            margin-bottom: 5px;
            color: var(--primary-color);
        }

        .medium-item .item-info p {
            font-size: 0.95rem;
            color: var(--text-color);
        }

/* -------------------------------
   Icon Items
---------------------------------- */
#icon-section {
    padding: 50px 0;
    background: var(--background-color);
    text-align: center;
}

    #icon-section h2 {
        margin-bottom: 30px;
        font-size: 2.5rem;
        color: var(--primary-color);
    }

.icon-item {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.3s;
    text-align: center;
}

    .icon-item:hover {
        transform: translateY(-5px);
    }

    .icon-item .icon {
        font-size: 2.5rem;
        color: var(--primary-color);
        margin-bottom: 10px;
    }

    .icon-item h3 {
        font-size: 1.2rem;
        margin-bottom: 5px;
        color: var(--primary-color);
    }

    .icon-item p {
        font-size: 0.9rem;
        color: var(--text-color);
    }

/* -------------------------------
   Text Only Items
---------------------------------- */
#text-section {
    padding: 50px 0;
    background: hsl(var(--primary-hue), 70%, 90%);
    text-align: center;
}

    #text-section h2 {
        margin-bottom: 30px;
        font-size: 2.5rem;
        color: var(--primary-color);
    }

.text-item {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: left;
}

    .text-item:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    }

    .text-item h3 {
        font-size: 1.2rem;
        margin-bottom: 8px;
        color: var(--primary-color);
    }

    .text-item p {
        font-size: 0.95rem;
        color: var(--text-color);
    }

/* -------------------------------
   Product Page Hero
---------------------------------- */
.product-hero {
    position: relative;
    height: 600px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .product-hero .hero-link {
        display: block;
        width: 100%;
        height: 100%;
        text-decoration: none;
        color: inherit;
        position: relative;
    }

    .product-hero .overlay-text {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        font-size: 3rem;
        font-weight: bold;
        background-color: rgba(0,0,0,0.5);
        padding: 20px 40px;
        border-radius: 8px;
        color: var(--background-color);
    }

/* Limit Customer Logos in Products Page */
#customer-logos-list .logo-item {
    max-width: 150px;
    margin: 0 auto;
}

/* -------------------------------
   Resources Page
---------------------------------- */
.resources-content {
    padding: 50px 0;
    background: var(--background-color);
    text-align: center;
}

    .resources-content h1 {
        margin-bottom: 30px;
        font-size: 2.5rem;
        color: var(--primary-color);
    }

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.resource-card {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: box-shadow 0.3s ease-in-out;
}

    .resource-card:hover {
        box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    }

.resource-thumbnail {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

    .resource-thumbnail img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.resource-info {
    margin-top: 15px;
}

    .resource-info h3 {
        font-size: 1.3rem;
        margin-bottom: 10px;
        color: var(--primary-color);
    }

    .resource-info p {
        font-size: 0.95rem;
        margin-bottom: 15px;
        color: var(--text-color);
    }

.download-button {
    display: inline-block;
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: var(--background-color);
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

    .download-button:hover {
        background-color: var(--gradient-end);
    }

/* -------------------------------
   News Page
---------------------------------- */
.news-hero {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: var(--background-color);
    padding: 80px 0;
    text-align: center;
    position: relative;
    height: 600px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .news-hero .hero-link {
        display: block;
        width: 100%;
        height: 100%;
        text-decoration: none;
        color: inherit;
        position: relative;
    }

    .news-hero .overlay-text {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        font-size: 3rem;
        font-weight: bold;
        background-color: rgba(0,0,0,0.5);
        padding: 20px 40px;
        border-radius: 8px;
        color: var(--background-color);
    }

.news-content {
    padding: 50px 0;
    background: #f9f9f9;
    color: var(--text-color);
}

.news-card {
    display: flex;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin: 20px 0;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.3s, box-shadow 0.3s;
}

    .news-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    }

.news-image {
    width: 40%;
    overflow: hidden;
}

    .news-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.news-info {
    padding: 20px;
    width: 60%;
    text-align: left;
}

    .news-info h3 {
        margin-bottom: 10px;
        color: var(--primary-color);
    }

.news-date {
    font-size: 0.9rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.news-description {
    font-size: 1rem;
    margin-bottom: 15px;
}

/* -------------------------------
   Text Only Items
---------------------------------- */
#text-section {
    padding: 50px 0;
    background: hsl(var(--primary-hue), 70%, 90%);
    text-align: center;
}

    #text-section h2 {
        margin-bottom: 30px;
        font-size: 2.5rem;
        color: var(--primary-color);
    }

.text-item {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: left;
}

    .text-item:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    }

    .text-item h3 {
        font-size: 1.2rem;
        margin-bottom: 8px;
        color: var(--primary-color);
    }

    .text-item p {
        font-size: 0.95rem;
        color: var(--text-color);
    }

/* -------------------------------
   Footer
---------------------------------- */
footer {
    background: hsl(var(--primary-hue), 100%, 20%);
    color: hsl(var(--primary-hue), 100%, 95%);
    text-align: center;
    padding: 20px 0;
    margin-top: 50px;
}

/* -------------------------------
   Responsive Styles
---------------------------------- */
/* Tablets & Smaller (max-width: 992px) */
@media (max-width: 992px) {
    .menu-toggle {
        display: block;
    }

    .nav-menu {
        width: 100%;
        display: none;
    }

        .nav-menu.active {
            display: block;
        }

        .nav-menu ul {
            flex-direction: column;
            align-items: center;
        }

            .nav-menu ul li {
                margin: 10px 0;
            }

    .product-hero,
    #hero-section,
    .about-hero,
    .news-hero {
        height: 500px;
    }

    .news-card {
        flex-direction: column;
    }

    .news-image,
    .news-info {
        width: 100%;
    }
    /* Limit customer logo sizes in Products page */
    #customer-logos-list .logo-item {
        max-width: 150px;
        margin: 0 auto;
    }
}

/* Mobile Devices (max-width: 768px) */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        align-items: center;
    }

    #hero-section,
    .about-hero,
    .product-hero,
    .news-hero {
        height: 400px;
    }

    .overlay-text {
        font-size: 2rem;
        padding: 15px 30px;
    }

    #featured-section h2,
    #medium-section h2,
    #icon-section h2,
    #text-section h2 {
        font-size: 2rem;
    }
}
