/* ============================================================
   FIMAK — haberler.css
   Yalnizca haberler.php'de yuklenir; style.css'i tamamlar.
   Sayfa hero'su paylasilan css/page-hero.css dosyasindadir.

   Bolumler
   1. Ortak kapsayici
   2. Kategori sekmeleri
   3. Izgara ve kart
   4. Bos durum ve "daha fazla"
   5. Responsive (tum media query'ler burada)

   Olculer akiskan: clamp ile 375px -> 1920px arasi dogrusal buyur.
   Renkler style.css'teki :root degiskenlerinden okunur.
   ============================================================ */


/* ------------------------------------------------------------
   1. Ortak kapsayici
   ------------------------------------------------------------ */
.nw {
    --nw-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --nw-line: var(--border);

    max-width: 1920px;
    margin-inline: auto;
    padding: clamp(32px, 3.3vw, 54px) clamp(20px, 9.8vw, 162px) clamp(70px, 6vw, 104px);

    /* style.css'teki govde degerlerini notrle */
    letter-spacing: normal;
    line-height: normal;
}


/* ------------------------------------------------------------
   2. Kategori sekmeleri
   Sekmeler arasindaki ince cizgi li::before ile cizilir; boylece
   ayri bir ayirici ogesi markup'a girmez.
   ------------------------------------------------------------ */
.nw-filter {
    /* Menuden gelen bagin hedefi: yapiskan baslik sekmeleri ortmesin */
    scroll-margin-top: calc(var(--nav-height, 44px) + 24px);
}

.nw-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    list-style: none;
}

.nw-tabs li {
    display: flex;
    align-items: center;
}

.nw-tabs li + li::before {
    content: "";
    width: clamp(24px, 4.3vw, 72px);
    height: 1px;
    background-color: var(--nw-line);
}

.nw-tab {
    height: clamp(44px, 3.2vw, 54px);
    padding: 0 clamp(22px, 2vw, 34px);
    border: 1px solid var(--nw-line);
    border-radius: 999px;
    background-color: var(--surface);
    font-family: inherit;
    font-size: clamp(14px, 1vw, 16px);
    font-weight: 400;
    white-space: nowrap;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background-color 0.4s var(--nw-ease), color 0.4s ease,
        border-color 0.4s ease, box-shadow 0.4s ease;
}

.nw-tab:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.nw-tab.is-active {
    border-color: var(--brand);
    background-color: var(--brand);
    color: #fff;
    box-shadow: 0 10px 24px -12px rgb(226 6 19 / 0.6);
}

.nw-tab:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
}


/* ------------------------------------------------------------
   3. Izgara ve kart
   Kart normalde beyaz ve cerceveli; fare uzerine gelince arkadaki
   gorsel acilir, yazilar beyaza doner ve kucuk ok buyuk daireye
   donusur.
   ------------------------------------------------------------ */
.nw-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(14px, 1.4vw, 23px);
    margin-top: clamp(40px, 4.9vw, 82px);
}

.nw-card {
    position: relative;
    /* isolation: gorsel z-index -1 ile sayfa zeminine degil karta gore yerlesir */
    isolation: isolate;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    min-height: clamp(300px, 24.8vw, 413px);
    padding: clamp(28px, 2.6vw, 44px);
    border: 1px solid var(--nw-line);
    background-color: var(--surface);
    /* style.css'te a { color: var(--brand-dark); } var; kart bir bag
       oldugu icin rengi ve altcizgiyi burada sifirliyoruz */
    color: inherit;
    text-decoration: none;
    transition: border-color 0.5s var(--nw-ease);
}

.nw-card.is-hidden { display: none; }

.nw-card.is-entering {
    animation: nw-in 0.6s var(--nw-ease) both;
    animation-delay: var(--d, 0ms);
}

@keyframes nw-in {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
}

/* Hover'da acilan gorsel. Gorsel dosyasi yoksa altindaki koyu
   gradyan kalir, kart yine okunur olur. */
.nw-card__media {
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: 0;
    background: radial-gradient(120% 80% at 50% 110%, #3a3a3f 0%, #1d1d1f 55%, #0b0b0c 100%);
    transform: scale(1.08);
    transition: opacity 0.6s var(--nw-ease), transform 1.1s var(--nw-ease);
}

.nw-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Okunurluk perdesi: baslik ve tarih her gorselde okunur kalsin */
.nw-card__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgb(0 0 0 / 0.72) 0%, rgb(0 0 0 / 0.15) 45%,
        rgb(0 0 0 / 0.6) 100%);
}

.nw-card__title {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: clamp(17px, 1.27vw, 21px);
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: -0.01em;
    color: var(--text);
    transition: color 0.45s var(--nw-ease);
}

.nw-card__foot {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.nw-card__meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    color: var(--text-secondary);
    transition: color 0.45s ease;
}

/* Kategori adi normalde kapali; hover'da yuksekligi acilarak girer */
.nw-card__cat {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(6px);
    transition: max-height 0.5s var(--nw-ease), opacity 0.4s ease,
        transform 0.5s var(--nw-ease);
}

.nw-card__arrow {
    position: relative;
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    /* Negatif margin: kucuk ok yerini korur, buyuk daire disari tasar */
    margin: 0 -18px -12px 0;
    border-radius: 50%;
    transition: background-color 0.45s var(--nw-ease), transform 0.45s var(--nw-ease);
}

.nw-card__arrow svg {
    position: absolute;
    fill: none;
    stroke: var(--text);
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: opacity 0.35s ease, transform 0.45s var(--nw-ease);
}

.nw-card__arrow svg:first-child {
    width: 12px;
    height: 12px;
    stroke-width: 1.8;
}

.nw-card__arrow svg:last-child {
    width: 24px;
    height: 24px;
    stroke-width: 2;
    opacity: 0;
    transform: translateX(-8px) rotate(-45deg);
}


/* ---------- Hover / odak ---------- */
/* focus-within: klavyeyle gezerken de ayni geri bildirim */
.nw-card:hover,
.nw-card:focus-within { border-color: transparent; }

.nw-card:hover .nw-card__media,
.nw-card:focus-within .nw-card__media {
    opacity: 1;
    transform: scale(1);
}

.nw-card:hover .nw-card__title,
.nw-card:focus-within .nw-card__title { color: #fff; }

.nw-card:hover .nw-card__meta,
.nw-card:focus-within .nw-card__meta { color: rgb(255 255 255 / 0.85); }

.nw-card:hover .nw-card__cat,
.nw-card:focus-within .nw-card__cat {
    max-height: 24px;
    opacity: 1;
    transform: none;
}

.nw-card:hover .nw-card__arrow,
.nw-card:focus-within .nw-card__arrow { background-color: var(--surface); }

.nw-card:hover .nw-card__arrow svg:first-child,
.nw-card:focus-within .nw-card__arrow svg:first-child {
    opacity: 0;
    transform: translate(6px, -6px);
}

.nw-card:hover .nw-card__arrow svg:last-child,
.nw-card:focus-within .nw-card__arrow svg:last-child {
    opacity: 1;
    transform: none;
}

.nw-card:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
}


/* ------------------------------------------------------------
   4. Bos durum ve "daha fazla"
   ------------------------------------------------------------ */
.nw-empty {
    grid-column: 1 / -1;
    display: none;
    padding: 60px 0;
    font-size: 16px;
    text-align: center;
    color: var(--text-secondary);
}

.nw-more {
    display: flex;
    justify-content: center;
    margin-top: clamp(36px, 3.5vw, 56px);
}

.nw-more[hidden] { display: none; }

.nw-more button {
    height: 50px;
    padding: 0 34px;
    border: 1px solid var(--nw-line);
    border-radius: 999px;
    background-color: var(--surface);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.4s ease, color 0.4s ease;
}

.nw-more button:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.nw-more button:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
}


/* ------------------------------------------------------------
   5. Responsive
   ------------------------------------------------------------ */
@media (max-width: 1024px) {
    .nw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .nw-grid { grid-template-columns: 1fr; }
    .nw-card { min-height: 240px; }
    .nw-tabs li + li::before { width: 14px; }
    .nw-tab { padding: 0 18px; }
}

/* Dokunmatikte hover yok: kategori adi her zaman gorunsun */
@media (hover: none) {
    .nw-card__cat {
        max-height: 24px;
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {

    .nw-tab,
    .nw-card,
    .nw-card__media,
    .nw-card__title,
    .nw-card__meta,
    .nw-card__cat,
    .nw-card__arrow,
    .nw-card__arrow svg,
    .nw-more button { transition: none; }

    .nw-card.is-entering { animation: none; }
}
