/*
Theme Name: Motosiklet Rehberi
Theme URI: https://motorsikletrehberi.com
Author: motorsikletrehberi.com
Description: motorsikletrehberi.com için özel olarak tasarlanmış, okunabilirlik odaklı editoryal blog teması. Kategori renk kodlaması, otomatik içindekiler tablosu ve şık FAQ kartları içerir.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: motosiklet-rehberi
*/

/* ============ DESIGN TOKENS ============ */
:root {
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Outfit', 'Inter', -apple-system, sans-serif;
  --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;

  --color-bg: #FBFAF7;
  --color-surface: #FFFFFF;
  --color-text: #191714;
  --color-text-muted: #6B6660;
  --color-text-faint: #9C968D;
  --color-border: #E9E5DD;
  --color-border-strong: #DAD4C8;

  --color-accent: #D64933;
  --color-accent-dark: #B23A26;
  --color-accent-light: #FBEAE5;

  --cat-satin-alma: #D64933;
  --cat-satin-alma-bg: #FBEAE5;
  --cat-bakim-onarim: #2F6690;
  --cat-bakim-onarim-bg: #E7F0F7;
  --cat-ekipman-aksesuar: #12836B;
  --cat-ekipman-aksesuar-bg: #E4F4F0;
  --cat-ehliyet-mevzuat: #7C4DAF;
  --cat-ehliyet-mevzuat-bg: #F1E9F8;
  --cat-surus-teknikleri: #B7841E;
  --cat-surus-teknikleri-bg: #FBF2DF;
  --cat-rota-gezi: #3F8F3F;
  --cat-rota-gezi-bg: #E9F5E9;

  --max-width: 1180px;
  --content-width: 740px;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(25,23,20,0.04), 0 8px 24px rgba(25,23,20,0.06);
}

/* ============ RESET ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-accent-dark); }
ul, ol { padding-left: 1.3em; }
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 700; line-height: 1.25; color: var(--color-text); margin: 0; }
button { font-family: inherit; cursor: pointer; }

.wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 16px; z-index: 999; background: var(--color-accent); color: #fff; padding: 10px 16px; border-radius: 8px; }

/* ============ HEADER ============ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251,250,247,0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--color-border);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; padding: 16px 24px; gap: 20px; }
.site-logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-heading); font-weight: 800; font-size: 20px; color: var(--color-text); letter-spacing: -0.02em; }
.site-logo:hover { color: var(--color-text); }
.site-logo svg { flex-shrink: 0; }
.site-logo .logo-accent { color: var(--color-accent); }

.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  color: var(--color-text-muted); font-size: 14.5px; font-weight: 600; padding: 8px 14px; border-radius: 100px;
  transition: background .15s ease, color .15s ease;
}
.site-nav a:hover, .site-nav a.is-active { background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow); }
@media (max-width: 780px) {
  .site-header__inner { padding: 14px 0 14px 24px; }
  .site-nav { overflow-x: auto; flex-wrap: nowrap; padding: 0 24px 0 0; -ms-overflow-style: none; scrollbar-width: none; }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { white-space: nowrap; }
}

/* ============ HERO / PAGE HEADER ============ */
.page-hero { padding: 56px 24px 40px; text-align: center; }
.page-hero__eyebrow { color: var(--color-accent); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 10px; }
.page-hero h1 { font-size: clamp(32px, 5vw, 48px); letter-spacing: -0.02em; }
.page-hero p { color: var(--color-text-muted); font-size: 18px; max-width: 620px; margin: 14px auto 0; }

/* ============ CATEGORY FILTER PILLS ============ */
.cat-filter { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 0 24px 40px; }
.cat-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 100px; font-size: 14px; font-weight: 600;
  background: var(--color-surface); color: var(--color-text-muted); border: 1px solid var(--color-border);
  transition: all .15s ease;
}
.cat-pill:hover { border-color: var(--color-border-strong); color: var(--color-text); }
.cat-pill.is-active { background: var(--color-text); color: #fff; border-color: var(--color-text); }
.cat-pill .count { opacity: .6; font-weight: 500; }

/* ============ POST GRID / CARDS ============ */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; padding: 0 24px 64px; max-width: var(--max-width); margin: 0 auto; }
@media (max-width: 980px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .post-grid { grid-template-columns: 1fr; } }

.post-card {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius);
  display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  position: relative; overflow: hidden;
}
.post-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--card-color, var(--color-accent)); z-index: 2; }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--color-border-strong); }
.post-card__thumb { display: block; aspect-ratio: 16/10.5; overflow: hidden; background: var(--card-bg, var(--color-accent-light)); }
.post-card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.post-card:hover .post-card__thumb img { transform: scale(1.05); }
.post-card__body { padding: 26px; display: flex; flex-direction: column; gap: 14px; flex-grow: 1; }
.post-card.has-thumb::before { display: none; }
.post-card__badge {
  align-self: flex-start; font-size: 12px; font-weight: 700; letter-spacing: 0.02em;
  padding: 5px 11px; border-radius: 100px; color: var(--card-color, var(--color-accent)); background: var(--card-bg, var(--color-accent-light));
}
.post-card h2, .post-card h3 { font-size: 19px; line-height: 1.35; letter-spacing: -0.01em; }
.post-card h2 a, .post-card h3 a { color: var(--color-text); }
.post-card h2 a:hover, .post-card h3 a:hover { color: var(--card-color, var(--color-accent)); }
.post-card p { color: var(--color-text-muted); font-size: 14.5px; line-height: 1.55; margin: 0; flex-grow: 1; }
.post-card__meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--color-text-faint); margin-top: auto; padding-top: 10px; border-top: 1px solid var(--color-border); }

/* ============ PAGINATION ============ */
.pagination { display: flex; justify-content: center; gap: 8px; padding: 0 24px 64px; }
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 12px;
  border-radius: 10px; border: 1px solid var(--color-border); font-size: 14px; font-weight: 600; color: var(--color-text-muted); background: var(--color-surface);
}
.pagination a:hover { border-color: var(--color-border-strong); color: var(--color-text); }
.pagination .current { background: var(--color-text); color: #fff; border-color: var(--color-text); }

/* ============ SINGLE POST ============ */

/* -- Reading progress bar -- */
.reading-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; background: transparent; }
.reading-progress span { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--color-accent), #F2A354); transition: width .1s linear; }

/* -- Back to top -- */
.back-to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 60;
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--color-border);
  background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, background .15s ease, color .15s ease;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--color-text); color: #fff; }

/* -- Text-only header (no featured image) -- */
.single-header { padding: 48px 24px 0; }
.single-header__inner { max-width: var(--content-width); margin: 0 auto; }
.post-category-badge {
  display: inline-flex; align-items: center; font-size: 13px; font-weight: 700; letter-spacing: .02em;
  padding: 6px 14px; border-radius: 100px; margin-bottom: 18px;
  color: var(--cat-color, var(--color-accent)); background: var(--cat-bg, var(--color-accent-light));
}
.single-header h1 { font-size: clamp(30px, 4.4vw, 44px); letter-spacing: -0.02em; }
.single-header .byline { padding-bottom: 32px; border-bottom: 1px solid var(--color-border); }

/* -- Breadcrumb -- */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13.5px; color: var(--color-text-faint); margin-bottom: 22px; }
.breadcrumb a { color: var(--color-text-faint); font-weight: 500; }
.breadcrumb a:hover { color: var(--color-accent); }
.breadcrumb--on-image, .breadcrumb--on-image a { color: rgba(255,255,255,.78); }
.breadcrumb--on-image a:hover { color: #fff; }

/* -- Byline (author-style meta row) -- */
.byline { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.byline__avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: var(--color-text); color: #fff; display: flex; align-items: center; justify-content: center;
}
.byline__text { display: flex; flex-direction: column; gap: 2px; }
.byline__name { font-weight: 700; font-size: 14px; color: var(--color-text); }
.byline__meta { font-size: 13px; color: var(--color-text-muted); display: flex; gap: 6px; align-items: center; }
.byline--on-image .byline__avatar { background: rgba(255,255,255,.18); backdrop-filter: blur(6px); }
.byline--on-image .byline__name { color: #fff; }
.byline--on-image .byline__meta { color: rgba(255,255,255,.8); }

/* -- Full-bleed hero banner (has featured image) -- */
.single-hero-banner { position: relative; height: min(66vh, 580px); min-height: 380px; overflow: hidden; }
.single-hero-banner__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.single-hero-banner__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,9,7,.35) 0%, rgba(10,9,7,.05) 30%, rgba(10,9,7,.55) 72%, rgba(10,9,7,.88) 100%);
}
.single-hero-banner__content { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 24px 40px; }
.single-hero-banner__content h1 { color: #fff; font-size: clamp(28px, 4.6vw, 46px); letter-spacing: -0.02em; max-width: 880px; }
.post-category-badge--on-image { background: rgba(255,255,255,.18); color: #fff; backdrop-filter: blur(6px); }

.single-body { max-width: var(--max-width); margin: 0 auto; padding: 40px 24px 80px; }
.single-layout { display: grid; grid-template-columns: 1fr; gap: 48px; position: relative; }
.single-layout.has-toc { grid-template-columns: 220px minmax(0,1fr); }
@media (max-width: 980px) { .single-layout.has-toc { grid-template-columns: 1fr; } }

/* TOC */
.toc { position: sticky; top: 96px; align-self: start; }
.toc__title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--color-text-faint); margin-bottom: 14px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; border-left: 2px solid var(--color-border); }
.toc a {
  display: block; padding: 7px 0 7px 16px; margin-left: -2px; border-left: 2px solid transparent;
  font-size: 13.5px; color: var(--color-text-muted); font-weight: 500; line-height: 1.4;
  transition: color .15s ease, border-color .15s ease;
}
.toc a:hover { color: var(--color-text); }
.toc a.is-active { color: var(--color-accent); border-left-color: var(--color-accent); font-weight: 600; }
@media (max-width: 980px) { .toc { display: none; } }

/* Content typography */
.entry-content { max-width: var(--content-width); font-family: var(--font-serif); font-size: 19px; line-height: 1.8; color: #2A2723; }
.single-layout.has-toc .entry-content { max-width: none; }
.entry-content.has-dropcap > p:first-of-type::first-letter {
  font-family: var(--font-heading); font-weight: 800; font-size: 4.4em; line-height: .78; float: left;
  padding: .05em .09em 0 0; margin-top: .04em; color: var(--color-accent);
}
.entry-content > * + * { margin-top: 1.4em; }
.entry-content h2 { font-size: 28px; letter-spacing: -0.01em; margin-top: 2.2em; padding-top: .2em; scroll-margin-top: 96px; }
.entry-content h2:first-child { margin-top: 0; }
.entry-content h3 { font-size: 21px; margin-top: 1.8em; scroll-margin-top: 96px; }
.entry-content p { color: #2A2723; }
.entry-content strong { color: var(--color-text); font-weight: 700; }
.entry-content a { text-decoration: underline; text-decoration-color: var(--color-accent-light); text-decoration-thickness: 2px; text-underline-offset: 3px; font-weight: 600; }
.entry-content a:hover { text-decoration-color: var(--color-accent); }
.entry-content ul, .entry-content ol { padding-left: 1.5em; }
.entry-content li { margin: 0.5em 0; }
.entry-content li::marker { color: var(--color-accent); font-weight: 700; }
.entry-content blockquote {
  margin: 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--color-accent); color: var(--color-text-muted); font-style: italic;
}

/* Tables */
.entry-content table { width: 100% !important; border-collapse: collapse; font-size: 15px; margin: 0; }
.entry-content .table-scroll { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--color-border); }
.entry-content table thead tr { background: var(--color-text) !important; color: #fff !important; }
.entry-content table th { padding: 13px 16px !important; font-weight: 600; text-align: left; white-space: nowrap; }
.entry-content table td { padding: 12px 16px !important; border-top: 1px solid var(--color-border); }
.entry-content table tbody tr:nth-child(even) { background: #FAF8F4; }

/* FAQ */
.faq-section { margin-top: 1.4em; display: flex; flex-direction: column; gap: 12px; }
.faq-section > h2 { margin-bottom: .2em; }
.faq-item {
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  padding: 20px 22px;
}
.faq-item h3 {
  font-family: var(--font-body); font-size: 16.5px; font-weight: 700; color: var(--color-accent-dark);
  display: flex; align-items: center; gap: 10px; margin: 0; cursor: pointer; position: relative; padding-right: 26px;
}
.faq-item h3::before { content: "S"; flex-shrink: 0; width: 22px; height: 22px; border-radius: 6px; background: var(--color-accent-light); color: var(--color-accent); font-size: 12px; display: flex; align-items: center; justify-content: center; }
.faq-item h3::after {
  content: ""; position: absolute; right: 2px; top: 50%; width: 8px; height: 8px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; opacity: .55;
  transform: translateY(-65%) rotate(45deg); transition: transform .25s ease;
}
.faq-item.is-open h3::after { transform: translateY(-35%) rotate(-135deg); }
.faq-item p { font-size: 15.5px; line-height: 1.7; color: var(--color-text-muted); margin: 0; padding-left: 32px; }
.faq-item > div[itemprop="acceptedAnswer"] { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .28s ease, margin-top .28s ease; }
.faq-item > div[itemprop="acceptedAnswer"] > p { overflow: hidden; }
.faq-item.is-open > div[itemprop="acceptedAnswer"] { grid-template-rows: 1fr; margin-top: 10px; }

/* Share / tags footer */
.post-footer { max-width: var(--content-width); margin: 56px auto 0; padding-top: 32px; border-top: 1px solid var(--color-border); }
.post-footer__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.post-footer__tags a { font-size: 13px; font-weight: 600; padding: 7px 13px; border-radius: 100px; background: var(--color-surface); border: 1px solid var(--color-border); color: var(--color-text-muted); }
.post-footer__tags a:hover { color: var(--color-accent); border-color: var(--color-accent-light); }

/* Related posts */
.related-posts { background: var(--color-surface); border-top: 1px solid var(--color-border); padding: 64px 24px; }
.related-posts__inner { max-width: var(--max-width); margin: 0 auto; }
.related-posts h2 { font-size: 24px; margin-bottom: 26px; }

/* ============ FOOTER ============ */
.site-footer { border-top: 1px solid var(--color-border); padding: 40px 24px; margin-top: 40px; }
.site-footer__inner { max-width: var(--max-width); margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.site-footer p { color: var(--color-text-faint); font-size: 14px; margin: 0; }
.site-footer a { color: var(--color-text-muted); font-weight: 600; }

/* Empty state */
.empty-state { text-align: center; padding: 80px 24px; color: var(--color-text-muted); }

/* Screen-reader only */
.screen-reader-text { position: absolute !important; clip: rect(1px,1px,1px,1px); width: 1px; height: 1px; overflow: hidden; }
