/* KafClub Journal: index + article details */
:root {
  --kaf-green: #0F3D3E;
  --kaf-green-2: #0F766E;
  --kaf-gold: #D4A017;
  --cream: #FBF7F0;
  --paper: #fff;
  --ink: #242523;
  --muted: #777a75;
  --line: #ece8e0;
  --soft: #f5f1e9;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: #f6f4ef;
  font-family: "Vazirmatn", Tahoma, sans-serif;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.site-shell { width: min(1200px, calc(100% - 36px)); margin: 38px auto 64px; }

/* Shared hero */
.blog-hero {
  position: relative;
  display: flex;
  min-height: 245px;
  align-items: center;
  overflow: hidden;
  padding: 38px 54px;
  border-radius: 18px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(9,28,27,.82), rgba(9,28,27,.55)),
    url("https://images.unsplash.com/photo-1445116572660-236099ec97a0?auto=format&fit=crop&w=1800&q=85") center 48%/cover;
}
.blog-hero__content { position: relative; z-index: 1; max-width: 620px; }
.eyebrow { margin: 0 0 8px; color: #d7a943; font: 700 11px Arial,sans-serif; letter-spacing: 3px; }
.blog-hero h1 { margin: 0; font-size: clamp(30px,4vw,42px); font-weight: 800; }
.blog-hero p { margin: 8px 0 20px; color: rgba(255,255,255,.84); font-size: 15px; }
.blog-hero__decoration { position: absolute; left: 7%; top: 50%; color: rgba(255,255,255,.13); font-size: 150px; transform: translateY(-50%) rotate(-12deg); }
.hero-search { display: flex; width: min(430px,100%); height: 48px; padding: 5px; border-radius: 9px; background: #fff; }
.hero-search input { flex: 1; min-width: 0; padding: 0 13px; border: 0; outline: 0; color: var(--ink); font: inherit; font-size: 13px; }
.hero-search button { width: 39px; border: 0; border-radius: 7px; color: #fff; background: var(--kaf-green); font-size: 25px; cursor: pointer; }

/* Index layout */
.blog-layout { display: grid; grid-template-columns: 265px minmax(0,1fr); gap: 25px; align-items: start; margin-top: 28px; }
.blog-sidebar, .articles-content { min-width: 0; }
.blog-sidebar { position: sticky; top: 22px; padding: 23px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); box-shadow: 0 7px 22px rgba(30,35,28,.035); }
.sidebar-heading { display: flex; align-items: center; gap: 9px; }
.sidebar-heading h2 { margin: 0; font-size: 17px; font-weight: 800; }
.sidebar-heading__icon { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 8px; color: var(--kaf-green); background: #edf3ef; font-size: 20px; }
.sidebar-hint { margin: 9px 0 17px; color: var(--muted); font-size: 12px; }
.category-filter { display: grid; gap: 5px; }
.category-filter__link { display: flex; min-height: 43px; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 8px; color: #555a55; font-size: 13px; transition: .2s ease; }
.category-filter__link:hover, .category-filter__link.is-active { color: var(--kaf-green); background: #eff5f1; }
.category-filter__link.is-active { font-weight: 700; }
.category-count { display: inline-flex; min-width: 27px; height: 24px; align-items: center; justify-content: center; padding: 0 6px; border-radius: 20px; color: #777; background: #f2f0eb; font-size: 11px; font-weight: 600; }
.is-active .category-count { color: #fff; background: var(--kaf-green); }
.sidebar-note { margin-top: 23px; padding: 15px; border-radius: 10px; background: var(--cream); }
.sidebar-note__icon { color: var(--kaf-gold); font-size: 18px; }
.sidebar-note strong { display: block; margin-top: 5px; font-size: 13px; }
.sidebar-note p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.9; }

.content-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 0 0 17px; }
.eyebrow--green { color: var(--kaf-green-2); letter-spacing: 1px; }
.content-toolbar h2 { margin: 0; font-size: 23px; font-weight: 800; }
.sort-control { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.sort-control select { min-width: 112px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; outline-color: var(--kaf-green-2); color: #4b4d49; background: #fff; font: inherit; font-size: 12px; }

.featured-article { display: grid; grid-template-columns: 42% 1fr; overflow: hidden; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.featured-article__image { min-height: 255px; overflow: hidden; }
.featured-article__image img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.featured-article__image:hover img, .article-card__image:hover img { transform: scale(1.045); }
.featured-article__body { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 23px 25px; }
.article-tag { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 5px; color: var(--kaf-green-2); background: #edf5f0; font-size: 11px; font-weight: 700; }
.featured-article h3 { margin: 12px 0 8px; font-size: 20px; line-height: 1.8; }
.featured-article h3 a:hover, .article-card h3 a:hover { color: var(--kaf-green-2); }
.featured-article p, .article-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 2.1; }
.article-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 14px; color: #92938e; font-size: 10px; }
.article-meta i, .detail-meta i { width: 3px; height: 3px; border-radius: 50%; background: #b8b8b1; }
.read-more { display: inline-flex; align-items: center; gap: 9px; margin-top: 16px; color: var(--kaf-green); font-size: 12px; font-weight: 700; }
.read-more span { font-size: 18px; transition: transform .2s ease; }
.read-more:hover span { transform: translateX(-4px); }

.articles-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 17px; }
.article-card { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; transition: transform .2s ease, box-shadow .2s ease; }
.article-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(30,35,28,.07); }
.article-card__image { display: block; height: 180px; overflow: hidden; background: #e8e1d5; }
.article-card__image img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.article-card__body { padding: 15px 16px 17px; }
.article-card h3 { min-height: 54px; margin: 9px 0 5px; font-size: 15px; line-height: 1.8; }
.article-card p { min-height: 50px; }
.article-card .article-meta { margin-top: 12px; }
.article-card .read-more { margin-top: 11px; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 28px; }
.pagination a { display: grid; min-width: 35px; height: 35px; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: #666; background: #fff; font-size: 12px; }
.pagination a:hover, .pagination a.is-current { border-color: var(--kaf-green); color: #fff; background: var(--kaf-green); }
.pagination .pagination__arrow { font-size: 17px; }
.pagination .is-disabled { opacity: .4; pointer-events: none; }
.pagination__dots { padding: 0 3px; color: #888; }

/* Article details */
.article-detail-layout { display: grid; grid-template-columns: minmax(0,1fr) 285px; gap: 27px; align-items: start; }
.article-detail { min-width: 0; padding: 28px 34px 35px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-bottom: 24px; color: #999a94; font-size: 11px; }
.breadcrumbs a:hover { color: var(--kaf-green-2); }
.detail-header h1 { margin: 13px 0 9px; font-size: clamp(25px,3vw,34px); font-weight: 800; line-height: 1.8; }
.detail-lead { margin: 0; color: #737771; font-size: 14px; line-height: 2.2; }
.detail-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 19px; color: #898b85; font-size: 11px; }
.author-avatar { display: inline-grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; color: #fff; background: var(--kaf-green); font-size: 14px; font-weight: 700; }
.detail-cover { margin: 25px 0 26px; }
.detail-cover img { width: 100%; max-height: 440px; aspect-ratio: 16/9; border-radius: 12px; object-fit: cover; }
.detail-cover figcaption { margin-top: 8px; color: #999a94; font-size: 10px; text-align: center; }
.article-body { color: #4e514d; font-size: 14px; line-height: 2.35; }
.article-body p { margin: 0 0 18px; }
.article-body h2 { margin: 30px 0 10px; color: #202522; font-size: 20px; font-weight: 800; line-height: 1.8; }
.article-callout { margin: 22px 0; padding: 16px 19px; border-right: 3px solid var(--kaf-gold); border-radius: 8px 0 0 8px; background: var(--cream); }
.article-callout strong { color: var(--kaf-green); font-size: 13px; }
.article-callout p { margin: 5px 0 0; font-size: 13px; }
.article-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); color: #777; font-size: 11px; }
.article-tags a { padding: 6px 10px; border-radius: 20px; color: var(--kaf-green); background: #eff5f1; }
.article-author { display: flex; align-items: center; gap: 13px; margin-top: 23px; padding: 17px; border: 1px solid var(--line); border-radius: 10px; background: #fdfcf9; }
.author-avatar--large { width: 45px; height: 45px; font-size: 19px; }
.article-author strong { font-size: 13px; }
.article-author p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.related-articles { margin-top: 34px; }
.related-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.related-heading h2 { margin: 0; font-size: 19px; }
.related-heading > a { color: var(--kaf-green-2); font-size: 11px; }
.related-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.related-card { overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 12px; font-weight: 700; line-height: 1.8; }
.related-card img { width: 100%; height: 115px; object-fit: cover; }
.related-card span { display: block; padding: 10px 12px; }

.detail-sidebar { position: sticky; top: 22px; display: grid; gap: 15px; }
.detail-side-card { padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.detail-side-card h2 { margin: 0 0 13px; font-size: 15px; }
.toc { display: grid; gap: 3px; }
.toc a { padding: 8px 9px; border-radius: 6px; color: #666b65; font-size: 11px; line-height: 1.8; }
.toc a::before { content: "•"; margin-left: 8px; color: var(--kaf-gold); }
.toc a:hover { color: var(--kaf-green); background: #eff5f1; }
.side-cta { text-align: center; background: var(--cream); }
.side-cta__icon { display: grid; width: 43px; height: 43px; place-items: center; margin: 0 auto 10px; border-radius: 50%; color: var(--kaf-gold); background: #fff; font-size: 22px; }
.side-cta h2 { font-size: 15px; line-height: 1.8; }
.side-cta p { margin: 0 0 14px; color: var(--muted); font-size: 11px; line-height: 2; }
.side-cta > a { display: block; padding: 10px; border-radius: 7px; color: #fff; background: var(--kaf-green); font-size: 11px; font-weight: 700; }
.back-to-articles { display: block; padding: 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--kaf-green); background: #fff; font-size: 12px; text-align: center; }

/* Responsive */
@media (max-width: 980px) {
  .blog-layout { grid-template-columns: 225px minmax(0,1fr); gap: 18px; }
  .article-detail-layout { grid-template-columns: minmax(0,1fr) 245px; gap: 18px; }
  .article-detail { padding: 25px; }
  .featured-article { grid-template-columns: 38% 1fr; }
  .featured-article__body { padding: 18px; }
}
@media (max-width: 760px) {
  .site-shell { width: min(100% - 24px, 620px); margin: 20px auto 40px; }
  .blog-hero { min-height: 225px; padding: 30px 25px; border-radius: 13px; }
  .blog-hero__decoration { left: 2%; font-size: 105px; }
  .blog-hero p { max-width: 390px; font-size: 13px; line-height: 2; }
  .blog-layout, .article-detail-layout { grid-template-columns: 1fr; }
  .blog-sidebar, .detail-sidebar { position: static; }
  .blog-sidebar { padding: 17px; }
  .category-filter { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .category-filter__link { font-size: 12px; }
  .sidebar-note { display: none; }
  .articles-content { margin-top: 5px; }
  .detail-sidebar { grid-template-columns: 1fr 1fr; }
  .detail-sidebar .back-to-articles { grid-column: 1/-1; }
}
@media (max-width: 540px) {
  .site-shell { width: calc(100% - 20px); margin-top: 12px; }
  .blog-hero { min-height: 220px; padding: 25px 18px; }
  .blog-hero h1 { font-size: 29px; }
  .blog-hero p { max-width: 290px; font-size: 12px; }
  .blog-hero__decoration { left: -12px; font-size: 82px; }
  .content-toolbar { align-items: flex-start; }
  .content-toolbar h2 { font-size: 20px; }
  .sort-control { flex-direction: column; align-items: flex-start; gap: 4px; }
  .sort-control select { min-width: 95px; padding: 7px; }
  .featured-article { grid-template-columns: 1fr; }
  .featured-article__image { min-height: 190px; height: 190px; }
  .featured-article__body { padding: 17px; }
  .featured-article h3 { font-size: 17px; }
  .articles-grid { grid-template-columns: 1fr; gap: 13px; }
  .article-card { display: grid; grid-template-columns: 116px minmax(0,1fr); }
  .article-card__image { height: 100%; min-height: 175px; }
  .article-card__body { padding: 11px; }
  .article-card h3 { min-height: 0; margin: 7px 0 4px; font-size: 13px; }
  .article-card p { display: none; }
  .article-card .article-meta { gap: 6px; margin-top: 9px; font-size: 9px; }
  .article-card .read-more { margin-top: 8px; font-size: 11px; }
  .category-filter { grid-template-columns: 1fr 1fr; }
  .category-filter__link { padding: 7px; font-size: 11px; }
  .category-count { min-width: 23px; height: 21px; font-size: 10px; }
  .article-detail { padding: 18px 15px 24px; }
  .breadcrumbs { gap: 6px; margin-bottom: 18px; font-size: 10px; }
  .detail-header h1 { font-size: 24px; line-height: 1.75; }
  .detail-lead { font-size: 12px; }
  .detail-meta { gap: 7px; font-size: 10px; }
  .detail-cover { margin: 20px 0; }
  .article-body { font-size: 13px; }
  .article-body h2 { font-size: 18px; }
  .detail-sidebar { grid-template-columns: 1fr; }
  .detail-sidebar .back-to-articles { grid-column: auto; }
  .related-heading h2 { font-size: 17px; }
  .related-heading > a { font-size: 10px; }
  .related-grid { gap: 9px; }
  .related-card { font-size: 11px; }
  .related-card img { height: 90px; }
  .pagination { gap: 5px; }
  .pagination a { min-width: 31px; height: 32px; }
}
