/* =============================================================
   KAR — Editorial system (blog hub, topic pages, articles)
   Layered on chat.css: uses its palette, fonts and header/footer.
   Deliberately card-light: rules and type do the structural work.
   ============================================================= */

:root {
  --ed-measure: 44rem;          /* article reading width */
  --ed-wide: 68rem;             /* index width */
  --ed-rule: #e3e8ef;
}

/* chat.css lays `main` out as a flex container; the editorial pages are a
   single column, and as a flex item the wrapper would refuse to shrink below
   its content and push the page sideways on phones. */
.ed-main { display: block; padding: 32px 20px 72px; }
.ed-wrap { max-width: var(--ed-wide); width: 100%; min-width: 0; margin: 0 auto; }

/* ── Masthead ────────────────────────────────────────────────── */
.ed-masthead {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
  padding-bottom: 18px; border-bottom: 2px solid var(--navy);
}
.ed-masthead h1 {
  font-family: var(--font-display); font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  font-weight: 700; color: var(--navy); margin: 0; letter-spacing: -.01em;
}
.ed-masthead p {
  margin: 0; font-size: .95rem; line-height: 1.55;
  color: var(--text-muted); max-width: 34rem;
}

/* ── Topic rail ──────────────────────────────────────────────── */
.ed-topics {
  display: flex; gap: 26px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding: 12px 0; margin-bottom: 40px;
  border-bottom: 1px solid var(--ed-rule);
  scrollbar-width: none;
}
.ed-topics::-webkit-scrollbar { display: none; }
.ed-topics a {
  flex: 0 0 auto; text-decoration: none; white-space: nowrap;
  font-size: .82rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-muted); padding-bottom: 4px; border-bottom: 2px solid transparent;
}
.ed-topics a:hover { color: var(--navy); }
.ed-topics a[aria-current="page"] { color: var(--navy); border-bottom-color: var(--accent); }

/* ── Kicker (category label) ─────────────────────────────────── */
.ed-kicker {
  display: inline-block; font-size: .74rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--accent);
  text-decoration: none; margin-bottom: 8px;
}
a.ed-kicker:hover { color: var(--navy); text-decoration: underline; }

/* ── Lead story ──────────────────────────────────────────────── */
.ed-lead {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 32px; align-items: center;
  padding-bottom: 36px; margin-bottom: 36px; border-bottom: 1px solid var(--ed-rule);
}
.ed-lead-figure { margin: 0; }
.ed-lead-figure img {
  width: 100%; aspect-ratio: 3/2; object-fit: cover; display: block;
  border-radius: 2px; background: var(--bg-light);
}
.ed-lead h2 {
  font-family: var(--font-display); font-size: clamp(1.4rem, 2.6vw, 1.95rem);
  line-height: 1.22; margin: 0 0 12px; color: var(--navy); font-weight: 700;
}
.ed-lead h2 a { color: inherit; text-decoration: none; }
.ed-lead h2 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.ed-lead p { margin: 0 0 12px; font-size: 1rem; line-height: 1.65; color: var(--text-muted); }

/* ── Story list ──────────────────────────────────────────────── */
.ed-section { margin-bottom: 52px; }
.ed-section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; padding-bottom: 10px; margin-bottom: 4px;
  border-bottom: 1px solid var(--navy);
}
.ed-section-head h2 {
  font-family: var(--font-display); font-size: 1.15rem; font-weight: 700;
  color: var(--navy); margin: 0;
}
.ed-section-head a {
  font-size: .8rem; font-weight: 600; color: var(--accent); text-decoration: none;
  white-space: nowrap;
}
.ed-section-head a:hover { text-decoration: underline; }

.ed-list { list-style: none; margin: 0; padding: 0; }
.ed-item {
  display: grid; grid-template-columns: 1fr 148px; gap: 20px; align-items: start;
  padding: 20px 0; border-bottom: 1px solid var(--ed-rule);
}
.ed-item:last-child { border-bottom: 0; }
.ed-item-figure { margin: 0; order: 2; }
.ed-item-figure img {
  width: 100%; aspect-ratio: 3/2; object-fit: cover; display: block;
  border-radius: 2px; background: var(--bg-light);
}
.ed-item h3 {
  font-family: var(--font-display); font-size: 1.08rem; line-height: 1.3;
  margin: 0 0 6px; font-weight: 700; color: var(--navy);
}
.ed-item h3 a { color: inherit; text-decoration: none; }
.ed-item h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.ed-item p { margin: 0 0 8px; font-size: .92rem; line-height: 1.6; color: var(--text-muted); }

.ed-byline {
  font-size: .78rem; color: var(--text-light); font-weight: 500;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.ed-byline .ed-sep { color: var(--ed-rule); }

.ed-empty { padding: 22px 0; color: var(--text-light); font-size: .92rem; }

/* ── Pagination ──────────────────────────────────────────────── */
.ed-pager {
  display: flex; justify-content: space-between; gap: 12px;
  padding-top: 12px; border-top: 1px solid var(--ed-rule);
}
.ed-pager a {
  font-size: .88rem; font-weight: 600; color: var(--accent); text-decoration: none;
}
.ed-pager a:hover { text-decoration: underline; }

/* =============================================================
   ARTICLE
   ============================================================= */
.ed-article { max-width: var(--ed-measure); margin: 0 auto; }

.ed-crumbs {
  font-size: .8rem; color: var(--text-light); margin-bottom: 22px;
  display: flex; gap: 7px; flex-wrap: wrap; align-items: center;
}
.ed-crumbs a { color: var(--text-muted); text-decoration: none; font-weight: 600; }
.ed-crumbs a:hover { color: var(--accent); text-decoration: underline; }
.ed-crumbs span[aria-current] { color: var(--text-light); font-weight: 500; }

.ed-article h1 {
  font-family: var(--font-display); font-size: clamp(1.75rem, 4.2vw, 2.6rem);
  line-height: 1.16; letter-spacing: -.015em; font-weight: 700;
  color: var(--navy); margin: 0 0 16px;
}
.ed-dek {
  font-size: 1.12rem; line-height: 1.6; color: var(--text-muted);
  margin: 0 0 24px; font-weight: 400;
}

.ed-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 0; margin-bottom: 28px;
  border-top: 1px solid var(--ed-rule); border-bottom: 1px solid var(--ed-rule);
  font-size: .84rem; color: var(--text-muted);
}
.ed-meta .ed-sep { color: var(--ed-rule); }
.ed-meta-author { font-weight: 600; color: var(--text-main); text-decoration: none; }
.ed-meta-author:hover { color: var(--accent); text-decoration: underline; }
.ed-meta-actions { margin-left: auto; position: relative; }

.ed-figure { margin: 0 0 30px; }
.ed-figure img {
  width: 100%; max-height: 460px; object-fit: cover; display: block;
  border-radius: 2px; background: var(--bg-light);
}
.ed-figure figcaption {
  font-size: .78rem; color: var(--text-light); padding-top: 8px; line-height: 1.5;
}

/* ── Body ────────────────────────────────────────────────────── */
.ed-body { font-size: 1.06rem; line-height: 1.78; color: var(--text-main); }
.ed-body > p:first-of-type::first-letter {
  float: left; font-family: var(--font-display); font-size: 3.3rem;
  line-height: .82; padding: 4px 10px 0 0; color: var(--navy);
}
.ed-body h2 {
  font-family: var(--font-display); font-size: 1.4rem; font-weight: 700;
  color: var(--navy); margin: 40px 0 12px; line-height: 1.3;
}
.ed-body h3 {
  font-family: var(--font-sans); font-size: 1.05rem; font-weight: 700;
  letter-spacing: .01em; color: var(--navy-2); margin: 30px 0 8px;
}
.ed-body p { margin: 0 0 20px; }
.ed-body p:empty, .ed-body p:has(> br:only-child) { display: none; }
.ed-body ul, .ed-body ol { margin: 0 0 20px; padding-left: 24px; }
.ed-body li { margin-bottom: 8px; }
.ed-body strong { font-weight: 700; color: var(--navy); }
.ed-body a {
  color: var(--navy); font-weight: 600;
  text-decoration: underline; text-decoration-color: var(--accent);
  text-decoration-thickness: 1.5px; text-underline-offset: 3px;
}
.ed-body a:hover { color: var(--accent); }
.ed-body blockquote {
  margin: 28px 0; padding: 2px 0 2px 22px; border-left: 3px solid var(--accent);
  font-family: var(--font-display); font-size: 1.12rem; line-height: 1.6;
  color: var(--navy);
}
.ed-body blockquote p:last-child { margin-bottom: 0; }
.ed-body hr { border: 0; border-top: 1px solid var(--ed-rule); margin: 36px 0; }
.ed-body img { max-width: 100%; height: auto; border-radius: 2px; margin: 24px 0; }
.ed-body figure { margin: 24px 0; }
.ed-body table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: .94rem; }
.ed-body th, .ed-body td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--ed-rule); }
.ed-body th { font-weight: 700; color: var(--navy); border-bottom-color: var(--navy); }

/* ── Tags ────────────────────────────────────────────────────── */
.ed-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 34px 0 0; }
.ed-tags a {
  font-size: .78rem; font-weight: 600; color: var(--text-muted);
  text-decoration: none; border: 1px solid var(--ed-rule);
  padding: 4px 11px; border-radius: 2px;
}
.ed-tags a:hover { border-color: var(--accent); color: var(--accent); }

/* ── Tool bridge (the one CTA) ───────────────────────────────── */
.ed-bridge {
  margin: 40px 0 0; padding: 22px 24px;
  background: var(--bg-light); border-left: 3px solid var(--accent);
}
.ed-bridge-label {
  display: block; font-size: .72rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 8px;
}
.ed-bridge h2 {
  font-family: var(--font-display); font-size: 1.15rem; font-weight: 700;
  color: var(--navy); margin: 0 0 6px;
}
.ed-bridge p { margin: 0 0 16px; font-size: .95rem; line-height: 1.6; color: var(--text-muted); }
.ed-bridge-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ed-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 3px; text-decoration: none;
  font-family: var(--font-sans); font-weight: 600; font-size: .92rem;
  background: var(--navy); color: #fff; border: 1px solid var(--navy);
  transition: background .15s, border-color .15s;
}
.ed-btn:hover { background: var(--navy-2); border-color: var(--navy-2); color: #fff; }
.ed-btn-ghost { background: transparent; color: var(--navy); border-color: var(--ed-rule); }
.ed-btn-ghost:hover { background: transparent; border-color: var(--navy); color: var(--navy); }

/* ── Author ──────────────────────────────────────────────────── */
.ed-author {
  display: flex; gap: 16px; align-items: center;
  margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--ed-rule);
  text-decoration: none; color: inherit;
}
.ed-author img {
  width: 56px; height: 56px; border-radius: 50%; object-fit: cover;
  flex-shrink: 0; background: var(--bg-light);
}
.ed-author-label {
  display: block; font-size: .72rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: var(--text-light); margin-bottom: 3px;
}
.ed-author-name { font-weight: 700; color: var(--navy); font-size: 1rem; }
a.ed-author:hover .ed-author-name { color: var(--accent); text-decoration: underline; }
.ed-author-role { margin: 2px 0 0; font-size: .86rem; color: var(--text-muted); }

/* ── Related ─────────────────────────────────────────────────── */
.ed-related { margin-top: 48px; }
.ed-related > h2 {
  font-family: var(--font-display); font-size: 1.1rem; font-weight: 700;
  color: var(--navy); margin: 0 0 4px; padding-bottom: 10px;
  border-bottom: 1px solid var(--navy);
}
.ed-related .ed-item { grid-template-columns: 1fr 108px; }

/* ── Share ───────────────────────────────────────────────────── */
.ed-share-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px; border: 1px solid var(--ed-rule); border-radius: 3px;
  background: transparent; color: var(--text-muted);
  font-family: inherit; font-size: .82rem; font-weight: 600; cursor: pointer;
}
.ed-share-btn:hover { border-color: var(--accent); color: var(--accent); }
.ed-share-btn:focus-visible, .ed-share-panel button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ed-share-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  width: 300px; max-width: calc(100vw - 32px);
  background: var(--bg-white); border: 1px solid var(--border);
  box-shadow: var(--shadow-md); padding: 14px; border-radius: 3px;
  display: none;
}
.ed-share-panel.is-open { display: block; }
.ed-share-panel p {
  margin: 0 0 10px; font-size: .8rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--text-light);
}
.ed-share-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ed-share-grid button {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 11px 4px; background: var(--bg-light); border: 1px solid var(--ed-rule);
  border-radius: 3px; cursor: pointer; font-family: inherit;
  font-size: .7rem; font-weight: 600; color: var(--text-main); text-align: center;
}
.ed-share-grid button:hover { border-color: var(--accent); }
.ed-share-grid button i { font-size: 1rem; }
.ed-share-grid button.is-copied { border-color: var(--success); color: var(--success-dark); }
.ed-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.ed-state { padding: 64px 0; text-align: center; color: var(--text-muted); }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 760px) {
  .ed-lead { grid-template-columns: 1fr; gap: 18px; }
  .ed-lead-figure { order: -1; }
}
@media (max-width: 560px) {
  .ed-main { padding: 22px 16px 56px; }
  .ed-item { grid-template-columns: 1fr 96px; gap: 14px; }
  .ed-related .ed-item { grid-template-columns: 1fr 88px; }
  .ed-body { font-size: 1.02rem; }
  .ed-body > p:first-of-type::first-letter { font-size: 2.9rem; }
  .ed-meta-actions { margin-left: 0; }
  .ed-share-panel { position: fixed; left: 16px; right: 16px; bottom: 16px; top: auto; width: auto; }
  .ed-bridge { padding: 18px; }
}

/* ── Header language toggle (shared by the editorial pages) ──────────── */
.header-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.kar-lang-toggle {
  display: inline-flex; align-items: center; position: relative; flex-shrink: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,.1));
  border: 1px solid rgba(255,255,255,.32); border-radius: 999px; padding: 3px;
  cursor: pointer; font-family: inherit; font-size: .78rem; font-weight: 700;
  letter-spacing: .03em; color: rgba(255,255,255,.85);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.08), 0 1px 8px rgba(0,0,0,.12);
  transition: border-color .2s, background .2s;
}
.kar-lang-toggle:hover { background: rgba(255,255,255,.22); border-color: rgba(255,255,255,.45); }
.kar-lang-toggle::before {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: calc(50% - 3px); height: calc(100% - 6px);
  background: #fff; border-radius: 999px; box-shadow: 0 2px 6px rgba(0,0,0,.18);
  transition: transform .28s cubic-bezier(.65,0,.35,1); z-index: 0;
}
.kar-lang-toggle.lang-is-el::before { transform: translateX(100%); }
.kar-lang-toggle .lang-segment {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; line-height: 1; white-space: nowrap;
  transition: color .2s ease;
}
.kar-lang-toggle .lang-segment.active { color: #10305c; }
.kar-lang-toggle .lang-flag { border-radius: 50%; flex-shrink: 0; display: block; }
