﻿/* Anasayfa — BM SKA etkinlik kartları (resmi UN renk paleti) */
.sdg-etkinlik-section .trend-title-text {
    color: var(--kku-brand, #5eb8d9);
}

/* Etkinlik detay: sayım satırı yok; etiket yukarı hizalansın */
.etkinlik-sdg-card .sdg-label {
    margin-top: 0.35rem;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.etkinlik-sdg-block {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}
.etkinlik-sdg-card-wrap {
    padding-top: 0.5rem;
}

.sdg-card-grid-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.35rem 0 0.75rem;
    box-sizing: border-box;
    width: 100%;
}

/* 9 + 8 kart: iki satır; 2. satırdaki 8 kart flex + justify-content:center ile ortalanır */
.sdg-card-grid {
    --sdg-gap: 12px;
    --sdg-cols: 9;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    column-gap: var(--sdg-gap);
    row-gap: var(--sdg-gap);
    width: 100%;
    box-sizing: border-box;
}

.sdg-home-card {
    /* Bir satırda 9 eşit sütun (9 kart arası 8 aralık) + üst sınır ~150px */
    box-sizing: border-box;
    flex: 0 0 min(150px, calc((100% - ((var(--sdg-cols) - 1) * var(--sdg-gap))) / var(--sdg-cols)));
    min-width: 0;
    border-radius: 10px;
    padding: 10px 6px 12px;
    color: #fff;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    position: relative;
    overflow: hidden;
    min-height: 148px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    cursor: pointer;
    transition:
        transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.42s ease,
        filter 0.35s ease;
}

a.sdg-home-card,
a.sdg-home-card:hover,
a.sdg-home-card:focus,
a.sdg-home-card:visited {
    color: #fff;
    text-decoration: none;
}

a.sdg-home-card:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

/* Üst ışık lekesi (istatistik kartlarıyla aynı mantık) */
.sdg-home-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(95% 72% at 50% -8%, rgba(255, 255, 255, 0.36) 0%, rgba(255, 255, 255, 0.06) 40%, transparent 64%);
    opacity: 0;
    transition: opacity 0.45s ease;
    pointer-events: none;
    z-index: 1;
}

.sdg-home-card:hover::after {
    opacity: 1;
}

.sdg-home-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px -8px rgba(0, 0, 0, 0.26);
    filter: brightness(1.03);
}

.sdg-home-card .sdg-goal-no {
    position: absolute;
    top: 6px;
    left: 8px;
    z-index: 2;
    font-size: 0.75rem;
    font-weight: 800;
    opacity: 0.95;
}

/* UN görsellerine yaklaşık: Font Awesome 6 (Layout’ta tüm set) */
.sdg-home-card .sdg-icon {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 2.35rem;
    margin: 0.2rem 0 0.1rem;
    padding: 0 2px;
}

.sdg-home-card .sdg-icon i {
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", "Font Awesome 5 Pro";
    font-style: normal;
    font-weight: 900;
    -webkit-font-smoothing: antialiased;
    font-size: clamp(1.2rem, 2.1vw, 1.75rem);
    line-height: 1;
    color: rgba(255, 255, 255, 0.95);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
    opacity: 0.98;
    transition:
        transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
        filter 0.35s ease;
}

.sdg-home-card:hover .sdg-icon i {
    transform: translateY(-3px) scale(1.06);
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.28));
}

.sdg-home-card .sdg-count {
    position: relative;
    z-index: 2;
    font-size: 1.55rem;
    font-weight: 800;
    line-height: 1.1;
    margin: 0.1rem 0 0.3rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.sdg-home-card .sdg-count__inner {
    font-variant-numeric: tabular-nums;
    display: inline-block;
    min-width: 0.5em;
}

.sdg-home-card .sdg-count__inner.kku-sdg-count-active {
    transition: none;
}

.sdg-home-card .sdg-label {
    position: relative;
    z-index: 2;
    font-size: clamp(0.78rem, 0.72rem + 0.18vw, 0.88rem);
    font-weight: 700;
    line-height: 1.25;
    text-transform: uppercase;
    letter-spacing: 0.015em;
    opacity: 0.98;
    padding: 0 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    hyphens: auto;
}

.sdg-1 { background: #e5243b; }
.sdg-2 { background: #dda63a; }
.sdg-3 { background: #4c9f38; }
.sdg-4 { background: #c5192d; }
.sdg-5 { background: #ff3a21; }
.sdg-6 { background: #26bde2; }
.sdg-7 { background: #fcc30b; }
.sdg-8 { background: #a21942; }
.sdg-9 { background: #fd6925; }
.sdg-10 { background: #dd1367; }
.sdg-11 { background: #fd9d24; }
.sdg-12 { background: #bf8b2e; }
.sdg-13 { background: #3f7e44; }
.sdg-14 { background: #0a97d9; }
.sdg-15 { background: #56c02b; }
/* SKA 16: güvercin + parlak mavi siyasi logo çağrışımı yapmasın — kurumsal lacivert-teal */
.sdg-16 { background: #1e4d6b; }
.sdg-17 { background: #19486a; }

@media (prefers-reduced-motion: reduce) {
    .sdg-home-card,
    .sdg-home-card::after,
    .sdg-home-card .sdg-icon i {
        transition-duration: 0.01ms !important;
    }

    .sdg-home-card:hover {
        transform: none;
        filter: none;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    }

    .sdg-home-card:hover::after {
        opacity: 0.5;
    }

    .sdg-home-card:hover .sdg-icon i {
        transform: none;
        filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
    }
}

/* Tablet: ~5 sütun */
@media (max-width: 1100px) {
    .sdg-card-grid {
        --sdg-cols: 5;
    }
}

/* Dar tablet: 4 sütun */
@media (max-width: 768px) {
    .sdg-etkinlik-section.trend-analysis-container {
        padding: 0.65rem 0;
        margin-bottom: 0.85rem;
        border-radius: 10px;
    }

    .sdg-card-grid {
        --sdg-cols: 4;
    }

    .sdg-card-grid-wrap {
        max-width: 100%;
        padding: 0;
    }
}

/* Mobil: 2 sütun — tam genişlik, okunur etiket */
@media (max-width: 576px) {
    .sdg-card-grid {
        --sdg-cols: 2;
        --sdg-gap: 8px;
        justify-content: stretch;
    }

    .sdg-home-card {
        flex: 0 0 calc((100% - var(--sdg-gap)) / 2);
        max-width: calc((100% - var(--sdg-gap)) / 2);
        min-height: 128px;
        padding: 8px 6px 10px;
        border-radius: 10px;
    }

    .sdg-home-card .sdg-goal-no {
        top: 5px;
        left: 6px;
        font-size: 0.68rem;
    }

    .sdg-home-card .sdg-icon {
        min-height: 1.75rem;
        margin: 0.15rem 0 0.05rem;
    }

    .sdg-home-card .sdg-icon i {
        font-size: 1.05rem;
    }

    .sdg-home-card .sdg-count {
        font-size: 1.15rem;
        margin: 0.05rem 0 0.2rem;
    }

    .sdg-home-card .sdg-label {
        font-size: clamp(0.7rem, 2.8vw, 0.8rem);
        line-height: 1.25;
        letter-spacing: 0.012em;
        padding: 0 4px;
        -webkit-line-clamp: 3;
        min-height: 2.4em;
    }
}

@media (max-width: 380px) {
    .sdg-home-card .sdg-label {
        font-size: 0.68rem;
        -webkit-line-clamp: 4;
    }
}

/* BM SKA kartı — mobil başlık */
@media (max-width: 768px) {
    #sdgEtkinlikSection {
        padding: 0.85rem 0.9rem 1rem;
    }

    #sdgEtkinlikSection .trend-header {
        padding: 0.75rem 0.85rem;
        margin-bottom: 0.6rem;
    }

    #sdgEtkinlikSection .trend-title {
        flex-wrap: nowrap;
        align-items: center;
        gap: 0.4rem;
        font-size: 0.98rem;
        line-height: 1.25;
    }

    #sdgEtkinlikSection .trend-title i {
        flex-shrink: 0;
        font-size: 1rem;
    }

    #sdgEtkinlikSection .trend-title-text {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        min-width: 0;
        flex: 1 1 auto;
    }

    .birim-analiz-page #sdgEtkinlikSection {
        padding: 0.85rem 0.75rem 1rem;
    }
}
