/*
 * Insights blog: post cards (homepage + blog.html), page header, article
 * typography (post.html + editor preview) and status messages.
 * Relies on the colour tokens defined in index.html / css/site.css.
 */

/* ── PAGE HEADER (blog.html) ── */
.insights-hero {
  padding: 152px 60px 72px;
  background: var(--off-white);
  border-bottom: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.insights-hero::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(to bottom, var(--orange) 0%, transparent 100%);
}
.insights-hero-mark {
  position: absolute; right: -40px; bottom: -70px;
  width: 360px; height: 320px; opacity: 0.05; pointer-events: none;
}
.insights-hero .section-title { max-width: 760px; }

/* ── CARD GRID ── */
.insights-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.insights-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 32px; flex-wrap: wrap; margin-bottom: 56px;
}

.insight-card {
  background: var(--white);
  border: 1px solid var(--border);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
  display: flex;
}
.insight-card:hover {
  border-color: var(--orange);
  box-shadow: 0 8px 32px rgba(232,96,10,0.08);
  transform: translateY(-2px);
}
.insight-card-link {
  display: flex; flex-direction: column; width: 100%;
  color: inherit; text-decoration: none;
}
.insight-card-link:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }

.insight-cover {
  aspect-ratio: 16 / 9;
  background: var(--slate-dark);
  position: relative; overflow: hidden;
}
.insight-cover::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: var(--orange);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.35s;
}
.insight-card:hover .insight-cover::after { transform: scaleX(1); }
.insight-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.insight-placeholder {
  position: absolute; inset: 0;
  background:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(135deg, var(--slate-dark) 0%, var(--slate) 100%);
  background-size: 32px 32px, 32px 32px, 100% 100%;
  display: flex; align-items: center; justify-content: center;
}
.insight-placeholder-mark { width: 72px; height: 62px; }

.insight-body { padding: 28px 28px 32px; display: flex; flex-direction: column; flex: 1; }
.insight-date {
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--orange); font-weight: 600; margin-bottom: 12px;
}
.insight-title {
  font-family: 'Playfair Display', serif;
  font-size: 21px; font-weight: 600; line-height: 1.3;
  color: var(--slate-dark); margin-bottom: 12px;
}
.insight-excerpt {
  font-size: 14px; color: var(--text-muted);
  line-height: 1.75; font-weight: 300; margin-bottom: 24px;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.insight-more {
  margin-top: auto;
  font-size: 13px; font-weight: 600; color: var(--slate-dark);
  display: inline-flex; gap: 8px; align-items: center;
  transition: color 0.2s, gap 0.2s;
}
.insight-card:hover .insight-more { color: var(--orange); gap: 12px; }

/* ── STATUS MESSAGES ── */
.insights-status {
  border: 1px dashed var(--border);
  background: var(--off-white);
  padding: 56px 32px;
  text-align: center;
  font-size: 15px; color: var(--text-muted); line-height: 1.7;
}
.insights-status strong {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 22px; font-weight: 600; color: var(--slate-dark);
  margin-bottom: 6px;
}
.insights-status a { color: var(--orange); }

.insights-loading { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.skeleton {
  background: linear-gradient(90deg, var(--off-white) 0%, var(--cream) 50%, var(--off-white) 100%);
  background-size: 200% 100%;
  animation: skeleton 1.4s ease-in-out infinite;
}
.skeleton-card { height: 380px; border: 1px solid var(--border); }
@keyframes skeleton { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── ARTICLE (post.html + editor preview) ── */
.article-wrap { padding: 136px 60px 100px; }
.article { max-width: 760px; margin: 0 auto; }

.article-back {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.04em;
  color: var(--text-muted); text-decoration: none;
  margin-bottom: 40px; transition: color 0.2s;
}
.article-back:hover { color: var(--orange); }

.article-draft-banner {
  background: var(--orange-pale);
  border-left: 3px solid var(--orange);
  padding: 12px 16px; margin-bottom: 32px;
  font-size: 13px; color: var(--slate-dark);
}
.article-draft-banner strong { color: var(--orange); letter-spacing: 0.1em; text-transform: uppercase; font-size: 11px; margin-right: 8px; }

.article-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(34px, 4.2vw, 54px);
  font-weight: 700; line-height: 1.12;
  color: var(--slate-dark); margin-bottom: 24px;
}
.article-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px;
  font-size: 13px; color: var(--text-muted);
  padding-bottom: 28px; margin-bottom: 40px;
  border-bottom: 1px solid var(--border);
}
.article-meta-item { display: inline-flex; align-items: center; gap: 10px; }
.article-meta-item + .article-meta-item::before {
  content: ''; width: 6px; height: 6px; background: var(--orange); margin-right: 10px;
}
.article-meta strong { color: var(--slate-dark); font-weight: 600; }

.article-cover {
  margin: 0 0 48px; aspect-ratio: 16 / 9; overflow: hidden;
  background: var(--slate-dark); position: relative;
}
.article-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.article-cover::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--orange);
}

.article-content {
  font-size: 17px; line-height: 1.85; color: var(--text); font-weight: 400;
  overflow-wrap: break-word;
}
.article-content > * + * { margin-top: 1.25em; }
.article-content h2, .article-content h3, .article-content h4 {
  font-family: 'Playfair Display', serif; color: var(--slate-dark); line-height: 1.25;
}
.article-content h2 { font-size: 30px; font-weight: 700; margin-top: 1.8em; }
.article-content h3 { font-size: 23px; font-weight: 600; margin-top: 1.6em; }
.article-content h4 { font-size: 19px; font-weight: 600; margin-top: 1.4em; }
.article-content a { color: var(--orange); text-decoration: underline; text-underline-offset: 3px; }
.article-content a:hover { color: var(--slate-dark); }
.article-content strong, .article-content b { font-weight: 600; color: var(--slate-dark); }
.article-content ul, .article-content ol { padding-left: 1.4em; }
.article-content li + li { margin-top: 0.4em; }
.article-content ul li::marker { color: var(--orange); }
.article-content blockquote {
  font-family: 'Playfair Display', serif; font-style: italic;
  font-size: 21px; line-height: 1.6; color: var(--slate-dark);
  border-left: 3px solid var(--orange);
  background: var(--off-white);
  padding: 24px 28px; margin-top: 1.6em; margin-bottom: 1.6em;
}
.article-content img { max-width: 100%; height: auto; display: block; margin-left: auto; margin-right: auto; }
.article-content figure { margin: 1.6em 0; }
.article-content figcaption { font-size: 13px; color: var(--text-muted); text-align: center; margin-top: 8px; }
.article-content hr { border: none; border-top: 1px solid var(--border); margin: 2.4em 0; }
.article-content table { border-collapse: collapse; width: 100%; font-size: 15px; }
.article-content th, .article-content td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.article-content pre, .article-content code { font-family: ui-monospace, Consolas, monospace; font-size: 0.9em; background: var(--off-white); }
.article-content pre { padding: 16px; overflow-x: auto; }

.article-footer {
  margin-top: 64px; padding-top: 32px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap;
}
.article-footer p { font-size: 14px; color: var(--text-muted); }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .insights-hero { padding: 128px 32px 56px; }
  .insights-grid, .insights-loading { grid-template-columns: 1fr 1fr; }
  .article-wrap { padding: 120px 32px 72px; }
}
@media (max-width: 640px) {
  .insights-hero { padding: 112px 20px 48px; }
  .insights-grid, .insights-loading { grid-template-columns: 1fr; }
  .insights-loading .skeleton-card:nth-child(n+2) { display: none; }
  .article-wrap { padding: 104px 20px 56px; }
  .article-content { font-size: 16px; }
  .article-content blockquote { font-size: 18px; padding: 18px 20px; }
}
