/*
Theme Name: Table de Mixage
Theme URI: https://www.tabledemixage.fr/
Author: Table de Mixage
Description: Thème éditorial léger conçu pour TableDeMixage.fr.
Version: 1.0.0
Text Domain: tabledemixage
*/

:root {
  --tdm-ink: #111214;
  --tdm-paper: #f7f5ef;
  --tdm-white: #fff;
  --tdm-blue: #2457ff;
  --tdm-blue-dark: #173bc4;
  --tdm-acid: #d9ff43;
  --tdm-coral: #ff6b4a;
  --tdm-muted: #65676d;
  --tdm-line: #d8d7d1;
  --tdm-width: 1240px;
  --tdm-reading: 790px;
  --tdm-shadow: 0 18px 50px rgb(17 18 20 / 9%);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  margin: 0;
  color: var(--tdm-ink);
  background: var(--tdm-paper);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 18px;
  line-height: 1.62;
  text-rendering: optimizeLegibility;
}

body.nav-open { overflow: hidden; }

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

a {
  color: var(--tdm-blue-dark);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover { color: var(--tdm-blue); }

button,
input,
select,
textarea { font: inherit; }

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.screen-reader-text:focus,
.skip-link:focus {
  z-index: 100000;
  top: 12px;
  left: 12px;
  width: auto;
  height: auto;
  clip: auto;
  padding: 10px 14px;
  color: var(--tdm-white);
  background: var(--tdm-ink);
}

.skip-link { position: absolute; }

.site-header {
  position: relative;
  z-index: 100;
  color: var(--tdm-white);
  background: var(--tdm-ink);
}

.site-header__inner {
  width: min(var(--tdm-width), calc(100% - 48px));
  min-height: 84px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 42px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 13px;
  color: var(--tdm-white);
  font-size: 19px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.045em;
  text-decoration: none;
}

.site-brand:hover { color: var(--tdm-white); }

.site-brand__mark {
  width: 31px;
  height: 26px;
  display: flex;
  align-items: end;
  gap: 4px;
}

.site-brand__mark i {
  display: block;
  width: 7px;
  background: var(--tdm-acid);
}

.site-brand__mark i:nth-child(1) { height: 14px; }
.site-brand__mark i:nth-child(2) { height: 26px; }
.site-brand__mark i:nth-child(3) { height: 19px; background: var(--tdm-coral); }

.primary-navigation { margin-left: auto; }

.primary-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.primary-navigation > div > ul,
.primary-navigation > ul {
  display: flex;
  align-items: center;
  gap: 4px;
}

.primary-navigation li { position: relative; }

.primary-navigation .tdm-category-menu { order: 90; }
.primary-navigation .menu-item--deals { order: 100; }

.primary-navigation a {
  display: block;
  padding: 29px 14px;
  color: var(--tdm-white);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
}

.primary-navigation .menu-item--deals > a {
  margin-left: 8px;
  padding: 11px 16px;
  color: var(--tdm-ink);
  background: var(--tdm-acid);
}

.primary-navigation a:hover,
.primary-navigation .current-menu-item > a,
.primary-navigation .current-menu-ancestor > a { color: var(--tdm-acid); }

.primary-navigation .menu-item--deals > a:hover { color: var(--tdm-ink); background: var(--tdm-white); }

.primary-navigation .sub-menu {
  position: absolute;
  top: calc(100% - 8px);
  left: 0;
  width: 270px;
  max-height: min(70vh, 620px);
  overflow-y: auto;
  visibility: hidden;
  opacity: 0;
  transform: translateY(8px);
  background: var(--tdm-white);
  box-shadow: var(--tdm-shadow);
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms;
}

.primary-navigation .sub-menu .sub-menu {
  top: 0;
  left: 100%;
}

.primary-navigation li:hover > .sub-menu,
.primary-navigation li:focus-within > .sub-menu {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.primary-navigation .sub-menu a {
  padding: 11px 16px;
  color: var(--tdm-ink);
  font-size: 13px;
  border-bottom: 1px solid #ecebe7;
}

.primary-navigation .sub-menu a:hover { color: var(--tdm-blue); background: #f4f5ff; }

.tdm-category-menu .sub-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.tdm-category-menu .sub-menu small {
  color: var(--tdm-muted);
  font-size: 11px;
  font-weight: 800;
}

.submenu-toggle { display: none; }

.menu-toggle {
  display: none;
  width: 46px;
  height: 46px;
  padding: 11px;
  color: var(--tdm-white);
  background: transparent;
  border: 1px solid rgb(255 255 255 / 35%);
  cursor: pointer;
}

.menu-toggle span:not(.screen-reader-text) {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: currentColor;
}

.site-main { min-height: 60vh; }

.home-hero {
  width: min(var(--tdm-width), calc(100% - 48px));
  margin: 40px auto 28px;
  display: grid;
  grid-template-columns: minmax(360px, 0.88fr) minmax(0, 1.45fr);
  min-height: 430px;
  background: var(--tdm-blue);
  text-decoration: none;
}

.home-hero:hover { color: inherit; }
.home-hero:focus-visible { outline: 4px solid var(--tdm-acid); outline-offset: 5px; }

.home-hero__copy {
  padding: clamp(36px, 6vw, 78px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--tdm-white);
}

.home-hero__label {
  margin: 0 0 40px;
  color: var(--tdm-acid);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.home-hero h1 {
  max-width: 570px;
  margin: 0;
  font-size: clamp(48px, 6.3vw, 86px);
  line-height: 0.95;
  letter-spacing: -0.065em;
}

.home-hero__footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-top: 50px;
}

.home-hero__jump {
  color: var(--tdm-white);
  font-size: 15px;
  font-weight: 900;
}

.home-hero__meter {
  display: flex;
  align-items: end;
  gap: 8px;
  height: 40px;
}

.home-hero__meter i {
  width: 10px;
  background: var(--tdm-acid);
}

.home-hero__meter i:nth-child(1) { height: 14px; }
.home-hero__meter i:nth-child(2) { height: 25px; }
.home-hero__meter i:nth-child(3) { height: 38px; }
.home-hero__meter i:nth-child(4) { height: 20px; background: var(--tdm-coral); }

.home-hero__visual {
  position: relative;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  background: #18191d;
}

.home-hero__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-credit {
  position: absolute;
  right: 10px;
  bottom: 8px;
  margin: 0;
  padding: 3px 6px;
  color: rgb(255 255 255 / 76%);
  background: rgb(0 0 0 / 52%);
  font-size: 10px;
  line-height: 1.2;
}

.route-grid {
  width: min(var(--tdm-width), calc(100% - 48px));
  margin: 0 auto 72px;
  display: grid;
  grid-template-columns: 1fr 1fr 0.78fr;
  gap: 18px;
}

.route-card {
  position: relative;
  min-height: 285px;
  display: flex;
  flex-direction: column;
  justify-content: end;
  overflow: hidden;
  color: var(--tdm-white);
  background: var(--tdm-ink);
  text-decoration: none;
}

.route-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 280ms ease;
}

.route-card::after {
  content: "";
  position: absolute;
  inset: 25% 0 0;
  background: linear-gradient(transparent, rgb(0 0 0 / 85%));
}

.route-card:hover img { transform: scale(1.025); }
.route-card:hover { color: var(--tdm-white); }

.route-card__label {
  position: relative;
  z-index: 2;
  padding: 24px;
  font-size: clamp(26px, 3vw, 39px);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.route-card--links {
  min-height: 285px;
  padding: 28px;
  justify-content: space-between;
  color: var(--tdm-ink);
  background: var(--tdm-acid);
}

.route-card--links::after { display: none; }
.route-card--links:hover { color: var(--tdm-ink); }

.route-card--links strong {
  font-size: clamp(28px, 3.2vw, 43px);
  line-height: 1;
  letter-spacing: -0.05em;
}

.route-card--links span { font-size: 15px; font-weight: 800; }

.home-content,
.article-shell,
.archive-shell {
  width: min(var(--tdm-width), calc(100% - 48px));
  margin: 0 auto;
}

.home-content {
  margin-bottom: 96px;
  padding: clamp(34px, 6vw, 76px);
  background: var(--tdm-white);
}

.home-content__inner { max-width: 960px; }

.home-latest {
  width: min(var(--tdm-width), calc(100% - 48px));
  margin: 0 auto 96px;
}

.home-section-heading {
  margin-bottom: 28px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
}

.home-section-heading h2 {
  margin: 0;
  font-size: clamp(38px, 5vw, 62px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.home-section-heading > a {
  flex: 0 0 auto;
  color: var(--tdm-ink);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.home-section-heading > a:hover { color: var(--tdm-blue); }

.article-shell {
  max-width: 1040px;
  margin-top: 52px;
  margin-bottom: 96px;
}

.article-header {
  max-width: 920px;
  margin-bottom: 34px;
}

.article-kicker,
.archive-kicker {
  margin: 0 0 12px;
  color: var(--tdm-blue);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.article-header h1,
.archive-header h1 {
  margin: 0;
  font-size: clamp(46px, 7vw, 82px);
  line-height: 0.98;
  letter-spacing: -0.062em;
}

.article-meta {
  margin: 18px 0 0;
  color: var(--tdm-muted);
  font-size: 14px;
}

.article-hero {
  position: relative;
  width: 100%;
  max-height: 620px;
  margin: 0 0 42px;
  overflow: hidden;
  background: #deddd7;
}

.article-hero img {
  width: 100%;
  max-height: 620px;
  object-fit: cover;
}

.article-body {
  max-width: var(--tdm-reading);
  margin: 0 auto;
}

.prose > :first-child { margin-top: 0; }

.prose h2,
.prose h3,
.prose h4 {
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.prose h2 {
  margin: 64px 0 20px;
  font-size: clamp(32px, 4vw, 48px);
}

.prose h3 {
  margin: 40px 0 12px;
  font-size: clamp(24px, 3vw, 31px);
}

.prose h4 { margin: 30px 0 8px; font-size: 21px; }

.prose p,
.prose ul,
.prose ol { margin: 0 0 24px; }

.prose ul,
.prose ol { padding-left: 1.35em; }

.prose li { margin-bottom: 8px; }
.prose .tdm-lead { font-size: clamp(21px, 2.3vw, 26px); line-height: 1.46; }

.prose blockquote {
  margin: 38px 0;
  padding: 6px 0 6px 28px;
  border-left: 8px solid var(--tdm-acid);
  font-size: 23px;
  line-height: 1.45;
}

.prose .wp-block-image,
.prose figure { margin: 36px 0; }

.prose figcaption {
  margin-top: 8px;
  color: var(--tdm-muted);
  font-size: 12px;
}

.wp-block-table {
  margin: 34px 0 44px;
  overflow-x: auto;
  box-shadow: inset 0 0 0 1px var(--tdm-line);
}

.wp-block-table table,
.prose table {
  width: 100%;
  border: 0;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.45;
}

.wp-block-table th,
.wp-block-table td,
.prose table th,
.prose table td {
  min-width: 150px;
  padding: 14px 15px;
  border: 1px solid var(--tdm-line);
  text-align: left;
  vertical-align: top;
}

.wp-block-table th,
.prose table th { color: var(--tdm-white); background: var(--tdm-ink); }
.wp-block-table tbody tr:nth-child(even),
.prose table tbody tr:nth-child(even) { background: #f2f1ec; }

.lwptoc {
  margin: 30px 0 42px !important;
}

.lwptoc_i {
  width: 100%;
  padding: 22px 24px !important;
  border: 0 !important;
  background: #eef0ff !important;
}

.lwptoc_header { margin-bottom: 10px !important; }
.lwptoc_title { font-weight: 900 !important; }
.lwptoc_item a { color: var(--tdm-ink) !important; }
.lwptoc_item a:hover { color: var(--tdm-blue) !important; }

.archive-shell { margin-top: 58px; margin-bottom: 96px; }
.archive-header { max-width: 900px; margin-bottom: 44px; }

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.post-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--tdm-white);
}

.post-card__image {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #dfded8;
}

.post-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease;
}

.post-card:hover .post-card__image img { transform: scale(1.02); }

.post-card__body { padding: 24px; }

.post-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.post-card__meta {
  margin: 0 0 13px !important;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: var(--tdm-muted);
  font-size: 11px !important;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.post-card__meta span { color: var(--tdm-blue); }
.post-card__meta time::before { content: "·"; margin-right: 12px; color: var(--tdm-muted); }

.post-card h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.post-card h2 a { color: var(--tdm-ink); text-decoration: none; }
.post-card h2 a:hover { color: var(--tdm-blue); }
.post-card__excerpt { margin: 14px 0 20px !important; color: var(--tdm-muted); font-size: 15px !important; }

.post-card__read {
  margin-top: auto;
  color: var(--tdm-ink);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.post-card__read:hover { color: var(--tdm-blue); }

.category-hero {
  min-height: 390px;
  padding: clamp(38px, 6vw, 76px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 48px;
  align-items: end;
  color: var(--tdm-white);
  background: var(--tdm-blue);
}

.category-hero__kicker {
  margin: 0 0 16px;
  color: var(--tdm-acid);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.category-hero h1 {
  max-width: 850px;
  margin: 0;
  font-size: clamp(52px, 8vw, 96px);
  line-height: 0.9;
  letter-spacing: -0.068em;
}

.category-hero__intro {
  max-width: 760px;
  margin: 30px 0 0;
  font-size: clamp(18px, 2vw, 23px);
  line-height: 1.45;
}

.category-hero__count {
  min-width: 130px;
  margin: 0;
  padding: 18px 20px;
  color: var(--tdm-ink);
  background: var(--tdm-acid);
}

.category-hero__count strong,
.category-hero__count span { display: block; }
.category-hero__count strong { font-size: 48px; line-height: 0.9; letter-spacing: -0.06em; }
.category-hero__count span { margin-top: 7px; font-size: 12px; font-weight: 900; text-transform: uppercase; }

.category-switcher {
  margin: 22px 0 72px;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}

.category-switcher > span {
  margin-right: 5px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.category-switcher a {
  padding: 8px 12px;
  color: var(--tdm-ink);
  background: var(--tdm-white);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.category-switcher a:hover,
.category-switcher a[aria-current="page"] { color: var(--tdm-white); background: var(--tdm-ink); }

.category-posts .post-card { max-width: 410px; }

.pagination { margin-top: 44px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pagination a,
.pagination span { padding: 8px 13px; background: var(--tdm-white); }
.pagination .current { color: var(--tdm-white); background: var(--tdm-blue); }

.empty-state {
  max-width: 720px;
  padding: 48px;
  background: var(--tdm-white);
}

.search-form { display: flex; gap: 8px; margin-top: 24px; }
.search-field { min-width: 0; flex: 1; padding: 12px 14px; border: 1px solid var(--tdm-line); }
.search-submit { padding: 12px 18px; color: var(--tdm-white); background: var(--tdm-blue); border: 0; cursor: pointer; }

.site-footer { color: var(--tdm-white); background: var(--tdm-ink); }

.site-footer__inner {
  width: min(var(--tdm-width), calc(100% - 48px));
  margin: 0 auto;
  padding: 48px 0 42px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: end;
}

.site-footer__brand { margin: 0 0 9px; font-size: 27px; font-weight: 900; letter-spacing: -0.05em; }
.site-footer__meta { margin: 0; color: #aeb0b5; font-size: 12px; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 18px; }
.site-footer__links a { color: var(--tdm-white); font-size: 14px; text-decoration: none; }
.site-footer__links a:hover { color: var(--tdm-acid); }

@media (max-width: 1040px) {
  .site-header__inner { gap: 18px; }
  .primary-navigation a { padding-inline: 9px; font-size: 13px; }
  .home-hero { grid-template-columns: 0.92fr 1.08fr; }
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  body { font-size: 17px; }
  .site-header__inner { width: min(100% - 28px, 720px); min-height: 68px; }
  .menu-toggle { display: block; margin-left: auto; }
  .primary-navigation {
    position: fixed;
    z-index: 110;
    inset: 68px 0 0;
    display: none;
    overflow-y: auto;
    margin: 0;
    padding: 16px 20px 42px;
    background: var(--tdm-ink);
  }
  .primary-navigation.is-open { display: block; }
  .primary-navigation > div > ul,
  .primary-navigation > ul { display: flex; flex-direction: column; }
  .primary-navigation li { border-bottom: 1px solid rgb(255 255 255 / 13%); }
  .primary-navigation a { padding: 15px 48px 15px 4px; font-size: 17px; }
  .primary-navigation .menu-item--deals > a { margin: 14px 0 0; padding: 14px 16px; }
  .primary-navigation .sub-menu {
    position: static;
    width: auto;
    max-height: none;
    display: none;
    visibility: visible;
    opacity: 1;
    transform: none;
    overflow: visible;
    padding: 0 0 10px 16px;
    background: transparent;
    box-shadow: none;
  }
  .primary-navigation .menu-item.is-open > .sub-menu { display: block; }
  .primary-navigation .sub-menu .sub-menu { position: static; }
  .primary-navigation .sub-menu a { color: #d8d9dd; background: transparent; border: 0; }
  .submenu-toggle {
    position: absolute;
    top: 7px;
    right: 0;
    display: block;
    width: 40px;
    height: 40px;
    padding: 0;
    color: var(--tdm-white);
    background: transparent;
    border: 0;
  }
  .submenu-toggle::before { content: "+"; font-size: 25px; }
  .menu-item.is-open > .submenu-toggle::before { content: "−"; }
  .home-hero,
  .route-grid,
  .home-content,
  .home-latest,
  .article-shell,
  .archive-shell,
  .site-footer__inner { width: min(100% - 28px, 720px); }
  .home-hero { grid-template-columns: 1fr; margin-top: 22px; }
  .home-hero__copy { min-height: 340px; }
  .home-hero__visual { min-height: 260px; }
  .route-grid { grid-template-columns: 1fr 1fr; margin-bottom: 48px; }
  .route-card--links { grid-column: 1 / -1; min-height: 190px; }
  .home-content { padding: 34px 28px; margin-bottom: 60px; }
  .home-latest { margin-bottom: 60px; }
  .category-hero { min-height: 340px; grid-template-columns: 1fr; gap: 34px; align-items: start; }
  .category-hero__count { width: max-content; }
  .category-switcher { margin-bottom: 54px; }
  .article-shell { margin-top: 34px; margin-bottom: 60px; }
  .article-header h1,
  .archive-header h1 { font-size: clamp(43px, 10vw, 68px); }
  .article-hero { margin-bottom: 34px; }
  .site-footer__inner { grid-template-columns: 1fr; align-items: start; }
}

@media (max-width: 560px) {
  .site-brand { font-size: 17px; }
  .home-hero__copy { min-height: 300px; padding: 30px 25px; }
  .home-hero h1 { font-size: 48px; }
  .home-hero__visual { min-height: 190px; }
  .route-grid { grid-template-columns: 1fr; gap: 14px; }
  .route-card,
  .route-card--links { grid-column: auto; min-height: 230px; }
  .route-card--links { min-height: 175px; }
  .home-content { padding: 28px 19px; }
  .home-section-heading { align-items: start; flex-direction: column; gap: 13px; }
  .home-section-heading h2 { font-size: 42px; }
  .category-hero { min-height: 0; padding: 34px 24px; }
  .category-hero h1 { font-size: 52px; }
  .category-hero__intro { margin-top: 22px; font-size: 18px; }
  .article-header h1,
  .archive-header h1 { font-size: 43px; }
  .prose h2 { margin-top: 48px; font-size: 33px; }
  .prose h3 { font-size: 25px; }
  .post-grid { grid-template-columns: 1fr; }
  .empty-state { padding: 30px 22px; }
  .site-footer__links { display: grid; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
