/* =========================================================
   İSG Eğitim Sistemi — blog styles (loads after style.css)
   ========================================================= */

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.menu__link[aria-current="page"] { background: var(--blue-tint); color: var(--blue-deep); }

/* ---------- breadcrumb ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 22px; font-size: .92rem; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.crumbs [aria-current] { color: var(--ink); font-weight: 500; }
.post-hero .crumbs [aria-current] { display: inline-block; max-width: min(46ch, 100%); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

/* ---------- blog index ---------- */
.blog-hero {
  padding: clamp(32px, 5vw, 56px) 0 clamp(28px, 4vw, 44px);
  background: linear-gradient(180deg, var(--sky) 0, var(--sky) calc(100% - 80px), var(--white) 100%);
}
.blog-hero { text-align: center; }
.blog-hero .crumbs { justify-content: center; }
.blog-hero__lead { margin-inline: auto; }
.blog-search input { margin-inline: auto; display: block; }
.blog-hero .chips { justify-content: center; }
.blog-hero__title { font-size: clamp(2.3rem, 4.8vw, 3.6rem); line-height: 1.08; letter-spacing: -.02em; }
.blog-hero__lead { margin-top: 18px; max-width: 46em; font-size: 1.15rem; }
.blog-tools { margin-top: 30px; display: grid; gap: 18px; }
.blog-search input {
  width: 100%; max-width: 560px; padding: 15px 20px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--white); box-shadow: var(--shadow-sm);
  font: inherit; color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
.blog-search input::placeholder { color: var(--muted); }
.blog-search input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(2, 132, 199, .15); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--white); color: var(--ink);
  font: 600 .95rem/1.2 var(--font); cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.chip span { font-weight: 500; color: var(--muted); }
.chip:hover { border-color: var(--blue); color: var(--blue-deep); }
.chip.is-active { background: var(--blue); border-color: var(--blue); color: var(--white); }
.chip.is-active span { color: rgba(255, 255, 255, .8); }

.blog-count { margin-bottom: 20px; font-size: .95rem; color: var(--muted); }
.blog-empty { padding: 40px 0; text-align: center; color: var(--muted); }
.blog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }

/* ---------- post card ---------- */
.post-card {
  display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius);
  background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  text-decoration: none; color: inherit;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: rgba(2, 132, 199, .3); }
.post-card[hidden] { display: none; }
.post-card__media { display: block; aspect-ratio: 720 / 378; background: var(--sky); overflow: hidden; }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.post-card:hover .post-card__media img { transform: scale(1.04); }
.post-card__ph {
  display: grid; place-items: center; width: 100%; height: 100%;
  font-weight: 700; font-size: 1.1rem; color: var(--blue);
  background: linear-gradient(135deg, var(--sky) 0, var(--sky-soft) 100%);
}
.post-card__body { display: flex; flex-direction: column; gap: 10px; flex: 1; padding: 22px 24px 24px; }
.post-card__cat { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--blue); }
.post-card h2, .post-card h3 { font-size: 1.22rem; line-height: 1.28; }
.post-card:hover h2, .post-card:hover h3 { color: var(--blue-deep); }
.post-card__text {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  font-size: .98rem; line-height: 1.55; color: var(--muted);
}
.post-card__meta { margin-top: auto; padding-top: 6px; font-size: .88rem; color: var(--muted); }

/* ---------- post header ---------- */
.post-hero {
  padding: clamp(28px, 4vw, 48px) 0 clamp(72px, 9vw, 104px);
  background: linear-gradient(180deg, var(--sky) 0, var(--sky) calc(100% - 64px), var(--white) 100%);
}
.post-hero__inner { max-width: calc(980px + 2 * var(--gutter)); }
.cat-pill {
  display: inline-block; margin-bottom: 16px; padding: 6px 14px; border-radius: 999px;
  background: var(--white); box-shadow: var(--shadow-sm);
  font-size: .86rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--blue);
}
.post-title { font-size: clamp(2rem, 4.2vw, 3.2rem); line-height: 1.1; letter-spacing: -.02em; max-width: 24em; }
.post-lead { margin-top: 20px; max-width: 40em; font-size: 1.18rem; line-height: 1.6; }
.post-meta { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 10px; font-size: .95rem; color: var(--muted); }
.post-cover { max-width: 980px; margin: calc(-1 * clamp(52px, 7vw, 80px)) auto 0; position: relative; z-index: 1; }
.post-cover img {
  width: 100%; aspect-ratio: 1200 / 630; object-fit: cover;
  border-radius: var(--radius-lg); border: 4px solid var(--white); box-shadow: var(--shadow);
}
.post-cover figcaption { margin-top: 10px; font-size: .82rem; color: var(--muted); text-align: right; }
.post-cover figcaption a { color: inherit; text-underline-offset: 2px; }

/* ---------- article layout ---------- */
.post-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(32px, 5vw, 64px);
  align-items: start; max-width: calc(1120px + 2 * var(--gutter));
  padding-block: clamp(36px, 5vw, 56px) clamp(56px, 7vw, 88px);
}
.post-aside { position: sticky; top: calc(var(--topbar-h) + 24px); display: grid; gap: 20px; }
.toc { padding: 22px 22px 18px; border-radius: var(--radius); background: var(--sky-soft); border: 1px solid rgba(2, 132, 199, .14); }
.toc__title {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0;
  font-size: .82rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--blue-deep);
  list-style: none; cursor: pointer; user-select: none;
}
.toc__title::-webkit-details-marker { display: none; }
.toc__title::after {
  content: ""; flex: none; width: 9px; height: 9px; margin-right: 4px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg); transition: transform .2s;
}
.toc details[open] > .toc__title { margin-bottom: 10px; }
.toc details[open] > .toc__title::after { transform: translateY(2px) rotate(-135deg); }
@media (min-width: 992px) {
  .toc__title { cursor: default; }
  .toc__title::after { display: none; }
}
.toc ol { display: grid; gap: 2px; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a {
  display: grid; grid-template-columns: 22px 1fr; gap: 6px; padding: 7px 8px; border-radius: 10px;
  font-size: .94rem; line-height: 1.4; color: var(--text); text-decoration: none;
  transition: background-color .2s, color .2s;
}
.toc a::before { content: counter(toc); font-weight: 700; color: var(--blue-deep); }
.toc a:hover, .toc a.is-active { background: var(--white); color: var(--ink); }
.toc a.is-active { box-shadow: var(--shadow-sm); }
.aside-cta { padding: 24px; border-radius: var(--radius); background: var(--blue); color: rgba(255, 255, 255, .92); }
.aside-cta strong { display: block; font-size: 1.2rem; color: var(--white); }
.aside-cta p { margin: 6px 0 18px; font-size: .96rem; }
.aside-cta .btn { background: var(--white); color: var(--blue-deep); box-shadow: none; }
.aside-cta .btn:hover { background: var(--blue-tint); }

/* ---------- article typography ---------- */
.prose { font-size: 1.1rem; line-height: 1.78; color: var(--text); }
.prose > :first-child { margin-top: 0; }
.prose p { margin-top: 1.15em; }
.prose h2 { margin-top: 2.3em; font-size: clamp(1.55rem, 2.6vw, 2rem); line-height: 1.2; }
.prose h3 { margin-top: 1.8em; font-size: 1.28rem; }
.prose h2 + p, .prose h3 + p { margin-top: .8em; }
.prose strong { color: var(--ink); font-weight: 650; }
.prose a { color: var(--blue-deep); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { color: var(--blue); }
.prose code { padding: 2px 6px; border-radius: 6px; background: var(--sky-soft); font-size: .92em; color: var(--ink); }
.prose ul, .prose ol { margin-top: 1.1em; display: grid; gap: .55em; }
.prose li { position: relative; padding-left: 1.6em; }
.prose ul > li::before { content: ""; position: absolute; left: .35em; top: .72em; width: 7px; height: 7px; border-radius: 50%; background: var(--blue-bright); }
.prose ol { counter-reset: item; }
.prose ol > li { counter-increment: item; padding-left: 2.2em; }
.prose ol > li::before {
  content: counter(item); position: absolute; left: 0; top: .12em; display: grid; place-items: center;
  width: 1.6em; height: 1.6em; border-radius: 50%; background: var(--blue-tint);
  font-size: .85em; font-weight: 700; line-height: 1; color: var(--blue-deep);
}

.table-wrap { margin-top: 1.5em; overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); box-shadow: var(--shadow-sm); -webkit-overflow-scrolling: touch; }
.prose table { width: 100%; min-width: 540px; border-collapse: collapse; font-size: .98rem; line-height: 1.5; }
.prose th, .prose td { padding: 13px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose th { background: var(--sky-soft); font-weight: 700; color: var(--ink); white-space: nowrap; }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose tbody tr:nth-child(even) td { background: #fafcfe; }
.prose td:first-child { font-weight: 600; color: var(--ink); }

.callout { margin-top: 1.6em; padding: 18px 22px; border-radius: var(--radius-sm); border-left: 4px solid var(--blue); background: var(--sky-soft); font-size: 1.02rem; line-height: 1.7; }
.callout p { margin: 0; }
.callout p + p { margin-top: .7em; }
.callout__title { margin-bottom: 4px !important; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--blue-deep); }
.callout--dikkat { border-color: #e8a317; background: #fff8e8; }
.callout--dikkat .callout__title { color: #9a6a00; }
.callout--mevzuat { border-color: #4b5fd6; background: #f0f2ff; }
.callout--mevzuat .callout__title { color: #3a49b0; }
.callout--ornek { border-color: #1d7a47; background: #eef9f2; }
.callout--ornek .callout__title { color: var(--ok); }
.quote { margin: 1.4em 0 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--blue-bright); color: var(--ink); font-size: 1.02rem; line-height: 1.7; }
.quote p { margin: 0; }
.quote p + p { margin-top: .6em; }
.callout--vedubox { border-color: var(--blue-bright); background: linear-gradient(135deg, var(--blue-tint) 0, var(--sky-soft) 100%); }
.callout--vedubox .callout__title { color: var(--blue-deep); }
.callout--vedubox a { font-weight: 600; }
.callout--not { border-color: #8592ab; background: #f4f6fa; }
.callout--not .callout__title { color: var(--muted); }

.inline-cta {
  margin-top: 2em; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px;
  padding: 22px 26px; border-radius: var(--radius); background: linear-gradient(135deg, var(--blue-tint) 0, var(--sky) 100%);
  border: 1px solid rgba(2, 132, 199, .18);
}
.inline-cta div { display: grid; gap: 4px; flex: 1 1 280px; }
.inline-cta strong { font-size: 1.15rem; color: var(--ink); }
.inline-cta span { font-size: .98rem; line-height: 1.5; color: var(--text); }
.prose .inline-cta .btn { color: var(--white); text-decoration: none; }

/* ---------- end-of-article call to action ---------- */
.post-cta {
  margin-top: clamp(40px, 6vw, 64px); padding: clamp(28px, 4vw, 44px); border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--blue) 0, var(--blue-deep) 100%); color: rgba(255, 255, 255, .92);
}
.post-cta h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); color: var(--white); }
.post-cta p { margin-top: 12px; max-width: 38em; }
.post-cta__actions { margin-top: 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; }
.post-cta .btn { background: var(--white); color: var(--blue-deep); box-shadow: none; }
.post-cta .btn:hover { background: var(--blue-tint); }
.post-cta__link { color: var(--white); font-weight: 600; text-underline-offset: 4px; }

.related .blog-grid { margin-top: 0; }
.related__all { margin-top: 36px; text-align: center; }

/* ---------- responsive ---------- */
@media (max-width: 991px) {
  .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .post-layout { grid-template-columns: minmax(0, 1fr); }
  .post-aside { position: static; order: -1; }
  .aside-cta { display: none; }
  .post-cover figcaption { text-align: left; }
}
@media (max-width: 991px) {
  .toc { padding: 4px 22px; }
  .toc__title { min-height: 48px; }
  .toc details[open] { padding-bottom: 12px; }
}
@media (max-width: 640px) {
  .blog-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(-1 * var(--gutter)); padding: 2px var(--gutter) 8px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .blog-hero .chips { justify-content: flex-start; }
  .prose { font-size: 1.05rem; }
  .post-cover img { border-width: 3px; border-radius: var(--radius); }
}
@media print {
  .topbar, .post-aside, .post-cta, .related, .site-foot, .inline-cta { display: none !important; }
}
