/* ===================================================================
   SUB-PROJECTS & PROJECT DETAIL STYLING
   Mobile-first approach matching projects.css patterns
   =================================================================== */

/* ===== HEADER & BACK BUTTON (Mobile First) ===== */
.projects-section .projects-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0;
}

.projects-section .projects-header .detail-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    text-decoration: none;
    margin-bottom: 16px;
    padding: 10px 16px;
    background: #ffffff;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: background 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease;
}

.projects-section .projects-header .detail-back:hover {
    background: #f9fafb;
    color: #1a1a2e;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.projects-section .projects-header .detail-back svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.projects-section .projects-header .svc-heading {
    margin: 0 0 8px 0;
}

.projects-section .projects-header .projects-subtitle {
    margin: 0;
    display: block;
    font-size: 0.9rem;
    color: #374151;
    line-height: 1.5;
}

/* ===== SUB-PROJECTS GRID (Mobile First) ===== */
.sub-projects-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    margin-top: 24px;
    align-items: stretch;
}

.sub-projects-grid .category-card-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.sub-projects-grid .category-card {
    --card-accent: #003a7d;
    background: #ffffff;
    border-radius: 2px;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    cursor: pointer;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 6px 16px rgba(0, 0, 0, 0.03);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    width: 100%;
}

.sub-projects-grid .category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--card-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
    z-index: 1;
}

.sub-projects-grid .category-card:hover::before {
    transform: scaleX(1);
}

.sub-projects-grid .category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 20px 48px rgba(0, 0, 0, 0.1);
    border-color: transparent;
}

.sub-projects-grid .category-card-visual {
    width: 100%;
    height: 280px;
    border-radius: 0;
    background: #f5f5f5;
    overflow: hidden;
    flex-shrink: 0;
}

.sub-projects-grid .category-card-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.sub-projects-grid .category-card:hover .category-card-visual img {
    transform: scale(1.05);
}

.sub-projects-grid .category-card-content {
    position: relative;
    width: 100%;
    padding: 18px 56px 18px 24px;
    min-height: 76px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.sub-projects-grid .category-card-content h2 {
    font-size: 1.125rem;
    margin-bottom: 4px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--primary-blue);
    transition: color 0.3s ease;
}

.sub-projects-grid .category-card:hover .category-card-content h2 {
    color: var(--primary-green);
}

.sub-projects-grid .category-card-content p {
    font-size: 0.875rem;
    color: #5a5a5a;
    line-height: 1.5;
    display: none;
}

.sub-projects-grid .category-card-arrow {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    color: var(--primary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s ease;
}

.sub-projects-grid .category-card-arrow svg {
    width: 100%;
    height: 100%;
}

.sub-projects-grid .category-card:hover .category-card-arrow {
    transform: translateY(-50%) translateX(6px);
    color: var(--primary-green);
}

/* ===== PROJECT DETAIL PAGE (Mobile First) ===== */
/* Renamed from .project-meta-box to match HTML update */
.project-info-box {
    margin-top: 24px;
    padding: 24px;
    background: #fcfcfc;
    /* Very light gray/white background like the image */
    border-radius: 12px;
    /* More rounded corners */
    border: 1px solid #f0f0f0;
    /* Very subtle border */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    /* Subtle shadow for depth */
}

.project-info-box h3 {
    font-size: 1.125rem;
    /* Slightly smaller, bold title */
    font-weight: 700;
    margin: 0 0 20px 0;
    color: #000000;
    letter-spacing: -0.01em;
    font-family: inherit;
    /* Use default sans-serif, likely 'Inter' or similar */
}

.meta-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    /* Increased padding for breathing room */
    border-bottom: 1px solid #f0f0f0;
    /* Lighter separator */
    gap: 16px;
}

.meta-row:first-child {
    padding-top: 0;
}

.meta-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.meta-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #555555;
    /* Slightly softer gray */
    text-transform: capitalize;
    flex-shrink: 0;
}

.meta-value {
    font-size: 0.9rem;
    color: #111111;
    /* Darker black for better contrast */
    text-align: right;
    font-weight: 400;
}

.detail-objectives {
    margin-top: 32px;
}

.detail-objectives h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: #0a0a0a;
    letter-spacing: -0.01em;
}

.objectives-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.objectives-list li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 12px;
    line-height: 1.6;
    font-size: 0.9375rem;
    color: #4b5563;
}

.objectives-list li:last-child {
    margin-bottom: 0;
}

.objectives-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: #003a7d;
    font-weight: bold;
}

/* ===== TABLET BREAKPOINT (769px+) ===== */
@media (min-width: 769px) {
    .sub-projects-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px;
        margin-top: 32px;
    }

    .sub-projects-grid .category-card-content {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
    }

    .sub-projects-grid .category-card-content h2 {
        font-size: 1.25rem;
        margin-bottom: 8px;
    }

    .sub-projects-grid .category-card-content p {
        display: block;
        font-size: 0.875rem;
        color: #6b7280;
        line-height: 1.5;
        margin: 0 0 12px 0;
        flex-grow: 1;
    }

    .sub-projects-grid .category-card-arrow {
        align-self: flex-end;
    }

    .projects-section .projects-header .detail-back {
        font-size: 0.9rem;
    }

    .project-meta-box {
        padding: 24px;
    }

    .project-meta-box h3 {
        font-size: 1.375rem;
    }

    .detail-objectives h3 {
        font-size: 1.75rem;
    }
}

/* ===== DESKTOP BREAKPOINT (1101px+) ===== */
@media (min-width: 1101px) {
    .sub-projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 28px;
    }

    .sub-projects-grid .category-card-content h2 {
        font-size: 1.375rem;
    }

    .sub-projects-grid .category-card-content p {
        font-size: 0.9rem;
    }

    .project-meta-box {
        padding: 28px;
    }
}

/* ===== TOUCH DEVICE OPTIMIZATIONS ===== */
@media (hover: none) and (pointer: coarse) {
    .sub-projects-grid .category-card:hover {
        transform: none;
    }

    .sub-projects-grid .category-card:hover .category-card-visual img {
        transform: none;
    }

    .sub-projects-grid .category-card:hover .category-card-arrow svg {
        transform: none;
    }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {

    .sub-projects-grid .category-card,
    .sub-projects-grid .category-card-visual img,
    .sub-projects-grid .category-card-arrow svg {
        transition: none;
    }
}

/* ===== PROJECT ACTIONS (Buttons) ===== */
.project-actions-container {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
    flex-wrap: wrap;
    align-items: center;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background-color: #ffffff;
    border: 1px solid #d1d5db;
    /* Light gray border */
    border-radius: 6px;
    color: #374151;
    /* Dark gray text */
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
    color: #111827;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background: linear-gradient(135deg, #0f3460 0%, #1e5f43 100%);
    /* Blue to Green gradient */
    border: none;
    border-radius: 6px;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    filter: brightness(1.1);
}

/* Ensure buttons look good on smaller screens */
@media (max-width: 640px) {
    .project-actions-container {
        flex-direction: column;
        width: 100%;
    }

    .btn-secondary,
    .btn-primary {
        width: 100%;
        text-align: center;
    }
}