/* ============================================================================
   blog.css — "Realitní magazín"
   A refined editorial layer for the Popenková & Macánek journal.
   Extends the warm.css design system (ivory / espresso / satin gold,
   Hanken Grotesk + Fraunces). Loaded only on /blog/ pages.
   ============================================================================ */

/* ---- Masthead ----------------------------------------------------------- */
.blog-mast {
  padding: clamp(22px,3vw,34px) 0 clamp(16px,2vw,24px);
  position: relative;
}
.blog-mast__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 20px 40px;
  padding-bottom: clamp(16px, 2vw, 24px);
  border-bottom: 1px solid var(--line-2);
}
.blog-mast__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.9rem, 3.4vw, 2.8rem);
  line-height: 1.05;
  letter-spacing: -0.022em;
  color: var(--ink);
  margin: 8px 0 0;
}
.blog-mast__title em {
  font-family: var(--signature);
  font-style: italic;
  font-weight: 400;
  color: var(--gold-deep);
}
.blog-mast__lede {
  max-width: 56ch;
  margin: 11px 0 0;
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--ink-2);
}
.blog-mast__count {
  text-align: right;
  white-space: nowrap;
}
.blog-mast__count b {
  display: inline;
  font-family: var(--signature);
  font-style: italic;
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--gold-deep);
}
.blog-mast__count span {
  display: inline;
  margin-left: 5px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- Cover story (newest article) --------------------------------------- */
.cover {
  display: grid;
  grid-template-columns: 1.12fr 1fr;
  gap: clamp(28px, 4vw, 62px);
  align-items: center;
  padding: clamp(20px, 2.6vw, 34px) 0 clamp(34px, 4.5vw, 56px);
}
.cover__media {
  position: relative;
  overflow: hidden;
  border-radius: var(--r);
  background: var(--paper-2);
  aspect-ratio: 16 / 11;
  box-shadow: var(--shadow-md);
}
.cover__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1100ms var(--ease);
}
.cover:hover .cover__media img { transform: scale(1.04); }
.cover__media::after {            /* thin gold frame inset */
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(250, 246, 239, 0.45);
  pointer-events: none;
}
.cover__flag {
  position: absolute;
  top: 0; left: 0;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px;
  background: var(--ink);
  color: var(--on-dark);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.cover__flag::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
}
.cover__kicker {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-weight: 600;
}
.cover__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.75rem, 3.2vw, 2.7rem);
  line-height: 1.1;
  letter-spacing: -0.018em;
  color: var(--ink);
  margin: 16px 0 0;
}
.cover__title a { color: inherit; text-decoration: none; }
.cover__title a:hover { color: var(--gold-deep); }
.cover__excerpt {
  margin: 18px 0 26px;
  font-size: 1.06rem;
  line-height: 1.66;
  color: var(--ink-2);
  max-width: 52ch;
}
.cover__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  font-size: 12.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.cover__meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--line-2); }

/* ---- Section heading rule ----------------------------------------------- */
.blog-rule {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin: 8px 0 34px;
}
.blog-rule__label {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}
.blog-rule__line { flex: 1; height: 1px; background: var(--line-2); }

/* ---- Article grid ------------------------------------------------------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px 30px;
}
.post-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.post-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-2);
}
.post-card__media {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--paper-2);
}
.post-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 900ms var(--ease);
}
.post-card:hover .post-card__media img { transform: scale(1.05); }
.post-card__chip {
  position: absolute;
  left: 14px; top: 14px;
  padding: 6px 12px;
  background: rgba(43, 38, 32, 0.82);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  color: var(--on-dark);
  font-size: 10.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  border-radius: 2px;
}
.post-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 24px 26px 26px;
}
.post-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 13px;
}
.post-card__meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--gold); }
.post-card__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.28rem;
  line-height: 1.22;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin: 0;
}
.post-card__title a { color: inherit; text-decoration: none; transition: color 0.2s; }
.post-card__title a:hover { color: var(--gold-deep); }
.post-card__excerpt {
  margin: 12px 0 20px;
  font-size: 0.95rem;
  line-height: 1.58;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card .link { margin-top: auto; align-self: flex-start; }

/* ---- Pager -------------------------------------------------------------- */
.blog-pager {
  display: flex;
  gap: 22px;
  justify-content: center;
  align-items: center;
  margin-top: clamp(44px, 5vw, 68px);
  padding-top: 30px;
  border-top: 1px solid var(--line);
}
.blog-pager__state {
  font-size: 12.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ============================================================================
   ARTICLE (detail) — long-form reading layout
   ============================================================================ */
.read-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--gold), var(--gold-deep));
  z-index: 1200;
  transition: width 80ms linear;
}

.article-page { padding-top: clamp(44px,4.5vw,60px); }

.article-hero {
  max-width: 920px;
  margin: 0 auto;
  text-align: center;
}
.article-hero__back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s, gap 0.2s;
}
.article-hero__back:hover { color: var(--gold-deep); gap: 11px; }
.article-hero__kicker {
  margin: 30px 0 0;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-weight: 600;
}
.article-hero__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2rem, 4.6vw, 3.1rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 16px 0 0;
  text-wrap: balance;
}
.article-hero__byline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 26px 0 0;
}
.article-hero__avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--line-2);
}
.article-hero__who { text-align: left; line-height: 1.3; }
.article-hero__who b {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.article-hero__who span {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.article-hero__meta {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  margin: 22px 0 0;
  font-size: 12.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}
.article-hero__meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--gold); }

.article-figure {
  max-width: 1120px;
  margin: clamp(30px, 4vw, 52px) auto 0;
}
.article-figure img {
  width: 100%;
  height: auto;
  max-height: 540px;
  object-fit: cover;
  display: block;
  border-radius: var(--r);
  box-shadow: var(--shadow-md);
}
.article-figure figcaption {
  margin-top: 12px;
  text-align: center;
  font-family: var(--signature);
  font-style: italic;
  font-size: 14px;
  color: var(--muted);
}

/* ---- Two-column reading layout (rail + prose) --------------------------- */
.article-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 768px);
  gap: clamp(40px, 5vw, 76px);
  justify-content: center;
  align-items: start;
  max-width: var(--wrap);
  margin: clamp(34px, 4vw, 56px) auto 0;
}
.article-main { min-width: 0; }

.article-rail {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.article-rail__author { display: flex; align-items: center; gap: 13px; }
.article-rail__author img {
  width: 50px; height: 50px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--line-2), 0 0 0 4px var(--paper);
}
.article-rail__author b { display: block; font-size: 14.5px; font-weight: 600; color: var(--ink); line-height: 1.25; }
.article-rail__author span { font-size: 12.5px; color: var(--muted); }
.article-rail__meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.article-rail__meta div { display: flex; flex-direction: column; gap: 2px; }
.article-rail__meta dt {
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}
.article-rail__meta dd { margin: 0; font-size: 14px; color: var(--ink); font-weight: 500; }
.article-rail__share-label {
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}
.article-rail__share { display: flex; gap: 9px; }
.article-rail__share a, .article-rail__share button {
  width: 40px; height: 40px;
  padding: 0;                 /* reset the <button> default so its icon lines up with the <a> icons */
  display: grid;
  place-items: center;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.2s;
}
.article-rail__share a:hover, .article-rail__share button:hover {
  border-color: var(--gold);
  color: var(--gold-deep);
  transform: translateY(-2px);
}
.article-rail__share svg { width: 17px; height: 17px; fill: currentColor; }
.article-rail__back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s, gap 0.2s;
}
.article-rail__back:hover { color: var(--gold-deep); gap: 11px; }

/* ---- Prose -------------------------------------------------------------- */
.article-prose {
  font-size: 1.13rem;
  line-height: 1.82;
  color: var(--ink-2);
  /* Prevent long words / URLs / pasted tokens from running off the screen
     (the prose column has min-width:0, so without this they overflow). */
  overflow-wrap: anywhere;
  word-break: break-word;
}
.article-prose img { max-width: 100%; height: auto; }
.article-prose pre { overflow-x: auto; }
.article-prose > p:first-child::first-letter {
  float: left;
  font-family: var(--signature);
  font-weight: 500;
  font-size: 4.6rem;
  line-height: 0.78;
  padding: 8px 14px 0 0;
  color: var(--gold-deep);
}
.article-prose p { margin: 0 0 1.35em; }
.article-prose strong { color: var(--ink); font-weight: 600; }
.article-prose a {
  color: var(--gold-deep);
  text-decoration: underline;
  text-decoration-color: var(--line-2);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
}
.article-prose a:hover { text-decoration-color: var(--gold); }

.article-prose h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.6rem;
  line-height: 1.22;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin: 2.2em 0 0.7em;
  padding-top: 0.2em;
}
.article-prose h2::before {
  content: "";
  display: block;
  width: 38px;
  height: 2px;
  background: var(--gold);
  margin-bottom: 0.7rem;
}
.article-prose h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.24rem;
  color: var(--ink);
  margin: 1.8em 0 0.5em;
}

.article-prose ul, .article-prose ol { margin: 0 0 1.5em; padding-left: 0; }
.article-prose li {
  position: relative;
  list-style: none;
  padding-left: 1.9rem;
  margin-bottom: 0.6em;
  line-height: 1.7;
}
.article-prose ul > li::before {
  content: "";
  position: absolute;
  left: 0.2rem; top: 0.72em;
  width: 7px; height: 7px;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
}
.article-prose ol { counter-reset: li; }
.article-prose ol > li::before {
  counter-increment: li;
  content: counter(li);
  position: absolute;
  left: 0; top: 0.1em;
  width: 1.4rem; height: 1.4rem;
  display: grid;
  place-items: center;
  font-family: var(--signature);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--gold-deep);
  border: 1px solid var(--line-2);
  border-radius: 50%;
}

.article-prose figure {
  margin: clamp(28px, 4vw, 44px) 0;
  text-align: center;
}
.article-prose figure img {
  max-width: 100%;
  height: auto;
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}
.article-prose figure figcaption {
  margin-top: 10px;
  font-family: var(--signature);
  font-style: italic;
  font-size: 14px;
  color: var(--muted);
}

/* tables (tax rates etc.) */
.article-prose figure.wp-block-table,
.article-prose table { margin: 1.8em 0; }
.article-prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.98rem;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  overflow: hidden;
}
.article-prose thead td, .article-prose thead th,
.article-prose tr:first-child td {
  background: var(--paper-2);
  font-weight: 600;
  color: var(--ink);
}
.article-prose td, .article-prose th {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.article-prose tr:last-child td { border-bottom: none; }
.article-prose tbody tr:hover td { background: rgba(194, 163, 107, 0.05); }

.article-prose blockquote {
  margin: 1.8em 0;
  padding: 6px 0 6px 26px;
  border-left: 3px solid var(--gold);
  font-family: var(--signature);
  font-style: italic;
  font-size: 1.35rem;
  line-height: 1.5;
  color: var(--ink);
}

/* ---- End-of-article CTA band ------------------------------------------- */
.article-cta {
  margin: clamp(48px, 6vw, 76px) 0 0;
  background: var(--ink);
  color: var(--on-dark);
  border-radius: var(--r);
  /* Flat espresso ground with ONE solid gold edge. There used to be a
     radial-gradient glow bleeding out of the top-right corner; it read as
     generic AI-template chrome, so the accent is now structural (a hairline,
     the site's own idiom — see .eyebrow::before) rather than a light effect.
     Do not reintroduce a gradient here. */
  border-top: 3px solid var(--gold);
  padding: clamp(32px, 4vw, 48px);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.article-cta__eyebrow {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
.article-cta__title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.18;
  margin: 12px 0 8px;
  color: var(--on-dark);
}
.article-cta__title em { font-family: var(--signature); font-style: italic; color: var(--gold); font-weight: 400; }
.article-cta__text { color: var(--on-dark-mut); max-width: 44ch; margin: 0 auto 26px; line-height: 1.6; }
.article-cta__btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.article-cta .btn--on-dark {
  background: transparent;
  color: var(--on-dark);
  border-color: rgba(243, 236, 224, 0.38);
}
.article-cta .btn--on-dark:hover {
  background: var(--on-dark);
  border-color: var(--on-dark);
  color: var(--ink);
}

/* ---- Author card -------------------------------------------------------- */
.article-author {
  max-width: 760px;
  margin: clamp(40px, 5vw, 56px) auto 0;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 26px clamp(22px, 3vw, 32px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.article-author__avatar {
  width: 76px; height: 76px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--line-2), 0 0 0 5px var(--paper);
}
.article-author__label {
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.article-author__name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.18rem;
  color: var(--ink);
  margin: 4px 0 2px;
}
.article-author__role { font-size: 0.92rem; color: var(--ink-2); }

/* ---- Related ------------------------------------------------------------ */
.article-related { margin-top: clamp(56px, 7vw, 96px); }

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 1040px) {
  .article-layout {
    grid-template-columns: 1fr;
    max-width: 768px;
    gap: 26px;
  }
  .article-rail {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 28px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
  }
  .article-rail__meta {
    flex-direction: row;
    gap: 28px;
    border: none;
    padding: 0;
  }
  .article-rail__share-label { display: none; }
  .article-rail__back { margin-left: auto; }
}
@media (max-width: 900px) {
  .cover { grid-template-columns: 1fr; gap: 26px; }
  .cover__media { aspect-ratio: 16 / 10; }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .blog-mast__inner { grid-template-columns: 1fr; align-items: start; }
  .blog-mast__count { text-align: left; }
}
@media (max-width: 600px) {
  .post-grid { grid-template-columns: 1fr; }
  .article-prose > p:first-child::first-letter { font-size: 3.6rem; }
  .article-author { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) {
  /* stack the CTA buttons full-width so they don't wrap to uneven rows */
  .article-cta__btns { flex-direction: column; align-items: stretch; }
  .article-cta__btns .btn { width: 100%; }
}
