html, body {
    margin: 0;
    padding: 0;
    font-family: sans-serif;
    height: 100%;
    overflow-x: hidden;
}
body {
    font-family: 'Roboto', sans-serif;
}

body[dir="rtl"] {
    font-family: 'Vazirmatn', sans-serif;
}
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    z-index: -1;
    width: 100%;
    height: 100vh;
    background: linear-gradient(to bottom, rgb(200, 255, 200) 0%, rgb(255, 255, 255) 100%);
}

nav {
    position: sticky;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 10;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2d6a4f;
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-links a {
    margin-left: 20px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
}

.nav-links select {
    margin-left: 20px;
    padding: 5px;
    font-size: 1rem;
}

header {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #1b4332;
    padding: 2rem;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

header p {
    font-size: 1.25rem;
    max-width: 700px;
    margin: auto;
}

section {
    padding: 4rem 2rem;
    background-color: rgba(255,255,255,0.8);
    backdrop-filter: blur(4px);
}

footer {
    text-align: center;
    padding: 2rem;
    font-size: 0.9rem;
    color: #555;
}
/*carosel*/
.carousel {
    overflow: hidden;
    position: relative;
    width: 100%;
    max-width: 1000px;
    margin: 2rem auto;
    height: 120px;
}

.carousel-track {
    display: flex;
    animation: scroll-carousel 20s linear infinite;
    gap: 20px;
}

figure {
    text-align: center;
    margin: 0;
    max-width: 180px;
}

figure img {
    display: block;
    height: 90px;
    margin: 0 auto 8px;
    object-fit: contain;
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

figure img:hover {
    filter: grayscale(0%);
}

figcaption {
    font-size: 14px;
    color: #333;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.3em;
}
@keyframes scroll-carousel {
    0% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(-50%);
    }
}

/*contact*/
.social-icons {
    margin-top: 1rem;
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.social-icons a {
    font-size: 1.8rem;
    color: #2d6a4f;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.social-icons a:hover {
    transform: scale(1.2);
}

/*news and product*/
/* Card Grid Layout */
.card-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 2rem;
}

/* Outer Card */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    width: 280px;
    overflow: hidden;
    opacity: 1;
}

/* Card Inner (animated element) */
.card-inner {
    text-align: center;
    opacity: 0;
    transform: translateY(50px);
}

/* Image inside card */
.card-inner img {
    max-width: 100px;
    margin-bottom: 1rem;
}

/* Animate pop-in on first view */
.card.animate-visible .card-inner {
    animation: popin 0.6s ease forwards;
}

/* Pop-in animation keyframes */
@keyframes popin {
    0%   { opacity: 0; transform: translateY(50px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* News Cards */
.news-grid {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 2rem;
}

/* Outer News Card */
.news-card-inner {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 1rem;
    align-items: start;
}

/* Make the current <img> behave like a thumbnail */
.news-card-inner img {
    display: block;
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
}

/* Stack on phones + scale image height responsively */
@media (max-width: 640px) {
    .news-card-inner {
        grid-template-columns: 1fr;
    }
    .news-card-inner img {
        height: clamp(140px, 45vw, 240px);
    }
}

/* Pop-in animation for news cards */
.news-card.animate-visible .news-card-inner {
    animation: popin 0.6s ease forwards;
}


/*home*/
.visit-button {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.75rem 1.5rem;
    background-color: #2d6a4f;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.visit-button:hover {
    background-color: #1b4332;
}
#language-selector {
    font-size: 1rem;
    padding: 0.5rem 1rem;
    margin-left: 20px;
    border-radius: 6px;
    border: 1px solid #ccc;
    background-color: white;
    cursor: pointer;
}
/* utility */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-visible {
    opacity: 1;
    transform: translateY(0);
}
.more-news-button {
    display: inline-block;
    margin: 2rem auto 0;
    text-align: center;
    padding: 0.75rem 1.5rem;
    background-color: #2d6a4f;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.more-news-button:hover {
    background-color: #1b4332;
}
.news-card h4 a,
#news-container h4 a,
.news-card-content h4 a {
    text-decoration: none;
    color: inherit;
}
.news-card h4 a:hover {
    color: #2d6a4f;
    text-decoration: underline;
}


/*nav bar */
/* base */
:root { --nav-h: 64px; --slide-off: -100%; }
[dir="rtl"] { --slide-off: 100%; }

.navbar { position: sticky; top: 0; z-index: 50; background: #fff; }
.nav-inner { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding: .5rem 1rem; }
.nav-links { display:flex; align-items:center; gap:1rem; }

/* hamburger */
.menu-toggle {
    display:none; appearance:none; background:none; border:0; padding:.5rem;
    width:44px; height:44px; cursor:pointer; border-radius:.5rem;
}
.menu-toggle:focus-visible { outline:2px solid #999; outline-offset:2px; }
.menu-toggle .bar {
    display:block; width:22px; height:2px; margin:4px 0;
    background:#111; transition:transform .25s ease, opacity .2s ease;
}

/* desktop */
@media (min-width: 768px) {
    .nav-links { display:flex; }
}

/* mobile */
@media (max-width: 767px) {
    .menu-toggle { display:inline-flex; align-items:center; justify-content:center; }
    .nav-links {
        position: fixed;
        inset-inline-start: 0;
        top: var(--nav-h);
        width: min(86vw, 360px);
        height: calc(100dvh - var(--nav-h));
        background:#fff;
        box-shadow: 0 8px 24px rgba(0,0,0,.15);
        padding: 1rem;
        display: flex;
        flex-direction: column;
        gap: 1rem;
        transform: translateX(var(--slide-off));
        transition: transform .28s ease;
    }
    .nav-links a, .nav-links select { width:100%; }
    .nav-links.open { transform: translateX(0); }
    body.menu-open { overflow: hidden; }
    /* X animation */
    .menu-toggle.open .bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
    .menu-toggle.open .bar:nth-child(2) { opacity: 0; }
    .menu-toggle.open .bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
}

