/* ============================================
   Retake Article — Scoped styles
   All selectors scoped under .article-retake
   to avoid conflicts with main site styles.
   ============================================ */

/* --- Base resets scoped to article --- */
.article-retake *,
.article-retake *::before,
.article-retake *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.article-retake {
  line-height: 1.6;
  font-family: var(--art-font-body, sans-serif);
  font-size: var(--art-text-base);
  color: var(--art-color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.article-retake img,
.article-retake picture,
.article-retake video,
.article-retake canvas,
.article-retake svg {
  display: block;
  max-width: 100%;
  height: auto;
}
.article-retake ul[role='list'],
.article-retake ol[role='list'] {
  list-style: none;
}
.article-retake input,
.article-retake button,
.article-retake textarea,
.article-retake select {
  font: inherit;
  color: inherit;
}
.article-retake h1,
.article-retake h2,
.article-retake h3,
.article-retake h4,
.article-retake h5,
.article-retake h6 {
  text-wrap: balance;
  line-height: 1.15;
}
.article-retake p,
.article-retake li,
.article-retake figcaption {
  text-wrap: pretty;
  max-width: 72ch;
}

.article-retake ::selection {
  background: oklch(from var(--art-color-primary) l c h / 0.25);
  color: var(--art-color-text);
}
.article-retake :focus-visible {
  outline: 2px solid var(--art-color-primary);
  outline-offset: 3px;
  border-radius: var(--art-radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  .article-retake *,
  .article-retake *::before,
  .article-retake *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.article-retake button {
  cursor: pointer;
  background: none;
  border: none;
}
.article-retake table {
  border-collapse: collapse;
  width: 100%;
}

.article-retake a,
.article-retake button,
.article-retake [role='button'],
.article-retake [role='link'],
.article-retake input,
.article-retake textarea,
.article-retake select {
  transition:
    color var(--art-transition-interactive),
    background var(--art-transition-interactive),
    border-color var(--art-transition-interactive),
    box-shadow var(--art-transition-interactive);
}

.article-retake .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================
   Design tokens — prefixed with --art- to
   avoid collision with main site's CSS vars
   ============================================ */

:root {
  --art-text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --art-text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --art-text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --art-text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --art-text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --art-text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);

  --art-space-1: 0.25rem;
  --art-space-2: 0.5rem;
  --art-space-3: 0.75rem;
  --art-space-4: 1rem;
  --art-space-5: 1.25rem;
  --art-space-6: 1.5rem;
  --art-space-8: 2rem;
  --art-space-10: 2.5rem;
  --art-space-12: 3rem;
  --art-space-16: 4rem;
  --art-space-20: 5rem;
  --art-space-24: 6rem;
  --art-space-32: 8rem;

  --art-radius-sm: 0.375rem;
  --art-radius-md: 0.5rem;
  --art-radius-lg: 0.75rem;
  --art-radius-xl: 1rem;
  --art-radius-full: 9999px;

  --art-transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  --art-content-narrow: 640px;
  --art-content-default: 860px;
  --art-content-wide: 1100px;

  --art-font-display: 'Playfair Display', Georgia, serif;
  --art-font-body: 'Source Sans 3', 'Helvetica Neue', sans-serif;
}

/* ---- LIGHT MODE ---- */
:root,
[data-theme='light'] {
  --art-color-bg: #f5f6fa;
  --art-color-surface: #ffffff;
  --art-color-surface-2: #f0f1f5;
  --art-color-surface-offset: #e8eaf0;
  --art-color-divider: #d0d3dc;
  --art-color-border: #c5c8d2;
  --art-color-text: #1a1d2b;
  --art-color-text-muted: #5a5e6e;
  --art-color-text-faint: #9a9daa;
  --art-color-text-inverse: #f5f6fa;

  --art-color-navy: #1b2a4a;
  --art-color-navy-deep: #0f1b33;

  --art-color-primary: #0e7a7e;
  --art-color-primary-hover: #0a5f62;
  --art-color-primary-active: #084a4d;
  --art-color-primary-light: #e0f5f5;

  --art-color-gold: #c5912d;
  --art-color-gold-light: #fdf6e8;

  --art-color-success: #2a7d3f;
  --art-color-warning: #b5730d;
  --art-color-error: #b03030;

  --art-shadow-sm: 0 1px 3px rgba(27, 42, 74, 0.06);
  --art-shadow-md: 0 4px 12px rgba(27, 42, 74, 0.08);
  --art-shadow-lg: 0 12px 32px rgba(27, 42, 74, 0.12);
}

/* ====== GLOBAL ====== */
.article-retake a {
  color: var(--art-color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.article-retake a:hover {
  color: var(--art-color-primary-hover);
}

/* ====== HERO ====== */
.article-retake .art-hero {
  background: linear-gradient(155deg, var(--art-color-navy-deep) 0%, var(--art-color-navy) 55%, #1e3e5f 100%);
  padding: clamp(var(--art-space-16), 10vw, var(--art-space-32)) var(--art-space-4);
  text-align: left;
  position: relative;
  overflow: hidden;
}
.article-retake .art-hero::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(ellipse, rgba(14, 122, 126, 0.08) 0%, transparent 70%);
  pointer-events: none;
}
.article-retake .hero-inner {
  max-width: var(--art-content-default);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.article-retake .art-hero h1 {
  font-family: var(--art-font-display);
  font-size: var(--art-text-2xl);
  color: #ffffff;
  font-weight: 700;
  margin-bottom: var(--art-space-6);
  line-height: 1.15;
  max-width: 20ch;
}
.article-retake .art-hero-subtitle {
  font-size: var(--art-text-lg);
  color: rgba(255, 255, 255, 0.8);
  max-width: 52ch;
  margin-bottom: var(--art-space-8);
  line-height: 1.5;
}
.article-retake .hero-breadcrumb {
  font-size: var(--art-text-xs);
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: var(--art-space-4);
}
.article-retake .hero-breadcrumb a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
}
.article-retake .hero-breadcrumb a:hover {
  color: rgba(255, 255, 255, 0.85);
}

/* ====== MOTIVATION SECTION ====== */
.article-retake .motivation {
  padding: clamp(var(--art-space-12), 6vw, var(--art-space-20)) var(--art-space-4);
  background: var(--art-color-bg);
}
.article-retake .motivation-inner {
  max-width: var(--art-content-default);
  margin: 0 auto;
}
.article-retake .motivation-cards {
  display: grid;
  gap: var(--art-space-6);
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .article-retake .motivation-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}
.article-retake .motivation-card {
  background: var(--art-color-surface);
  border-radius: var(--art-radius-lg);
  padding: var(--art-space-8) var(--art-space-6);
  text-align: center;
  box-shadow: var(--art-shadow-sm);
  border: 1px solid var(--art-color-divider);
  position: relative;
  overflow: hidden;
}
.article-retake .motivation-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--art-color-primary), var(--art-color-gold));
}
.article-retake .motivation-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--art-space-4);
  color: var(--art-color-primary);
}
.article-retake .motivation-card h3 {
  font-family: var(--art-font-display);
  font-size: var(--art-text-lg);
  font-weight: 700;
  color: var(--art-color-text);
  margin-bottom: var(--art-space-3);
}
.article-retake .motivation-card p {
  font-size: var(--art-text-base);
  color: var(--art-color-text-muted);
  line-height: 1.6;
  max-width: 40ch;
  margin: 0 auto;
}

/* ====== SECTION NAV ====== */
.article-retake .section-nav {
  padding: var(--art-space-8) var(--art-space-4);
  background: var(--art-color-surface);
  border-bottom: 1px solid var(--art-color-divider);
  position: sticky;
  top: 52px;
  z-index: 40;
}
.article-retake .section-nav-inner {
  max-width: var(--art-content-default);
  margin: 0 auto;
  display: flex;
  gap: var(--art-space-4);
  align-items: center;
  flex-wrap: wrap;
}
.article-retake .section-nav-label {
  font-size: var(--art-text-sm);
  color: var(--art-color-text-faint);
  font-weight: 500;
  white-space: nowrap;
}
.article-retake .nav-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--art-space-2);
  padding: var(--art-space-2) var(--art-space-5);
  border-radius: var(--art-radius-full);
  font-size: var(--art-text-sm);
  font-weight: 600;
  text-decoration: none;
  border: 2px solid var(--art-color-primary);
  color: var(--art-color-primary);
  background: transparent;
}
.article-retake .nav-btn:hover {
  background: var(--art-color-primary);
  color: #fff;
}

/* ====== MAIN CONTENT SECTIONS ====== */
.article-retake .content-section {
  padding: clamp(var(--art-space-12), 6vw, var(--art-space-20)) var(--art-space-4);
}
.article-retake .content-section:nth-child(even) {
  background: var(--art-color-surface);
}
.article-retake .content-inner {
  max-width: var(--art-content-default);
  margin: 0 auto;
}
.article-retake .section-header {
  margin-bottom: var(--art-space-8);
}
.article-retake .section-tag {
  display: inline-block;
  font-size: var(--art-text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--art-color-primary);
  margin-bottom: var(--art-space-2);
}
.article-retake .section-header h2 {
  font-family: var(--art-font-display);
  font-size: var(--art-text-xl);
  font-weight: 700;
  color: var(--art-color-text);
  margin-bottom: var(--art-space-3);
}
.article-retake .section-header p {
  font-size: var(--art-text-base);
  color: var(--art-color-text-muted);
  max-width: 65ch;
}

/* ====== SUBJECT LIST ====== */
.article-retake .subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
  gap: var(--art-space-3);
  margin-bottom: var(--art-space-10);
}
.article-retake .subject-chip {
  display: flex;
  align-items: center;
  gap: var(--art-space-3);
  padding: var(--art-space-3) var(--art-space-4);
  background: var(--art-color-surface);
  border-radius: var(--art-radius-md);
  border: 1px solid var(--art-color-divider);
  font-size: var(--art-text-base);
  font-weight: 500;
  color: var(--art-color-text);
}
.article-retake .subject-chip .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--art-radius-full);
  background: var(--art-color-primary-light);
  color: var(--art-color-primary);
  font-size: var(--art-text-xs);
  font-weight: 700;
  flex-shrink: 0;
}

/* ====== SCORE TABLE ====== */
.article-retake .score-section {
  margin: var(--art-space-10) 0;
}
.article-retake .score-section h3 {
  font-family: var(--art-font-display);
  font-size: var(--art-text-lg);
  font-weight: 700;
  margin-bottom: var(--art-space-2);
}
.article-retake .score-section > p {
  color: var(--art-color-text-muted);
  margin-bottom: var(--art-space-6);
}
.article-retake .score-table-wrapper {
  border-radius: var(--art-radius-lg);
  border: 1px solid var(--art-color-divider);
  overflow: hidden;
  box-shadow: var(--art-shadow-sm);
  background: var(--art-color-surface);
}
.article-retake .score-table {
  width: 100%;
  border-collapse: collapse;
}
.article-retake .score-table thead th {
  background: var(--art-color-navy);
  color: #fff;
  font-size: var(--art-text-sm);
  font-weight: 600;
  padding: var(--art-space-3) var(--art-space-4);
  text-align: left;
  letter-spacing: 0.02em;
}
.article-retake .score-table tbody td {
  padding: var(--art-space-3) var(--art-space-4);
  border-bottom: 1px solid var(--art-color-divider);
  font-size: var(--art-text-base);
}
.article-retake .score-table tbody tr:last-child td { border-bottom: none; }
.article-retake .score-table tbody td:first-child { font-weight: 500; }
.article-retake .score-input {
  width: 80px;
  padding: var(--art-space-2) var(--art-space-3);
  border: 1px solid var(--art-color-border);
  border-radius: var(--art-radius-md);
  font-size: var(--art-text-base);
  text-align: center;
  background: var(--art-color-bg);
  color: var(--art-color-text);
  font-weight: 600;
}
.article-retake .score-input:focus {
  border-color: var(--art-color-primary);
  outline: 2px solid var(--art-color-primary);
  outline-offset: 1px;
}
.article-retake .score-input::placeholder {
  color: var(--art-color-text-faint);
  font-weight: 400;
}
.article-retake .status-badge {
  display: inline-block;
  padding: var(--art-space-1) var(--art-space-3);
  border-radius: var(--art-radius-full);
  font-size: var(--art-text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.article-retake .status-strong { background: #d4edda; color: #155724; }
.article-retake .status-ok { background: #fff3cd; color: #856404; }
.article-retake .status-weak { background: #f8d7da; color: #721c24; }
.article-retake .status-critical { background: #f5c6cb; color: #491217; }

.article-retake .evaluate-error {
  margin-top: var(--art-space-4);
  font-size: var(--art-text-sm);
  color: var(--art-color-error);
  font-weight: 500;
}
.article-retake .score-input.input-error {
  border-color: var(--art-color-error);
  outline: 2px solid var(--art-color-error);
  outline-offset: 1px;
  background: #fef2f2;
}

.article-retake .evaluate-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--art-space-2);
  margin-top: var(--art-space-6);
  padding: var(--art-space-3) var(--art-space-8);
  background: var(--art-color-primary);
  color: #fff;
  border-radius: var(--art-radius-md);
  font-size: var(--art-text-base);
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  border: none;
}
.article-retake .evaluate-btn:hover { background: var(--art-color-primary-hover); }
.article-retake .evaluate-btn:active { background: var(--art-color-primary-active); }

.article-retake .post-evaluate-cta {
  margin-top: var(--art-space-6);
  font-size: var(--art-text-sm);
  color: var(--art-color-text-muted);
  line-height: 1.5;
}
.article-retake .post-evaluate-cta a {
  color: var(--art-color-primary);
  font-weight: 600;
}

.article-retake .score-results { display: none; }
.article-retake .score-results.visible { display: block; }

.article-retake .priority-list {
  margin-top: var(--art-space-6);
  padding: var(--art-space-6);
  border-radius: var(--art-radius-lg);
  background: var(--art-color-gold-light);
  border: 1px solid oklch(from var(--art-color-gold) l c h / 0.2);
}
.article-retake .priority-list h4 {
  font-family: var(--art-font-display);
  font-size: var(--art-text-lg);
  font-weight: 700;
  margin-bottom: var(--art-space-3);
  color: var(--art-color-text);
}
.article-retake .priority-list .empty-msg {
  color: var(--art-color-text-muted);
  font-style: italic;
}
.article-retake .priority-item {
  display: flex;
  align-items: center;
  gap: var(--art-space-3);
  padding: var(--art-space-2) 0;
  font-size: var(--art-text-base);
}
.article-retake .priority-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--art-radius-full);
  background: var(--art-color-error);
  color: #fff;
  font-size: var(--art-text-xs);
  font-weight: 700;
  flex-shrink: 0;
}
.article-retake .priority-item .score-val {
  color: var(--art-color-text-muted);
  font-size: var(--art-text-sm);
}

/* ====== INFO CARDS ====== */
.article-retake .info-card {
  padding: var(--art-space-6);
  border-radius: var(--art-radius-lg);
  border: 1px solid var(--art-color-divider);
  background: var(--art-color-surface);
  box-shadow: var(--art-shadow-sm);
  margin-bottom: var(--art-space-6);
}
.article-retake .info-card h3 {
  font-family: var(--art-font-display);
  font-size: var(--art-text-lg);
  font-weight: 700;
  margin-bottom: var(--art-space-3);
}
.article-retake .info-card p, .article-retake .info-card li {
  color: var(--art-color-text-muted);
  line-height: 1.7;
}
.article-retake .info-card ul {
  padding-left: var(--art-space-6);
  margin: var(--art-space-3) 0;
}
.article-retake .info-card li { margin-bottom: var(--art-space-2); }

/* ====== CALLOUT ====== */
.article-retake .callout {
  padding: var(--art-space-6);
  border-radius: var(--art-radius-lg);
  border: 1px solid oklch(from var(--art-color-primary) l c h / 0.2);
  background: var(--art-color-primary-light);
  margin: var(--art-space-8) 0;
}
.article-retake .callout h4 {
  font-weight: 700;
  margin-bottom: var(--art-space-2);
  color: var(--art-color-text);
}
.article-retake .callout p {
  color: var(--art-color-text-muted);
  line-height: 1.7;
}

/* ====== TIP BOX ====== */
.article-retake .tip-box {
  display: flex;
  gap: var(--art-space-4);
  padding: var(--art-space-5) var(--art-space-6);
  border-radius: var(--art-radius-lg);
  background: var(--art-color-gold-light);
  border: 1px solid oklch(from var(--art-color-gold) l c h / 0.2);
  margin: var(--art-space-6) 0;
  align-items: flex-start;
}
.article-retake .tip-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: var(--art-color-gold);
  margin-top: 2px;
}
.article-retake .tip-box p {
  font-size: var(--art-text-base);
  color: var(--art-color-text);
  line-height: 1.6;
}

/* ====== FLORIDA SECTION TABS ====== */
.article-retake .fl-tabs {
  display: flex;
  gap: var(--art-space-2);
  margin-bottom: var(--art-space-8);
  border-bottom: 2px solid var(--art-color-divider);
}
.article-retake .fl-tab {
  padding: var(--art-space-3) var(--art-space-6);
  font-size: var(--art-text-sm);
  font-weight: 600;
  color: var(--art-color-text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  background: none;
  border-left: 0;
  border-right: 0;
  border-top: 0;
}
.article-retake .fl-tab:hover { color: var(--art-color-text); }
.article-retake .fl-tab.active {
  color: var(--art-color-primary);
  border-bottom-color: var(--art-color-primary);
}
.article-retake .fl-tab-content { display: none; }
.article-retake .fl-tab-content.active { display: block; }

/* ====== SUMMARY / CTA ====== */
.article-retake .summary-section {
  background: linear-gradient(155deg, var(--art-color-navy-deep) 0%, var(--art-color-navy) 55%, #1e3e5f 100%);
  padding: clamp(var(--art-space-12), 8vw, var(--art-space-24)) var(--art-space-4);
  color: #fff;
}
.article-retake .summary-inner {
  max-width: var(--art-content-default);
  margin: 0 auto;
}
.article-retake .summary-inner h2 {
  font-family: var(--art-font-display);
  font-size: var(--art-text-xl);
  font-weight: 700;
  margin-bottom: var(--art-space-6);
  color: #fff;
}
.article-retake .summary-inner p {
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.7;
  margin-bottom: var(--art-space-4);
  max-width: 65ch;
}
.article-retake .summary-inner strong { color: #fff; }

.article-retake .cta-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--art-space-2);
  padding: var(--art-space-3) var(--art-space-8);
  background: var(--art-color-primary);
  color: #fff;
  border-radius: var(--art-radius-md);
  font-size: var(--art-text-sm);
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.01em;
}
.article-retake .cta-btn:hover {
  background: var(--art-color-primary-hover);
  color: #fff;
}
.article-retake .cta-btn-outline {
  background: transparent;
  border: 2px solid rgba(255,255,255,0.3);
  color: #fff;
}
.article-retake .cta-btn-outline:hover {
  border-color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.08);
  color: #fff;
}

/* ====== PROSE ====== */
.article-retake .prose h3 {
  font-family: var(--art-font-display);
  font-size: var(--art-text-lg);
  font-weight: 700;
  margin: var(--art-space-8) 0 var(--art-space-3);
}
.article-retake .prose h3:first-child { margin-top: 0; }
.article-retake .prose p {
  color: var(--art-color-text-muted);
  line-height: 1.7;
  margin-bottom: var(--art-space-4);
}
.article-retake .prose ul, .article-retake .prose ol {
  padding-left: var(--art-space-6);
  margin-bottom: var(--art-space-4);
}
.article-retake .prose li {
  color: var(--art-color-text-muted);
  margin-bottom: var(--art-space-2);
  line-height: 1.6;
}
.article-retake .prose strong {
  color: var(--art-color-text);
  font-weight: 600;
}

/* ====== RESPONSIVE ====== */
@media (max-width: 767px) {
  .article-retake .art-hero h1 {
    font-size: clamp(1.6rem, 5vw, 2.2rem);
  }
  .article-retake .section-nav-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--art-space-3);
  }
  .article-retake .fl-tabs { overflow-x: auto; }
  .article-retake .score-table { font-size: var(--art-text-sm); }
  .article-retake .score-table thead th,
  .article-retake .score-table tbody td {
    padding: var(--art-space-2) var(--art-space-3);
  }
  .article-retake .score-input { width: 60px; }
}

.article-retake .table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.article-retake .fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.article-retake .fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}
