/*
Theme Name: Haber mi Var
Theme URI: https://habermivar.com
Author: Haber mi Var
Description: Haber ve köşe yazısı derleme sitesi için modern, mobil öncelikli blok teması.
Version: 1.6.0
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: haber-mi-var
*/

/* ---------- Koyu tema: cihaz koyu modda ise renkleri değiştirir ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --wp--preset--color--bg: #0B0F17;
    --wp--preset--color--surface: #141A25;
    --wp--preset--color--ink: #EEF1F5;
    --wp--preset--color--muted: #9DA8B7;
    --wp--preset--color--line: #243044;
    --wp--preset--color--chip: #1B2333;
    --wp--preset--color--accent: #FF7A45;
    --wp--preset--color--on-accent: #1A0B04;
    --wp--preset--color--hero: #1D2736;
    --hmv-head-bg: rgba(11, 15, 23, 0.85);
  }
}
:root { --hmv-head-bg: rgba(233, 237, 242, 0.85); }
@media (prefers-color-scheme: dark) { :root { --hmv-head-bg: rgba(11, 15, 23, 0.85); } }

html { scroll-behavior: smooth; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--wp--preset--color--accent);
  outline-offset: 2px;
}
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Üst çubuk ---------- */
.hmv-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--hmv-head-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--wp--preset--color--line);
}
.admin-bar .hmv-header { top: var(--wp-admin--admin-bar--height, 0px); }
.hmv-header .wp-block-site-title a { text-decoration: none; }
.hmv-header .wp-block-search__input {
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--wp--preset--color--chip);
  color: var(--wp--preset--color--ink);
  padding: 0 16px;
}
.hmv-header .wp-block-search__button {
  min-height: 44px;
  min-width: 44px;
  border-radius: 999px;
  border: 0;
  background: var(--wp--preset--color--accent);
  color: var(--wp--preset--color--on-accent);
}

/* ---------- Kategori etiketleri: telefonda yana kayar ---------- */
ul.hmv-chips {
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 2px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
ul.hmv-chips::-webkit-scrollbar { display: none; }
.hmv-chips li { flex: 0 0 auto; margin: 0; }
.hmv-chips a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--wp--preset--color--line);
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.hmv-chips a:hover { background: var(--wp--preset--color--chip); text-decoration: none; }

/* ---------- Bölüm başlıkları ---------- */
.hmv-section-title { margin: 0; letter-spacing: -0.02em; }
.hmv-mono {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.75rem;
  color: var(--wp--preset--color--muted);
}

/* ---------- Manşet ---------- */
.hmv-hero {
  background: var(--wp--preset--color--hero);
  color: #fff;
  border-radius: 28px;
  padding: clamp(24px, 4vw, 44px);
  min-height: 340px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
}
.hmv-hero a { color: #fff; }
.hmv-hero .wp-block-post-title { font-size: clamp(1.75rem, 5vw, 2.9rem); line-height: 1.08; text-wrap: balance; margin: 0; }
.hmv-hero .wp-block-post-excerpt { color: #B7C2D0; font-size: 1.05rem; }
.hmv-hero .wp-block-post-excerpt__more-link,
.hmv-hero .wp-block-read-more {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  background: #fff;
  color: #0E1420;
  font-weight: 700;
  text-decoration: none;
}
.hmv-hero .taxonomy-category a {
  background: var(--wp--preset--color--accent);
  color: var(--wp--preset--color--on-accent);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
}

/* ---------- Kartlar ---------- */
.hmv-card {
  box-sizing: border-box;
  height: 100%;
  background: var(--wp--preset--color--surface);
  border: 1px solid var(--wp--preset--color--line);
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hmv-card .wp-block-post-title { font-size: 1.25rem; line-height: 1.25; margin: 0; text-wrap: balance; }
.hmv-card .wp-block-post-title a { text-decoration: none; }
.hmv-card .wp-block-post-title a:hover { text-decoration: underline; }
.hmv-card .wp-block-post-excerpt { color: var(--wp--preset--color--muted); font-size: 0.95rem; margin: 0; }
.hmv-card .wp-block-post-excerpt__excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}
.hmv-card .wp-block-post-date { color: var(--wp--preset--color--muted); font-size: 0.75rem; font-family: ui-monospace, Menlo, Consolas, monospace; }
.hmv-card .taxonomy-category { font-size: 0.75rem; font-weight: 700; }
.hmv-card .taxonomy-category a {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--wp--preset--color--chip);
  color: var(--wp--preset--color--ink);
  text-decoration: none;
}

.hmv-thumb { margin: -20px -20px 0; }
.hmv-thumb a { display: block; }
.hmv-thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 20px 20px 0 0;
}

/* Kategori renkleri: yazı kategorisine göre */
.category-gundem .hmv-card .taxonomy-category a { background: #E4EAFF; color: #1F3FB8; }
.category-ekonomi .hmv-card .taxonomy-category a { background: #DDF3E6; color: #14693A; }
.category-spor .hmv-card .taxonomy-category a { background: #FFE7D6; color: #A5390A; }
.category-dunya .hmv-card .taxonomy-category a { background: #E6E0FA; color: #4B35A8; }
.category-teknoloji .hmv-card .taxonomy-category a { background: #D9F1F5; color: #0B6070; }
.category-kose-yazilari .hmv-card .taxonomy-category a { background: #FBE0E8; color: #A3173F; }
@media (prefers-color-scheme: dark) {
  .category-gundem .hmv-card .taxonomy-category a { background: #1B2547; color: #A9BBFF; }
  .category-ekonomi .hmv-card .taxonomy-category a { background: #12301F; color: #8FDDAE; }
  .category-spor .hmv-card .taxonomy-category a { background: #3A1F10; color: #FFB48A; }
  .category-dunya .hmv-card .taxonomy-category a { background: #261F45; color: #BFB0FF; }
  .category-teknoloji .hmv-card .taxonomy-category a { background: #0F2F36; color: #86DCEB; }
  .category-kose-yazilari .hmv-card .taxonomy-category a { background: #3A1B26; color: #FFA9C0; }
}

/* ---------- Köşe yazıları: yatay kaydırma ---------- */
.hmv-scroller .wp-block-post-template {
  display: flex !important;
  flex-wrap: nowrap;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  padding: 0 0 4px;
  margin: 0;
  list-style: none;
}
.hmv-scroller .wp-block-post-template::-webkit-scrollbar { display: none; }
.hmv-scroller .wp-block-post-template > li {
  flex: 0 0 min(300px, 80%);
  scroll-snap-align: start;
  margin: 0;
}

/* ---------- Sayfa kenar boşlukları ---------- */
.hmv-wrap { padding-left: max(16px, 3vw); padding-right: max(16px, 3vw); }

/* ---------- Sayfalama ---------- */
.wp-block-query-pagination { gap: 12px; }
.wp-block-query-pagination a,
.wp-block-query-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  border: 1px solid var(--wp--preset--color--line);
  border-radius: 999px;
  text-decoration: none;
}
.wp-block-query-pagination .current { background: var(--wp--preset--color--ink); color: var(--wp--preset--color--bg); }

/* ---------- Alt bilgi ---------- */
.hmv-footer { border-top: 1px solid var(--wp--preset--color--line); }
.hmv-footer .wp-block-navigation a { min-height: 44px; display: inline-flex; align-items: center; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ================= Ana sayfa v1.2: manşet kaydırıcı + kategori bölümleri ================= */
.hmv-slider { position: relative; }
.hmv-slider .wp-block-post-template {
  display: flex !important;
  flex-wrap: nowrap;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.hmv-slider .wp-block-post-template::-webkit-scrollbar { display: none; }
.hmv-slider .wp-block-post-template > li { flex: 0 0 82%; margin: 0; scroll-snap-align: start; }
@media (min-width: 900px) { .hmv-slider .wp-block-post-template > li { flex-basis: 78%; } }
.hmv-slide {
  position: relative;
  box-sizing: border-box;
  height: clamp(280px, 48vw, 460px);
  border-radius: 28px;
  overflow: hidden;
  background: var(--wp--preset--color--hero);
  color: #fff;
}
.hmv-slide-img, .hmv-slide-img a { position: absolute; inset: 0; margin: 0; display: block; }
.hmv-slide-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s ease; }
.hmv-slide:hover .hmv-slide-img img { transform: scale(1.03); }
.hmv-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8,12,20,.88) 0%, rgba(8,12,20,.35) 45%, rgba(8,12,20,0) 70%);
  pointer-events: none;
}
.hmv-slide-text { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: clamp(18px, 3vw, 36px); display: flex; flex-direction: column; gap: 10px; }
.hmv-slide-text a { color: #fff; }
.hmv-slide-text .wp-block-post-title { font-size: clamp(1.35rem, 3.4vw, 2.3rem); line-height: 1.12; margin: 0; text-wrap: balance; }
.hmv-slide-text .wp-block-post-title a { text-decoration: none; }
.hmv-slide-text .wp-block-post-date { font-size: .8rem; color: #C9D2DE; font-family: ui-monospace, Menlo, Consolas, monospace; }
.hmv-slide-text .taxonomy-category a {
  background: var(--wp--preset--color--accent);
  color: var(--wp--preset--color--on-accent);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
}
.hmv-slider-ctrl { position: absolute; top: 16px; right: 16px; display: flex; gap: 8px; z-index: 5; }
.hmv-slider-ctrl button {
  width: 44px; height: 44px; border-radius: 999px; border: 0; cursor: pointer;
  background: rgba(255,255,255,.9); color: #0E1420; font-size: 1.5rem; line-height: 1;
}
.hmv-slider-ctrl button:hover { background: #fff; }

/* Bölüm başlıkları */
.hmv-section { --hmv-tone: var(--wp--preset--color--accent); }
.hmv-sec-gundem { --hmv-tone: #2F54EB; }
.hmv-sec-ekonomi { --hmv-tone: #1A9A5B; }
.hmv-sec-spor { --hmv-tone: #E8590C; }
.hmv-sec-dunya { --hmv-tone: #7048E8; }
.hmv-sec-teknoloji { --hmv-tone: #0C8599; }
.hmv-sec-head { margin-bottom: 14px; }
.hmv-sec-head .hmv-section-title { display: flex; align-items: center; gap: 12px; }
.hmv-sec-head .hmv-section-title::before { content: ""; width: 6px; height: 1.1em; border-radius: 3px; background: var(--hmv-tone); }
.hmv-sec-more { margin: 0; font-weight: 700; font-size: .9rem; }
.hmv-sec-more a { color: var(--hmv-tone); }

/* Öne çıkan + liste düzeni */
.hmv-lead-list .wp-block-post-template {
  display: grid !important;
  grid-template-columns: 1.35fr 1fr;
  gap: 12px;
  margin: 0; padding: 0; list-style: none;
}
.hmv-lead-list .wp-block-post-template > li { margin: 0; min-width: 0; }
.hmv-lead-list .wp-block-post-template > li:first-child { grid-row: 1 / span 3; }
@media (max-width: 760px) {
  .hmv-lead-list .wp-block-post-template { grid-template-columns: 1fr; }
  .hmv-lead-list .wp-block-post-template > li:first-child { grid-row: auto; }
}
/* Birinci kart: görsel üstüne yazı */
.hmv-lead-list li:first-child .hmv-card { position: relative; padding: 0; min-height: 360px; overflow: hidden; background: var(--wp--preset--color--hero); border: 0; justify-content: flex-end; }
.hmv-lead-list li:first-child .hmv-thumb { position: absolute; inset: 0; margin: 0; }
.hmv-lead-list li:first-child .hmv-thumb a, .hmv-lead-list li:first-child .hmv-thumb img { display: block; width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; border-radius: 0; }
.hmv-lead-list li:first-child .hmv-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(8,12,20,.88), rgba(8,12,20,0) 65%); pointer-events: none; }
.hmv-lead-list li:first-child .hmv-card > :not(.hmv-thumb) { position: relative; z-index: 2; margin-left: 20px; margin-right: 20px; color: #fff; }
.hmv-lead-list li:first-child .hmv-card > .wp-block-post-date { margin-bottom: 20px; color: #C9D2DE; }
.hmv-lead-list li:first-child .wp-block-post-title { font-size: clamp(1.3rem, 2.6vw, 1.8rem); }
.hmv-lead-list li:first-child .wp-block-post-title a { color: #fff; }
.hmv-lead-list li:first-child .wp-block-post-excerpt { display: none; }
/* Diğer kartlar: solda küçük görsel, sağda başlık */
.hmv-lead-list li:not(:first-child) .hmv-card { display: grid; grid-template-columns: 112px 1fr; grid-template-areas: "img title" "img date"; gap: 4px 14px; padding: 12px; align-content: center; }
.hmv-lead-list li:not(:first-child) .hmv-thumb { grid-area: img; margin: 0; align-self: start; }
.hmv-lead-list li:not(:first-child) .hmv-thumb img { aspect-ratio: 1 / 1; border-radius: 14px; }
.hmv-lead-list li:not(:first-child) .taxonomy-category, .hmv-lead-list li:not(:first-child) .wp-block-post-excerpt { display: none; }
.hmv-lead-list li:not(:first-child) .wp-block-post-title { grid-area: title; font-size: 1.02rem; }
.hmv-lead-list li:not(:first-child) .wp-block-post-date { grid-area: date; align-self: end; }
/* Görselsiz kartta boş sütun kalmasın */
.hmv-lead-list li:not(:first-child) .hmv-card:not(:has(.hmv-thumb img)) { grid-template-columns: 1fr; grid-template-areas: "title" "date"; }
.hmv-lead-list li:first-child .hmv-card:not(:has(.hmv-thumb img)) { background: var(--wp--preset--color--hero); }

/* Gazete manşetleri şeridi */
.hmv-papers { --hmv-tone: #C2255C; }
.hmv-paper-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hmv-paper-chips a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
  border: 1px solid var(--wp--preset--color--line); border-radius: 999px;
  background: var(--wp--preset--color--surface); font-weight: 700; text-decoration: none;
}
.hmv-paper-chips a:hover { background: var(--wp--preset--color--chip); }
.hmv-paper-chips .hmv-papers-all { border-color: transparent; color: var(--hmv-tone); }

/* ---------- Günün özeti kutusu ---------- */
.hmv-digest { background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--line); border-radius: 16px; padding: 20px 22px; }
.hmv-digest-title { font-size: 1.25rem; margin: 0 0 12px; }
.hmv-digest ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.hmv-digest-item { display: grid; grid-template-columns: 92px 1fr; gap: 4px 14px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--wp--preset--color--line); }
.hmv-digest-item:first-child { border-top: 0; }
.hmv-digest-cat { font-size: .75rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--hmv-tone, var(--wp--preset--color--accent)); }
.hmv-digest-item a { font-weight: 700; text-decoration: none; color: var(--wp--preset--color--ink); }
.hmv-digest-item a:hover { text-decoration: underline; }
.hmv-digest-src { grid-column: 2; font-size: .8rem; color: var(--wp--preset--color--muted); }
@media (max-width: 560px) { .hmv-digest-item { grid-template-columns: 1fr; } .hmv-digest-src { grid-column: 1; } }

/* ---------- Sol açılır menü ---------- */
.hmv-header .wp-block-site-title { margin-right: auto; }
.hmv-menu-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--wp--preset--color--line); background: var(--wp--preset--color--surface); display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; cursor: pointer; margin-right: 12px; padding: 0; }
.hmv-menu-btn span { display: block; width: 20px; height: 2px; border-radius: 2px; background: var(--wp--preset--color--ink); }
.hmv-drawer-backdrop { position: fixed; inset: 0; background: rgba(8,12,20,.5); z-index: 99; }
.hmv-drawer { position: fixed; top: 0; bottom: 0; left: 0; width: min(320px, 86vw); background: var(--wp--preset--color--surface); color: var(--wp--preset--color--ink); z-index: 100; padding: 16px 20px 32px; overflow-y: auto; box-shadow: 8px 0 30px rgba(0,0,0,.2); }
.hmv-drawer[hidden], .hmv-drawer-backdrop[hidden] { display: none; }
.hmv-drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 1.15rem; }
.hmv-menu-close { width: 44px; height: 44px; border: 0; background: transparent; color: inherit; font-size: 1.8rem; cursor: pointer; }
.hmv-drawer-label { font-size: .75rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--wp--preset--color--muted); margin: 18px 0 6px; }
.hmv-drawer ul { list-style: none; margin: 0; padding: 0; }
.hmv-drawer li a { display: block; padding: 12px 8px; border-radius: 10px; font-weight: 600; text-decoration: none; color: inherit; }
.hmv-drawer li a:hover { background: var(--wp--preset--color--chip); }
html.hmv-menu-open { overflow: hidden; }
.admin-bar .hmv-drawer, .admin-bar .hmv-drawer-backdrop { top: var(--wp-admin--admin-bar--height, 0px); }

/* ---------- Çerez onayı ---------- */
.hmv-consent { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 640px; margin: 0 auto; z-index: 200; background: var(--wp--preset--color--surface); color: var(--wp--preset--color--ink); border: 1px solid var(--wp--preset--color--line); border-radius: 16px; padding: 16px 18px; box-shadow: 0 10px 40px rgba(0,0,0,.25); display: grid; gap: 12px; }
.hmv-consent[hidden] { display: none; }
.hmv-consent p { margin: 0; font-size: .9rem; }
.hmv-consent-actions { display: flex; gap: 10px; justify-content: flex-end; }
.hmv-consent button { min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--wp--preset--color--line); background: var(--wp--preset--color--chip); color: inherit; font-weight: 700; cursor: pointer; }
.hmv-consent .hmv-consent-yes { background: var(--wp--preset--color--accent); color: var(--wp--preset--color--on-accent); border-color: transparent; }

/* ---------- Piyasa şeridi ---------- */
.hmv-markets { background: var(--wp--preset--color--surface); border: 1px solid var(--wp--preset--color--line); border-radius: 16px; padding: 12px 16px 8px; }
.hmv-markets ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; }
.hmv-markets ul::-webkit-scrollbar { display: none; }
.hmv-markets li { display: grid; gap: 2px; flex: 0 0 auto; min-width: 110px; }
.hmv-mkt-name { font-size: .72rem; font-weight: 800; letter-spacing: .04em; color: var(--wp--preset--color--muted); }
.hmv-mkt-val { font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.hmv-mkt-chg { font-size: .78rem; font-weight: 700; }
.hmv-mkt-chg.up { color: #12805C; }
.hmv-mkt-chg.down { color: #D92D20; }
.hmv-mkt-note { margin: 8px 0 0; font-size: .7rem; color: var(--wp--preset--color--muted); }
@media (prefers-color-scheme: dark) { .hmv-mkt-chg.up { color: #4ADE9B; } .hmv-mkt-chg.down { color: #FF8A80; } }
