/* Depremİstatistik.com — quake-list.css
   Deprem verisi yüzeyleri (tüm deprem sayfaları): özet şeridi, büyüklük renkleri ve açıklaması,
   bölmeli seçici (canlı süzgecin düğmeleri, arşivin süzgeç ve sıralama bağlantıları) ve tablo
   düzeninde deprem listesi. Canlı güncelleme durumları da buradadır (yeni satır, göreli süre,
   gecikmeli veri). Büyüklük rozetleri dolu renktir; küçük depremler sakin, büyükler belirgin.
   Renk tek başına bilgi taşımaz; değer her zaman yazılıdır. Kartın tamamı detay sayfasına
   gider. */

:root {
    --mag-lt3: #2bb673;
    --mag-3: #f2c230;
    --mag-4: #ff8a1f;
    --mag-5: #e3251e;
    --icon-depth: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 3h2v11.2l3.6-3.6 1.4 1.4-6 6-6-6 1.4-1.4 3.6 3.6zM4 20h16v2H4z'/%3E%3C/svg%3E");
    --icon-pin: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7c0 5.2 7 13 7 13s7-7.8 7-13a7 7 0 0 0-7-7zm0 9.5a2.5 2.5 0 1 1 0-5 2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E");
    --icon-locate: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21 3 3 10.5l7.4 2.1L12.5 20z'/%3E%3C/svg%3E");
}

/* Seviye: --mag-color (renk) / --mag-fill (rozet zemini) / --mag-ink (rozet yazısı) /
   --mag-text (koyu zeminde küçük yazı; yalnızca 5+'da ayrı, açık kırmızı) */
.mag-lt3 { --mag-color: var(--mag-lt3); --mag-fill: #1c5a43; --mag-ink: #c9f5e0; }
.mag-3 { --mag-color: var(--mag-3); --mag-fill: var(--mag-3); --mag-ink: #2a2000; }
.mag-4 { --mag-color: var(--mag-4); --mag-fill: var(--mag-4); --mag-ink: #2a1300; }
.mag-5 { --mag-color: var(--mag-5); --mag-text: #ff6a63; --mag-fill: var(--mag-5); --mag-ink: #fff; }

/* Renk açıklaması (istatistik grafiği ve haritalar): seviye renginde kare ve etiket */
.mag-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
    color: var(--text-muted);
}

.mag-legend li { display: inline-flex; align-items: center; gap: 7px; }
.mag-legend li::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--mag-color); }

/* Özet şeridi: tek blok, üstte turuncu şerit, hücreler çizgiyle ayrılır */
.quake-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0 0 16px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-top: 5px solid var(--accent);
    border-radius: 18px;
    background: var(--surface);
}

.stat-card { min-width: 0; padding: 14px 18px; }
.stat-card + .stat-card { border-left: 1px solid var(--line); }
.stat-card dt { font-size: 13px; font-weight: 800; color: var(--text-muted); }
.stat-card dd { margin: 2px 0 0; }
.stat-value { font-size: 30px; font-weight: 900; line-height: 1.1; color: var(--text); }
.stat-card-magnitude .stat-value { color: var(--mag-color); }
.stat-sub { font-size: 13px; line-height: 1.35; color: var(--text-muted); overflow-wrap: anywhere; }

/* Panel başlığı ve bölmeli seçici: öğeler düğme (canlı süzgeç) ya da bağlantıdır (arşiv);
   seçili öğe aria-pressed / aria-current ile, boş aralık disabled / aria-disabled ile işaretlenir */
.quake-panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-bottom: 14px;
}

.quake-panel-title { margin: 0; font-size: 20px; font-weight: 900; color: var(--text); }
.quake-panel-sync { margin: 0 0 0 auto; font-size: 14px; font-weight: 700; color: var(--text-muted); }
.is-stale .quake-panel-sync { color: var(--mag-3); }
.quake-panel-foot { margin: 12px 0 0; font-size: 14px; color: var(--text-muted); }

.quake-filter {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg);
}

.quake-filter > * {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 12px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.quake-filter > * > span { font-size: 12px; opacity: .75; }
.quake-filter > :hover:not(:disabled, [aria-disabled="true"]) { color: var(--text); }
.quake-filter > [aria-pressed="true"], .quake-filter > [aria-current="true"] { background: var(--accent-strong); color: #fff; }
.quake-filter > [aria-pressed="true"] > span, .quake-filter > [aria-current="true"] > span { opacity: 1; }
.quake-filter > :disabled, .quake-filter > [aria-disabled="true"] { opacity: .4; cursor: default; }

/* Yakınımda: konum izniyle açılan aç/kapa düğmesi; açıkken vurgu rengi çerçeve ve yazı */
.quake-near {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg);
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    color: var(--text-muted);
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease;
}

.quake-near::before {
    content: "";
    width: 14px;
    height: 14px;
    background: currentColor;
    -webkit-mask: var(--icon-locate) center / contain no-repeat;
    mask: var(--icon-locate) center / contain no-repeat;
}

.quake-near:hover { color: var(--text); }
.quake-near[aria-pressed="true"] { border-color: var(--accent); color: var(--accent-text); }
.quake-near[aria-busy="true"] { opacity: .6; cursor: progress; }

.quake-near-note { margin: -4px 0 12px; font-size: 13px; color: var(--text-muted); }

/* Veri eskiyken (panel is-stale): uyarı notu görünür, boş liste notu ("deprem yok") gizlenir;
   liste boşsa tablo da gizlenir, panelde yalnızca uyarı kalır (:has desteklemeyen tarayıcı
   yalnızca son kuralı atlar; o yüzden ayrı kural) */
.quake-stale-note { display: none; margin: -4px 0 12px; font-size: 14px; font-weight: 700; color: var(--mag-3); }
.is-stale .quake-stale-note { display: block; }
.is-stale .quake-list-empty { display: none; }
.is-stale:not(:has(.quake-row)) :is(.quake-list-head, .quake-list) { display: none; }

/* Boş liste ve Yakınımda'da yarıçap içi boş: listenin bir satırı gibi */
.quake-near-empty, .quake-list-empty { margin: 0; padding: 18px 12px; border-bottom: 1px solid var(--line); font-weight: 700; text-align: center; color: var(--text-muted); }

/* Tablo: sütun başlıkları + satırlar aynı ızgarayı paylaşır */
.quake-list-head, .quake-row {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 96px 132px;
    align-items: center;
    column-gap: 16px;
}

.quake-list-head {
    padding: 0 12px 8px;
    border-bottom: 1px solid var(--line);
    font-size: 12px;
    font-weight: 800;
    color: var(--text-muted);
}

.quake-list-head span:nth-child(n+3) { text-align: right; }

.quake-list { margin: 0; padding: 0; list-style: none; }

.quake-row {
    position: relative;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    transition: background-color .5s ease;
}

.quake-row:hover { background-color: rgba(255, 255, 255, .04); }
.quake-row:focus-within { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Canlı güncellemeyle gelen satır: kısa süre vurgulanır, sonra normale döner */
.quake-row[data-new] {
    background-color: rgba(255, 90, 54, .12);
    animation: quake-row-in .35s ease-out;
}

@keyframes quake-row-in {
    from { opacity: 0; transform: translate3d(0, -6px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}

.quake-mag {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 44px;
    border-radius: 10px;
    background: var(--mag-fill);
    color: var(--mag-ink);
    line-height: 1;
}

.quake-mag strong { font-size: 20px; font-weight: 900; }
.quake-mag small { margin-top: 2px; font-size: 10px; font-weight: 800; opacity: .8; }
.mag-5 .quake-mag small { opacity: 1; }

.quake-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.quake-place { font-size: 16px; font-weight: 800; line-height: 1.3; color: var(--text); overflow-wrap: break-word; }

.quake-link { color: inherit; text-decoration: none; }
.quake-link:focus-visible { outline: none; }
.quake-link::after { content: ""; position: absolute; inset: 0; }

.quake-nearest { --icon: var(--icon-pin); display: inline-flex; align-items: flex-start; gap: 6px; min-width: 0; font-size: 13px; color: var(--text-muted); }
.quake-distance { --icon: var(--icon-locate); display: inline-flex; align-items: flex-start; gap: 6px; font-size: 13px; color: var(--text-muted); }
.quake-distance.is-near { font-weight: 800; color: var(--accent-text); }
.quake-depth { --icon: var(--icon-depth); display: flex; justify-content: flex-end; align-items: flex-start; gap: 6px; font-size: 15px; font-weight: 700; color: var(--text); }

/* İkon görünümü ortak; ikon yalnızca content verilen yerde çizilir (derinlikte yalnızca mobilde) */
.quake-nearest::before, .quake-distance::before, .quake-depth::before {
    flex-shrink: 0;
    width: 13px;
    height: 13px;
    margin-top: .2em;
    background: currentColor;
    -webkit-mask: var(--icon) center / contain no-repeat;
    mask: var(--icon) center / contain no-repeat;
}

.quake-nearest::before, .quake-distance::before { content: ""; }

/* Sağ sütun: büyük depremlerde etiket, altında saat */
.quake-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 0; }

.quake-badge {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--mag-5);
    font-size: 11px;
    font-weight: 900;
    line-height: 1.2;
    white-space: nowrap;
    color: #fff;
}

.quake-badge.is-severe { background: #9b0f17; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); }

.quake-time { display: flex; flex-wrap: wrap; justify-content: flex-end; column-gap: 6px; text-align: right; white-space: nowrap; }
.quake-clock { flex-basis: 100%; font-size: 15px; font-weight: 800; color: var(--text); }
.quake-day, .quake-ago { font-size: 13px; color: var(--text-muted); }
.quake-ago:empty { display: none; }

@media (prefers-reduced-motion: reduce) {
    .quake-filter > *, .quake-near, .quake-row { transition: none; }
    .quake-row[data-new] { animation: none; }
}

@media (max-width: 860px) {
    .quake-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-card:nth-child(3) { border-left: 0; }
    .stat-card:nth-child(n+3) { border-top: 1px solid var(--line); }
    .stat-value { font-size: 26px; }
}

@media (max-width: 600px) {
    /* Başlık ve son kontrol üstte; büyüklük süzgeci ve Yakınımda altta, tam genişlik */
    .quake-filter, .quake-near { order: 3; width: 100%; }
    .quake-filter > * { flex: 1; justify-content: center; min-height: 38px; }
    .quake-near { min-height: 46px; }

    .quake-list-head { display: none; }
    .quake-list { border-top: 1px solid var(--line); }

    .quake-row {
        grid-template-columns: 46px minmax(0, 1fr) auto;
        grid-template-areas: "mag main side" "mag depth side";
        align-items: start;
        column-gap: 12px;
        row-gap: 2px;
        padding: 10px 8px;
    }

    .quake-mag { grid-area: mag; width: 46px; height: 42px; }
    .quake-mag strong { font-size: 18px; }
    .quake-main { grid-area: main; }
    .quake-place { font-size: 15px; }
    .quake-depth { grid-area: depth; justify-content: flex-start; font-size: 13px; font-weight: 400; color: var(--text-muted); }
    .quake-depth::before { content: ""; }
    .quake-side { grid-area: side; }
    .quake-time { flex-direction: column; align-items: flex-end; }
    .quake-clock { flex-basis: auto; font-size: 14px; }

    /* Göreli süre varken (canlı listede) gün satırı gizlenir; satır iki satıra iner */
    .quake-time:has(.quake-ago:not(:empty)) .quake-day { display: none; }
}

/* Çok dar ekran: rozet iki satıra iner, aralıklar daralır; uzun yer adları kelime ortasından bölünmez */
@media (max-width: 380px) {
    .quake-row { column-gap: 10px; }
    .quake-place { font-size: 14px; }
    .quake-badge { max-width: 72px; padding: 2px 6px; font-size: 10px; text-align: center; white-space: normal; }
}

/* En dar telefonlar (≤340 px): büyüklük kutusu ve saat küçülür, en uzun il adı tek parça sığar */
@media (max-width: 340px) {
    .quake-row { grid-template-columns: 42px minmax(0, 1fr) auto; column-gap: 8px; }
    .quake-mag { width: 42px; height: 40px; }
    .quake-mag strong { font-size: 17px; }
    .quake-clock { font-size: 13px; }
    .quake-day, .quake-ago { font-size: 12px; }
    .quake-badge { max-width: 60px; font-size: 9px; }
}
