/* Projects directory + case study detail — aligned with products.css & ser_sub_pagestyle.css */

/* ===================== Listing page ===================== */

.projects-section {
    position: relative;
    padding: 90px 0 80px;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    overflow: hidden;
}

.projects-section::before,
.projects-section::after {
    content: '';
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    filter: blur(40px);
    opacity: 0.18;
}

.projects-section::before {
    width: 260px;
    height: 260px;
    top: -60px;
    right: -80px;
    background: radial-gradient(circle, rgba(11, 106, 50, 0.25) 0%, transparent 70%);
}

.projects-section::after {
    width: 220px;
    height: 220px;
    bottom: -50px;
    left: -70px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.25) 0%, transparent 70%);
}

.projects-section .container,
.project-detail-hero .container,
.project-detail-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

.projects-decorations {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.proj-box {
    position: absolute;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    opacity: 0.07;
    border-radius: 12px;
    animation: projRotateFloat 16s ease-in-out infinite;
}

.proj-box-1 {
    width: 180px;
    height: 180px;
    top: 12%;
    right: 8%;
    transform: rotate(35deg);
    animation-delay: 0.4s;
}

[dir="ltr"] .proj-box-1 { right: auto; left: 8%; }

.proj-box-2 {
    width: 130px;
    height: 130px;
    bottom: 18%;
    left: 10%;
    transform: rotate(-25deg);
    animation-delay: 3s;
}

[dir="ltr"] .proj-box-2 { left: auto; right: 10%; }

.proj-circle {
    position: absolute;
    border: 3px dashed var(--primary-light);
    border-radius: 50%;
    opacity: 0.18;
    animation: projPulseRotate 12s ease-in-out infinite;
}

.proj-circle-1 {
    width: 260px;
    height: 260px;
    top: 22%;
    right: -120px;
    animation-delay: 1.2s;
}

[dir="ltr"] .proj-circle-1 { right: auto; left: -120px; }

.proj-circle-2 {
    width: 200px;
    height: 200px;
    bottom: 12%;
    left: -100px;
    animation-delay: 2.4s;
}

[dir="ltr"] .proj-circle-2 { left: auto; right: -100px; }

/* Header — mirrors .products-header */
.projects-header {
    text-align: center;
    margin-bottom: 28px;
    opacity: 0;
    transform: translateY(20px);
}

.projects-header.in-view {
    animation: projFadeIn 0.7s ease-out 0.1s forwards;
}

.projects-header .section-label-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    border-radius: 10px;
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.14), rgba(11, 106, 50, 0.10));
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.projects-header .section-label {
    padding: 6px 14px;
    border-radius: 8px;
    background: var(--accent-color);
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.6px;
    font-size: 13px;
    text-transform: uppercase;
}

.projects-header .section-label-line {
    width: 140px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-color), transparent);
    opacity: 0.6;
}

.projects-title {
    margin: 16px 0 12px;
    font-weight: 900;
    font-size: clamp(1.75rem, 3vw, 2.4rem);
    background: linear-gradient(90deg, var(--text-primary), var(--primary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.3px;
    position: relative;
}

.projects-title::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -10px;
    width: 160px;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    box-shadow: 0 2px 10px rgba(11, 106, 50, 0.25);
}

.projects-subtitle {
    color: var(--text-secondary);
    max-width: 800px;
    margin: 18px auto 0;
    line-height: 1.9;
    font-size: 17px;
}

/* Filter bar */
.projects-filter-shell {
    margin: 0 auto 34px;
    max-width: 980px;
    padding: 14px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--border-color);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(8px);
}

.projects-filter-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 0;
}

.projects-filter-btn {
    border: 1.5px solid color-mix(in srgb, var(--primary-color) 35%, transparent);
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 10px 18px;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.projects-filter-btn:hover,
.projects-filter-btn.is-active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: #fff;
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(11, 106, 50, 0.25);
}

/* Project cards */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.project-card {
    opacity: 0;
    transform: translateY(24px);
}

.project-card.in-view {
    animation: projFadeIn 0.7s ease-out forwards;
}

.project-card.in-view:nth-child(1) { animation-delay: 0.05s; }
.project-card.in-view:nth-child(2) { animation-delay: 0.12s; }
.project-card.in-view:nth-child(3) { animation-delay: 0.19s; }
.project-card.in-view:nth-child(4) { animation-delay: 0.26s; }
.project-card.in-view:nth-child(5) { animation-delay: 0.33s; }
.project-card.in-view:nth-child(6) { animation-delay: 0.4s; }

.project-card.is-hidden {
    display: none;
}

.project-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.06);
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
    position: relative;
}

.project-card-link::after {
    content: '';
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

[dir="rtl"] .project-card-link::after {
    transform-origin: right;
}

.project-card-link:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-light);
}

.project-card-link:hover::after {
    transform: scaleX(1);
}

.project-card-media {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--bg-secondary);
}

.project-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 35%, rgba(11, 31, 58, 0.55) 100%);
    opacity: 0.85;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.project-card-link:hover .project-card-overlay {
    opacity: 1;
}

.project-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.project-card-link:hover .project-card-media img {
    transform: scale(1.05);
}

.project-hero-metric {
    position: absolute;
    bottom: 12px;
    inset-inline-start: 12px;
    z-index: 2;
    background: rgba(11, 31, 58, 0.88);
    color: var(--accent-color);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(212, 175, 55, 0.45);
}

.project-card-body {
    padding: 20px 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.project-category-tag {
    display: inline-flex;
    align-self: flex-start;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--primary-color);
    background: rgba(11, 106, 50, 0.08);
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 700;
    border: 1px solid rgba(11, 106, 50, 0.12);
}

.project-card-title {
    font-size: 1.15rem;
    line-height: 1.35;
    color: var(--text-primary);
    margin: 0;
    font-weight: 800;
}

.project-card-teaser {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.65;
    flex: 1;
}

.project-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.project-card-cta-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(11, 106, 50, 0.08);
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.9rem;
    border: 1.5px solid rgba(11, 106, 50, 0.2);
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.project-card-link:hover .project-card-cta-btn {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.project-card-cta i {
    color: var(--primary-color);
    transition: transform 0.2s ease, color 0.25s ease;
}

.project-card-link:hover .project-card-cta i {
    color: #fff;
    transform: translateX(4px);
}

[dir="rtl"] .project-card-link:hover .project-card-cta i {
    transform: translateX(-4px);
}

/* Detail page: tighter flow after breadcrumb hero */
.page-hero + main .project-detail-hero {
    padding-top: 36px;
}

.projects-empty-msg {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 32px;
    padding: 28px 20px;
    border-radius: 16px;
    background: var(--bg-primary);
    border: 1px dashed var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.projects-empty-msg i {
    font-size: 1.75rem;
    color: var(--primary-color);
    opacity: 0.7;
}

/* ===================== Case study detail ===================== */

.project-detail-hero {
    padding: 48px 0 56px;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    position: relative;
    overflow: hidden;
}

.project-detail-hero::before,
.project-detail-hero::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    opacity: 0.18;
    pointer-events: none;
    animation: projFloatCircle 14s ease-in-out infinite;
}

.project-detail-hero::before {
    width: 260px;
    height: 260px;
    top: -70px;
    right: -40px;
    background: radial-gradient(circle, rgba(11, 106, 50, 0.35) 0%, transparent 70%);
}

.project-detail-hero::after {
    width: 200px;
    height: 200px;
    bottom: 5%;
    left: -80px;
    background: radial-gradient(circle, rgba(0, 123, 255, 0.25) 0%, transparent 70%);
    animation-delay: 5s;
}

[dir="ltr"] .project-detail-hero::before {
    right: auto;
    left: -40px;
}

[dir="ltr"] .project-detail-hero::after {
    left: auto;
    right: -80px;
}

.project-detail-hero-media {
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.08);
    position: relative;
    margin-bottom: 28px;
    max-height: 480px;
}

.project-detail-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 55%, rgba(11, 31, 58, 0.35) 100%);
    pointer-events: none;
}

.project-detail-hero-media::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 28px;
    pointer-events: none;
}

.project-detail-hero-main {
    max-width: 860px;
    margin: 0 auto 28px;
    text-align: center;
}

.project-detail-hero-main .section-label-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(11, 106, 50, 0.08);
    margin-bottom: 18px;
}

.project-detail-hero-main .section-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-detail-hero-main .section-label-line {
    width: 120px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), transparent);
}

[dir="rtl"] .project-detail-hero-main .section-label-line {
    background: linear-gradient(270deg, var(--primary-color), transparent);
}

.project-detail-lead {
    color: var(--text-secondary);
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    line-height: 1.9;
    max-width: 760px;
    margin: 0 auto;
}

.project-detail-hero-media img,
.project-solution-media img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-height: 480px;
}

.project-detail-meta-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 8px;
}

.project-meta-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    opacity: 0;
    transform: translateY(12px);
}

.project-meta-item.in-view {
    animation: projFadeIn 0.55s ease-out forwards;
}

.project-meta-item.in-view:nth-child(1) { animation-delay: 0.05s; }
.project-meta-item.in-view:nth-child(2) { animation-delay: 0.12s; }
.project-meta-item.in-view:nth-child(3) { animation-delay: 0.19s; }
.project-meta-item.in-view:nth-child(4) { animation-delay: 0.26s; }

.project-meta-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.08);
    border-color: rgba(11, 106, 50, 0.2);
}

.project-meta-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(11, 106, 50, 0.12), rgba(212, 175, 55, 0.12));
    color: var(--primary-color);
    font-size: 1rem;
}

.project-meta-content {
    min-width: 0;
}

.project-meta-label {
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--accent-color);
    margin-bottom: 6px;
    font-weight: 700;
}

.project-meta-value {
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.5;
}

/* Content sections */
.project-detail-section {
    padding: 70px 0;
    position: relative;
    overflow: hidden;
}

.project-challenge {
    background: var(--bg-secondary);
}

.project-challenge-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 28px;
    align-items: start;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 28px;
    padding: 36px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

.project-challenge-card::before {
    content: '';
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-color), var(--accent-color));
}

.project-section-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: #fff;
    font-size: 1.5rem;
    box-shadow: 0 12px 30px rgba(11, 106, 50, 0.3);
    flex-shrink: 0;
}

.project-solution {
    background: var(--bg-primary);
}

.project-solution-eyebrow {
    text-align: center;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-color);
    margin-bottom: 18px;
}

.project-impact {
    background: linear-gradient(180deg, #ffffff 0%, #eefaf3 100%);
}

.project-section-title {
    font-size: clamp(1.75rem, 2.5vw, 2.25rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 16px;
    position: relative;
}

.project-challenge .project-section-title::after,
.project-solution .project-section-title::after {
    content: '';
    display: block;
    width: 70px;
    height: 4px;
    margin-top: 14px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    box-shadow: 0 8px 20px rgba(11, 106, 50, 0.25);
}

.project-section-body {
    color: var(--text-secondary);
    line-height: 1.9;
    max-width: 820px;
    font-size: 17px;
}

.project-solution-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
    align-items: center;
    background: #f2f6ff;
    border-radius: 32px;
    padding: 36px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.07);
}

.project-solution-features {
    list-style: none;
    padding: 0;
    margin: 18px 0 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.project-solution-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    font-size: 17px;
}

.project-solution-features i {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 10px 20px rgba(11, 106, 50, 0.35);
}

.project-solution-media {
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.1);
}

.project-impact-heading {
    text-align: center;
    font-size: clamp(1.75rem, 2.5vw, 2.25rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 28px;
}

.project-impact-heading::after {
    content: '';
    display: block;
    width: 70px;
    height: 4px;
    margin: 14px auto 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    box-shadow: 0 8px 20px rgba(11, 106, 50, 0.25);
}

.project-impact-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.project-impact-metric {
    text-align: center;
    padding: 32px 20px 28px;
    border-radius: 28px;
    background: #ffffff;
    border: 1px solid rgba(11, 106, 50, 0.05);
    box-shadow: 0 28px 80px rgba(0, 53, 28, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    opacity: 0;
    transform: translateY(14px);
}

.project-impact-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, var(--primary-light) 0%, var(--primary-color) 70%);
    color: #fff;
    font-size: 1.25rem;
    box-shadow: 0 16px 36px rgba(11, 106, 50, 0.28);
}

.project-impact-metric.in-view {
    animation: projFadeIn 0.6s ease-out forwards;
}

.project-impact-metric.in-view:nth-child(1) { animation-delay: 0.05s; }
.project-impact-metric.in-view:nth-child(2) { animation-delay: 0.15s; }
.project-impact-metric.in-view:nth-child(3) { animation-delay: 0.25s; }

.project-impact-metric:hover {
    transform: translateY(-6px);
    box-shadow: 0 35px 90px rgba(0, 53, 28, 0.12);
}

.project-impact-value {
    display: block;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 900;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1.1;
}

.project-impact-label {
    display: block;
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Animations */
@keyframes projFadeIn {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes projRotateFloat {
    0%, 100% { transform: rotate(35deg) translateY(0); }
    50% { transform: rotate(40deg) translateY(-12px); }
}

@keyframes projPulseRotate {
    0%, 100% { transform: rotate(0deg) scale(1); opacity: 0.18; }
    50% { transform: rotate(180deg) scale(1.05); opacity: 0.28; }
}

@keyframes projFloatCircle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-16px); }
}

/* Responsive */
@media (max-width: 992px) {
    .projects-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .project-challenge-card {
        grid-template-columns: 1fr;
        padding: 28px 24px;
    }

    .project-section-icon {
        margin-bottom: 4px;
    }

    .project-solution-grid {
        grid-template-columns: 1fr;
        padding: 28px;
        border-radius: 24px;
    }

    .project-impact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .projects-filter-shell {
        border-radius: 20px;
        padding: 12px;
    }

    .projects-filter-bar {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .project-detail-hero-media {
        border-radius: 20px;
        margin-bottom: 22px;
    }

    .project-detail-hero-media::after {
        border-radius: 20px;
    }

    .project-detail-meta-row {
        grid-template-columns: 1fr;
    }
}
