/* ColoringGen — style.css */
:root {
  --pink:   #e91e8c;
  --violet: #9c27b0;
  --teal:   #009688;
  --orange: #ff9800;
  --bg:     #fdf7ff;
  --card:   #fff;
  --text:   #2d2d2d;
  --muted:  #666;
  --border: #e0d0f0;
  --shadow: 0 2px 12px rgba(120,40,160,.10);
  --radius: 12px;
}
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--pink); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── NAV ── */
nav {
  background: linear-gradient(135deg, var(--pink) 0%, var(--violet) 100%);
  color: #fff; padding: .7rem 1.5rem;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.nav-brand { font-size: 1.25rem; font-weight: 700; color: #fff; text-decoration: none; }
.nav-brand span { opacity: .8; font-weight: 400; }
.nav-links { display: flex; gap: .6rem; flex-wrap: wrap; margin-left: auto; }
.nav-links a {
  color: rgba(255,255,255,.85); font-size: .88rem; padding: .25rem .6rem;
  border-radius: 20px; border: 1px solid rgba(255,255,255,.35);
}
.nav-links a:hover, .nav-links a.active { background: rgba(255,255,255,.2); text-decoration: none; color: #fff; }

/* ── HERO ── */
.hero {
  background: linear-gradient(135deg, #fff0f8 0%, #f3e5ff 100%);
  padding: 2.5rem 1.5rem 2rem; text-align: center;
  border-bottom: 1px solid var(--border);
}
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); color: var(--violet); }
.hero p  { color: var(--muted); max-width: 600px; margin: .6rem auto 0; font-size: 1.05rem; }

/* ── CONTENT WRAPPER ── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }
main { padding: 2rem 0 3rem; }

/* ── GENERATOR GRID (home) ── */
.gen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.2rem; margin: 1.5rem 0;
}
.gen-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.4rem 1.2rem;
  text-align: center; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: .7rem;
  transition: transform .15s, box-shadow .15s;
}
.gen-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(120,40,160,.14); }
.gen-card .icon { font-size: 2.4rem; }
.gen-card h2 { font-size: 1.1rem; color: var(--violet); }
.gen-card p  { font-size: .9rem; color: var(--muted); }
.btn-go {
  display: inline-block; margin-top: .5rem; padding: .5rem 1.2rem;
  background: linear-gradient(90deg, var(--pink), var(--violet));
  color: #fff; border-radius: 20px; font-size: .9rem; font-weight: 600;
  text-decoration: none;
}
.btn-go:hover { opacity: .9; text-decoration: none; }

/* ── GENERATOR PAGE ── */
.gen-page { display: grid; grid-template-columns: 300px 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 680px) { .gen-page { grid-template-columns: 1fr; } }

.controls-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow);
  position: sticky; top: 1rem;
}
.controls-card h2 { font-size: 1rem; color: var(--violet); margin-bottom: 1rem; }

.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .3rem; }
.field select, .field input[type=range] {
  width: 100%; padding: .45rem .6rem; border: 1px solid var(--border);
  border-radius: 8px; font-size: .9rem; background: #fff; color: var(--text);
}
.field input[type=range] { padding: .3rem 0; accent-color: var(--pink); }
.range-val { font-size: .85rem; color: var(--pink); font-weight: 600; }

.btn-gen, .btn-dl {
  width: 100%; padding: .6rem; border: none; border-radius: 8px;
  font-size: 1rem; font-weight: 700; cursor: pointer;
}
.btn-gen {
  background: linear-gradient(90deg, var(--pink), var(--violet));
  color: #fff; margin-bottom: .7rem;
}
.btn-gen:hover { opacity: .9; }
.btn-dl {
  background: #fff; color: var(--violet);
  border: 2px solid var(--violet);
}
.btn-dl:hover { background: var(--violet); color: #fff; }

.preview-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow);
}
.preview-card h2 { font-size: 1rem; color: var(--violet); margin-bottom: .8rem; }
#previewCanvas {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--border); border-radius: 8px; background: #fff;
}

/* ── INFO SECTION ── */
.info-section { margin: 2.5rem 0 1rem; }
.info-section h2 { font-size: 1.3rem; color: var(--violet); margin-bottom: .6rem; }
.info-section p, .info-section li { font-size: .95rem; color: var(--muted); }
.info-section ul { padding-left: 1.4rem; }
.info-section li { margin-bottom: .3rem; }

/* ── HOW-TO STEPS ── */
.steps { display: flex; gap: 1rem; flex-wrap: wrap; margin: 1.2rem 0; }
.step {
  flex: 1 1 180px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem; text-align: center;
  box-shadow: var(--shadow);
}
.step .step-num {
  width: 2rem; height: 2rem; border-radius: 50%;
  background: linear-gradient(135deg, var(--pink), var(--violet));
  color: #fff; font-weight: 700; font-size: 1rem;
  display: flex; align-items: center; justify-content: center; margin: 0 auto .5rem;
}
.step p { font-size: .9rem; color: var(--muted); }

/* ── AD PLACEHOLDER ── */
.ad-slot {
  background: #f5f0ff; border: 2px dashed var(--border);
  border-radius: 8px; padding: .8rem; text-align: center;
  color: #bbb; font-size: .8rem; margin: 1.5rem 0;
}

/* ── CROSS-LINKS ── */
.sister-sites { display: flex; gap: .8rem; flex-wrap: wrap; margin: 1rem 0; }
.sister-link {
  flex: 1 1 200px; background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: .9rem 1rem; text-align: center; box-shadow: var(--shadow);
}
.sister-link h3 { font-size: .95rem; color: var(--pink); }
.sister-link p  { font-size: .82rem; color: var(--muted); margin-top: .25rem; }

/* ── FOOTER ── */
footer {
  background: #2d2d3a; color: #aaa; text-align: center;
  padding: 1.2rem 1rem; font-size: .82rem;
}
footer a { color: #ccc; }

/* ============================================================
   W-2 ADDITIONS: dark mode / focus-visible / 44px taps
   ============================================================ */

/* 1. DARK MODE (prefers-color-scheme) */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:      #0f1117;
    --card-bg: #1a1d27;
    --text:    #e8eaf0;
    --muted:   #8fa0bc;
    --border:  #2a3047;
    --shadow:  0 2px 12px rgba(0,0,0,0.4);
  }
  /* card / white surface overrides */
  .card, .card-bg, .white-bg { background: #1a1d27 !important; }
  /* ad placeholder dark */
  .ad-placeholder { background:#1a1d27; border-color:#2a3047; }
  /* form controls */
  select, input, textarea {
    background: #1e2233;
    color: var(--text);
    border-color: var(--border);
    color-scheme: dark;
  }
}

/* 2. FOCUS-VISIBLE (keyboard accessibility, WCAG 2.1 SC 2.4.7) */
/* Reset — pointer users see no ring; keyboard users see ring below */
a:focus, button:focus, input:focus, select:focus,
textarea:focus, [tabindex]:focus { outline: none; }
/* Keyboard ring */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--primary, #3d5af1);
  outline-offset: 3px;
  border-radius: 4px;
}

/* 3. 44px MINIMUM TAP TARGETS (WCAG 2.5.5) */
.site-header nav a,
.nav-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
button,
.btn-primary,
.btn-secondary,
[role="button"] {
  min-height: 44px;
}
.site-footer a,
footer a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding-top: 4px;
  padding-bottom: 4px;
}
.tap-target {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   W-3 ADDITIONS: font-size ≥16px body text + responsive nav
   ============================================================ */

/* ① Body text minimum 16px */
html { font-size: 16px; }
body { font-size: 1rem; }

/* Content paragraph text: was .82-.88rem → 1rem */
.info-section p,
.info-section ul,
.info-section li,
.step p,
.sister-link p,
.gen-card p,
.hero p { font-size: 1rem; }

/* Cards/descriptions subheads: small bump for readability */
.gen-card h2 { font-size: 1rem; }
.info-section h3 { font-size: 1.05rem; }

/* ② Responsive nav — hamburger toggle */
.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
  padding: .25rem .5rem;
  min-height: 44px;
  min-width: 44px;
  align-items: center;
  justify-content: center;
}

@media (max-width: 640px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0;
    padding: .4rem 0 .2rem;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: .55rem .8rem;
    font-size: 1rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .hero h1 { font-size: 1.35rem; }
  .hero p  { font-size: 1rem; }
  .container { padding: .75rem .75rem 2rem; }
}

@media (max-width: 480px) {
  .gen-grid { grid-template-columns: 1fr; }
  .sister-sites { grid-template-columns: 1fr; }
}

/* E-37: Language switcher */
.lang-switch {
  font-size: 0.78rem;
  padding: 3px 8px;
  border: 1px solid var(--border, #ddd);
  border-radius: 4px;
  color: var(--muted, #666);
  text-decoration: none;
  white-space: nowrap;
}
.lang-switch:hover { background: var(--bg-alt, #f5f5f5); }
