/* ============================================================================
 * NEWS  —  Khorraman  (gallery .khr-news, single .khr-single)
 * Brand system: deep green (#016644) + lime (#D8E41F) on a soft mint canvas,
 * matching css/blog-page.css and css/category-page.css.
 * RTL (fa) + LTR (en/ru) via logical properties.
 * ========================================================================== */

.khr-news,
.khr-single {
  --khr-lime: #D8E41F;
  --khr-green: #099B55;
  --khr-green2: #13c06b;
  --khr-deep: #016644;
  --khr-forest: #015134;
  --khr-bg: #f6fbf8;
  --khr-card: #fff;
  --khr-border: #d7e4dd;
  --khr-text: #173325;
  --khr-muted: #5f6e66;
  --khr-shadow: 0 14px 28px rgba(1, 81, 52, .10);
  --khr-shadow-lg: 0 22px 44px rgba(1, 81, 52, .18);
  --khr-radius: 20px;
  color: var(--khr-text);
  background: var(--khr-bg);
  box-sizing: border-box;
}

.khr-news *,
.khr-single * {
  box-sizing: border-box;
}

.khr-news__srOnly {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ======================================================================
 * GALLERY — HERO
 * ==================================================================== */

.khr-news__hero {
  position: relative;
  overflow: hidden;
  background: radial-gradient(120% 160% at 100% 0%, #0b7d4a 0%, #016644 45%, #013c27 100%);
  background-size: cover;
  background-position: center;
  color: #fff;
}

.khr-news__hero:after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--khr-lime), var(--khr-green), var(--khr-lime));
  z-index: 3;
}

.khr-news__heroOverlay {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.khr-news__hero--img .khr-news__heroOverlay {
  background: linear-gradient(180deg, rgba(1, 60, 39, .82) 0%, rgba(1, 81, 52, .88) 60%, rgba(1, 45, 29, .95) 100%);
}

.khr-news__heroInner {
  position: relative;
  z-index: 2;
  width: 95%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 118px 0 54px;
}

.khr-news__crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: .84rem;
  margin-bottom: 20px;
  color: #cfeede;
}

.khr-news__crumbs a {
  color: #cfeede;
  text-decoration: none;
  transition: color .2s ease;
}

.khr-news__crumbs a:hover {
  color: var(--khr-lime);
}

.khr-news__crumbCurrent {
  color: #fff;
  font-weight: 600;
  max-width: 46ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.khr-news__kicker {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--khr-lime);
  background: rgba(216, 228, 31, .14);
  border: 1px solid rgba(216, 228, 31, .35);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.khr-news__pageTitle {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.15;
}

.khr-news__lead {
  margin-top: 14px;
  max-width: 660px;
  font-size: 1.03rem;
  line-height: 1.75;
  color: #eafff5;
  opacity: .95;
}

.khr-news__lead p {
  margin: 0 0 8px;
}

.khr-news__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 24px;
}

.khr-news__stat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .88rem;
  color: #dff6ea;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .16);
  padding: 7px 14px;
  border-radius: 999px;
}

.khr-news__stat strong {
  color: var(--khr-lime);
  font-weight: 700;
}

.khr-news__stat svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* ======================================================================
 * GALLERY — SHELL
 * ==================================================================== */

.khr-news__wrap {
  width: 95%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 34px 0 90px;
}

/* Category chips */
.khr-news__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.khr-news__chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--khr-card);
  border: 1px solid var(--khr-border);
  color: var(--khr-deep);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .22s ease, color .22s ease, border-color .22s ease, transform .22s ease;
}

.khr-news__chip:hover {
  background: #ecf8f2;
  border-color: var(--khr-green);
  transform: translateY(-2px);
}

.khr-news__chip--active {
  background: linear-gradient(135deg, var(--khr-deep), var(--khr-green));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 18px rgba(1, 81, 52, .22);
}

.khr-news__chipCount {
  font-size: .74rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(1, 102, 68, .1);
  color: var(--khr-deep);
}

.khr-news__chip--active .khr-news__chipCount {
  background: rgba(216, 228, 31, .28);
  color: var(--khr-lime);
}

/* Filter bar */
.khr-news__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  background: var(--khr-card);
  border: 1px solid var(--khr-border);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 6px 16px rgba(1, 81, 52, .06);
  margin-bottom: 34px;
}

.khr-news__search {
  position: relative;
  flex: 1 1 260px;
  display: flex;
  align-items: center;
}

.khr-news__search svg {
  position: absolute;
  inset-inline-start: 13px;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--khr-muted);
  stroke-width: 1.9;
  stroke-linecap: round;
  pointer-events: none;
}

.khr-news__search input {
  width: 100%;
  font: inherit;
  font-size: .95rem;
  color: var(--khr-text);
  padding: 11px 14px;
  padding-inline-start: 40px;
  border: 1px solid var(--khr-border);
  border-radius: 12px;
  background: #fbfefc;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.khr-news__search input:focus {
  border-color: var(--khr-green);
  box-shadow: 0 0 0 3px rgba(9, 155, 85, .14);
}

.khr-news__sort select {
  font: inherit;
  font-size: .92rem;
  color: var(--khr-text);
  padding: 11px 14px;
  border: 1px solid var(--khr-border);
  border-radius: 12px;
  background: #fbfefc;
  cursor: pointer;
  outline: none;
  transition: border-color .2s ease;
}

.khr-news__sort select:focus {
  border-color: var(--khr-green);
}

.khr-news__filterBtn {
  font: inherit;
  font-size: .92rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--khr-deep), var(--khr-green));
  border: 0;
  border-radius: 12px;
  padding: 12px 24px;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}

.khr-news__filterBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(1, 81, 52, .22);
}

.khr-news__filterReset {
  font-size: .88rem;
  font-weight: 600;
  color: var(--khr-muted);
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
  transition: color .2s ease;
}

.khr-news__filterReset:hover {
  color: var(--khr-deep);
}

.khr-news__resultNote {
  margin: -18px 0 28px;
  font-size: .95rem;
  color: var(--khr-muted);
}

.khr-news__resultNote strong {
  color: var(--khr-deep);
}

/* Section heads */
.khr-news__sectionHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.khr-news__sectionTitle {
  position: relative;
  margin: 0;
  padding-bottom: 12px;
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--khr-deep);
}

.khr-news__sectionTitle:after {
  content: "";
  position: absolute;
  bottom: 0;
  inset-inline-start: 0;
  width: 56px;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--khr-lime), var(--khr-green));
}

.khr-news__sectionPage {
  font-size: .86rem;
  color: var(--khr-muted);
}

/* ======================================================================
 * CARDS
 * ==================================================================== */

.khr-news__card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--khr-card);
  border: 1px solid var(--khr-border);
  border-radius: var(--khr-radius);
  box-shadow: var(--khr-shadow);
  transition: transform .32s ease, box-shadow .32s ease, border-color .32s ease;
}

.khr-news__card:hover {
  transform: translateY(-5px);
  border-color: rgba(9, 155, 85, .45);
  box-shadow: var(--khr-shadow-lg);
}

.khr-news__cardMedia {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #e7f4ed, #d5ebe0);
}

.khr-news__cardImg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s ease;
}

.khr-news__card:hover .khr-news__cardImg {
  transform: scale(1.05);
}

.khr-news__cardNoImg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.khr-news__cardNoImg svg {
  width: 46px;
  height: 46px;
  fill: none;
  stroke: rgba(1, 102, 68, .32);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.khr-news__cardBadges {
  position: absolute;
  inset-block-start: 12px;
  inset-inline-start: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  z-index: 2;
}

.khr-news__cardCat {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  color: #fff;
  background: rgba(1, 81, 52, .86);
  backdrop-filter: blur(4px);
}

.khr-news__cardFlag {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  color: var(--khr-forest);
  background: linear-gradient(135deg, var(--khr-lime), #eef36a);
  box-shadow: 0 4px 12px rgba(216, 228, 31, .34);
}

.khr-news__cardBody {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px 20px 20px;
}

.khr-news__cardMeta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  font-size: .8rem;
  color: var(--khr-muted);
  margin-bottom: 10px;
}

.khr-news__cardDate,
.khr-news__cardRead {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.khr-news__cardMeta svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--khr-green);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.khr-news__cardTitle {
  margin: 0 0 10px;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: -.01em;
}

.khr-news__cardTitle a {
  color: var(--khr-text);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .22s ease;
}

.khr-news__cardTitle a:hover {
  color: var(--khr-green);
}

.khr-news__cardText {
  margin: 0 0 16px;
  font-size: .93rem;
  line-height: 1.85;
  color: var(--khr-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.khr-news__cardCta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  font-size: .88rem;
  font-weight: 700;
  color: var(--khr-deep);
  text-decoration: none;
}

.khr-news__cardCta svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .25s ease;
}

[dir="rtl"] .khr-news__cardCta svg,
[dir="rtl"] .khr-single__relatedAll svg {
  transform: scaleX(-1);
}

.khr-news__card:hover .khr-news__cardCta svg {
  transform: translateX(4px);
}

[dir="rtl"] .khr-news__card:hover .khr-news__cardCta svg {
  transform: scaleX(-1) translateX(4px);
}

/* ======================================================================
 * TOP STORIES BAND
 * ==================================================================== */

.khr-news__top {
  margin-bottom: 56px;
}

.khr-news__topGrid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 20px;
  align-items: stretch;
}

.khr-news__topGrid .khr-news__card--lead {
  grid-column: 1;
  grid-row: 1 / -1;
}

.khr-news__topGrid .khr-news__card--lead .khr-news__cardMedia {
  aspect-ratio: 16 / 9;
}

.khr-news__topGrid .khr-news__card--lead .khr-news__cardBody {
  padding: 24px 26px 26px;
}

.khr-news__topGrid .khr-news__card--lead .khr-news__cardTitle {
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  line-height: 1.4;
}

.khr-news__topGrid .khr-news__card--lead .khr-news__cardText {
  font-size: 1rem;
  -webkit-line-clamp: 4;
}

/* Compact horizontal cards beside the lead story */
.khr-news__card--side {
  flex-direction: row;
  align-items: stretch;
}

.khr-news__card--side .khr-news__cardMedia {
  flex: none;
  width: 118px;
  aspect-ratio: auto;
}

.khr-news__card--side .khr-news__cardBadges {
  display: none;
}

.khr-news__card--side .khr-news__cardBody {
  padding: 14px 16px;
}

.khr-news__card--side .khr-news__cardTitle {
  font-size: .98rem;
  margin-bottom: 6px;
  -webkit-line-clamp: 2;
}

.khr-news__card--side .khr-news__cardTitle a {
  -webkit-line-clamp: 2;
}

.khr-news__card--side .khr-news__cardText,
.khr-news__card--side .khr-news__cardCta,
.khr-news__card--side .khr-news__cardRead {
  display: none;
}

/* ======================================================================
 * LATEST GRID
 * ==================================================================== */

.khr-news__latest {
  margin-bottom: 40px;
}

.khr-news__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(298px, 1fr));
  gap: 24px;
}

.khr-news__grid--related {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* Wide lead card inside a category gallery */
.khr-news__grid .khr-news__card--lead {
  grid-column: 1 / -1;
  flex-direction: row;
}

.khr-news__grid .khr-news__card--lead .khr-news__cardMedia {
  flex: none;
  width: 46%;
  max-width: 520px;
  aspect-ratio: auto;
}

.khr-news__grid .khr-news__card--lead .khr-news__cardBody {
  padding: 26px 28px;
  justify-content: center;
}

.khr-news__grid .khr-news__card--lead .khr-news__cardTitle {
  font-size: clamp(1.2rem, 1.9vw, 1.6rem);
}

.khr-news__grid .khr-news__card--lead .khr-news__cardText {
  -webkit-line-clamp: 4;
}

/* Related cards are lighter */
.khr-news__card--related .khr-news__cardMedia {
  aspect-ratio: 16 / 9;
}

.khr-news__card--related .khr-news__cardTitle {
  font-size: 1rem;
  margin-bottom: 0;
}

/* ======================================================================
 * PAGINATION + EMPTY
 * ==================================================================== */

.khr-news__pagination {
  margin-top: 46px;
}

.khr-news__pagination ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.khr-news__pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--khr-card);
  border: 1px solid var(--khr-border);
  color: var(--khr-deep);
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}

.khr-news__pagination .page-numbers:hover {
  background: #ecf8f2;
  transform: translateY(-2px);
}

.khr-news__pagination .page-numbers.current {
  background: linear-gradient(135deg, var(--khr-deep), var(--khr-green));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 18px rgba(1, 81, 52, .22);
}

.khr-news__pagination .page-numbers.dots {
  background: transparent;
  border-color: transparent;
}

.khr-news__empty {
  text-align: center;
  background: var(--khr-card);
  border: 1px dashed var(--khr-border);
  border-radius: var(--khr-radius);
  padding: 64px 24px;
}

.khr-news__empty svg {
  width: 52px;
  height: 52px;
  fill: none;
  stroke: rgba(1, 102, 68, .35);
  stroke-width: 1.5;
  stroke-linecap: round;
  margin-bottom: 14px;
}

.khr-news__empty p {
  margin: 0 0 22px;
  color: var(--khr-muted);
  font-size: 1.02rem;
}

.khr-news__emptyBtn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--khr-deep), var(--khr-green));
  color: #fff;
  font-weight: 700;
  font-size: .93rem;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
}

.khr-news__emptyBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(1, 81, 52, .24);
}

/* ======================================================================
 * SINGLE NEWS — HERO
 * ==================================================================== */

.khr-single__hero {
  position: relative;
  overflow: hidden;
  background: radial-gradient(120% 160% at 100% 0%, #0b7d4a 0%, #016644 45%, #013c27 100%);
  color: #fff;
}

.khr-single__hero:after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--khr-lime), var(--khr-green), var(--khr-lime));
  z-index: 3;
}

.khr-single__heroImg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.khr-single__heroOverlay {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.khr-single__hero--img .khr-single__heroOverlay {
  background: linear-gradient(180deg, rgba(1, 60, 39, .72) 0%, rgba(1, 60, 39, .84) 55%, rgba(1, 45, 29, .95) 100%);
}

.khr-single__heroInner {
  position: relative;
  z-index: 2;
  width: 95%;
  max-width: 900px;
  margin: 0 auto;
  padding: 122px 0 58px;
}

.khr-single__crumbs {
  font-size: .84rem;
  color: #cfeede;
  margin-bottom: 20px;
}

.khr-single__crumbs a {
  color: #cfeede;
  text-decoration: none;
  transition: color .2s ease;
}

.khr-single__crumbs a:hover {
  color: var(--khr-lime);
}

.khr-single__crumbs span[aria-hidden] {
  margin-inline: 7px;
  opacity: .7;
}

.khr-single__crumbCurrent {
  color: #fff;
  font-weight: 600;
}

.khr-single__heroCat {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
  color: var(--khr-forest);
  background: linear-gradient(135deg, var(--khr-lime), #eef36a);
  text-decoration: none;
  margin-bottom: 16px;
  box-shadow: 0 6px 16px rgba(216, 228, 31, .3);
  transition: transform .2s ease;
}

.khr-single__heroCat:hover {
  transform: translateY(-2px);
}

.khr-single__title {
  margin: 0;
  font-size: clamp(1.75rem, 3.6vw, 2.85rem);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -.02em;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .22);
}

.khr-single__standfirst {
  margin: 16px 0 0;
  font-size: 1.08rem;
  line-height: 1.9;
  color: #eafff5;
  opacity: .95;
}

.khr-single__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, .18);
}

.khr-single__metaItem {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .86rem;
  color: #dff6ea;
}

.khr-single__metaItem svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--khr-lime);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* ======================================================================
 * SINGLE NEWS — BODY
 * ==================================================================== */

.khr-single__wrap {
  width: 95%;
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 0 90px;
}

.khr-single__body {
  font-size: 1.05rem;
  line-height: 2.15;
  color: #24382d;
}

.khr-single__body > *:first-child {
  margin-top: 0;
}

.khr-single__body p,
.khr-single__body li {
  /* Justified columns read as a solid block in Persian, which has no
     hyphenation to fall back on — inter-word keeps the stretching in the
     spaces rather than inside words. The last line is left ragged. */
  text-align: justify;
  text-justify: inter-word;
}

.khr-single__body p {
  margin: 0 0 1.5em;
}

.khr-single__body h2,
.khr-single__body h3,
.khr-single__body h4 {
  color: var(--khr-deep);
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1.5;
  margin: 2em 0 .8em;
}

.khr-single__body h2 {
  font-size: 1.6rem;
  position: relative;
  padding-inline-start: 16px;
}

.khr-single__body h2:before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: .25em;
  bottom: .25em;
  width: 5px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--khr-lime), var(--khr-green));
}

.khr-single__body h3 {
  font-size: 1.32rem;
}

.khr-single__body h4 {
  font-size: 1.12rem;
}

.khr-single__body a {
  color: var(--khr-green);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .2s ease;
}

.khr-single__body a:hover {
  color: var(--khr-deep);
}

/* ---------------------------------------------------------------------------
 * ARTICLE MEDIA
 * The block editor is disabled theme-wide, so body content arrives as classic
 * editor markup. That means three shapes to tame, each of which ships its own
 * hard-coded pixel dimensions that would otherwise overflow the column:
 *   images   bare <img>, or a [caption] wrapper with an inline width
 *   embedded  an <iframe> with width/height attributes (YouTube, Vimeo), or a
 *             provider wrapper with inline padding and an absolute iframe
 *             (Aparat and most "responsive embed" snippets)
 *   internal  the [video] shortcode, rendered by MediaElement, which copies a
 *             pixel width onto several nested wrappers
 * ------------------------------------------------------------------------ */

.khr-single__body img {
  max-width: 100%;
  height: auto;
  border-radius: 16px;
  display: block;
  margin: 1.8em auto;
  box-shadow: var(--khr-shadow);
}

.khr-single__body figure,
.khr-single__body .wp-caption {
  /* [caption] carries an inline pixel width; releasing it lets the figure
     track the column instead of spilling past it on narrow screens. */
  width: auto !important;
  max-width: 100%;
  margin: 1.8em auto;
}

.khr-single__body figure img,
.khr-single__body .wp-caption img {
  margin: 0 auto;
}

.khr-single__body figcaption,
.khr-single__body .wp-caption-text {
  text-align: center;
  font-size: .86rem;
  line-height: 1.7;
  color: var(--khr-muted);
  margin: 10px 0 0;
}

/* Classic editor alignment classes */
.khr-single__body .aligncenter {
  margin-inline: auto;
}

.khr-single__body .alignleft {
  float: left;
  margin: .5em 1.6em 1.2em 0;
  max-width: 50%;
}

.khr-single__body .alignright {
  float: right;
  margin: .5em 0 1.2em 1.6em;
  max-width: 50%;
}

.khr-single__body .alignnone {
  margin-inline: 0;
}

/* --- Embedded video from an external source ------------------------------ */

/* A bare iframe: aspect-ratio replaces its width/height attributes, so it
   scales with the column without needing a wrapper element. */
.khr-single__body iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  margin: 1.8em auto;
  border: 0;
  border-radius: 16px;
  background: #000;
  box-shadow: var(--khr-shadow);
}

/* Providers that ship their own responsive wrapper (inline padding holding the
   ratio open, iframe absolutely positioned inside) already solve the ratio —
   :has lets us detect that shape and hand the sizing back to the wrapper
   instead of fighting it with aspect-ratio. */
.khr-single__body div[style*="padding"]:has(> iframe) {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 0;
  margin: 1.8em auto;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--khr-shadow);
}

.khr-single__body div[style*="padding"]:has(> iframe) > iframe {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: auto;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

/* Gutenberg embeds, in case any older content still carries them. */
.khr-single__body .wp-block-embed {
  margin: 1.8em 0;
}

.khr-single__body .wp-block-embed__wrapper {
  position: relative;
}

/* --- Internal (self-hosted) video ---------------------------------------- */

.khr-single__body video {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 1.8em auto;
  border-radius: 16px;
  background: #000;
  box-shadow: var(--khr-shadow);
}

/* MediaElement stamps the shortcode's pixel width onto every wrapper it
   builds, so each one has to be released before the player can shrink. */
.khr-single__body .wp-video,
.khr-single__body .wp-video-shortcode,
.khr-single__body .mejs-container,
.khr-single__body .mejs-overlay,
.khr-single__body .mejs-poster,
.khr-single__body .mejs-mediaelement {
  width: 100% !important;
  max-width: 100% !important;
}

.khr-single__body .wp-video {
  margin: 1.8em auto;
}

/* The container's height is also written in pixels; swapping it for a ratio is
   what keeps the poster and controls in step once the width is fluid. */
.khr-single__body .mejs-container {
  height: auto !important;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--khr-shadow);
}

.khr-single__body .mejs-mediaelement video,
.khr-single__body .mejs-overlay,
.khr-single__body .mejs-poster {
  height: 100% !important;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

.khr-single__body ul,
.khr-single__body ol {
  margin: 0 0 1.5em;
  padding-inline-start: 1.4em;
}

.khr-single__body li {
  margin-bottom: .6em;
}

.khr-single__body ul li::marker {
  color: var(--khr-green);
}

.khr-single__body blockquote {
  margin: 1.8em 0;
  padding: 20px 24px;
  border-inline-start: 5px solid var(--khr-lime);
  background: #eef8f3;
  border-radius: 0 16px 16px 0;
  color: var(--khr-forest);
  font-size: 1.05rem;
}

[dir="rtl"] .khr-single__body blockquote {
  border-radius: 16px 0 0 16px;
}

.khr-single__body blockquote p:last-child {
  margin-bottom: 0;
}

.khr-single__body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.8em 0;
  font-size: .95rem;
  display: block;
  overflow-x: auto;
}

.khr-single__body th,
.khr-single__body td {
  border: 1px solid var(--khr-border);
  padding: 12px 14px;
  text-align: start;
}

.khr-single__body th {
  background: #eef8f3;
  color: var(--khr-deep);
  font-weight: 700;
}

.khr-single__pageLinks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 30px 0;
  font-size: .9rem;
  color: var(--khr-muted);
}

.khr-single__pageLinks a,
.khr-single__pageLinks > span > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--khr-border);
  background: var(--khr-card);
  color: var(--khr-deep);
  text-decoration: none;
  font-weight: 700;
}

/* Source attribution */
.khr-single__source {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 34px 0 0;
  padding: 16px 20px;
  border-radius: 14px;
  background: #eef8f3;
  border: 1px solid var(--khr-border);
  font-size: .93rem;
  color: var(--khr-forest);
}

.khr-single__source svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--khr-green);
  stroke-width: 1.8;
  stroke-linecap: round;
  flex: none;
}

.khr-single__sourceLabel {
  font-weight: 800;
  color: var(--khr-deep);
}

.khr-single__source a {
  color: var(--khr-green);
  text-decoration: underline;
  text-underline-offset: 3px;
  word-break: break-word;
}

/* ======================================================================
 * SINGLE NEWS — FOOTER (tags + share)
 * ==================================================================== */

.khr-single__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 40px;
  padding-top: 26px;
  border-top: 1px solid var(--khr-border);
}

.khr-single__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.khr-single__tag {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: #eef8f3;
  border: 1px solid var(--khr-border);
  color: var(--khr-deep);
  font-size: .84rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s ease, transform .2s ease;
}

.khr-single__tag:hover {
  background: var(--khr-lime);
  transform: translateY(-2px);
}

.khr-single__share {
  display: flex;
  align-items: center;
  gap: 10px;
}

.khr-single__shareLabel {
  font-size: .88rem;
  font-weight: 700;
  color: var(--khr-muted);
}

.khr-single__shareBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
  background: var(--khr-card);
  border: 1px solid var(--khr-border);
  cursor: pointer;
  transition: background .22s ease, transform .22s ease, border-color .22s ease;
}

.khr-single__shareBtn svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: var(--khr-deep);
  stroke-width: 1.7;
  stroke-linejoin: round;
  stroke-linecap: round;
  transition: stroke .22s ease;
}

.khr-single__shareBtn:hover {
  background: linear-gradient(135deg, var(--khr-deep), var(--khr-green));
  border-color: transparent;
  transform: translateY(-3px);
}

.khr-single__shareBtn:hover svg {
  stroke: #fff;
}

.khr-single__copy.is-copied {
  background: var(--khr-lime);
  border-color: transparent;
}

.khr-single__copy.is-copied svg {
  stroke: var(--khr-forest);
}

/* ======================================================================
 * SINGLE NEWS — PREV/NEXT + RELATED
 * ==================================================================== */

.khr-single__nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 40px;
}

.khr-single__navItem {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  border-radius: 16px;
  background: var(--khr-card);
  border: 1px solid var(--khr-border);
  text-decoration: none;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.khr-single__navItem:hover {
  transform: translateY(-3px);
  border-color: rgba(9, 155, 85, .45);
  box-shadow: var(--khr-shadow);
}

.khr-single__navItem--next {
  text-align: end;
  grid-column: 2;
}

.khr-single__navLabel {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--khr-green);
}

.khr-single__navTitle {
  font-size: .98rem;
  font-weight: 700;
  line-height: 1.6;
  color: var(--khr-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.khr-single__related {
  margin-top: 56px;
}

.khr-single__relatedAll {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .88rem;
  font-weight: 700;
  color: var(--khr-deep);
  text-decoration: none;
  white-space: nowrap;
}

.khr-single__relatedAll svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.khr-single__comments {
  margin-top: 56px;
}

/* ======================================================================
 * RESPONSIVE
 * ==================================================================== */

@media (max-width: 1024px) {
  .khr-news__topGrid {
    grid-template-columns: 1fr;
  }

  .khr-news__topGrid .khr-news__card--lead {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 860px) {
  .khr-news__heroInner,
  .khr-single__heroInner {
    padding-top: 104px;
    padding-bottom: 44px;
  }

  .khr-news__grid .khr-news__card--lead {
    flex-direction: column;
  }

  .khr-news__grid .khr-news__card--lead .khr-news__cardMedia {
    width: 100%;
    max-width: none;
    aspect-ratio: 16 / 10;
  }

  .khr-single__nav {
    grid-template-columns: 1fr;
  }

  .khr-single__navItem--next {
    grid-column: auto;
    text-align: start;
  }

  .khr-single__footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .khr-news__wrap,
  .khr-single__wrap {
    width: 92%;
    padding-bottom: 64px;
  }

  .khr-news__chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .khr-news__chips::-webkit-scrollbar {
    display: none;
  }

  .khr-news__chip {
    flex: none;
  }

  .khr-news__filters {
    gap: 10px;
  }

  .khr-news__search,
  .khr-news__sort,
  .khr-news__sort select,
  .khr-news__filterBtn {
    flex: 1 1 100%;
    width: 100%;
  }

  .khr-news__grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .khr-news__card--side .khr-news__cardMedia {
    width: 96px;
  }

  .khr-single__body {
    font-size: 1rem;
    line-height: 2;
  }

  /* A floated image beside a justified column leaves unreadable slivers of
     text at this width, so media goes full-bleed instead. */
  .khr-single__body .alignleft,
  .khr-single__body .alignright {
    float: none;
    max-width: 100%;
    margin-inline: auto;
  }

  .khr-single__body img,
  .khr-single__body iframe,
  .khr-single__body video,
  .khr-single__body .mejs-container,
  .khr-single__body div[style*="padding"]:has(> iframe) {
    border-radius: 12px;
  }

  .khr-single__stats,
  .khr-news__stats {
    gap: 8px;
  }
}
