/* Project pages share the site navigation and footer, while their original
   page-specific layouts live in separate stylesheets. */
.project-page .fade-in {
    opacity: 1;
    transform: none;
}

/* The project designs draw their own underline below each section heading. */
.project-page .section-title::after {
    content: none;
}

/* Team cards use the supplied layout on both project pages. The darker purple
   and pale mint keep the white names and roles readable. */
.project-page .team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 30px;
    margin-top: 30px;
}

.project-page .team-member {
    min-width: 0;
    padding: 30px;
    color: #fff;
    background: var(--primary-dark);
    border-radius: 20px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-page .team-member:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.project-page .member-photo {
    display: block;
    width: 150px;
    max-width: 100%;
    height: auto;
    aspect-ratio: 1;
    margin: 0 auto 20px;
    object-fit: cover;
    border: 4px solid var(--accent);
    border-radius: 50%;
}

.project-page .member-name {
    margin-bottom: 8px;
    font-size: 1.4rem;
    overflow-wrap: anywhere;
}

.project-page .member-role {
    color: #e0fff9;
    font-weight: 600;
    overflow-wrap: anywhere;
}

@media (max-width: 768px) {
    .project-page .team-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .project-page .member-photo {
        width: 120px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .project-page .team-member:hover {
        transform: none;
    }
}

/* The source uses a 576px body breakpoint; keep it aligned with the shared nav. */
@media (min-width: 481px) and (max-width: 576px) {
    body.project-page {
        padding: 15px;
    }
}

@media (max-width: 576px) {
    .project-page main {
        overflow-wrap: anywhere;
    }

    .project-page .mission-card,
    .project-page .direction-card,
    .project-page .book-cover,
    .project-page .book-info {
        min-width: 0;
        width: 100%;
    }

    .project-page .container,
    .project-page .content-section,
    .project-page .map-container,
    .project-page .legend-section,
    .project-page .info-section,
    .project-page .team-member,
    .project-page .info-card {
        min-width: 0;
    }

    .project-page .directions-grid,
    .project-page .legend-grid,
    .project-page .info-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .project-page .subdivision {
        padding: 20px;
    }

    .project-page .subdivision-title {
        max-width: 100%;
    }

    .project-page .info-card h3 {
        display: block;
    }

    /* On narrow screens a vertical control stack can be taller than the map. */
    .project-page .map-controls {
        position: static;
        flex-direction: row;
        justify-content: center;
        padding: 10px;
    }
}

@media (max-width: 340px) {
    .project-page .project-text h1 {
        font-size: 1.2rem;
    }
}

/* Keep the partner's actual link available even when JavaScript is disabled. */
#supportersGrid .supporter-item {
    height: auto;
    min-height: 180px;
    padding: 0;
}

#supportersGrid .supporter-item::before {
    pointer-events: none;
}

.supporter-trigger {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 178px;
    padding: 20px;
    text-decoration: none;
}

.supporter-trigger:focus-visible {
    outline-offset: -5px;
}

#supportersGrid .partner-warning {
    background: #6653ae;
    padding: 12px;
}

/* Let an open confirmation grow with enlarged text instead of clipping it. */
#supportersGrid .supporter-item.warning-open .supporter-trigger {
    display: none;
}

#supportersGrid .partner-warning.active {
    position: static;
    width: 100%;
    min-height: 178px;
}

#supportersGrid .warning-text {
    margin-bottom: 8px;
}

#supportersGrid .warning-actions {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
}

#supportersGrid .warning-btn {
    flex: 1 1 4.5rem;
    width: auto;
    min-width: 0;
    padding: 8px 12px;
}

#supportersGrid .warning-proceed {
    background: #075d57;
}

#supportersGrid .warning-proceed:hover {
    background: #064e49;
}

/* Text controls and lists supplement the interactive map for keyboard,
   touch, and screen-reader users. */
.map-switches {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 22px;
}

.map-switches[hidden] {
    display: none;
}

.map-switches button {
    padding: 10px 18px;
    border: 0;
    border-radius: 24px;
    background: #6653ae;
    color: white;
    font: 600 0.95rem 'Raleway', sans-serif;
    cursor: pointer;
}

.map-switches button:hover,
.map-switches button[aria-pressed="true"] {
    background: #392a75;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.project-page .map-hint {
    color: #606060;
}

.project-page .map-tooltip {
    max-width: calc(100% - 10px);
}

.map-data {
    margin: 18px auto 0;
    max-width: 700px;
    text-align: left;
}

.map-data summary {
    color: #503a9d;
    font-weight: 700;
    cursor: pointer;
}

.map-data ul {
    max-height: 18rem;
    overflow-y: auto;
    margin-top: 10px;
    padding: 12px 15px 12px 35px;
    background: #f7f5fc;
    border-radius: 8px;
}

.map-data li {
    padding: 3px 0;
    overflow-wrap: anywhere;
}

.map-data a {
    color: #503a9d;
    text-decoration: underline;
}

.map-data ul:focus-visible,
.legend-item[role="button"]:focus-visible {
    outline: 3px solid #cf6500;
    outline-offset: 3px;
}

.vk-comic-icon {
    width: 32px;
    height: 32px;
    margin-bottom: 10px;
    border-radius: 5px;
}

.external-video-link {
    padding: 12px 16px;
    background: white;
    text-align: center;
}

.external-video-link a {
    color: #503a9d;
    text-decoration: underline;
    text-underline-offset: 3px;
}
