/* ============================================================
   Blog / Flashcards page — extends style.css, reuses its
   CSS variables (--bg, --surface, --magenta, --grad, etc.)
   ============================================================ */

/* ---- Hero ---- */
/* Matches the .page-hero treatment used on Recruitment-form.html */
#blog-hero {
  padding: 8.5rem 0 3.5rem;
  text-align: center;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

#blog-hero::before {
  content: '';
  position: absolute;
  top: -120px;
  right: -120px;
  width: 360px;
  height: 360px;
  background: var(--grad);
  opacity: 0.18;
  filter: blur(80px);
  border-radius: 50%;
  pointer-events: none;
}

#blog-hero h1 {
  font-size: clamp(1.8rem, 3.4vw, 2.7rem);
  font-weight: 800;
  color: var(--white);
  margin-bottom: 0.9rem;
  line-height: 1.5;
}

#blog-hero p {
  max-width: 560px;
  margin: 0 auto;
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 2;
}

@media (max-width: 640px) {
  #blog-hero { padding: 7.5rem 0 3rem; }
}

/* ---- Grid section ---- */
#blog-grid-section {
  padding: 1rem 0 7rem;
  background: var(--bg);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .blog-grid { grid-template-columns: 1fr; }
}

/* ---- Flashcard ---- */
.blog-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 0 0 2rem;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.blog-card-media {
  width: 100%;
  aspect-ratio: 400 / 220;
  overflow: hidden;
}

.blog-card-media svg {
  width: 100%;
  height: 100%;
  display: block;
  transition: transform 0.4s ease;
}

.blog-card:hover .blog-card-media svg {
  transform: scale(1.05);
}

.blog-card-tag,
.blog-card h3,
.blog-card p,
.blog-card-more {
  margin-inline: 1.6rem;
}

.blog-card-tag { margin-top: 1.6rem; }

.blog-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 60%;
  height: 2px;
  background: var(--grad-h);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.blog-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-glow);
  box-shadow: 0 14px 40px rgba(210, 53, 138, 0.18);
}

.blog-card:hover::after { opacity: 1; }

.blog-card-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--magenta);
  border: 1px solid var(--border-glow);
  border-radius: 2rem;
  padding: 0.2rem 0.8rem;
}

.blog-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.7;
}

.blog-card p {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.9;
  flex-grow: 1;
}

.blog-card-more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--pink);
}

.blog-card-more svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-more svg {
  transform: translateX(-4px);
}

/* ============================================================
   Article page (blog/*.html)
   ============================================================ */

#article-hero {
  padding: 8.5rem 0 3.5rem;
  text-align: center;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

#article-hero::before {
  content: '';
  position: absolute;
  top: -120px;
  right: -120px;
  width: 360px;
  height: 360px;
  background: var(--grad);
  opacity: 0.18;
  filter: blur(80px);
  border-radius: 50%;
  pointer-events: none;
}

#article-hero .article-breadcrumb {
  justify-content: center;
}

@media (max-width: 640px) {
  #article-hero { padding: 7.5rem 0 3rem; }
  .article-cover { padding: 0 1.2rem; }
  .article-toc { padding: 1.2rem 1.3rem; }
  .article-keypoints { padding: 1.3rem 1.4rem; }
  .article-cta { padding: 1.5rem; }
}

.article-cover {
  position: relative;
  width: 100%;
  max-width: 1000px;
  margin: 3rem auto 0;
  padding: 0 2rem;
}

/* Ambient glow blobs behind the cover, echoing the hero background glow */
.article-cover::before,
.article-cover::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: var(--grad);
  filter: blur(70px);
  pointer-events: none;
  z-index: 0;
}

.article-cover::before {
  top: -50px;
  inset-inline-end: 6%;
  width: 240px;
  height: 240px;
  opacity: 0.22;
}

.article-cover::after {
  bottom: -60px;
  inset-inline-start: 6%;
  width: 210px;
  height: 210px;
  opacity: 0.15;
}

/* Gradient-bordered frame (padding trick) around the actual cover media */
.article-cover-frame {
  position: relative;
  z-index: 1;
  padding: 3px;
  border-radius: 1.4rem;
  background: var(--grad);
  box-shadow:
    0 26px 60px rgba(210, 53, 138, 0.28),
    0 10px 30px rgba(0, 0, 0, 0.5);
  transition: transform 0.45s cubic-bezier(.22,.85,.32,1), box-shadow 0.45s ease;
}

.article-cover-frame:hover {
  transform: translateY(-5px);
  box-shadow:
    0 34px 72px rgba(210, 53, 138, 0.36),
    0 14px 36px rgba(0, 0, 0, 0.55);
}

.article-cover-frame img,
.article-cover-frame svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: calc(1.4rem - 3px);
  background: var(--surface2);
}

/* Small floating tag chip on the corner of the cover, matches .article-tag styling */
.article-cover-chip {
  position: absolute;
  bottom: 1.1rem;
  inset-inline-start: 1.4rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--white);
  background: rgba(20, 9, 28, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-glow);
  border-radius: 2rem;
  padding: 0.35rem 0.9rem 0.35rem 0.7rem;
}

.article-cover-chip svg {
  width: 14px;
  height: 14px;
  color: var(--pink);
}

@media (max-width: 640px) {
  .article-cover-frame { padding: 2px; border-radius: 1.1rem; }
  .article-cover-frame img,
  .article-cover-frame svg { border-radius: calc(1.1rem - 2px); }
  .article-cover::before { width: 160px; height: 160px; }
  .article-cover::after { width: 140px; height: 140px; }
}

/* Kept for optional use elsewhere (e.g. inline within article body) */
.article-back-wrap { margin-bottom: 1.5rem; text-align: center; }

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  transition: all 0.3s ease;
}

.btn-back:hover {
  background: var(--grad-h);
  color: var(--white);
  border-color: transparent;
}

.btn-back svg { width: 18px; height: 18px; transition: transform 0.3s ease; }
.btn-back:hover svg { transform: translateX(4px); }

.article-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--magenta);
  border: 1px solid var(--border-glow);
  border-radius: 2rem;
  padding: 0.25rem 0.9rem;
  margin-bottom: 1rem;
}

#article-hero h1 {
  font-size: clamp(1.8rem, 3.4vw, 2.7rem);
  font-weight: 800;
  color: var(--white);
  line-height: 1.5;
  max-width: 760px;
  margin: 0 auto 0.9rem;
}

.article-meta {
  margin-top: 0;
  color: var(--text-dim);
  font-size: 0.9rem;
}

#article-body {
  padding: 3rem 0 7rem;
  background: var(--bg);
}

.article-content {
  max-width: 780px;
  margin: 0 auto;
  text-align: justify;
}

.article-content p {
  color: var(--text);
  font-size: 0.98rem;
  line-height: 2.1;
  margin-bottom: 1.4rem;
}

.article-content h2 {
  color: var(--white);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 2.2rem 0 1rem;
  padding-inline-start: 0.8rem;
  border-inline-start: 3px solid var(--magenta);
}

.article-content ul {
  margin: 0 0 1.4rem 0;
  padding-inline-start: 1.4rem;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 2;
}

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

.article-content strong { color: var(--pink); }

.article-divider {
  height: 1px;
  background: var(--border);
  margin: 3rem 0;
}

.article-cta {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.8rem;
  text-align: center;
  max-width: 780px;
  margin: 0 auto;
}

.article-cta p { color: var(--text-dim); margin-bottom: 1rem; }


/* Target the new image class */
.blog-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* This ensures the image fills the area without distortion */
  display: block;
  transition: transform 0.5s ease; /* Keeps your hover effect logic */

}

/* Optional: Add a slight zoom effect when hovering the card, 
   matching your existing SVG transition logic */
.blog-card:hover .blog-card-img {
  transform: scale(1.05);
}

/* ============================================================
   Article page extras — breadcrumb, TOC, key points, FAQ,
   related articles, share row
   (used by blog/*.html article pages built from the template)
   ============================================================ */

/* ---- Breadcrumb ---- */
.article-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 1.1rem;
}

.article-breadcrumb a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s ease;
}

.article-breadcrumb a:hover { color: var(--pink); }

.article-breadcrumb .sep { opacity: 0.5; }

.article-breadcrumb .current {
  color: var(--white);
  font-weight: 600;
}

/* ---- Table of contents ---- */
.article-toc {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.4rem 1.6rem;
  margin: 0 0 2.2rem;
}

.article-toc h2 {
  font-size: 1rem;
  margin: 0 0 0.9rem;
  padding-inline-start: 0;
  border-inline-start: none;
  color: var(--white);
}

.article-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.article-toc a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  transition: color 0.2s ease;
}

.article-toc a:hover { color: var(--pink); }

.article-toc .toc-num {
  color: var(--magenta);
  font-weight: 700;
  font-size: 0.78rem;
  flex-shrink: 0;
}

/* ---- Key takeaways box ---- */
.article-keypoints {
  background: linear-gradient(135deg, rgba(210, 53, 138, 0.10), rgba(150, 42, 130, 0.05));
  border: 1px solid var(--border-glow);
  border-radius: 1rem;
  padding: 1.6rem 1.8rem;
  margin: 0 0 2.2rem;
}

.article-keypoints h2 {
  font-size: 1rem;
  margin: 0 0 0.9rem;
  padding-inline-start: 0;
  border-inline-start: none;
  color: var(--white);
}

.article-keypoints ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.article-keypoints li {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.8;
}

.article-keypoints li svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 3px;
  color: var(--magenta);
}

/* ---- FAQ accordion (native <details>, crawlable, no JS needed) ---- */
.article-faq { margin: 2.6rem 0; }

.faq-item {
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: var(--surface2);
  margin-bottom: 0.8rem;
  overflow: hidden;
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-weight: 600;
  color: var(--white);
  font-size: 0.95rem;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '';
  flex-shrink: 0;
  width: 9px;
  height: 9px;
  border-inline-end: 2px solid var(--magenta);
  border-bottom: 2px solid var(--magenta);
  transform: rotate(45deg);
  transition: transform 0.25s ease;
  margin-inline-start: auto;
}

.faq-item[open] summary::after { transform: rotate(225deg); }

.faq-item .faq-answer {
  padding: 0 1.3rem 1.2rem;
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.9;
}

/* ---- Related articles ---- */
.article-related { margin: 3.2rem 0 0; }

.article-related h2 {
  color: var(--white);
  font-size: 1.35rem;
  font-weight: 700;
  padding-inline-start: 0.8rem;
  border-inline-start: 3px solid var(--magenta);
  margin-bottom: 1.4rem;
}

.article-related .blog-grid { margin-top: 0; }

/* ---- Share row ---- */
.article-share {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 1.8rem 0 0;
}

.article-share span {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 600;
}