/* ChessCheckZine : échecs, école et enfants. Thème « cahier d'écolier ». */
:root {
  --paper: #FFFDF7;
  --ink: #22303C;
  --muted: #55606B;
  --blue: #2C5DA8;
  --blue-dark: #1E447F;
  --red: #C23B2F;
  --yellow: #FFE38A;
  --green: #2F7A4F;
  --grid: #DCE6F4;
  --line: #E6DFCF;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Atkinson Hyperlegible", "Segoe UI", Arial, sans-serif;
  font-size: 1.075rem;
  line-height: 1.7;
  overflow-wrap: break-word;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: var(--red); }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* En-tête */
.site-header { background: #fff; border-bottom: 3px solid var(--blue); position: relative; z-index: 5; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-text { font-family: "Baloo 2", "Trebuchet MS", sans-serif; font-weight: 800; font-size: 1.35rem; line-height: 1.05; color: var(--blue-dark); }
.brand-text small { display: block; font-family: "Atkinson Hyperlegible", Arial, sans-serif; font-weight: 400; font-size: .78rem; color: var(--muted); letter-spacing: .02em; }
.menu-btn { display: none; font: 700 .95rem "Atkinson Hyperlegible", Arial, sans-serif; background: var(--blue); color: #fff; border: 0; border-radius: 999px; padding: 8px 16px; cursor: pointer; }
.main-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; }
.main-nav a { display: block; padding: 6px 11px; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: .93rem; }
.main-nav a:hover { background: var(--yellow); color: var(--ink); }
.main-nav a[aria-current="page"] { background: var(--blue); color: #fff; }

/* Bandeau : papier quadrillé */
.hero {
  background-color: #F4F8FD;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  border-bottom: 1px solid var(--grid);
  padding: 28px 0 34px;
}
.breadcrumb { font-size: .9rem; color: var(--muted); margin-bottom: 14px; }
.breadcrumb a { color: var(--blue-dark); }
.kicker { display: inline-block; margin: 0 0 8px; background: var(--yellow); padding: 2px 12px; border-radius: 6px; font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; transform: rotate(-1deg); }
h1, h2, h3 { font-family: "Baloo 2", "Trebuchet MS", sans-serif; line-height: 1.2; color: var(--blue-dark); }
h1 { font-size: clamp(1.75rem, 4.2vw, 2.7rem); margin: 6px 0 12px; max-width: 900px; }
.chapo { font-size: 1.15rem; max-width: 780px; margin: 0; color: #33404C; }

/* Contenu */
.content { max-width: 820px; padding-top: 30px; padding-bottom: 40px; }
.content h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); margin: 2.2em 0 .5em; padding-left: 14px; border-left: 6px solid var(--red); }
.content h3 { font-size: 1.25rem; margin: 1.6em 0 .4em; color: var(--ink); }
.content p, .content li { max-width: 72ch; }
.content ul, .content ol { padding-left: 1.3em; }
.content li { margin: .3em 0; }
.answer { background: #fff; border: 2px solid var(--blue); border-radius: var(--radius); padding: 18px 22px 8px; box-shadow: 6px 6px 0 var(--yellow); margin-bottom: 26px; }
.answer-label { margin: 0 0 4px; font-weight: 700; color: var(--red); text-transform: uppercase; font-size: .8rem; letter-spacing: .08em; }
.definition { background: #FFF6D6; border-left: 6px solid #E5B93A; border-radius: 0 var(--radius) var(--radius) 0; padding: 12px 18px; margin: 18px 0; }
.definition dt { font-weight: 700; color: var(--blue-dark); }
.definition dd { margin: 4px 0 0; }
.note { background: #EEF6F0; border-left: 6px solid var(--green); border-radius: 0 var(--radius) var(--radius) 0; padding: 12px 18px; }
.warn { background: #FCEDEB; border-left: 6px solid var(--red); border-radius: 0 var(--radius) var(--radius) 0; padding: 12px 18px; }
.source { font-size: .92rem; color: var(--muted); }
.table-scroll { width: 100%; overflow-x: auto; margin: 18px 0; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }
table { border-collapse: collapse; width: 100%; font-size: .96rem; }
th, td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--blue); color: #fff; font-weight: 700; }
tr:nth-child(even) td { background: #FAF7EF; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.big-number { font-family: "Baloo 2", sans-serif; font-weight: 800; font-size: clamp(1.25rem, 4.5vw, 2rem); color: var(--red); letter-spacing: .02em; overflow-wrap: anywhere; }
.cards { list-style: none; padding: 0 !important; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.cards li { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 0; max-width: none; }
.cards li strong { display: block; color: var(--blue-dark); font-family: "Baloo 2", sans-serif; font-size: 1.1rem; }
.puzzle { background: #fff; border: 2px dashed var(--blue); border-radius: var(--radius); padding: 16px 18px; margin: 22px 0; }
.puzzle h3 { margin-top: 0; }
.puzzle details { margin-top: 8px; }
.puzzle summary { cursor: pointer; font-weight: 700; color: var(--red); }
figure.board { margin: 12px 0; }
figure.board svg { width: 100%; max-width: 300px; display: block; }
figure.board figcaption { font-size: .9rem; color: var(--muted); }
.grid-num { border-collapse: collapse; width: auto; margin: 10px 0; }
.grid-num th { padding: 0 4px; background: transparent; color: var(--muted); font-weight: 700; text-align: center; }
.grid-num td { width: 44px; height: 44px; text-align: center; border: 1px solid #9FB3D1; padding: 0; font-weight: 700; }
.grid-num tr:nth-child(odd) td:nth-child(even), .grid-num tr:nth-child(even) td:nth-child(odd) { background: #DCE6F4; }
.grid-num tr:nth-child(even) td { background: #fff; }
.grid-num tr:nth-child(even) td:nth-child(odd) { background: #DCE6F4; }
.steps { counter-reset: s; list-style: none; padding-left: 0 !important; }
.steps > li { counter-increment: s; position: relative; padding-left: 52px; margin: 14px 0; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%; background: var(--yellow); color: var(--ink); font-weight: 800; display: flex; align-items: center; justify-content: center; font-family: "Baloo 2", sans-serif; }
.hub { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 18px 0; }
.hub section { background: #fff; border: 1px solid var(--line); border-top: 6px solid var(--blue); border-radius: var(--radius); padding: 14px 18px; }
.hub section:nth-child(2) { border-top-color: var(--red); }
.hub section:nth-child(3) { border-top-color: var(--green); }
.hub h3 { margin: 0 0 6px; }
.hub ul { padding-left: 1.1em; margin: 0; }

/* FAQ */
.faq { margin-top: 40px; }
.faq-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin: 10px 0; padding: 0 18px; }
.faq-item summary { cursor: pointer; font-weight: 700; padding: 14px 0; color: var(--blue-dark); }
.faq-a { padding-bottom: 12px; }
.faq-a p { margin-top: 0; }

/* À lire aussi */
.related { margin-top: 44px; }
.related ul { list-style: none; padding: 0 !important; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.related li { margin: 0; max-width: none; }
.related a { display: block; height: 100%; background: var(--blue); color: #fff; text-decoration: none; border-radius: var(--radius); padding: 14px 16px; font-weight: 700; }
.related a:hover { background: var(--red); color: #fff; }
.rel-kicker { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; opacity: .85; font-weight: 400; }

/* Pied de page */
.site-footer { background: var(--blue-dark); color: #E9EEF6; padding: 36px 0 18px; margin-top: 30px; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--yellow); text-decoration: underline; }
.foot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 22px; }
.foot-title { font-family: "Baloo 2", sans-serif; font-weight: 700; color: var(--yellow); font-size: 1.1rem; margin: 0 0 6px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 4px 0; font-size: .95rem; }
.foot-note { font-size: .88rem; color: #C9D4E6; }
.foot-legal { font-size: .85rem; color: #C9D4E6; border-top: 1px solid #3A5B92; padding-top: 14px; margin-top: 24px; }

@media (max-width: 860px) {
  .menu-btn { display: inline-block; }
  .main-nav { display: none; width: 100%; padding-bottom: 12px; }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; }
}
@media (max-width: 480px) {
  body { font-size: 1.02rem; }
  .wrap { padding: 0 16px; }
  .answer { padding: 14px 16px 4px; box-shadow: 4px 4px 0 var(--yellow); }
  th, td { padding: 7px 8px; }
  .grid-num td, .grid-num th { width: 32px; height: 32px; padding: 0; }
  .grid-num { font-size: .9rem; }
}

/* sélecteur de langue (pbn_i18n) */
.lang-switch{max-width:1100px;margin:24px auto 0;padding:14px 20px 0;border-top:1px solid rgba(255,255,255,.12);font-size:.82rem;line-height:1.9;text-align:center;opacity:.85}
.lang-switch a{color:inherit;text-decoration:none;white-space:nowrap}
.lang-switch a:hover{text-decoration:underline}
.lang-switch a.current{font-weight:700;text-decoration:underline}
