/* =====================================================================
   HABER KAPAGI (.kp) — fotografsiz duyuru / haber / etkinlik icin
   koddan cizilen kapak. Markup: Views/Shared/_HaberKapagi.cshtml

   Tek bilesen, kutusunun boyutuna gore (container query) duzen degistirir:
   liste satirindaki 92-112 px kucuk resimden anasayfa kartina kadar.
   - Duyuru / etkinlik: tarih yapragi + simge + tur yazisi
   - Haber: gazete mansheti gibi buyuk "HABER" + ince cizgi + tarih
   Tur kimligi yalnizca --kp-* degiskenlerinden gelir; renk/duzen degisecekse
   yalnizca bu dosya degisir.
   Hareket yalnizca 200 px'ten genis kutularda; "hareketi azalt" acikken yok.
   ===================================================================== */

.hg-kapak {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
}

.kp {
    --kp-zemin: linear-gradient(135deg, #8f0a14 0%, #d40a17 62%, #e8382c 100%);
    --kp-halka: rgba(255,255,255,.16);
    --kp-ay: #7a0911;
    --kp-gecikme: 0s;
    position: absolute;
    inset: 0;
    isolation: isolate;
    overflow: hidden;
    container-type: size;
    color: #fff;
    background: var(--kp-zemin);
    font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
    line-height: 1;
    text-align: left;
}

.kp--haber {
    --kp-zemin: linear-gradient(140deg, #1d0406 0%, #4a0a10 58%, #7a0911 100%);
    --kp-halka: rgba(255,255,255,.10);
    --kp-ay: #12151b;
}

.kp--etkinlik {
    --kp-zemin: linear-gradient(135deg, #a8081a 0%, #e3262a 55%, #f0663a 100%);
}

/* Doku: ince capraz cizgiler + sitenin halka motifi */
.kp::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: repeating-linear-gradient(-45deg, rgba(255,255,255,.035) 0 10px, transparent 10px 22px);
}

.kp::after {
    content: "";
    position: absolute;
    z-index: -1;
    width: 120cqh;
    height: 120cqh;
    right: -38cqh;
    top: -10cqh;
    border-radius: 50%;
    background: radial-gradient(circle, transparent 0 29%, var(--kp-halka) 29% 29.6%, transparent 29.6% 44%, var(--kp-halka) 44% 44.5%, transparent 44.5% 60%, var(--kp-halka) 60% 60.4%, transparent 60.4%);
    animation: kp-nefes 9s ease-in-out var(--kp-gecikme) infinite alternate;
}

.kp--haber::after { right: auto; left: -50cqh; top: 20cqh; }

.kp__ic {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto 1fr auto;
    padding: 9cqh 6cqw;
}

.kp__logo {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    display: grid;
    place-items: center;
    padding: 2.6cqh 3.4cqh;
    border-radius: 2.6cqh;
    background: #fff;
    box-shadow: 0 1.5cqh 4cqh rgba(0,0,0,.18);
}

/* .news-img img / .img-fluid gibi site kurallari bu olcuyu ezmesin */
.kp .kp__logo img {
    display: block;
    height: 12cqh !important;
    width: auto !important;
    max-width: none;
    object-fit: contain;
    transform: none !important;
}

.kp__tur {
    grid-column: 1;
    grid-row: 3;
    align-self: end;
    display: flex;
    align-items: center;
    gap: 5cqh;
    font-weight: 900;
    font-size: 16cqh;
    letter-spacing: .14em;
    text-transform: uppercase;
    white-space: nowrap;
}

.kp__simge {
    position: relative;
    display: grid;
    place-items: center;
    width: 1.5em;
    height: 1.5em;
    border-radius: 50%;
    background: rgba(255,255,255,.18);
    flex: none;
}

    .kp__simge svg { width: .9em; height: .9em; }

    .kp__simge::before,
    .kp__simge::after {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: 50%;
        border: max(1px, .6cqh) solid rgba(255,255,255,.6);
        opacity: 0;
        animation: kp-dalga 3.2s cubic-bezier(.22,1,.36,1) var(--kp-gecikme) infinite;
    }

    .kp__simge::after { animation-delay: calc(var(--kp-gecikme) + 1.6s); }

/* Yazinin uzerinden yavasca gecen isik */
.kp__soz {
    background: linear-gradient(100deg, #fff 40%, rgba(255,255,255,.45) 50%, #fff 60%) 0 0 / 260% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: kp-parilti 5s ease-in-out var(--kp-gecikme) infinite;
    filter: drop-shadow(0 .8cqh 2cqh rgba(0,0,0,.25));
}

/* Tarih yapragi */
.kp__yaprak {
    grid-column: 2;
    grid-row: 1 / 4;
    align-self: center;
    display: grid;
    width: 34cqh;
    border-radius: 4cqh;
    overflow: hidden;
    background: #fff;
    color: #12151b;
    text-align: center;
    box-shadow: 0 3cqh 7cqh rgba(0,0,0,.22);
}

.kp__ay { padding: 2.2cqh 0; background: var(--kp-ay); color: #fff; font-weight: 800; font-size: 6.4cqh; letter-spacing: .18em; }
.kp__gun { padding: 3cqh 0 1cqh; font-weight: 900; font-size: 17cqh; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kp__yil { padding: 0 0 3cqh; font-size: 5.4cqh; font-weight: 600; color: #6b7280; font-variant-numeric: tabular-nums; }

/* Haber: gazete mansheti */
.kp__manset {
    grid-column: 1 / 3;
    grid-row: 3;
    display: grid;
    gap: 3cqh;
    align-self: end;
}

    .kp__manset .kp__tur { grid-row: auto; font-size: 24cqh; letter-spacing: .2em; }

.kp__kural {
    position: relative;
    overflow: hidden;
    height: 1.2cqh;
    min-height: 1px;
    width: 100%;
    background: rgba(255,255,255,.45);
}

    .kp__kural::after {
        content: "";
        position: absolute;
        inset: 0;
        width: 28%;
        background: linear-gradient(90deg, transparent, #fff, transparent);
        transform: translateX(-110%);
        animation: kp-akis 5s ease-in-out var(--kp-gecikme) infinite;
    }

.kp__tarih { font-size: 6cqh; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; opacity: .8; }

.kp__isaret {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    width: 22cqh;
    height: 22cqh;
    opacity: .9;
}

@keyframes kp-dalga { from { transform: scale(1); opacity: .85; } to { transform: scale(1.75); opacity: 0; } }
@keyframes kp-parilti { 0%, 40% { background-position: 100% 0; } 80%, 100% { background-position: 0 0; } }
@keyframes kp-nefes { to { transform: scale(1.07); } }
@keyframes kp-akis { 0% { transform: translateX(-110%); } 65%, 100% { transform: translateX(360%); } }

/* --- Kucuk kutu (liste satiri, onceki/sonraki): logo ve hareket kalkar --- */
@container (max-width: 200px) {
    .kp__ic { grid-template-columns: 1fr; grid-template-rows: 1fr auto; padding: 9cqh 8cqw; justify-items: center; }
    .kp__logo, .kp__isaret, .kp__kural, .kp__tarih, .kp__simge, .kp__yil { display: none; }
    .kp__yaprak { grid-column: 1; grid-row: 1; width: 46cqh; border-radius: 5cqh; }
    .kp__ay { font-size: 8.5cqh; padding: 2.4cqh 0; }
    .kp__gun { font-size: 22cqh; padding: 3cqh 0 3.5cqh; }
    .kp__tur { grid-column: 1; grid-row: 2; font-size: 12.5cqh; justify-self: center; gap: 0; }
    .kp__soz { animation: none; background-position: 0 0; }
    .kp__manset { grid-column: 1; grid-row: 1 / 3; align-self: center; justify-items: center; gap: 4cqh; }
    .kp__manset .kp__tur { font-size: 19cqh; letter-spacing: .16em; }
    .kp__manset::before { content: ""; display: block; width: 30cqw; height: 1.4cqh; background: rgba(255,255,255,.6); }
}

/* Kucuk kutularda zemin halkasi da durgun (container query kendi kutusunu sorgulayamaz) */
.nl-row__img .kp::after,
.nd-pn__thumb .kp::after { animation: none; }

/* Anasayfa karti: kapak turu zaten buyuk yaziyor; ustteki rozet logoyu ortmesin */
.news-img:has(.kp) .news-badge { display: none; }

@media (prefers-reduced-motion: reduce) {
    .kp::after,
    .kp__soz,
    .kp__simge::before,
    .kp__simge::after,
    .kp__kural::after { animation: none !important; }
}
