/* Ana sayfaya özel stiller (ortak olanlar site.css'te) */

.header-content--home {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
}

/* ---------- Filtre kapsülü + kayan gösterge ---------- */
.filters {
    position: relative;
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    padding: 4px;
    border-radius: var(--r-pill);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.25);
}
.filter-indicator {
    position: absolute;
    top: 4px; bottom: 4px; left: 0;
    width: var(--w, 0px);
    transform: translateX(var(--x, 0px));
    border-radius: var(--r-pill);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.09) 100%);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.55);
    opacity: 0;
    pointer-events: none;
}
.filters.ready .filter-indicator {
    opacity: 1;
    transition: transform 0.38s var(--ease), width 0.38s var(--ease), opacity 0.2s;
}
.filter-btn {
    position: relative; z-index: 1;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
    padding: 0.45rem 1.15rem;
    border-radius: var(--r-pill);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    transition: color var(--t-base) ease;
}
.filter-btn:hover { color: #fff; }
.filter-btn[aria-pressed="true"] { color: #fff; font-weight: 600; }

/* ---------- Arama + RSS ---------- */
.action-container { display: flex; justify-content: flex-end; align-items: center; gap: 0.85rem; }

.search-container {
    display: flex; align-items: center; gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--r-pill);
    padding: 0.45rem 0.95rem;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transition: background var(--t-base), border-color var(--t-base), box-shadow var(--t-base);
}
.search-container:focus-within {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.38);
    box-shadow: 0 0 20px rgba(96, 165, 250, 0.22), inset 0 1px 1px rgba(255, 255, 255, 0.25);
}
.search-container i { color: var(--text-muted); }
.search-input {
    background: transparent; border: none; outline: none;
    color: var(--text-main);
    font-size: 0.9rem;
    width: 190px; min-width: 0;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input::-webkit-search-cancel-button { filter: invert(1); opacity: .6; }

.rss-link-btn {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.72), rgba(234, 88, 12, 0.45));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.36);
    color: #fff;
    padding: 0.5rem 1.1rem;
    border-radius: var(--r-pill);
    text-decoration: none;
    font-size: 0.88rem; font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 4px 18px rgba(249, 115, 22, 0.32), inset 0 1px 1.5px rgba(255, 255, 255, 0.55);
    transition: transform var(--t-base) var(--ease), box-shadow var(--t-base), background var(--t-base);
}
.rss-link-btn:hover {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.88), rgba(234, 88, 12, 0.65));
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(249, 115, 22, 0.48), inset 0 1px 1.5px rgba(255, 255, 255, 0.7);
}

/* ---------- Ana alan + kart ızgarası ---------- */
main { flex: 1; width: 100%; max-width: 1200px; margin: 2.25rem auto; padding: 0 1.25rem; }

#news-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(310px, 100%), 1fr));
    gap: 2rem;
    margin-bottom: 2.5rem;
    transition: opacity 0.16s ease, transform 0.16s ease;
}
#news-container.is-leaving { opacity: 0; transform: translateY(6px); }

.news-card {
    position: relative;
    display: flex; flex-direction: column;
    overflow: hidden;
    color: inherit; text-decoration: none;
    animation: riseIn 0.55s var(--ease) backwards;
    animation-delay: calc(var(--i, 0) * 45ms);
    transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s ease, background 0.35s ease;
}
.news-card:hover {
    transform: translateY(-6px) scale(1.008);
    background: var(--surface-hover);
    border-color: var(--glass-border-bright);
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.48), 0 0 28px rgba(96, 165, 250, 0.16),
                inset 0 1.5px 2px rgba(255, 255, 255, 0.55), inset 0 -1px 1px rgba(255, 255, 255, 0.1);
}

/* Görsel alanı: yükseklik sabit → sayfa zıplamaz */
.card-media {
    height: 180px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 0.9rem; font-weight: 500; letter-spacing: 0.4px;
}
.card-media img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s var(--ease);
}
.card-media img.loaded { opacity: 1; }
.news-card:hover .card-media img { transform: scale(1.03); }

.card-content { padding: 1.5rem; display: flex; flex-direction: column; flex-grow: 1; }

.card-tag {
    align-self: flex-start;
    padding: 0.28rem 0.85rem;
    border-radius: var(--r-pill);
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.tag-anime {
    background: var(--anime-tag);
    border: 1px solid rgba(244, 114, 182, 0.48);
    color: #fce7f3;
    box-shadow: 0 4px 14px rgba(236, 72, 153, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.4);
}
.tag-cartoon {
    background: var(--cartoon-tag);
    border: 1px solid rgba(251, 191, 36, 0.48);
    color: #fef3c7;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

.card-title { font-size: 1.15rem; font-weight: 600; margin-bottom: 0.75rem; color: #fff; line-height: 1.4; overflow-wrap: anywhere; }
.card-excerpt { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; flex-grow: 1; overflow-wrap: anywhere; }

.card-footer {
    display: flex; justify-content: space-between; align-items: center; gap: 0.75rem;
    font-size: 0.84rem; color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.11);
    padding-top: 1rem;
}
.read-more-btn {
    display: inline-flex; align-items: center; gap: 5px;
    color: var(--accent-soft); font-weight: 600; font-size: 0.88rem;
    white-space: nowrap;
    transition: color var(--t-fast) ease, text-shadow var(--t-fast) ease;
}
.read-more-btn i { transition: transform var(--t-fast) ease; }
.news-card:hover .read-more-btn { color: #fff; text-shadow: 0 0 12px rgba(147, 197, 253, 0.7); }
.news-card:hover .read-more-btn i { transform: translateX(3px); }

/* ---------- Skeleton kart (yüklenirken) ---------- */
.news-card.is-skeleton { pointer-events: none; }
.news-card.is-skeleton .card-media { border-bottom-color: transparent; }
.sk-line { height: 14px; margin-bottom: 0.7rem; }
.sk-tag  { width: 74px; height: 22px; border-radius: var(--r-pill); margin-bottom: 1rem; }
.sk-title { height: 20px; width: 92%; }
.sk-w60 { width: 60%; }
.sk-w80 { width: 80%; }

/* ---------- Boş / hata durumu ---------- */
.state-box {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: var(--text-muted);
    animation: riseIn 0.45s var(--ease) backwards;
}
.state-box h3 { color: #fff; margin-bottom: 0.5rem; }
.state-box.is-error { color: #fca5a5; background: rgba(239, 68, 68, 0.12); border-color: rgba(248, 113, 113, 0.3); }
.state-box .retry-btn {
    margin-top: 1.1rem;
    padding: 0.55rem 1.3rem; border-radius: var(--r-pill); cursor: pointer;
    background: rgba(255, 255, 255, 0.1); border: 1px solid var(--glass-border-bright);
    font-weight: 600; transition: background var(--t-fast), transform var(--t-base) var(--ease);
}
.state-box .retry-btn:hover { background: rgba(255, 255, 255, 0.18); transform: translateY(-2px); }

/* ---------- Sayfalama: asla kadrajdan taşmaz ---------- */
.pagination {
    display: flex; justify-content: center; align-items: center;
    flex-wrap: wrap;                 /* sığmazsa alt satıra geçer, yana taşmaz */
    gap: 0.5rem;
    margin-top: 2rem;
    max-width: 100%;
    transition: opacity 0.16s ease;
}
.pagination.is-leaving { opacity: 0; }

.page-btn {
    min-width: 2.75rem; height: 2.75rem;
    padding: 0 0.85rem;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-ctl);
    cursor: pointer;
    font-weight: 500; font-size: 0.95rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28), inset 0 1px 1px rgba(255, 255, 255, 0.3);
    transition: transform var(--t-base) var(--ease), background var(--t-base), border-color var(--t-base), box-shadow var(--t-base);
}
.page-btn:hover:not(:disabled):not(.active) {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
    border-color: var(--glass-border-bright);
    transform: translateY(-2px);
}
.page-btn.active {
    background: linear-gradient(145deg, rgba(96, 165, 250, 0.55), rgba(59, 130, 246, 0.28));
    border-color: rgba(255, 255, 255, 0.48);
    color: #fff; font-weight: 700; cursor: default;
    box-shadow: 0 6px 22px rgba(59, 130, 246, 0.38), inset 0 1px 1.5px rgba(255, 255, 255, 0.65);
}
.page-btn:disabled { opacity: 0.38; cursor: not-allowed; }
.page-gap { min-width: 1.4rem; text-align: center; color: var(--text-muted); user-select: none; letter-spacing: 2px; }

/* ---------- Duyarlı ---------- */
@media (min-width: 901px) {
    /* Masaüstünde header tek satır → sticky kalabilir */
    .site-header--home { position: sticky; }
}

@media (max-width: 900px) {
    :root { --header-h: 0rem; }

    /* Mobilde header uzun (4 satır) olduğu için ekranı yemesin: takip etmesin */
    .site-header--home { position: static; }

    .header-content--home { display: flex; flex-direction: column; align-items: stretch; gap: 0.85rem; }
    .header-content--home .logo-container { justify-content: center; }
    .filters { width: 100%; }
    .filter-btn { flex: 1; padding: 0.5rem 0.4rem; }
    .action-container { width: 100%; justify-content: stretch; gap: 0.6rem; }
    .search-container { flex: 1; min-width: 0; }
    .search-input { width: 100%; }
}

@media (max-width: 520px) {
    main { margin: 1.5rem auto; padding: 0 1rem; }
    #news-container { gap: 1.25rem; }
    .rss-link-btn { padding: 0.5rem 0.95rem; }
    .rss-long { display: none; }

    .pagination { gap: 0.25rem; }
    .page-btn { min-width: 2.25rem; height: 2.5rem; padding: 0 0.45rem; border-radius: 12px; font-size: 0.9rem; }
    .page-btn .page-label { display: none; }   /* Önceki / Sonraki → sadece ok */
    .page-gap { min-width: 0.9rem; }
}
