/* ============================================================
   Flutter sub-pillar theme — "Sepia Paper + Flutter Cyan"
   Concept: warm sepia paper background, Flutter brand cyan/blue accents,
   playful display font. Low-contrast, friendly cho đọc lâu.
   ============================================================ */

:root {
  /* Backgrounds */
  --bg:           #f4ebd5;
  --bg-card:      #fbf6e7;
  --bg-alt:       #ebe0bf;

  /* Text */
  --text:         #2a1e0d;
  --text-soft:    #5b4d34;
  --text-muted:   #8c7e63;
  --ink:          #1a1206;

  /* Accent (Flutter blue family) */
  --accent:       #0468d7;
  --accent-deep:  #03488c;
  --accent-soft:  #d4e3f6;

  /* Secondary highlight (Flutter cyan + warm coral) */
  --cyan:         #54c5f8;
  --cyan-soft:    #d3edfb;
  --gold:         #cd6600;
  --gold-soft:    #f4d8b4;

  /* Borders */
  --border:       #d6c79c;
  --border-soft:  #e3d4a9;

  /* Fonts */
  --font-body:    "Inter", "Helvetica Neue", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-display: "DM Serif Display", "Recoleta", "Iowan Old Style", "Georgia", serif;
  --font-mono:    "JetBrains Mono", "Fira Code", "Menlo", "Consolas", monospace;

  /* Code block (deep navy with cyan accent) */
  --code-bg:        #0d1830;
  --code-fg:        #e9dfc4;
  --code-inline-bg: #f0e0b4;
  --code-inline-fg: #5a3c10;

  /* Syntax highlight (works on deep navy) */
  --syn-kw:    #7bd0ff;   /* Flutter cyan-ish for keywords */
  --syn-type:  #ffb874;
  --syn-str:   #c4e08e;
  --syn-num:   #f4a3ee;
  --syn-com:   #939c8e;
  --syn-fn:    #ffd476;
  --syn-op:    #d1d6df;
  --syn-cls:   #ffb874;
}

/* Flutter logo mark — stylized */
.site-logo .mark.mark-flutter {
  background: linear-gradient(135deg, #54c5f8 0%, #0468d7 100%);
  color: #fefbf1;
  font-family: var(--font-display);
  font-weight: 700;
}

/* Flutter hero treatment — playful */
.hero.flutter-hero {
  background:
    radial-gradient(ellipse 70% 50% at 30% 0%, rgba(84,197,248,0.15) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 20%, rgba(4,104,215,0.10) 0%, transparent 60%),
    linear-gradient(to bottom, var(--bg), var(--bg));
}
.hero.flutter-hero h1 em {
  color: var(--accent);
  font-style: normal;
  background: linear-gradient(120deg, var(--accent) 0%, var(--cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Chapter accent stripe (cyan gradient) */
.chapter-header {
  border-top: 4px solid;
  border-image: linear-gradient(90deg, var(--accent), var(--cyan)) 1;
  padding-top: 36px;
}

/* Chapter number badge */
.chapter-num {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: var(--cyan-soft);
  padding: 4px 12px;
  border-radius: 4px;
  margin-bottom: 12px;
  text-transform: uppercase;
}

/* Sub-pillar card */
.subpillar-card.subpillar-flutter {
  --card-accent: var(--accent);
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--cyan-soft) 100%);
}

/* Widget-tree-like callout for layout/widget examples */
.widget-tree {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 22px;
  margin: 20px 0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-soft);
  overflow-x: auto;
}
.widget-tree .widget-name {
  color: var(--accent);
  font-weight: 600;
}
.widget-tree .widget-prop {
  color: var(--gold);
}

/* Quiz number Flutter-cyan */
.quiz-num { background: var(--cyan-soft); color: var(--accent); }
.exercise::before { background: var(--accent); }

/* Flutter feature block */
.flutter-feature {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px 20px 60px;
  margin: 20px 0;
  position: relative;
}
.flutter-feature::before {
  content: "";
  position: absolute;
  left: 18px; top: 22px;
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--cyan) 100%);
  border-radius: 6px;
  transform: rotate(-12deg);
}
.flutter-feature h4 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  color: var(--ink);
}
.flutter-feature p:last-child { margin-bottom: 0; }

/* Demo iframe / embedded sample */
.flutter-demo {
  margin: 18px 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-card);
}
.flutter-demo-label {
  padding: 8px 14px;
  background: var(--cyan-soft);
  border-bottom: 1px solid var(--border-soft);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-deep);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Footer subtle gradient */
.site-footer {
  background: linear-gradient(to bottom, var(--bg), var(--bg-alt));
}

/* Layout side-by-side compare block for "code + preview" */
.code-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0;
}
.code-preview > div {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.code-preview .preview-label {
  padding: 6px 12px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border-soft);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.code-preview pre { margin: 0; border-radius: 0; border: none; }
.code-preview .preview-content { padding: 18px; }
@media (max-width: 760px) {
  .code-preview { grid-template-columns: 1fr; }
}
