/* ==========================================================================
   Sandeloos — journal (listing + article pages)
   Builds on styles.css. Phone first; tablet ≥ 768px, laptop ≥ 1200px.
   ========================================================================== */

.journal-page main { background: var(--bg); }

/* ---------- Breadcrumb ---------- */
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--ink-2); font-weight: 600; }
.crumbs a:hover { color: var(--blue); }
.crumbs [aria-current] { color: var(--muted); }
.crumb-sep { width: 14px; height: 14px; color: var(--muted-2); }

/* ---------- Listing: hero, tools ---------- */
.j-hero { background: var(--surface); padding: 22px 0 26px; border-bottom: 1px solid var(--line-2); }
.j-hero h1 { font-family: var(--font-display); font-size: 32px; line-height: 1.7; margin-top: 12px; }
.j-lead { color: var(--muted); font-size: 15px; line-height: 2.05; margin-top: 6px; max-width: 640px; }
.j-tools { display: grid; gap: 14px; margin-top: 20px; }
.j-search { position: relative; }
.j-search .icon { position: absolute; top: 50%; right: 16px; transform: translateY(-50%); color: var(--muted); width: 20px; height: 20px; pointer-events: none; }
.j-search input {
  width: 100%; min-height: 52px; padding: 12px 48px 12px 16px; border-radius: 16px;
  border: 1.5px solid var(--line); background: #fff; outline: none; transition: border-color .2s, box-shadow .2s;
}
.j-search input:focus { border-color: #9db8f2; box-shadow: 0 0 0 4px rgba(45, 106, 224, .1); }
.j-chips { margin-bottom: 0; }
.j-chips .chip small { color: var(--muted); font-weight: 500; }
.j-chips .chip.is-active small { color: rgba(255, 255, 255, .75); }

/* ---------- Listing: featured ---------- */
.j-featured {
  display: grid; gap: 0; margin-top: 26px; background: #fff; border: 1px solid var(--line-2);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm);
}
.j-featured-media { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; }
.j-featured-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.j-featured:hover .j-featured-media img { transform: scale(1.03); }
.j-featured-body { padding: 18px; display: grid; gap: 8px; justify-items: start; }
.j-featured-body h2 { font-family: var(--font-display); font-size: 24px; line-height: 1.7; }
.j-featured-body h2 a:hover { color: var(--blue); }
.j-featured-body p { color: var(--muted); font-size: 14.5px; line-height: 2; }
.j-featured-body .btn { margin-top: 6px; }

/* ---------- Cards ---------- */
.j-list { margin-top: 34px; }
.j-list-title { font-family: var(--font-head); font-size: 20px; display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.j-list-title small { font-size: 13px; color: var(--muted); font-weight: 500; }
.j-grid { display: grid; gap: 16px; }
.j-card {
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line-2);
  border-radius: 22px; overflow: hidden; transition: box-shadow .25s, transform .25s;
}
.j-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.j-card-media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.j-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.j-card:hover .j-card-media img { transform: scale(1.04); }
.j-card-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; flex: 1; }
.j-card-body h3 { font-size: 16.5px; line-height: 1.85; }
.j-card-body h3 a:hover { color: var(--blue); }
.j-card-body p { color: var(--muted); font-size: 13.5px; line-height: 2; }
.j-card-body time { margin-top: auto; padding-top: 6px; font-size: 12px; color: var(--muted); }
.j-empty { background: #fff; border: 1px dashed #d4daea; border-radius: 18px; padding: 18px; color: var(--muted); }
.j-cta { margin-block: 40px 8px; }

/* ---------- Article ---------- */
.read-progress { position: fixed; top: 0; inset-inline: 0; height: 3px; z-index: 60; pointer-events: none; }
.read-progress i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--gold-2), var(--orange)); transform: scaleX(0); transform-origin: right; }

.post-head { padding-top: 22px; display: grid; gap: 10px; justify-items: start; }
.post-cat { margin-top: 8px; font-size: 13px; }
.post-cat:hover { text-decoration: underline; }
.post-head h1 { font-family: var(--font-display); font-size: 30px; line-height: 1.7; max-width: 820px; }
.post-excerpt { color: var(--muted); font-size: 16px; line-height: 2.05; max-width: 720px; }
.post-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; color: var(--muted); }
.post-meta span { display: inline-flex; align-items: center; gap: 6px; }
.post-meta .icon { width: 16px; height: 16px; }
.post-cover { margin-top: 20px; }
.post-cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-lg); box-shadow: var(--shadow); }

.post-layout { display: grid; gap: 22px; margin-top: 26px; }
.toc details { background: #fff; border: 1px solid var(--line-2); border-radius: 18px; padding: 12px 16px; }
.toc summary { cursor: pointer; font-weight: 700; font-size: 14.5px; list-style-position: inside; }
.toc ol { list-style: persian; padding-inline-start: 22px; margin-top: 8px; display: grid; gap: 4px; }
.toc a { display: block; font-size: 13.5px; line-height: 1.9; color: var(--ink-2); padding: 2px 0; }
.toc a:hover, .toc a.is-active { color: var(--blue); }
.toc a.is-active { font-weight: 700; }

.post-main { min-width: 0; }
.prose { font-size: 16.5px; line-height: 2.2; color: var(--ink-2); max-width: 70ch; }
.prose > * + * { margin-top: 18px; }
.prose h2 { font-family: var(--font-display); font-size: 24px; line-height: 1.7; color: var(--ink); margin-top: 40px; scroll-margin-top: calc(var(--header-h) + 20px); }
.prose h3 { font-size: 18px; margin-top: 28px; }
.prose strong { color: var(--ink); }
.prose a { color: var(--blue); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose ul, .prose ol { padding-inline-start: 24px; display: grid; gap: 8px; }
.prose ul { list-style: disc; }
.prose ol { list-style: persian; }
.prose li::marker { color: var(--orange-600); font-weight: 700; }
.tip {
  display: grid; gap: 4px; background: #fff7e8; border: 1px solid #ffe2a8; border-radius: 16px; padding: 14px 16px;
  font-size: 15px; line-height: 2.05; color: #5c3f07;
}
.tip strong { color: #8a5a00; font-size: 14px; }
.post-figure { margin-inline: 0; }
.post-figure img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 18px; }
.post-figure figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }

.service-cta {
  display: grid; gap: 14px; margin-top: 34px; color: #fff; border-radius: 22px; padding: 20px;
  background: radial-gradient(circle at 0% 100%, rgba(255, 122, 26, .35), transparent 55%), var(--night);
}
.service-cta strong { display: block; font-family: var(--font-head); font-size: 18px; line-height: 1.8; }
.service-cta span { font-size: 13.5px; color: rgba(255, 255, 255, .8); }
.service-cta .btn { justify-self: start; }

.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 24px; font-size: 13.5px; color: var(--muted); }
.share > span { width: 100%; }
.share-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 12px;
  background: #fff; border: 1px solid var(--line); color: var(--ink); font-weight: 600; font-size: 13.5px;
  transition: box-shadow .2s, border-color .2s;
}
.share-btn:hover { box-shadow: var(--shadow-sm); border-color: #c4cde4; }
.share-btn .icon { width: 17px; height: 17px; }

.post-nav { display: grid; gap: 10px; margin-top: 28px; }
.post-nav-item {
  display: grid; gap: 4px; background: #fff; border: 1px solid var(--line-2); border-radius: 18px; padding: 14px 16px;
  transition: box-shadow .2s, transform .2s;
}
.post-nav-item:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.post-nav-item small { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.post-nav-item small .icon { width: 15px; height: 15px; }
.post-nav-item strong { font-size: 15px; line-height: 1.8; }

.related { margin-block: 48px 16px; }
.related-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.related-head h2 { font-family: var(--font-display); font-size: 24px; }

/* ==========================================================================
   Tablet ≥ 768px
   ========================================================================== */
@media (min-width: 768px) {
  .j-hero { padding: 30px 0 34px; }
  .j-hero h1 { font-size: 40px; }
  .j-tools { grid-template-columns: minmax(260px, 1fr) auto; align-items: center; }
  .j-chips { flex-wrap: wrap; }
  .j-featured { grid-template-columns: 1.1fr 1fr; align-items: center; }
  .j-featured-media { aspect-ratio: auto; height: 100%; min-height: 300px; }
  .j-featured-body { padding: 28px; }
  .j-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .post-head { padding-top: 30px; }
  .post-head h1 { font-size: 38px; }
  .service-cta { grid-template-columns: 1fr auto; align-items: center; padding: 24px 28px; }
  .service-cta .btn { justify-self: end; }
  .share > span { width: auto; margin-inline-end: 6px; }
  .post-nav { grid-template-columns: 1fr 1fr; }
  .post-nav-item:only-child.is-older { grid-column: 2; }
}

/* ==========================================================================
   Laptop ≥ 1200px
   ========================================================================== */
@media (min-width: 1200px) {
  .j-hero { padding: 40px 0 44px; }
  .j-hero h1 { font-size: 50px; }
  .j-featured-body { padding: 40px; }
  .j-featured-body h2 { font-size: 30px; }
  .j-grid { grid-template-columns: repeat(3, 1fr); gap: 24px; }
  .post-head h1 { font-size: 46px; }
  .post-cover img { aspect-ratio: 21 / 9; }
  .post-layout { grid-template-columns: 260px minmax(0, 1fr); gap: 56px; margin-top: 40px; }
  .toc { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; }
  .toc summary { pointer-events: none; list-style: none; }
  .toc summary::-webkit-details-marker { display: none; }
  .prose { font-size: 17.5px; }
}
