/* YAKAZU & Cie - styles.css */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,700&family=Inter:wght@400;600&display=swap');

:root {
  --primary: #E4572E;
  --primary-hover: #C8461F;
  --secondary: #1E293B;
  --secondary-light: #F1EBE0;
  --dark: #0F172A;
  --light: #FAF6EF;
  --white: #FFFFFF;
  --grey-light: #E7DFD2;
  --grey-medium: #64748B;
  --success: #10B981;
  --error: #EF4444;
  --warning: #F59E0B;
  
  --font-title: 'Fraunces', serif;
  --font-body: 'Inter', sans-serif;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 4px 6px -1px rgb(0 0 0 / 0.05);
  --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--light);
  color: var(--dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Animations */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Structure */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
header {
  background-color: var(--white);
  border-bottom: 1px solid var(--grey-light);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}

.logo svg {
  color: var(--primary);
}

.logo span {
  color: var(--dark);
}

nav {
  display: flex;
  gap: 24px;
}

nav a {
  text-decoration: none;
  color: var(--dark);
  font-weight: 600;
  font-size: 16px;
  transition: color 0.2s;
  position: relative;
  padding: 8px 0;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 3px;
  background-color: var(--primary);
  border-radius: 2px;
  transition: width 0.2s;
}

nav a:hover {
  color: var(--primary);
}

nav a:hover::after, nav a.active::after {
  width: 100%;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--dark);
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--white) 0%, var(--secondary-light) 100%);
  padding: 80px 0;
  border-bottom-right-radius: var(--radius-lg);
  border-bottom-left-radius: var(--radius-lg);
  margin-bottom: 48px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 48px;
  align-items: center;
}

.hero-content h1 {
  font-family: var(--font-title);
  font-size: 48px;
  color: var(--primary);
  line-height: 1.2;
  margin-bottom: 24px;
}

.hero-content h1 span {
  color: var(--dark);
}

.hero-content p {
  font-size: 18px;
  color: var(--grey-medium);
  margin-bottom: 32px;
}

.hero-btns {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-family: var(--font-title);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background-color: var(--primary);
  color: var(--white);
  box-shadow: 0 4px 14px rgb(0 119 182 / 30%);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 6px 20px rgb(0 119 182 / 40%);
}

.btn-secondary {
  background-color: var(--white);
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-secondary:hover {
  background-color: var(--secondary-light);
}

.hero-image {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.hero-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Grid Cards de Jeux */
.section-title-wrap {
  text-align: center;
  margin-bottom: 40px;
}

.section-title {
  font-family: var(--font-title);
  font-size: 36px;
  color: var(--dark);
  margin-bottom: 8px;
}

.section-subtitle {
  font-size: 16px;
  color: var(--grey-medium);
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  margin-bottom: 64px;
}

.game-card {
  background-color: var(--white);
  border-radius: var(--radius-md);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--grey-light);
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  display: flex;
  flex-direction: column;
}

.game-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-md);
  border-color: var(--secondary);
}

.game-icon {
  width: 64px;
  height: 64px;
  background-color: var(--secondary-light);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  margin-bottom: 24px;
}

.game-card h3 {
  font-family: var(--font-title);
  font-size: 22px;
  margin-bottom: 12px;
}

.game-card p {
  color: var(--grey-medium);
  font-size: 15px;
  margin-bottom: 24px;
  flex-grow: 1;
}

.game-card .difficulty-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.difficulty-badge.easy { background-color: #D1FAE5; color: #065F46; }
.difficulty-badge.medium { background-color: #FEF3C7; color: #92400E; }
.difficulty-badge.hard { background-color: #FEE2E2; color: #991B1B; }

/* Interactive Puzzle Section */
.interactive-section {
  background-color: var(--white);
  border-radius: var(--radius-lg);
  padding: 48px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 64px;
  border: 1px solid var(--grey-light);
}

/* Le Moteur de Jeu de Logique */
.game-container {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: start;
}

.game-board-outer {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--light);
  border-radius: var(--radius-md);
  padding: 32px;
  box-shadow: inset var(--shadow-sm);
}

.board {
  display: grid;
  background-color: var(--dark);
  gap: 2px;
  padding: 2px;
  border-radius: var(--radius-sm);
  max-width: 100%;
}

.cell {
  background-color: var(--white);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 20px;
  color: var(--dark);
  position: relative;
  transition: background-color 0.2s, color 0.2s;
  cursor: pointer;
}

.cell input {
  width: 100%;
  height: 100%;
  border: none;
  outline: none;
  text-align: center;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 20px;
  color: var(--primary);
  background: transparent;
}

.cell.read-only {
  background-color: var(--light);
  color: var(--dark);
  cursor: not-allowed;
}

.cell.black-cell {
  background-color: var(--dark);
  cursor: not-allowed;
}

.cell.error-cell {
  background-color: #FEE2E2;
  color: var(--error);
}

.cell.selected {
  background-color: var(--secondary-light);
}

/* Sudoku Sub-grids border */
.board-sudoku {
  grid-template-columns: repeat(9, 1fr);
  width: 450px;
  height: 450px;
}

.board-sudoku .cell:nth-child(3n) {
  border-right: 3px solid var(--dark);
}
.board-sudoku .cell:nth-child(9n) {
  border-right: none;
}
.board-sudoku .cell:nth-child(27n+1),
.board-sudoku .cell:nth-child(27n+2),
.board-sudoku .cell:nth-child(27n+3),
.board-sudoku .cell:nth-child(27n+4),
.board-sudoku .cell:nth-child(27n+5),
.board-sudoku .cell:nth-child(27n+6),
.board-sudoku .cell:nth-child(27n+7),
.board-sudoku .cell:nth-child(27n+8),
.board-sudoku .cell:nth-child(27n+9) {
  border-bottom: 1px solid var(--dark);
}

/* Takuzu */
.board-takuzu {
  grid-template-columns: repeat(6, 1fr);
  width: 360px;
  height: 360px;
}

/* Yakazu */
.board-yakazu {
  grid-template-columns: repeat(5, 1fr);
  width: 320px;
  height: 320px;
}

.cell.black-cell svg {
  width: 16px;
  height: 16px;
  color: var(--grey-medium);
}

.game-controls {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.game-meta h2 {
  font-family: var(--font-title);
  font-size: 28px;
  color: var(--primary);
  margin-bottom: 8px;
}

.game-meta p {
  color: var(--grey-medium);
  font-size: 15px;
}

.timer {
  font-size: 24px;
  font-weight: 700;
  color: var(--dark);
  font-family: var(--font-title);
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--secondary-light);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  width: fit-content;
}

.game-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.game-instructions {
  background-color: var(--light);
  padding: 20px;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary);
}

.game-instructions h4 {
  font-family: var(--font-title);
  margin-bottom: 8px;
  font-size: 16px;
}

.game-instructions p {
  font-size: 14px;
  color: var(--dark);
}

/* Rules / Guides Grid */
.rules-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  margin-bottom: 64px;
}

.rule-box {
  background-color: var(--white);
  border-radius: var(--radius-md);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--grey-light);
}

.rule-box h3 {
  font-family: var(--font-title);
  font-size: 24px;
  color: var(--primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.rule-box p {
  margin-bottom: 16px;
}

.rule-box ul {
  list-style-type: none;
  padding-left: 0;
  margin-bottom: 24px;
}

.rule-box ul li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 8px;
  font-size: 15px;
}

.rule-box ul li::before {
  content: "✦";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
}

/* Comparative Table for Applis / Affiliation */
.comparative-section {
  margin-bottom: 64px;
}

.table-responsive {
  overflow-x: auto;
  background-color: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--grey-light);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--grey-light);
}

th {
  background-color: var(--secondary-light);
  font-family: var(--font-title);
  font-weight: 700;
  color: var(--primary-hover);
}

tr:last-child td {
  border-bottom: none;
}

.rating {
  color: #F59E0B;
  font-weight: bold;
}

/* Footer */
footer {
  background-color: var(--dark);
  color: var(--white);
  padding: 64px 0 32px 0;
  margin-top: 80px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-bottom: 48px;
}

.footer-col h4 {
  font-family: var(--font-title);
  font-size: 18px;
  color: var(--white);
  margin-bottom: 20px;
}

.footer-col p {
  color: var(--grey-medium);
  font-size: 14px;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 12px;
}

.footer-col ul li a {
  color: var(--grey-medium);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.footer-col ul li a:hover {
  color: var(--white);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 32px;
  text-align: center;
  color: var(--grey-medium);
  font-size: 14px;
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: var(--white);
  padding: 40px;
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-icon {
  width: 80px;
  height: 80px;
  background-color: #D1FAE5;
  color: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px auto;
}

.modal-icon svg {
  width: 40px;
  height: 40px;
}

.modal h3 {
  font-family: var(--font-title);
  font-size: 28px;
  margin-bottom: 12px;
}

.modal p {
  color: var(--grey-medium);
  margin-bottom: 24px;
}

/* Responsive */
@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 32px;
  }
  .hero-btns {
    justify-content: center;
  }
  .game-container {
    grid-template-columns: 1fr;
  }
  .rules-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  nav {
    display: none;
  }
  .mobile-menu-btn {
    display: block;
  }
  .hero {
    padding: 48px 0;
  }
  .hero-content h1 {
    font-size: 36px;
  }
  .board-sudoku {
    width: 320px;
    height: 320px;
  }
  .cell {
    font-size: 16px;
  }
  .cell input {
    font-size: 16px;
  }
}

/* Style d'impression d'une grille propre */
@media print {
  body {
    background-color: #ffffff;
    color: #000000;
  }
  header, footer, .hero, .game-controls, .game-buttons, .navbar, .btn, .no-print {
    display: none !important;
  }
  .container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .interactive-section {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .game-container {
    display: block !important;
  }
  .game-board-outer {
    background: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin-bottom: 40px !important;
  }
  .board {
    border: 3px solid #000000 !important;
    background-color: #000000 !important;
    margin: 0 auto !important;
  }
  .cell {
    background-color: #ffffff !important;
    color: #000000 !important;
    border: 1px solid #000000 !important;
  }
  .cell.black-cell {
    background-color: #000000 !important;
  }
  .cell input {
    display: none !important;
  }
  .print-only {
    display: block !important;
    text-align: center;
    margin-bottom: 24px;
  }
  .print-only h1 {
    font-family: serif;
    font-size: 28px;
  }
}

.print-only {
  display: none;
}
/* ============================= SUBMENU OUTILS ============================= */
/* Sous-menu déroulant "Outils" dans la nav (front + blog). Hover desktop,
   clic/tactile via .open, accordéon en flux sur mobile. */
.has-submenu { position: relative; display: flex; align-items: center; }
.has-submenu > .submenu-toggle { cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.has-submenu > .submenu-toggle .caret { font-size: 12px; transition: transform 0.2s; }
.has-submenu.open > .submenu-toggle .caret { transform: rotate(180deg); }
.submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 260px;
  background: var(--white);
  border: 1px solid var(--grey-light);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-md);
  padding: 8px;
  z-index: 1000;
}
.submenu a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  color: var(--dark);
  white-space: nowrap;
}
.submenu a::after { display: none; }
.submenu a:hover { background: var(--secondary-light); color: var(--primary); }
.has-submenu:hover > .submenu { display: block; }
.has-submenu.open > .submenu { display: block; }

@media (max-width: 768px) {
  .has-submenu { flex-direction: column; align-items: flex-start; width: 100%; }
  .submenu {
    position: static;
    box-shadow: none;
    border: none;
    padding: 4px 0 4px 16px;
    min-width: 0;
    background: transparent;
  }
  .has-submenu:hover > .submenu { display: none; }
  .has-submenu.open > .submenu { display: block; }
}

/* ============================= FOOTER-SUB ============================= */
/* Outils & Ressources repliés en accordéons fermés dans le bloc Navigation. */
.footer-sub { margin-top: 4px; border-top: 1px solid rgba(255,255,255,0.08); }
.footer-sub > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 0; color: var(--white, #fff); font-weight: 600; font-size: 14px; font-family: var(--font-body, 'Inter'); }
.footer-sub > summary::-webkit-details-marker { display: none; }
.footer-sub > summary::after { content: '+'; font-size: 18px; line-height: 1; color: var(--grey-medium, #94A3B8); }
.footer-sub[open] > summary::after { content: '\2212'; }
.footer-sub > summary:hover { color: var(--primary, #E4572E); }
.footer-sub ul { margin: 6px 0 12px; padding-left: 10px; }
.footer-sub ul li { margin-bottom: 10px; }

/* ===================== FOOTER-CONTRAST ===================== */
/* Lisibilité sur le fond sombre du footer (var(--dark)) : textes éclaircis (AA). */
footer .footer-col p { color: #BAC3D0; }
footer .footer-col ul li a { color: #C7D0DB; }
footer .footer-col ul li a:hover { color: #FFFFFF; }
footer .footer-bottom { color: #BAC3D0; }
footer .footer-bottom p { color: #BAC3D0; }
footer .affiliate-notice { color: #A7B1BF; }
footer .footer-sub > summary::after { color: #A7B1BF; }

/* ===================== HERO-COMPACT ===================== */
/* Hero réduit : la grille du jour reste visible dès l'ouverture de la home. */
.hero.hero-compact { padding: 34px 0 30px; }
.hero-slim { text-align: center; max-width: 760px; }
.hero-eyebrow { display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: .5px; color: var(--primary, #E4572E); text-transform: uppercase; margin-bottom: 10px; }
.hero-slim h1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.12; margin-bottom: 12px; }
.hero-slim h1 span { color: var(--primary, #E4572E); }
.hero-slim p { color: var(--dark, #1E293B); font-size: 17px; max-width: 620px; margin: 0 auto 18px; }
.hero-slim .hero-btns { justify-content: center; }
#grille-du-jour { margin-top: 4px; }
@media (max-width: 768px) { .hero.hero-compact { padding: 22px 0 20px; } .hero-slim p { font-size: 15px; } }
