/* Blog & resources pages — shared layout, listing cards, and article typography.
   Used by: blog/index.html, blog/index.ru.html, resources/index.html,
   resources/*.html article pages.
   Link after custom.css: <link rel="stylesheet" href="../static/blog-resources.css"> */

/* ── Page shell ─────────────────────────────────────────────────────────── */

html[data-i18n-state="loading"] [data-i18n],
html[data-i18n-state="loading"] [data-i18n-attr] {
  visibility: hidden;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-y: auto;
}

.blog-page-wrap {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2.5rem 2.5rem;
  width: 100%;
  background-image: url('../img/background/city.jpg');
  background-size: 100% auto;
  background-position: left top;
  background-repeat: repeat-y;
  border-radius: 24px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  color: #111827;
}

@media (max-width: 768px) {
  .blog-page-wrap {
    padding: 3rem 1rem 0 1rem;
    border-radius: 0;
  }
}

/* ── Hero row (blog index + resources index) ────────────────────────────── */

.blog-hero-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 1rem;
  margin: 0.5rem 0 1.5rem;
}

.blog-page-title {
  font-family: 'Merriweather', serif;
  font-weight: 700;
  font-size: 2.25rem;
  letter-spacing: 0.02em;
  color: #45110b;
  margin: 0;
  white-space: nowrap;
  flex-shrink: 0;
}

.blog-hero-title-link {
  text-decoration: none;
  color: inherit;
  flex-shrink: 1;
  min-width: 0;
}

.blog-hero-bubble {
  margin: 0;
  padding: 0.6rem 0.9rem;
  border-radius: 18px;
  background: #f7f7ed;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.2);
  display: inline-flex;
}

.blog-hero-title-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.blog-hero-title-stack .hero-brand {
  font-family: 'Merriweather', serif;
  font-weight: 700;
  font-size: 2.25rem;
  letter-spacing: 0.02em;
  color: #45110b;
  line-height: 1.2;
  white-space: nowrap;
}

.blog-hero-title-stack .hero-tagline {
  margin-top: 0.1rem;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.03em;
  color: #45110b;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .blog-hero-row {
    gap: 0.5rem;
  }

  .blog-page-title {
    font-size: 1.35rem;
  }

  .blog-hero-bubble {
    padding: 0.4rem 0.65rem;
    border-radius: 14px;
  }

  .blog-hero-title-stack .hero-brand {
    font-size: 1.15rem;
  }

  .blog-hero-title-stack .hero-tagline {
    font-size: 0.75rem;
  }
}

/* ── Post card shell (all pages) ────────────────────────────────────────── */

.blog-post {
  background: rgba(255, 255, 255, 0.94);
  border-radius: 16px;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

/* Listing pages: blog index, resources index */
.blog-page-wrap > .blog-post:not(.article-body) {
  margin-bottom: 1.75rem;
  line-height: 1.65;
  font-size: 1.02rem;
}

.blog-page-wrap > .blog-post {
  scroll-margin-top: 3rem;
}

@media (max-width: 768px) {
  .blog-page-wrap > .blog-post {
    margin-left: calc(0.2rem - 1rem);
    margin-right: calc(0.2rem - 1rem);
    width: calc(100% + 2 * (1rem - 0.2rem));
    max-width: calc(100% + 2 * (1rem - 0.2rem));
    box-sizing: border-box;
  }
}

/* ── Listing card content (blog + resources index) ──────────────────────── */

.blog-post h2 {
  font-family: 'Merriweather', serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: #45110b;
  margin: 0 0 0.75rem;
}

.blog-post-meta {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 1rem;
}

.blog-post img {
  float: left;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 0 1rem 0.85rem 0;
}

.blog-post::after {
  content: "";
  display: block;
  clear: both;
}

.blog-post p {
  margin-bottom: 0.85rem;
}

.blog-post ul,
.blog-post ol {
  margin: 0 0 0.85rem 1.25rem;
  padding: 0;
}

.blog-post li {
  margin-bottom: 0.35rem;
}

.blog-post a {
  color: #2563eb;
  text-decoration: underline;
}

.blog-placeholder-caption {
  font-size: 0.85rem;
  color: #6b7280;
  font-style: italic;
  margin-top: 0;
  margin-bottom: 1rem;
}

/* Resources index teasers */
.resource-read-more {
  display: inline-block;
  margin-top: 0.5rem;
  font-weight: 600;
  color: #2563eb;
  text-decoration: underline;
}

.resource-read-more:hover {
  color: #1d4ed8;
}

.resource-post-figure {
  float: left;
  max-width: min(100%, 400px);
  margin: 0 1rem 0.85rem 0;
}

.resource-post-figure img {
  float: none;
  margin: 0;
  display: block;
  width: 100%;
}

.resource-post-caption {
  font-size: 0.85rem;
  color: #6b7280;
  font-style: italic;
  margin: 0.35rem 0 0;
  line-height: 1.4;
}

/* ── Article detail pages (resources/*.html) ────────────────────────────── */

.article-breadcrumb {
  font-size: 0.95rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 1.25rem;
  padding: 0.7rem 1.1rem;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 10px;
  border: 1px solid rgba(69, 17, 11, 0.15);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}

.article-breadcrumb a {
  color: #1d4ed8;
  font-weight: 600;
  text-decoration: none;
}

.article-breadcrumb a:hover {
  text-decoration: underline;
}

.article-breadcrumb span {
  color: #45110b;
  font-weight: 600;
}

.article-body {
  line-height: 1.7;
  font-size: 1.04rem;
}

.article-body h1 {
  font-family: 'Merriweather', serif;
  font-weight: 700;
  font-size: 2rem;
  line-height: 1.25;
  color: #45110b;
  margin: 0 0 0.75rem;
}

.article-body h2 {
  font-family: 'Merriweather', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: #45110b;
  margin: 2rem 0 0.75rem;
}

.article-body h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #45110b;
  margin: 1.5rem 0 0.5rem;
}

.article-meta {
  font-size: 0.88rem;
  color: #6b7280;
  margin-bottom: 1.5rem;
}

.article-figure {
  margin: 0 0 1.5rem;
}

.article-figure img {
  width: 100%;
  height: auto;
  border-radius: 14px;
  display: block;
}

.article-figure figcaption {
  font-size: 0.85rem;
  color: #6b7280;
  font-style: italic;
  margin-top: 0.4rem;
}

.article-body p {
  margin-bottom: 1rem;
}

.article-body ul,
.article-body ol {
  margin: 0 0 1rem 1.4rem;
  padding: 0;
}

.article-body li {
  margin-bottom: 0.4rem;
}

.article-body a {
  color: #2563eb;
  text-decoration: underline;
}

.article-body a.article-cta {
  color: #fff;
  text-decoration: none;
}

.article-cta {
  display: inline-block;
  margin: 0.5rem 0 1.25rem;
  padding: 0.7rem 1.25rem;
  background: #2563eb;
  color: #fff;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.article-cta:hover,
.article-body a.article-cta:hover {
  background: #1d4ed8;
  color: #fff;
  text-decoration: none;
}

.article-dialogue {
  background: #f7f7ed;
  border-left: 4px solid #d1a054;
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  margin: 0 0 1rem;
}

.article-dialogue p {
  margin-bottom: 0.6rem;
}

.article-dialogue p:last-child {
  margin-bottom: 0;
}

/* ── Blog language switcher (blog index only) ───────────────────────────── */

#blogLangSwitcher {
  position: relative;
  display: inline-flex;
  align-items: center;
}

#blogLangSwitcher .blog-lang-popup {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
  padding: 0.35rem;
  z-index: 9999;
  min-width: 60px;
}

#blogLangSwitcher .blog-lang-item {
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  border-radius: 5px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1a1a1a;
}

#blogLangSwitcher .blog-lang-item:hover {
  background: #f1f5f9;
}

#blogLangSwitcher .blog-lang-item.active {
  background: #e8f0fe;
  color: #2563eb;
}

#blogGlobeBtn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.2rem;
  display: flex;
  align-items: center;
  opacity: 0.85;
  transition: opacity 0.2s;
}

#blogGlobeBtn:hover {
  opacity: 1;
}
