/*
 * AnchorLabs Article CSS — Medium.com-style reading experience
 * Scoped to: .single-post body class (individual articles)
 *            .al-articles-page (articles listing)
 *            .al-category-archive (category archives)
 */

/* ── Reading Progress Bar ─────────────────────────────────────────────────── */
#al-reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  z-index: 99999;
  pointer-events: none;
}
#al-reading-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--al-accent, #2563EB);
  transition: width 0.08s linear;
}
.single-post #al-reading-progress { background: rgba(226,232,240,.5); }

/* ── Article Layout Wrapper ──────────────────────────────────────────────── */
.al-article-wrap {
  background: #fff;
}

/* ── Article Header ──────────────────────────────────────────────────────── */
.al-article-header {
  max-width: 780px;
  margin: 0 auto;
  padding: 64px 24px 0;
  text-align: center;
}
.al-article-cats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}
.al-cat-pill {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 20px;
  text-decoration: none;
  transition: opacity .15s;
}
.al-cat-pill:hover { opacity: .8; }

.al-article-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.12;
  color: #0F172A;
  margin: 0 0 20px;
}
.al-article-excerpt {
  font-size: 1.2rem;
  color: #64748B;
  line-height: 1.65;
  max-width: 640px;
  margin: 0 auto 28px;
  font-weight: 400;
}
.al-article-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: .875rem;
  color: #94A3B8;
  margin-bottom: 48px;
  flex-wrap: wrap;
}
.al-author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #2563EB;
  color: #fff;
  font-size: .875rem;
  font-weight: 700;
}
.al-author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.al-meta-dot { color: #CBD5E1; }
.al-meta-author { color: #475569; font-weight: 600; }

/* ── Featured Image Hero ─────────────────────────────────────────────────── */
.al-article-hero {
  max-width: 960px;
  margin: 0 auto 60px;
  padding: 0 24px;
}
.al-article-hero img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  box-shadow: 0 4px 32px rgba(0,0,0,.10);
}

/* ── Article Body (the actual content) ───────────────────────────────────── */
.al-article-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px 80px;
  font-size: 19px;
  line-height: 1.75;
  color: #374151;
}

/* Drop cap on first paragraph */
.al-article-body > p:first-child::first-letter {
  font-size: 4rem;
  font-weight: 800;
  float: left;
  line-height: .82;
  margin-right: 10px;
  margin-top: 4px;
  color: #0F172A;
}

/* Headings */
.al-article-body h2 {
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  font-weight: 800;
  color: #0F172A;
  letter-spacing: -.025em;
  margin: 1.85rem 0 .7rem;
  line-height: 1.25;
}
.al-article-body h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0F172A;
  margin: 1.4rem 0 .5rem;
  line-height: 1.3;
}
.al-article-body h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0F172A;
  margin: 1.2rem 0 .4rem;
}

/* Paragraphs */
.al-article-body p { margin-bottom: 1.1rem; }

/* Links */
.al-article-body a {
  color: #2563EB;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.al-article-body a:hover { color: #1D4ED8; }

/* Blockquote */
.al-article-body blockquote {
  border-left: 4px solid #2563EB;
  margin: 2.5rem 0;
  padding: 2px 0 2px 28px;
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.75;
  color: #475569;
}
.al-article-body blockquote p { margin-bottom: 0; }
.al-article-body blockquote cite {
  display: block;
  margin-top: 8px;
  font-size: .875rem;
  font-style: normal;
  color: #94A3B8;
}

/* Inline code */
.al-article-body code {
  font-family: 'SF Mono','Fira Code','Cascadia Code',Consolas,monospace;
  font-size: .875em;
  background: #F1F5F9;
  border-radius: 4px;
  padding: 2px 7px;
  color: #0F172A;
  word-break: break-word;
}

/* Code blocks */
.al-article-body pre {
  background: #1E293B;
  color: #E2E8F0;
  border-radius: 10px;
  padding: 20px 24px;
  overflow-x: auto;
  font-size: .875rem;
  line-height: 1.65;
  margin: 2rem 0;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
}
.al-article-body pre code {
  background: none;
  padding: 0;
  color: inherit;
  border-radius: 0;
  font-size: inherit;
}

/* Images */
.al-article-body img {
  max-width: 100%;
  border-radius: 8px;
  margin: 1.5rem 0;
  display: block;
}
.al-article-body figure { margin: 2.5rem 0; }
.al-article-body figcaption {
  text-align: center;
  font-size: .875rem;
  font-style: italic;
  color: #94A3B8;
  margin-top: 10px;
  line-height: 1.5;
}

/* Lists */
.al-article-body ul,
.al-article-body ol {
  padding-left: 28px;
  margin: 1.25rem 0 1.5rem;
}
.al-article-body li {
  margin-bottom: .6rem;
  line-height: 1.75;
}
.al-article-body ul > li::marker { color: #2563EB; }

/* Horizontal rule */
.al-article-body hr {
  border: none;
  border-top: 1px solid #E2E8F0;
  margin: 3.5rem auto;
  width: 64px;
}

/* Tables */
.al-article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
  margin: 2rem 0;
}
.al-article-body th,
.al-article-body td {
  padding: 10px 16px;
  border: 1px solid #E2E8F0;
  text-align: left;
}
.al-article-body th {
  background: #F8FAFC;
  font-weight: 700;
  color: #0F172A;
  font-size: .875rem;
}

/* ── Table of Contents ───────────────────────────────────────────────────── */
.al-toc {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 20px 24px;
  margin: 2.5rem 0;
  font-size: .9rem;
}
.al-toc-title {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #94A3B8;
  margin: 0 0 12px;
}
.al-toc ol {
  margin: 0;
  padding-left: 20px;
  counter-reset: item;
}
.al-toc li { margin-bottom: 7px; }
.al-toc a {
  color: #475569;
  text-decoration: none;
  line-height: 1.5;
}
.al-toc a:hover { color: #2563EB; text-decoration: underline; }

/* ── Article Footer (tags + share) ──────────────────────────────────────── */
.al-article-footer {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 24px 48px;
  border-top: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.al-article-footer-label {
  font-size: .8rem;
  font-weight: 600;
  color: #94A3B8;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-right: 4px;
}
.al-tag-pill {
  display: inline-block;
  background: #F1F5F9;
  color: #475569;
  font-size: .8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.al-tag-pill:hover { background: #E2E8F0; color: #0F172A; }

.al-share-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #F1F5F9;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: .8rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: background .15s;
}
.al-share-btn:hover { background: #E2E8F0; }

/* ── Author Bio ──────────────────────────────────────────────────────────── */
.al-author-bio-wrap {
  max-width: 720px;
  margin: 0 auto 64px;
  padding: 0 24px;
}
.al-author-bio {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 28px 32px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.al-author-bio-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #2563EB;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
}
.al-author-bio-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: 0;
  border-radius: 50%;
}
.al-author-bio-name {
  font-size: 1rem;
  font-weight: 700;
  color: #0F172A;
  margin: 0 0 6px;
}
.al-author-bio-text {
  font-size: .9rem;
  color: #475569;
  line-height: 1.65;
  margin: 0;
}

/* ── Related Posts ───────────────────────────────────────────────────────── */
.al-related-section {
  max-width: 960px;
  margin: 0 auto 80px;
  padding: 0 24px;
}
.al-related-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #94A3B8;
  margin-bottom: 24px;
}
.al-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.al-related-card {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  display: block;
  transition: box-shadow .2s, transform .2s;
}
.al-related-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  transform: translateY(-2px);
}
.al-related-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}
.al-related-thumb-placeholder {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #1D4ED8 0%, #7C3AED 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.al-related-info { padding: 16px; }
.al-related-cat { margin-bottom: 8px; }
.al-related-title {
  font-size: .95rem;
  font-weight: 700;
  color: #0F172A;
  margin: 0 0 8px;
  line-height: 1.4;
}
.al-related-meta { font-size: .78rem; color: #94A3B8; }

/* ── Articles Listing Page ───────────────────────────────────────────────── */
.al-articles-page { padding: 60px 24px 80px; }
.al-articles-page-header {
  max-width: 780px;
  margin: 0 auto 40px;
  text-align: center;
}
.al-articles-page-header h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -.03em;
  color: #0F172A;
  margin: 0 0 16px;
}
.al-articles-page-header p {
  font-size: 1.1rem;
  color: #64748B;
  line-height: 1.65;
  margin: 0;
}

/* Category filter tabs */
.al-category-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid #E2E8F0;
  max-width: 1160px;
  margin-left: auto;
  margin-right: auto;
}
.al-cat-tab {
  display: inline-block;
  padding: 8px 20px;
  font-size: .875rem;
  font-weight: 600;
  color: #64748B;
  text-decoration: none;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all .15s;
}
.al-cat-tab:hover { background: #F1F5F9; color: #0F172A; }
.al-cat-tab.active {
  background: #2563EB;
  color: #fff;
  border-color: #2563EB;
}

/* Featured hero post */
.al-featured-post {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  max-width: 1160px;
  margin: 0 auto 48px;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  transition: box-shadow .2s, transform .2s;
}
.al-featured-post:hover {
  box-shadow: 0 12px 48px rgba(0,0,0,.10);
  transform: translateY(-2px);
}
.al-featured-thumb-wrap { overflow: hidden; }
.al-featured-thumb {
  width: 100%;
  height: 100%;
  min-height: 300px;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}
.al-featured-post:hover .al-featured-thumb { transform: scale(1.03); }
.al-featured-thumb-placeholder {
  width: 100%;
  min-height: 300px;
  background: linear-gradient(135deg, #1D4ED8 0%, #7C3AED 100%);
}
.al-featured-info {
  padding: 36px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.al-featured-badge {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #2563EB;
  margin-bottom: 12px;
}
.al-featured-title {
  font-size: clamp(1.35rem, 3vw, 1.8rem);
  font-weight: 800;
  color: #0F172A;
  letter-spacing: -.02em;
  line-height: 1.25;
  margin: 0 0 14px;
}
.al-featured-excerpt {
  font-size: .95rem;
  color: #64748B;
  line-height: 1.7;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.al-featured-meta { font-size: .8rem; color: #94A3B8; }
.al-read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #2563EB;
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
  margin-top: 16px;
}
.al-read-more:hover { color: #1D4ED8; }

/* Article card grid */
.al-article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  max-width: 1160px;
  margin: 0 auto 48px;
}
.al-article-card {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s, transform .2s;
}
.al-article-card:hover {
  box-shadow: 0 8px 28px rgba(0,0,0,.08);
  transform: translateY(-2px);
}
.al-card-thumb-wrap { overflow: hidden; }
.al-card-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}
.al-article-card:hover .al-card-thumb { transform: scale(1.04); }
.al-card-thumb-placeholder {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #1D4ED8 0%, #7C3AED 100%);
}
/* Generated cover graphic (al_card_cover) — for articles with no featured image */
.al-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: linear-gradient(135deg, var(--a, #2563EB), var(--b, #7C3AED));
  display: flex;
  align-items: flex-end;
  padding: 16px;
}
.al-cover-motif { position: absolute; inset: 0; width: 100%; height: 100%; }
.al-cover-mark {
  position: absolute; top: 13px; right: 16px; z-index: 1;
  color: rgba(255,255,255,.92); font-weight: 800; font-size: .78rem; letter-spacing: .02em;
}
.al-cover-label {
  position: relative; z-index: 1;
  color: #fff; font-size: .7rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  background: rgba(255,255,255,.18); padding: 5px 11px; border-radius: 999px;
}
.al-article-card:hover .al-cover-motif,
.al-featured-post:hover .al-cover-motif { transform: scale(1.04); transition: transform .4s ease; }
.al-featured-thumb-wrap .al-cover { aspect-ratio: auto; height: 100%; min-height: 300px; }
/* Wide cover banner at the top of an article (Notion-style, above the title) */
.al-article-cover { max-width: 1000px; margin: 8px auto 30px; padding: 0 24px; }
.al-article-cover img,
.al-article-cover .al-cover {
  width: 100%;
  height: clamp(170px, 26vw, 290px);
  object-fit: cover;
  border-radius: 14px;
  display: block;
}
.al-article-cover .al-cover { aspect-ratio: auto; }
/* Cover used inside related-posts cards (smaller — scale the chrome down) */
.al-related-card .al-cover { aspect-ratio: 16/9; }
.al-related-card .al-cover-label { font-size: .58rem; padding: 3px 8px; }
.al-related-card .al-cover-mark { font-size: .64rem; top: 10px; right: 11px; }
.al-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.al-card-cats { margin-bottom: 8px; }
.al-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0F172A;
  line-height: 1.4;
  margin: 0 0 8px;
}
.al-card-excerpt {
  font-size: .875rem;
  color: #64748B;
  line-height: 1.65;
  flex: 1;
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.al-card-meta {
  font-size: .78rem;
  color: #94A3B8;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* Pagination */
.al-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  max-width: 1160px;
  margin: 0 auto 40px;
  flex-wrap: wrap;
}
.al-pagination a,
.al-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  transition: all .15s;
}
.al-pagination a:hover { background: #F1F5F9; border-color: #CBD5E1; }
.al-pagination .current {
  background: #2563EB;
  border-color: #2563EB;
  color: #fff;
}

/* ── Category Archive Page ───────────────────────────────────────────────── */
.al-category-archive { padding: 60px 24px 80px; }
.al-category-header {
  max-width: 780px;
  margin: 0 auto 48px;
  text-align: center;
}
.al-category-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #94A3B8;
  margin-bottom: 8px;
}
.al-category-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -.025em;
  color: #0F172A;
  margin: 0 0 12px;
}
.al-category-desc {
  font-size: 1rem;
  color: #64748B;
  line-height: 1.65;
  margin: 0;
}

/* No posts found */
.al-no-posts {
  text-align: center;
  padding: 80px 24px;
  color: #94A3B8;
}
.al-no-posts h2 { color: #0F172A; margin-bottom: 12px; }

/* ── Feature Request link in articles ───────────────────────────────────── */
.al-article-notion-cta {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px 16px;
  text-align: right;
}
.al-article-notion-cta a {
  font-size: .8rem;
  color: #94A3B8;
  text-decoration: none;
}
.al-article-notion-cta a:hover { color: #2563EB; text-decoration: underline; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .al-related-grid { grid-template-columns: repeat(2, 1fr); }
  .al-article-grid  { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .al-article-header { padding: 40px 20px 0; }
  .al-article-title  { font-size: clamp(1.75rem, 7vw, 2.5rem); }
  .al-article-excerpt { font-size: 1.05rem; }
  .al-article-hero { padding: 0; border-radius: 0; }
  .al-article-hero img { border-radius: 0; aspect-ratio: 4/3; }
  .al-article-body { font-size: 17px; padding: 0 20px 60px; }
  .al-article-body > p:first-child::first-letter { font-size: 2.75rem; }
  .al-article-body h2 { font-size: 1.3rem; }
  .al-article-body blockquote { font-size: 1rem; padding-left: 18px; }
  .al-article-footer { padding: 20px; }
  .al-author-bio { flex-direction: column; gap: 16px; padding: 24px 20px; }
  .al-related-grid { grid-template-columns: 1fr; }
  .al-related-section { margin-bottom: 60px; }

  .al-featured-post { grid-template-columns: 1fr; }
  .al-featured-thumb { min-height: 200px; }
  .al-featured-info { padding: 24px; }
  .al-featured-title { font-size: 1.25rem; }

  .al-article-grid { grid-template-columns: 1fr; }
  .al-articles-page { padding: 40px 0 60px; }
  .al-articles-page-header { padding: 0 20px; }
  .al-category-tabs { padding: 0 20px 16px; margin-bottom: 28px; }

  .al-category-archive { padding: 40px 0 60px; }
}

@media (max-width: 480px) {
  .al-article-meta { gap: 6px; font-size: .8rem; }
  .al-article-body blockquote { margin-left: 0; }
}
