/* ==========================================================
   1000exercices.info
   Optimisé pour Firefox, Chrome, Brave, Edge et navigateurs modernes.
   Non testé sous Netscape Navigator, Mosaic, ni U.S. Robotics 56K.
   Si vous entendez krrrr... piiii... tchiiii..., rechargez la page !
   ========================================================== */
:root {
  --blue: #1e5f8f;
  --blue-dark: #17476c;
  --blue-light: #e8f2fa;
  --green: #2f8b57;
  --green-dark: #236b42;
  --green-light: #e8f6ee;
  --text: #25313b;
  --muted: #667684;
  --border: #d8e3ea;
  --bg: #eef4f8;
  --white: #ffffff;
  --soft: #f8fbfd;
  --yellow-soft: #fff8df;
}

* {
  box-sizing: border-box;
}

html {
  max-width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--green-dark);
  text-decoration: underline;
}

p,
li {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.site-wrapper {
  max-width: 1180px;
  margin: 0 auto;
  background: var(--white);
  box-shadow: 0 0 24px rgba(27, 61, 84, 0.12);
}

/* Header */

.site-header {
  background: var(--white);
}

.site-top-banner {
  width: 100%;
  margin: 0;
  padding: 0;
  background: var(--white);
}

.top-banner-link {
  display: block;
  width: 100%;
  color: inherit;
  text-decoration: none;
}

.top-banner-link:hover,
.top-banner-link:focus {
  text-decoration: none;
}

.top-banner-img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 1180px;
  margin: 0 auto;
}

/* Navigation */

.mobile-nav-bar {
  display: none;
  background: var(--blue);
  border-top: 1px solid var(--blue-dark);
  border-bottom: 3px solid var(--green);
  padding: 8px 12px;
  text-align: right;
}

.mobile-nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 38px;
  padding: 0;
  background: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 4px;
  cursor: pointer;
}

.mobile-nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  margin: 0 auto;
  background: var(--blue-dark);
  border-radius: 3px;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.mobile-nav-toggle.is-active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-nav-toggle.is-active span:nth-child(2) {
  opacity: 0;
}

.mobile-nav-toggle.is-active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  background: var(--blue);
  border-top: 1px solid var(--blue-dark);
  border-bottom: 3px solid var(--green);
}

.main-nav a {
  padding: 13px 16px;
  color: var(--white);
  font-size: 0.95rem;
  font-weight: bold;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
}

.main-nav a:first-child {
  border-left: 1px solid rgba(255, 255, 255, 0.18);
}

.main-nav a:hover,
.main-nav a:focus,
.main-nav a.active {
  background: var(--green);
  color: var(--white);
  text-decoration: none;
}

/* Page catégorie */

.category-page {
  padding: 24px;
}

/* Fil d’Ariane */

.breadcrumb {
  margin: 0 0 18px;
  font-size: 0.92rem;
  color: var(--muted);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumb li {
  display: flex;
  align-items: center;
  color: var(--muted);
}

.breadcrumb li + li::before {
  content: "›";
  margin: 0 6px 0 0;
  color: var(--green);
  font-weight: 700;
}

.breadcrumb a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
}

.breadcrumb a:hover,
.breadcrumb a:focus {
  color: var(--green-dark);
  text-decoration: underline;
}

.breadcrumb [aria-current="page"] {
  color: var(--muted);
}

/* Hero catégorie */

.category-hero {
  margin-bottom: 24px;
  padding: 28px 28px 26px;
  background:
    linear-gradient(90deg, rgba(232, 242, 250, 0.98), rgba(255, 255, 255, 0.98)),
    var(--white);
  border: 1px solid var(--border);
  border-top: 4px solid var(--green);
  border-radius: 6px;
}

.category-kicker {
  margin: 0 0 10px;
  color: var(--green-dark);
  font-weight: bold;
}

.category-hero h1 {
  max-width: 850px;
  margin: 0 0 14px;
  color: var(--blue-dark);
  font-size: 2.3rem;
  line-height: 1.22;
}

.category-lead {
  max-width: 920px;
  margin: 0 0 22px;
  color: #33424e;
  font-size: 1.12rem;
}

.category-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.btn-main,
.btn-secondary {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 3px;
  font-weight: bold;
  text-align: center;
}

.btn-main {
  background: var(--green);
  color: var(--white);
  border: 1px solid var(--green-dark);
}

.btn-main:hover,
.btn-main:focus {
  background: var(--green-dark);
  color: var(--white);
  text-decoration: none;
}

.btn-secondary {
  background: var(--blue);
  color: var(--white);
  border: 1px solid var(--blue-dark);
}

.btn-secondary:hover,
.btn-secondary:focus {
  background: var(--blue-dark);
  color: var(--white);
  text-decoration: none;
}

.category-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-points span {
  display: inline-block;
  padding: 7px 10px;
  background: var(--white);
  color: var(--blue-dark);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 0.92rem;
  font-weight: bold;
}

/* Sections */

.category-section {
  margin-bottom: 24px;
  padding: 24px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.category-soft {
  background: var(--soft);
}

.section-title {
  max-width: 940px;
  margin-bottom: 22px;
}

.section-title h2,
.category-text-block h2 {
  margin: 0 0 12px;
  padding-bottom: 9px;
  color: var(--blue-dark);
  font-size: 1.55rem;
  line-height: 1.25;
  border-bottom: 2px solid var(--blue-light);
}

.section-title h2::first-letter,
.category-text-block h2::first-letter {
  color: var(--green);
}

.section-title p {
  margin: 0;
  color: var(--muted);
}

/* Cartes livres façon 64Chess, images paysage 850 x 565 */

.lesson-list {
  display: grid;
  gap: 20px;
}

.lesson-row {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
  background: var(--soft);
  border: 1px solid var(--border);
  border-left: 4px solid var(--green);
  border-radius: 6px;
  overflow: hidden;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.lesson-row:hover {
  border-color: #b8dcc8;
  box-shadow: 0 10px 24px rgba(27, 61, 84, 0.10);
  transform: translateY(-2px);
}

.lesson-media {
  display: block;
  position: relative;
  min-height: 210px;
  background: var(--blue-light);
  overflow: hidden;
  text-decoration: none;
}

.lesson-media:hover,
.lesson-media:focus {
  text-decoration: none;
}

.lesson-media picture {
  display: block;
  width: 100%;
  height: 100%;
}

.lesson-media img {
  width: 100%;
  height: 100%;
  min-height: 210px;
  object-fit: cover;
  object-position: center;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.lesson-row:hover .lesson-media img {
  transform: scale(1.03);
  opacity: 0.96;
}

.lesson-content {
  min-width: 0;
  padding: 24px 24px 22px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.lesson-kicker {
  display: inline-block;
  width: fit-content;
  margin: 0 0 10px;
  padding: 4px 9px;
  background: var(--green-light);
  color: var(--green-dark);
  border: 1px solid #b8dcc8;
  border-radius: 3px;
  font-size: 0.82rem;
  font-weight: bold;
}

.lesson-content h3 {
  margin: 0 0 10px;
  color: var(--blue-dark);
  font-size: 1.45rem;
  line-height: 1.25;
}

.lesson-content h3 a {
  color: var(--blue-dark);
}

.lesson-content h3 a:hover,
.lesson-content h3 a:focus {
  color: var(--green-dark);
}

.lesson-content p {
  margin: 0 0 12px;
  color: var(--text);
}

.info-list {
  margin: 0 0 14px;
  padding-left: 18px;
  color: var(--muted);
}

.info-list li {
  margin-bottom: 3px;
}

.card-link {
  display: inline-block;
  width: fit-content;
  font-weight: bold;
}

.card-link::after {
  content: " →";
}

/* Grille rapide */

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.quick-card {
  display: block;
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-top: 3px solid var(--blue);
  border-radius: 4px;
}

.quick-card strong {
  display: block;
  margin-bottom: 5px;
  color: var(--blue-dark);
  font-size: 1.05rem;
}

.quick-card span {
  display: block;
  color: var(--muted);
  font-size: 0.95rem;
}

.quick-card:hover,
.quick-card:focus {
  background: var(--green-light);
  border-top-color: var(--green);
  text-decoration: none;
}

/* Texte bas de page */

.category-text-block {
  max-width: 920px;
}

.category-text-block p {
  margin: 0 0 14px;
  color: var(--text);
}

.note-box {
  margin-top: 18px;
  padding: 16px 18px;
  background: var(--yellow-soft);
  border: 1px solid #eadc9d;
  border-left: 4px solid #d4a82c;
  border-radius: 4px;
}

/* Footer */

.site-footer {
  background: var(--blue-dark);
  color: rgba(255, 255, 255, 0.88);
  border-top: 4px solid var(--green);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 24px;
}

.footer-inner p {
  margin: 6px 0 0;
}

.site-footer a {
  color: var(--white);
  font-weight: bold;
}

/* Responsive tablette */

@media (max-width: 900px) {
  .mobile-nav-bar {
    display: block;
  }

  .main-nav {
    display: none;
    background: var(--blue-dark);
    border-top: 0;
    border-bottom: 3px solid var(--green);
  }

  .main-nav.is-open {
    display: block;
  }

  .main-nav a {
    display: block;
    padding: 13px 18px;
    border-right: 0;
    border-left: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  }

  .main-nav a:first-child {
    border-left: 0;
  }

  .main-nav a:last-child {
    border-bottom: 0;
  }

  .lesson-row {
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 20px;
  }

  .lesson-content {
    padding: 22px 22px 20px 0;
  }

  .lesson-media,
  .lesson-media img {
    min-height: 210px;
  }

  .quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Responsive mobile */

@media (max-width: 720px) {
  .lesson-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .lesson-media {
    width: 100%;
    min-height: 0;
    aspect-ratio: 850 / 565;
  }

  .lesson-media picture {
    height: 100%;
  }

  .lesson-media img {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
  }

  .lesson-content {
    padding: 18px 18px 20px;
  }
}

@media (max-width: 680px) {
  body {
    background: var(--white);
  }

  .site-wrapper {
    box-shadow: none;
  }

  .top-banner-img {
    width: 100%;
    height: auto;
  }

  .category-page {
    padding: 14px;
  }

  .category-hero,
  .category-section {
    padding: 18px;
  }

  .category-hero h1 {
    font-size: 1.85rem;
  }

  .category-lead {
    font-size: 1.02rem;
  }

  .category-actions {
    display: block;
  }

  .category-actions .btn-main,
  .category-actions .btn-secondary {
    display: block;
    margin-bottom: 10px;
  }

  .category-points {
    display: block;
  }

  .category-points span {
    display: block;
    margin-bottom: 7px;
  }

  .quick-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    display: block;
    padding: 20px 14px;
  }

  .footer-inner div + div {
    margin-top: 14px;
  }
}

@media (max-width: 520px) {
  .lesson-content h3 {
    font-size: 1.28rem;
  }

  .section-title h2,
  .category-text-block h2 {
    font-size: 1.35rem;
  }
}

/* ==========================================================
   Correctif final cartes livres : image pleine hauteur sur bureau
   ========================================================== */

.lesson-row {
  grid-template-columns: minmax(440px, 470px) minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
}

.lesson-media {
  width: 100%;
  min-height: 100%;
  aspect-ratio: auto;
  align-self: stretch;
  background: var(--blue-light);
}

.lesson-media picture {
  display: block;
  width: 100%;
  height: 100%;
}

.lesson-media img {
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Tablette / mobile : on repasse en image paysage propre */

@media (max-width: 980px) {
  .lesson-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .lesson-media {
    width: 100%;
    min-height: 0;
    aspect-ratio: 850 / 565;
  }

  .lesson-media picture {
    height: 100%;
  }

  .lesson-media img {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
  }

  .lesson-content {
    padding: 18px 18px 20px;
  }
}

@media (max-width: 520px) {
  .lesson-content h3 {
    font-size: 1.28rem;
  }
}

/* ==========================================================
   Textes éditoriaux : justification et respiration
   ========================================================== */

.category-section p,
.section-intro-text p,
.lesson-content p,
.category-text-block p,
.note-box {
  text-align: justify;
}

.section-intro-text {
  max-width: 980px;
  margin-bottom: 26px;
}

.section-intro-text p {
  margin: 0 0 18px;
  color: var(--text);
}

.section-intro-text .note-box {
  margin-top: 6px;
}

/* Bloc SEO bas de page */

.seo-text-block {
  max-width: 980px;
}

.seo-text-block h3 {
  margin: 26px 0 10px;
  color: var(--green-dark);
  font-size: 1.22rem;
  line-height: 1.3;
}

.seo-text-block p {
  margin: 0 0 18px;
  text-align: justify;
}

.seo-text-block .note-box {
  margin-top: 22px;
}

/* ==========================================================
   Bloc Chess.com : entraînement tactique
   ========================================================== */

.chesscom-training-block {
  background: #fffaf0;
}

.chesscom-training-card {
  max-width: 980px;
  margin: 0 auto;
}

.chesscom-training-card h2 {
  margin: 0 0 18px;
  padding-bottom: 9px;
  color: var(--green-dark);
  font-size: 1.55rem;
  line-height: 1.25;
  border-bottom: 2px solid rgba(47, 139, 87, 0.16);
}

.chesscom-training-image {
  display: block;
  margin: 0 0 22px;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(47, 139, 87, 0.18);
  background: var(--green-light);
  box-shadow: 0 8px 20px rgba(27, 61, 84, 0.08);
  text-decoration: none;
}

.chesscom-training-image:hover,
.chesscom-training-image:focus {
  text-decoration: none;
}

.chesscom-training-image picture,
.chesscom-training-image img {
  display: block;
  width: 100%;
}

.chesscom-training-image img {
  height: auto;
  transition:
    transform 0.22s ease,
    opacity 0.22s ease;
}

.chesscom-training-image:hover img,
.chesscom-training-image:focus img {
  transform: scale(1.025);
  opacity: 0.96;
}

.chesscom-training-content p {
  margin: 0 0 14px;
  color: var(--text);
  text-align: justify;
}

.chesscom-training-facts {
  margin: 18px 0 22px;
}

.chesscom-training-facts p {
  margin-bottom: 12px;
}

.chesscom-training-facts strong {
  color: var(--blue-dark);
}

.chesscom-training-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  background: var(--green-dark);
  color: var(--white);
  border: 1px solid var(--green-dark);
  border-radius: 999px;
  font-weight: bold;
  text-align: center;
  box-shadow: 0 8px 18px rgba(35, 107, 66, 0.18);
}

.chesscom-training-button:hover,
.chesscom-training-button:focus {
  background: var(--green);
  color: var(--white);
  text-decoration: none;
  transform: translateY(-1px);
}

@media (max-width: 680px) {
  .chesscom-training-card h2 {
    font-size: 1.35rem;
  }

  .chesscom-training-button {
    width: 100%;
  }
}