/* ================================================================
   LAYOUTS — Page structure, grid systems, sections, responsive
   ================================================================ */

/* --- Container --- */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container--narrow {
    max-width: var(--max-width-narrow);
}

/* --- Sections --- */
.section {
    padding: var(--section-padding) 0;
}

.section--alt {
    background: var(--color-bg-alt);
}

.section--white {
    background: #ffffff;
}

.section--green {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, #004d22 100%);
    color: white;
}

.section--green h2,
.section--green h3,
.section--green p {
    color: white;
}

.section--green .text-muted {
    color: rgba(255, 255, 255, 0.8);
}

.section--green .btn-primary {
    background: white;
    color: var(--color-primary-dark);
}

.section--green .btn-primary:hover {
    background: var(--color-primary-light);
}

.section--dark {
    background: linear-gradient(180deg, var(--color-bg-dark) 0%, var(--color-bg-darker) 100%);
    color: white;
}

.section--cta {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
    color: white;
}

.section--cta h2,
.section--cta h3 {
    color: white;
}

.section--cta p {
    color: rgba(255, 255, 255, 0.9);
}

.section--cta .btn-primary {
    background: white;
    color: var(--color-primary-dark);
}

.section--cta .btn-primary:hover {
    background: var(--color-primary-light);
}

.section--cta .btn-secondary {
    background: white;
    color: var(--color-primary-dark);
    border-color: white;
}

.section--cta .btn-secondary:hover {
    background: var(--color-primary-light);
    border-color: var(--color-primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.section--dark h2,
.section--dark h3 {
    color: white;
}

.section--dark p {
    color: rgba(255, 255, 255, 0.85);
}

.section--dark .card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.section--dark .card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--color-primary);
}

.section--dark .card__title a,
.section--dark .card__text {
    color: rgba(255, 255, 255, 0.9);
}

.section--dark .card__link {
    color: var(--color-primary);
}

.section__header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto var(--space-3xl);
}

.section__header h2 {
    margin-bottom: var(--space-md);
}

.section__header p {
    color: var(--color-text-light);
    font-size: 1.1rem;
}

.section--dark .section__header p {
    color: rgba(255, 255, 255, 0.7);
}

/* --- Grid System --- */
.grid {
    display: grid;
    gap: var(--space-xl);
}

.grid--2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid--4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
    .grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .grid--2,
    .grid--3,
    .grid--4 {
        grid-template-columns: 1fr;
    }

    .section {
        padding: var(--space-3xl) 0;
    }

    .stats-block {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
}

/* --- Hero Section --- */
.hero {
    position: relative;
    min-height: 500px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: var(--color-bg-dark);
}

.hero--full {
    min-height: 85vh;
}

.hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 31, 20, 0.75) 0%,
        rgba(0, 107, 48, 0.5) 50%,
        rgba(0, 31, 20, 0.6) 100%
    );
    z-index: 1;
}

.hero__content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    padding: var(--space-3xl) 0;
}

.hero__content h1 {
    color: white;
    margin-bottom: var(--space-md);
}

.hero__content p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    margin-bottom: var(--space-xl);
}

.hero__cta {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .hero {
        min-height: auto;
    }

    .hero__bg img {
        object-position: center top;
    }

    .hero__content {
        padding: calc(var(--header-height) + var(--space-lg)) 0 var(--space-lg);
    }

    .hero {
        background: white;
        border: none !important;
    }

    .hero__bg,
    .hero__overlay {
        bottom: -2px;
    }

    .hero__content h1 {
        font-size: 1.75rem;
    }

    .hero__content p {
        font-size: 0.95rem;
        margin-bottom: var(--space-md);
    }

    .hero__cta {
        flex-direction: column;
    }

    .hero__cta .btn {
        width: 100%;
    }
}

/* --- Site Header --- */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--color-bg-dark);
    box-shadow: none;
    z-index: 1000;
    transition: background var(--transition-base), box-shadow var(--transition-base);
}

.site-header--scrolled {
    background: rgba(6, 26, 14, 0.97);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.site-header__logo {
    height: 40px;
    width: auto;
}

.site-header__nav {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.site-header__phone,
.site-header__cta {
    display: none;
}

@media (min-width: 1024px) {
    .site-header__phone,
    .site-header__cta {
        display: flex;
    }
}

/* Hamburger */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-md);
    min-width: 48px;
    min-height: 48px;
}

.hamburger__line {
    display: block;
    width: 24px;
    height: 2px;
    background: white;
    margin: 5px 0;
    transition: all var(--transition-fast);
}

@media (max-width: 1023px) {
    .hamburger {
        display: block;
    }

    .site-header__nav .nav-list {
        display: none;
    }
}

/* Mobile menu drawer */
.mobile-menu {
    position: fixed;
    top: var(--header-height);
    right: -100%;
    width: 300px;
    height: calc(100vh - var(--header-height));
    background: white;
    box-shadow: var(--shadow-xl);
    z-index: 999;
    transition: right var(--transition-base);
    overflow-y: auto;
    padding: var(--space-xl);
}

.mobile-menu.open {
    right: 0;
}

.mobile-menu .nav-list {
    flex-direction: column;
    gap: 0;
}

.mobile-menu .nav-link {
    display: block;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 1rem;
    color: var(--color-text);
}

.mobile-menu .nav-link:hover {
    color: var(--color-primary);
}

/* Ensure mobile CTA button keeps white text on primary-green background */
.mobile-menu .nav-link.btn-primary,
.mobile-menu .nav-link.btn-primary:hover {
    color: white;
}

.mobile-menu .nav-dropdown__menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    padding-left: var(--space-lg);
    background: white;
    border: none;
}

.mobile-menu .nav-dropdown__link {
    color: var(--color-text);
}

.mobile-menu .nav-dropdown__link:hover {
    color: var(--color-primary);
    background: var(--color-primary-light);
}

.mobile-menu__overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    display: none;
}

.mobile-menu__overlay.active {
    display: block;
}

/* Push content below fixed header */
.site-content {
    margin-top: var(--header-height);
}

/* Homepage hero extends behind the fixed header */
.site-content--flush {
    margin-top: 0 !important;
}

/* --- Site Footer --- */
.site-footer {
    background: var(--color-bg-dark);
    color: rgba(255, 255, 255, 0.85);
    padding: var(--space-3xl) 0 var(--space-xl);
}

.site-footer a {
    color: rgba(255, 255, 255, 0.85);
}

.site-footer a:hover {
    color: white;
}

.footer__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-2xl);
    margin-bottom: var(--space-3xl);
}

.footer__heading {
    color: white;
    font-size: 1rem;
    margin-bottom: var(--space-md);
}

.footer__list li {
    margin-bottom: var(--space-sm);
}

.footer__list a {
    font-size: 0.9rem;
}

.footer__location-name {
    font-weight: 600;
    color: var(--color-accent-light);
    margin-bottom: var(--space-xs);
}

.footer__location-detail {
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: var(--space-md);
}

.footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.footer__social {
    display: flex;
    gap: var(--space-md);
}

.footer__social a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: background var(--transition-fast);
}

.footer__social a:hover {
    background: var(--color-primary);
}

.footer__social svg {
    width: 18px;
    height: 18px;
    fill: white;
}

@media (max-width: 1024px) {
    .footer__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .footer__grid {
        grid-template-columns: 1fr;
    }

    .footer__bottom {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }
}

/* --- Blog Layout --- */
.blog-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--space-3xl);
    align-items: start;
}

.blog-layout__content {
    min-width: 0;
}

.blog-layout__sidebar {
    position: sticky;
    top: calc(var(--header-height) + var(--space-xl));
}

@media (max-width: 1024px) {
    .blog-layout {
        grid-template-columns: 1fr;
    }

    .blog-layout__sidebar {
        position: static;
    }
}

/* --- Article Content --- */
.article-content h2 {
    margin-top: var(--space-3xl);
    margin-bottom: var(--space-md);
    padding-top: var(--space-md);
}

.article-content h3 {
    margin-top: var(--space-xl);
    margin-bottom: var(--space-md);
}

.article-content p {
    margin-bottom: var(--space-md);
    line-height: 1.8;
}

.article-content ul,
.article-content ol {
    margin-bottom: var(--space-md);
    padding-left: var(--space-xl);
}

.article-content ul {
    list-style: disc;
}

.article-content ol {
    list-style: decimal;
}

.article-content li {
    margin-bottom: var(--space-sm);
    line-height: 1.7;
}

.article-content img {
    border-radius: var(--radius-md);
    margin: var(--space-xl) 0;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--space-xl) 0;
}

.article-content table th,
.article-content table td {
    padding: var(--space-md);
    border: 1px solid var(--color-border);
    text-align: left;
}

.article-content table th {
    background: var(--color-bg-alt);
    font-weight: 600;
}

/* --- Two-column split (text + image) --- */
.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
    align-items: center;
}

.split--reverse {
    direction: rtl;
}

.split--reverse > * {
    direction: ltr;
}

.split__image {
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.split__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 768px) {
    .split,
    .split--reverse {
        grid-template-columns: 1fr;
        direction: ltr;
    }
}

/* --- Inner Hero (no background image, dark section) --- */
.hero--inner {
    min-height: auto;
    padding: var(--space-3xl) 0;
}

.hero--inner h1 {
    color: white;
}

.hero--inner .hero__subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    margin-top: var(--space-md);
    max-width: 600px;
}
