/* Public Site Styling - AgroNova Brand Colors */
: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 */
}

html, body {
    height: 100%;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: var(--color-cream);
    color: var(--color-text);
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* allow footer to stick to bottom when content is short */
}

.public-header {
    background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-accent) 100%);
    padding: 40px 20px;
    text-align: center;
    border-bottom: 3px solid var(--color-primary);
}

.public-header h1 {
    color: var(--color-cream);
    margin: 0;
}

.public-header p {
    color: var(--color-secondary);
    font-size: 1.1em;
}

.news-main {
    padding: 20px;
    background-color: var(--color-cream);
}

#news-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

/* --- News Card Design (Image Background) --- */
.news-card {
    /* Dimensions and positioning context */
    height: 350px;
    position: relative; 
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: white;
    
    /* Dynamic background properties - contain instead of cover to prevent cropping */
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    background-color: var(--color-bg-light);
    transition: transform 0.3s, box-shadow 0.3s;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(107, 191, 89, 0.5);
}

.content-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end; 

    /* Gradient for text readability */
    background: linear-gradient(
        to bottom, 
        rgba(0, 0, 0, 0) 0%, 
        rgba(0, 0, 0, 0.85) 100%
    ); 
}

.post-date {
    color: var(--color-primary);
    font-size: 0.8em;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.content-overlay h2 {
    font-size: 1.5em;
    margin: 0 0 10px 0;
}

.content-overlay .content {
    font-size: 0.9em;
    opacity: 0.8;
    flex-grow: 1;
    margin: 10px 10px 10px 0;
    overflow: hidden;
    max-height: none;
}

/* Shared header/footer/navigation styles (copied from home styles) */
header{
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(90deg, var(--color-dark) 0%, var(--color-accent) 100%);
    margin: 0;
    padding: 8px 16px;
    top: 0;
    z-index: 1000;
    position: sticky;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

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

/* Footer with matching gradient */
footer {
    margin-top: auto;
    background: linear-gradient(90deg, var(--color-dark) 0%, var(--color-accent) 100%);
    color: var(--color-cream);
    padding: 12px 16px;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.15);
}
/* hamburger toggle - hidden by default, shown only on small screens */
#nav-toggle{ display: none; background: transparent; border: none; color: var(--color-primary); font-size: 26px; cursor: pointer; }

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); }

.footer-inner{ max-width:1100px; margin:0 auto; display:flex; justify-content:space-between; align-items:center; padding:0; font-size: 0.9em; }
.footer-nav a{ color:var(--color-cream); margin-left:12px; text-decoration:none; opacity:0.9; transition: opacity 0.3s; }
.footer-nav a:hover{ opacity:1; }

/* Make main content expand so footer stays at the bottom */
main{ flex: 1 0 auto; }

/* When nav has .open (toggled by nav.js), show the menu on small screens */
header nav.open ul{ display:flex; }
header nav.open ul{
    flex-direction: column;
    gap: 12px;
}

/* Small-screen dropdown panel for nav when opened */
@media screen and (max-width:700px){
    header{ position: relative; }
    nav ul{ display: none; }
    #nav-toggle{ display: block; }
    /* position the toggle at the right edge */
    #nav-toggle{ position: absolute; right: 12px; top: 10px; }
    /* dropdown panel */
    header nav.open ul{
        display: flex;
        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.3);
        z-index: 1200;
        min-width: 180px;
    }
    header nav.open ul li a{ display:block; }
}