/* =====================================================
   BLOG — Magazine style
   Префікс .blog-* та .single-post-*
   ===================================================== */

.blog-page,
.single-post {
  width: 100%;
}

.blog-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}

.blog-container--narrow {
  max-width: 780px;
}

/* =====================================================
   BLOG HERO (заголовок сторінки блогу)
   ===================================================== */
.blog-hero {
  padding: 72px 24px 48px;
  text-align: center;
  border-bottom: 1px solid var(--border, #e6e8f0);
}

.blog-hero__inner {
  max-width: 780px;
  margin: 0 auto;
}

.blog-hero__kicker {
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent, #4b5ef0);
  font-weight: 500;
  margin-bottom: 16px;
}

.blog-hero__title {
  margin: 0 0 16px;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.blog-hero__subtitle {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-muted, #5b6478);
  line-height: 1.55;
}

@media (max-width: 640px) {
  .blog-hero { padding: 48px 20px 32px; }
}

/* =====================================================
   FEATURED POST (великий hero у стрічці)
   ===================================================== */
.blog-featured {
  display: block;
  position: relative;
  margin: 48px 0 64px;
  border-radius: 20px;
  overflow: hidden;
  min-height: 480px;
  color: #fff;
  text-decoration: none;
  transition: transform 0.3s, box-shadow 0.3s;
}

.blog-featured:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 60px rgba(0,0,0,0.2);
}

.blog-featured__media {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.blog-featured__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.blog-featured__media--placeholder {
  background: linear-gradient(135deg, #1a2555 0%, #4b5ef0 100%);
}

.blog-featured__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.85) 100%);
  z-index: 2;
}

.blog-featured__content {
  position: relative;
  z-index: 3;
  padding: 48px;
  max-width: 760px;
  margin-top: 200px;
}

.blog-featured__title {
  margin: 12px 0 16px;
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.blog-featured__excerpt {
  margin: 0 0 20px;
  font-size: 1.05rem;
  line-height: 1.55;
  opacity: 0.92;
  max-width: 580px;
}

.blog-featured__meta {
  font-size: 0.9rem;
  opacity: 0.85;
  display: flex;
  gap: 10px;
  align-items: center;
}

@media (max-width: 768px) {
  .blog-featured {
    min-height: 400px;
    margin: 32px 0 48px;
  }
  .blog-featured__content {
    padding: 28px 24px;
    margin-top: 140px;
  }
}

/* =====================================================
   BADGE (категорія)
   ===================================================== */
.blog-badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1;
}

.blog-badge--on-dark {
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
}

/* =====================================================
   GRID
   ===================================================== */
.blog-grid__heading {
  margin: 0 0 28px;
  font-size: clamp(1.3rem, 2.5vw, 1.6rem);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 32px;
  margin-bottom: 64px;
}

.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--bg, #fff);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border, #e6e8f0);
  transition: transform 0.25s, box-shadow 0.25s;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.08);
}

.blog-card__media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #eef1f7;
}

.blog-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s;
}

.blog-card:hover .blog-card__media img {
  transform: scale(1.04);
}

.blog-card__media--placeholder {
  background: linear-gradient(135deg, #1a2555, #4b5ef0);
}

.blog-card__body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.blog-card__title {
  margin: 4px 0 0;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.blog-card__excerpt {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-muted, #5b6478);
  flex: 1;
}

.blog-card__meta {
  font-size: 0.8rem;
  color: var(--text-muted, #5b6478);
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.blog-meta__sep {
  opacity: 0.5;
}

/* =====================================================
   PAGINATION
   ===================================================== */
.blog-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 32px 0 64px;
  flex-wrap: wrap;
}

.blog-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border, #e6e8f0);
  background: var(--bg, #fff);
  color: var(--text, #1a2040);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s;
}

.blog-pagination .page-numbers:hover {
  border-color: var(--accent, #4b5ef0);
  color: var(--accent, #4b5ef0);
}

.blog-pagination .page-numbers.current {
  background: var(--accent, #4b5ef0);
  color: #fff;
  border-color: var(--accent, #4b5ef0);
}

/* =====================================================
   EMPTY STATE
   ===================================================== */
.blog-empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted, #5b6478);
}

.blog-empty h2 {
  margin: 0 0 12px;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text, #1a2040);
}

/* =====================================================
   SINGLE POST — HEADER
   ===================================================== */
.single-post {
  margin: 0 auto;
}

/* Header без картинки */
.single-post__header {
  padding: 72px 0 32px;
  text-align: center;
  border-bottom: 1px solid var(--border, #e6e8f0);
  margin-bottom: 48px;
}

/* Header з картинкою (fullwidth hero) */
.single-post__header--with-image {
  position: relative;
  padding: 0;
  text-align: left;
  border-bottom: none;
  margin-bottom: 48px;
  min-height: 520px;
  overflow: hidden;
  color: #fff;
  display: flex;
  align-items: flex-end;
}

.single-post__hero-media {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.single-post__hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.single-post__hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.8) 100%);
}

.single-post__hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 48px 0 56px;
}

.single-post__title {
  margin: 18px 0 28px;
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: 780px;
}

.single-post__header:not(.single-post__header--with-image) .single-post__title {
  margin-left: auto;
  margin-right: auto;
}

.single-post__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  flex-wrap: wrap;
}

.single-post__header:not(.single-post__header--with-image) .single-post__meta {
  color: var(--text-muted, #5b6478);
  justify-content: center;
}

.single-post__author-avatar img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  vertical-align: middle;
  border: 2px solid rgba(255,255,255,0.3);
}

.single-post__author-name {
  font-weight: 500;
}

@media (max-width: 768px) {
  .single-post__header--with-image {
    min-height: 400px;
  }
  .single-post__hero-content {
    padding: 32px 0 36px;
  }
}

/* =====================================================
   SINGLE POST — BODY (the_content)
   ===================================================== */
.single-post__body {
  padding: 0 0 80px;
}

.single-post__content {
  font-size: 1.08rem;
  line-height: 1.8;
  color: #2a3040;
}

.single-post__content > * {
  margin: 0 0 1.4em;
}

.single-post__content h2 {
  margin: 2.2em 0 0.7em;
  font-size: clamp(1.4rem, 2.8vw, 1.8rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.single-post__content h3 {
  margin: 1.8em 0 0.6em;
  font-size: 1.25rem;
  font-weight: 600;
}

.single-post__content h4 {
  margin: 1.6em 0 0.5em;
  font-size: 1.1rem;
  font-weight: 600;
}

.single-post__content p {
  margin: 0 0 1.2em;
}

.single-post__content ul,
.single-post__content ol {
  margin: 0 0 1.4em;
  padding-left: 1.6em;
  list-style: revert;
}

.single-post__content li {
  margin-bottom: 0.5em;
}

.single-post__content blockquote {
  margin: 2em 0;
  padding: 1em 1.5em;
  border-left: 4px solid var(--accent, #4b5ef0);
  background: var(--bg-card, #f6f7fb);
  border-radius: 0 8px 8px 0;
  font-size: 1.05rem;
  font-style: italic;
  color: #3a4050;
}

.single-post__content blockquote p:last-child {
  margin-bottom: 0;
}

.single-post__content a {
  color: var(--accent, #4b5ef0);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.single-post__content a:hover {
  text-decoration-thickness: 2px;
}

.single-post__content img {
  border-radius: 12px;
  margin: 2em 0;
}

.single-post__content code {
  background: var(--bg-card, #f6f7fb);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.92em;
  font-family: var(--font-mono, Menlo, Monaco, monospace);
}

.single-post__content pre {
  background: #1a2040;
  color: #e8eaf4;
  padding: 20px;
  border-radius: 10px;
  overflow-x: auto;
  margin: 2em 0;
  font-size: 0.9rem;
  line-height: 1.55;
}

.single-post__content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* Great first-letter accent (дропкап) на початку першого параграфа */
.single-post__content > p:first-of-type::first-letter {
  float: left;
  font-size: 3.5em;
  line-height: 0.9;
  padding: 0.05em 0.12em 0 0;
  font-weight: 700;
  color: var(--accent, #4b5ef0);
}

@media (max-width: 640px) {
  .single-post__content {
    font-size: 1.02rem;
  }
  .single-post__content > p:first-of-type::first-letter {
    font-size: 3em;
  }
}

/* =====================================================
   TAGS
   ===================================================== */
.single-post__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 48px 0 32px;
  padding-top: 32px;
  border-top: 1px solid var(--border, #e6e8f0);
}

.blog-tag {
  padding: 6px 14px;
  background: var(--bg-card, #f6f7fb);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-muted, #5b6478);
  text-decoration: none;
  transition: all 0.15s;
}

.blog-tag:hover {
  background: var(--accent, #4b5ef0);
  color: #fff;
}

/* =====================================================
   AUTHOR CARD
   ===================================================== */
.single-post__author-card {
  display: flex;
  gap: 20px;
  padding: 28px;
  background: var(--bg-card, #f6f7fb);
  border-radius: 16px;
  margin: 32px 0 48px;
  align-items: flex-start;
}

.single-post__author-card-avatar img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
}

.single-post__author-card-body {
  flex: 1;
}

.single-post__author-card-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted, #5b6478);
  font-weight: 600;
  margin-bottom: 4px;
}

.single-post__author-card-name {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.single-post__author-card-bio {
  margin: 0;
  color: var(--text-muted, #5b6478);
  font-size: 0.95rem;
  line-height: 1.55;
}

@media (max-width: 640px) {
  .single-post__author-card {
    flex-direction: column;
    text-align: center;
    padding: 24px;
  }
  .single-post__author-card-avatar {
    margin: 0 auto;
  }
}

/* =====================================================
   RELATED POSTS
   ===================================================== */
.single-post__related {
  padding: 64px 0;
  background: var(--bg-card, #f6f7fb);
  border-top: 1px solid var(--border, #e6e8f0);
}

.single-post__related-heading {
  margin: 0 0 32px;
  font-size: clamp(1.4rem, 2.8vw, 1.8rem);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.single-post__related .blog-card {
  background: #fff;
}
