/* Align colors and header/footer with the rest of the site - AgroNova Brand */
:root {
    --color-dark: #2C5F4F;        /* Deep forest green for depth */
    --color-primary: #6BBF59;     /* Vibrant light green - agricultural */
    --color-secondary: #5BA3D0;   /* Professional light blue - tech/water */
    --color-text: #2D2D2D;        /* Dark gray for readability */
    --color-bg-light: #F5F5DC;    /* Cream/beige background */
    --color-cream: #FFF8E8;       /* Pure cream white */
    --color-accent: #4A9D7E;      /* Teal blend for accents */
}

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

html,
body {
    height: 100%;
}

body {
    font-family: Arial, sans-serif;
    padding: 20px;
    background-color: var(--color-cream);
    color: var(--color-text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h2 {
    text-align: center;
    margin-bottom: 24px;
    color: var(--color-primary);
    font-size: 2rem;
}

.work-container {
    max-width: 1100px;
    margin: 0 auto 40px auto;
}

.work {
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.28s ease, box-shadow 0.28s ease;
    cursor: pointer;
    position: relative;
    border: 2px solid var(--color-primary);
}

.work:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 24px rgba(107, 191, 89, 0.3);
}

.work-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 12px;
    background: linear-gradient(180deg, rgba(44, 95, 79, 0), rgba(44, 95, 79, 0.95));
    color: var(--color-cream);
    text-align: center;
    font-weight: 700;
    opacity: 0;
    transition: opacity 220ms ease;
}

.work:hover .work-caption {
    opacity: 1;
}

.work img {
    width: 100%;
    height: 300px;
    object-fit: contain;
    display: block;
    transition: transform 300ms ease, filter 300ms ease;
    background: var(--color-bg-light);
}

.work img:hover {
    transform: scale(1.04);
    filter: brightness(1.02);
}

.gallery-page {
    display: none;
}

.active-page {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* two columns on desktop */
    gap: 20px;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 16px;
}

.pagination-controls button {
    background: transparent;
    color: var(--color-text);
    border: 2px solid var(--color-primary);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.pagination-controls button:hover:not(:disabled) {
    background: var(--color-primary);
    color: white;
}

.pagination-controls button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#pageNumber {
    font-weight: 700;
    color: var(--color-text);
}

@media (max-width: 900px) {
    .active-page {
        grid-template-columns: 1fr; /* stack to one column on smaller screens */
    }

    .work img {
        height: 250px;
    }
}

/* Header / footer styles to match site (only for this page) */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(90deg, var(--color-dark) 0%, var(--color-accent) 100%);
    padding: 8px 16px;
    position: -webkit-sticky; /* Safari */
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    margin: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

header img.logo {
    border-radius: 8px;
}

/* navigation list & links for header */
nav ul {
    list-style: none;
    display: flex;
    gap: 16px;
    margin: 0;
    padding: 0;
    align-items: center;
}

nav ul li a {
    color: var(--color-cream);
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 6px;
    transition: all 0.3s;
}

nav ul li a:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--color-primary);
}

/* hamburger toggle hidden by default; shown on small screens by media query */
#nav-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--color-primary);
    font-size: 26px;
    cursor: pointer;
}

footer {
    margin-top: auto;
    background: linear-gradient(90deg, var(--color-dark) 0%, var(--color-accent) 100%);
    padding: 12px 16px;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.15);
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
}

.footer-nav a {
    color: var(--color-cream);
    margin-left: 12px;
    text-decoration: none;
    transition: opacity 0.3s;
}

.footer-nav a:hover {
    opacity: 0.8;
}

/* Small-screen nav toggle behavior for this page */
@media screen and (max-width: 700px) {
    #nav-toggle {
        display: block;
        position: absolute;
        right: 12px;
        top: 10px;
    }

    nav ul {
        display: none;
    }

    header nav.open ul {
        display: flex;
        flex-direction: column;
        position: absolute;
        right: 12px;
        top: calc(100% + 8px);
        background: var(--color-dark);
        padding: 12px;
        border-radius: 8px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
        z-index: 1200;
        min-width: 180px;
    }
}