.posts-hub, .posts-home-section { padding-block: 48px; }
.posts-hub-header { max-width: 760px; margin-bottom: 24px; }
.posts-hub-header h1, .posts-section-heading h2 { font-weight: 800; font-size: clamp(24px, 3vw, 32px); line-height: 1.7; }
.posts-hub-header p { color: #4b5b52; line-height: 1.9; }
.posts-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.posts-section-heading a { min-height: 44px; display: inline-flex; align-items: center; color: #1565c0; }
.posts-section-heading h2 { margin: 0; }
.posts-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.post-card { position: relative; min-width: 0; background: #fff; border: 1px solid #d5e2d8; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.post-card-image { display: block; overflow: hidden; aspect-ratio: 16/10; }
.post-card-image img { width: 100%; height: 100%; object-fit: cover; }
.post-card-body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.post-category-label { display: inline-block; font-size: 13px; color: #205c25; font-weight: 700; margin-bottom: 12px; }
.post-card h3, .post-card h2.post-card-heading { font-size: 20px; line-height: 1.9; font-weight: 800; margin-bottom: 12px; overflow-wrap: anywhere; }
.post-card h3 a, .post-card h2.post-card-heading a { color: #0f1f12; text-decoration: none; }
.post-card h3 a:hover, .post-card h2.post-card-heading a:hover { color: #1565c0; }
.post-card p { color: #4b5b52; font-size: 15px; line-height: 1.9; }
.post-card time { color: #4b5b52; font-size: 13px; margin-top: auto; padding-top: 12px; }
.post-card-link::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.post-card:has(.post-card-link:hover) { border-color: #2e7d32; box-shadow: 0 4px 16px #205c251a; }
.post-card:focus-within { outline: 3px solid #1565c0; outline-offset: 3px; }
.post-card--featured { border: 3px solid #2e7d32; box-shadow: 0 0 0 3px #e2eee5; }
.post-featured-mark { position: absolute; top: 12px; inset-inline-start: 12px; display: grid; place-items: center; width: 36px; height: 36px; color: white; background: #205c25; border: 2px solid white; border-radius: 50%; pointer-events: none; }
.post-featured-mark svg { width: 20px; height: 20px; fill: currentColor; }
.post-card--featured:not(:has(.post-card-image)) .post-card-body { padding-top: 58px; }
.posts-search { display: flex; gap: 12px; max-width: 700px; margin-bottom: 20px; }
.posts-search input { font-size: 16px; min-height: 48px; }
.posts-search button { min-width: 90px; }
.posts-category-nav { display: flex; flex-wrap: wrap; gap: 10px; margin-block: 20px 32px; max-height: 190px; overflow-y: auto; padding: 4px; }
.posts-category-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border: 1px solid #b9cabc; border-radius: 24px; color: #315a38; background: #fff; text-decoration: none; }
.posts-category-nav a[aria-current] { background: #2e7d32; border-color: #2e7d32; color: white; }
.post-breadcrumb { display: flex; gap: 10px; flex-wrap: wrap; font-size: 14px; line-height: 1.9; margin-bottom: 24px; }
.post-breadcrumb a { min-height: 36px; display: inline-flex; align-items: center; }
.posts-pagination { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: center; margin-top: 36px; }
.posts-pagination .btn { min-height: 44px; display: inline-flex; align-items: center; }
#homepage-posts { scroll-margin-top: 120px; }
.posts-empty { grid-column: 1/-1; padding: 40px 24px; background: #fff; border: 1px dashed #a8c1ae; border-radius: 12px; }
.posts-empty h2 { font-size: 23px; font-weight: 700; }
.posts-empty p { line-height: 1.9; color: #4b5b52; }
.post-detail-container { padding-top: 32px; max-width: 1160px; }
.public-content-page { padding-bottom: 40px; }
.public-content-page .post-detail-container > .post-article {
  padding: clamp(18px, 4vw, 44px);
  background: #fff;
  border: 1px solid #d7e4dc;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(15,31,18,.04);
}
.post-article-header { max-width: 850px; margin: 12px auto 32px; }
.post-article-header h1 { font-size: clamp(28px, 4vw, 44px); font-weight: 800; line-height: 1.7; overflow-wrap: anywhere; margin: 8px 0 20px; }
.post-introduction { font-size: 19px; line-height: 2; color: #40554a; }
.post-byline { display: flex; gap: 12px 24px; flex-wrap: wrap; color: #4b5b52; font-size: 14px; }
.post-cover { margin: 0 0 36px; }
.post-cover > img { width: 100%; height: auto; aspect-ratio: 16/9; object-fit: cover; border-radius: 12px; }
.post-article figcaption { font-size: 14px; color: #4b5b52; padding-top: 10px; line-height: 1.9; }
.post-reading-layout { max-width: 820px; margin-inline: auto; }
.post-outline { background: #edf5ef; border-inline-start: 3px solid #2e7d32; padding: 22px 28px; margin-bottom: 32px; border-radius: 8px; }
.post-outline h2 { font-size: 19px; font-weight: 700; }
.post-outline ul { list-style: disc; padding-inline-start: 24px; margin: 12px 0 0; }
.post-outline a { display: inline-block; padding-block: 7px; color: #205c25; line-height: 1.8; }
.post-outline-child { margin-inline-start: 16px; }
.post-prose { font-size: 18px; line-height: 2.15; overflow-wrap: anywhere; }
.post-prose h2, .post-prose h3, .post-prose h4, .post-prose h5, .post-prose h6 { font-weight: 800; line-height: 1.8; margin-block: 32px 16px; scroll-margin-top: 120px; }
.post-prose h2 { font-size: 27px; }.post-prose h3 { font-size: 23px; }
.post-prose p { margin-bottom: 22px; }.post-prose ul { list-style: disc; }.post-prose ol { list-style: decimal; }.post-prose ul, .post-prose ol { padding-inline-start: 28px; margin-bottom: 22px; }
.post-prose li + li { margin-top: 7px; }.post-prose img { max-width: 100%; height: auto; border-radius: 8px; }
.post-prose blockquote { border-inline-start: 3px solid #7fa38a; padding: 12px 24px; background: #f1f6f2; }
.post-prose pre { direction: ltr; overflow: auto; background: #eef2ef; padding: 16px; border-radius: 8px; }.post-prose table { display: block; overflow: auto; max-width: 100%; border-collapse: collapse; }.post-prose td, .post-prose th { padding: 10px 16px; border: 1px solid #b9cabc; }
.post-gallery-section, .post-related { margin-top: 48px; }.post-gallery-section h2, .post-related h2 { font-size: 26px; line-height: 1.8; font-weight: 800; margin-bottom: 24px; }
.post-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }.post-gallery figure { margin: 0; }.post-gallery img { width: 100%; height: auto; border-radius: 8px; }
.post-action { padding: 28px; border-radius: 12px; background: #eaf3ec; margin-top: 40px; display: flex; gap: 20px; flex-wrap: wrap; justify-content: space-between; align-items: center; }.post-action p { margin: 0; font-size: 18px; line-height: 1.9; }.post-action .btn { min-height: 48px; display: inline-flex; align-items: center; }
.post-preview-banner { padding: 16px 20px; background: #fff8e5; border: 1px solid #dfc68b; border-radius: 8px; display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.post-detail-container :focus-visible, .posts-hub :focus-visible, .posts-home-section :focus-visible { outline: 3px solid #1565c0; outline-offset: 3px; }
@media(max-width: 991px) { .posts-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.post-prose { font-size: 17px; } }
@media(max-width: 575px) { .posts-card-grid, .post-gallery { grid-template-columns: minmax(0, 1fr); }.posts-hub, .posts-home-section { padding-block: 32px; }.post-card-body { padding: 18px; }.post-introduction { font-size: 17px; }.post-byline { gap: 8px 16px; }.post-cover > img { border-radius: 8px; }.post-outline { padding: 18px; }.post-action { padding: 20px; }.post-prose h2 { font-size: 24px; }.post-prose h3 { font-size: 21px; } }

/* Home cards are deliberately shorter; the hub keeps its reading space. */
.posts-home-section { padding-block: 32px; }
.posts-home-section .posts-section-heading { margin-bottom: 18px; }
.posts-home-section .posts-section-heading h2 { font-size: clamp(22px, 2.5vw, 28px); }
.posts-home-section .posts-card-grid { gap: 18px; }
.posts-home-section .post-card-image { aspect-ratio: 16/7; }
.posts-home-section .post-card-body { padding: 16px; }
.posts-home-section .post-category-label { margin-bottom: 8px; }
.posts-home-section .post-card h3 { font-size: 18px; line-height: 1.7; margin-bottom: 8px; }
.posts-home-section .post-card h3, .posts-home-section .post-card p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.posts-home-section .post-card p { font-size: 14px; line-height: 1.8; margin-bottom: 8px; }
.posts-home-section .post-card time { padding-top: 8px; }
.home-row-footer { display: none; }
@media (max-width: 767.98px) {
  /* A leftward swipe advances the row; the cards themselves remain Persian RTL. */
  .posts-home-section .home-card-row {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: min(82%, 300px);
    gap: 14px;
    direction: ltr;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 6px;
    padding: 8px 6px 16px;
    margin-inline: -6px;
    scrollbar-width: thin;
    scrollbar-color: #9eb9a5 transparent;
  }
  .home-card-row > .post-card {
    direction: rtl;
    text-align: start;
    scroll-snap-align: start;
  }
  .home-card-row:has(> .post-card:only-child) {
    direction: rtl;
    grid-auto-columns: min(100%, 300px);
  }
  .posts-home-section .post-card-body { padding: 12px; }
  .posts-home-section .post-card-image { aspect-ratio: 16/6; }
  .posts-home-section .post-card h3 { font-size: 17px; }
  .posts-home-section .post-card p { font-size: 13px; }
  .posts-home-section .post-card time { font-size: 12px; }
  .home-row-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
  .home-row-hint { margin: 0; color: #4b5b52; font-size: 12px; line-height: 1.8; }
  .home-row-controls { display: flex; align-items: center; gap: 4px; direction: ltr; }
  .home-row-controls[hidden] { display: none; }
  .home-row-position { min-width: 44px; text-align: center; direction: rtl; font-size: 12px; color: #40554a; font-variant-numeric: tabular-nums; }
  .home-row-arrow { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; border: 1px solid #afc7b7; border-radius: 50%; background: #fff; color: #205c25; touch-action: manipulation; }
  .home-row-arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .home-row-arrow:disabled { opacity: .4; cursor: default; }
  .home-row-arrow:not(:disabled):active { background: #e4efe7; }
}
@media (hover: hover) and (pointer: fine) {
  .home-row-arrow:not(:disabled):hover { background: #edf5ef; border-color: #2e7d32; }
}
@media print {
  .home-row-footer { display: none; }
  .posts-home-section .home-card-row { display: block; overflow: visible; }
  .home-card-row > .post-card { break-inside: avoid; margin-bottom: 16px; }
}
.post-prose .post-inline-image, .report-prose .post-inline-image { display: block; margin: 16px auto; }
.post-gallery-stage { position: relative; }
.post-gallery-section.is-interactive .post-gallery { display: block; }
.post-gallery-section.is-interactive [data-gallery-slide] { margin: 0; }
.post-gallery-section.is-interactive [data-gallery-slide][hidden] { display: none; }
.post-gallery-section.is-interactive [data-gallery-open] { display: flex; align-items: center; justify-content: center; min-height: 180px; background: #eef3ef; border-radius: 10px; }
.post-gallery-section.is-interactive .post-gallery img { width: 100%; height: min(62vh, 580px); object-fit: contain; }
.post-gallery-controls[hidden], .post-gallery-counter[hidden], .post-gallery-hint[hidden] { display: none; }
.post-gallery-controls { pointer-events: none; position: absolute; inset: 0 0 auto; height: min(62vh, 580px); min-height: 180px; }
.post-gallery-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid #b9cabc; border-radius: 50%; background: #fff; color: #205c25; box-shadow: 0 2px 12px #0f1f1226; cursor: pointer; pointer-events: auto; touch-action: manipulation; }
.post-gallery-arrow svg { width: 24px; height: 24px; }
.post-gallery-arrow--left { left: 12px; }.post-gallery-arrow--right { right: 12px; }
.post-gallery-arrow:hover { background: #edf5ef; }.post-gallery-arrow:focus-visible { outline: 3px solid #1565c0; outline-offset: 3px; }
.post-gallery-counter, .post-gallery-hint { color: #4b5b52; font-size: 14px; line-height: 1.9; }.post-gallery-hint { margin-top: 12px; }
.post-gallery-viewer { padding: 64px 76px 60px; border: 0; background: #0f1f12; color: #fff; width: 100vw; height: 100dvh; max-width: 100vw; max-height: 100dvh; margin: 0; overflow: auto; }
.post-gallery-viewer::backdrop { background: #0f1f12; }
.post-gallery-viewer[open] { display: flex; align-items: center; justify-content: center; }
.post-gallery-viewer figure { width: 100%; margin: 0; text-align: center; }
.post-gallery-viewer img { display: block; width: 100%; height: calc(100dvh - 180px); object-fit: contain; margin: auto; }
.post-gallery-viewer figcaption { max-height: 80px; overflow: auto; font-size: 16px; line-height: 1.8; margin-top: 12px; overflow-wrap: anywhere; }
.post-viewer-close { position: absolute; top: max(12px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); width: 48px; height: 48px; border: 1px solid #b9cabc; border-radius: 50%; background: white; color: #205c25; font-size: 30px; line-height: 1; }
.post-viewer-close:focus-visible { outline: 3px solid #8bbdff; outline-offset: 3px; }
.post-gallery-viewer [data-viewer-counter] { position: absolute; bottom: max(12px, env(safe-area-inset-bottom)); inset-inline: 64px; text-align: center; margin: 0; }
.post-gallery-viewer .post-gallery-arrow[hidden] { display: none; }
@media(max-width: 575px) { .posts-home-section { padding-block: 24px; }.post-gallery-section.is-interactive .post-gallery img { height: min(55vh, 380px); }.post-gallery-controls { height: min(55vh, 380px); }.post-gallery-arrow--left { left: 6px; }.post-gallery-arrow--right { right: 6px; }.post-gallery-viewer { padding-inline: 10px; }.post-gallery-viewer .post-gallery-arrow { top: auto; bottom: max(12px, env(safe-area-inset-bottom)); transform: none; }.post-gallery-viewer .post-gallery-arrow--left { left: 12px; }.post-gallery-viewer .post-gallery-arrow--right { right: 12px; } }

[data-live-submit][hidden], [data-live-retry][hidden] { display: none; }
.posts-live-feedback { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-block: -8px 20px; min-height: 28px; }
.posts-live-feedback p { color: #4b5b52; font-size: 14px; line-height: 1.9; margin: 0; }
[data-live-results] { scroll-margin-top: 140px; }
[data-live-results][aria-busy=true] { opacity: .65; }
[data-live-results]:focus-visible { outline: 3px solid #1565c0; outline-offset: 4px; }
.posts-search.is-live input { flex: 1; min-width: 0; }
