/* ══════════════════════════════════════════════════════════
   article.css — Interactive Article activity type
   Design system for KaiRise article shell (article_shell.html)
   ══════════════════════════════════════════════════════════ */

:root {
  --ink:          #1a1814;
  --paper:        #faf8f4;
  --accent:       #c8440a;
  --accent-light: #f5ede7;
  --mid:          #6b6560;
  --rule:         #ddd9d2;
  --field-bg:     #f0ede7;
  --radius:       6px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  line-height: 1.8;
  font-size: 17px;
}

/* ── Site header ── */
.site-header {
  border-bottom: 1px solid var(--rule);
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.3px;
}
.logo span { color: var(--accent); }
.header-badge {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 4px 10px;
  border-radius: 20px;
}

/* ── Embedded (iframe) mode — hide site chrome ── */
html.embedded .site-header { display: none; }
html.embedded .article-wrap { padding-top: 28px; }

/* ── Article wrapper ── */
.article-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 56px 24px 96px;
}

/* ── Kicker / meta ── */
.kicker {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 16px;
}
h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(26px, 5vw, 40px);
  line-height: 1.2;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}
.byline {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--mid);
  font-size: 14px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 36px;
}
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-weight: 500;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ── Article body ── */
.article-body p {
  margin-bottom: 24px;
  color: var(--ink);
}
.article-body p:last-child { margin-bottom: 0; }

/* ── Interactive field blocks ── */
.field-block {
  background: var(--field-bg);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 24px 28px;
  margin: 36px 0;
}
.field-block-label {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.field-block-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--accent);
  opacity: 0.25;
}
.field-group { margin-bottom: 16px; }
.field-group:last-child { margin-bottom: 0; }
.field-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 8px;
  line-height: 1.4;
}
.field-group textarea,
.field-group select {
  width: 100%;
  background: white;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--ink);
  resize: vertical;
  transition: border-color 0.2s;
  line-height: 1.6;
}
.field-group textarea:focus,
.field-group select:focus {
  outline: none;
  border-color: var(--accent);
}
.field-group textarea { min-height: 80px; }

/* ── Article divider ── */
.article-divider {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 40px 0;
}

/* ── Submit section ── */
.submit-section {
  background: var(--ink);
  color: white;
  border-radius: 10px;
  padding: 36px 32px;
  margin-top: 48px;
  text-align: center;
}
.submit-section h3 {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  margin-bottom: 10px;
  font-weight: 700;
}
.submit-section p {
  font-size: 14px;
  color: rgba(255,255,255,0.65);
  margin-bottom: 24px;
  line-height: 1.6;
}
.submit-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 14px 36px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 500;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  letter-spacing: 0.3px;
}
.submit-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.submit-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── Error message ── */
.error-msg {
  color: rgba(255,255,255,0.8);
  font-size: 13px;
  margin-top: 12px;
  display: none;
}
.error-msg.visible { display: block; }

/* ── Response area ── */
.response-area {
  margin-top: 32px;
  display: none;
  text-align: left;
}
.response-area.visible { display: block; }
.response-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}
.askmike-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-weight: 700;
  font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.response-meta { font-size: 13px; color: rgba(255,255,255,0.55); }
.response-meta strong { display: block; color: white; font-size: 15px; font-weight: 500; }
.response-text {
  font-size: 16px;
  line-height: 1.85;
  color: rgba(255,255,255,0.9);
}
.response-text p { margin-bottom: 16px; }
.response-text p:last-child { margin-bottom: 0; }

/* ── Loading dots ── */
.loading-dots {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 16px 0;
}
.loading-dots span {
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  animation: bounce 1.2s infinite ease-in-out;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
  40%            { transform: scale(1);   opacity: 1; }
}

/* ── Course CTA footer ── */
.article-cta {
  margin-top: 56px;
  padding: 32px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.cta-icon { font-size: 28px; flex-shrink: 0; margin-top: 2px; }
.article-cta h4 {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  margin-bottom: 6px;
}
.article-cta p { font-size: 14px; color: var(--mid); margin-bottom: 14px; }
.cta-link {
  display: inline-block;
  background: var(--accent);
  color: white;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: var(--radius);
  transition: opacity 0.2s;
}
.cta-link:hover { opacity: 0.85; }
