/* ============================================================
   Chocolata Graphics — base : variables, reset, typographie
   ============================================================ */

:root {
  /* Structure */
  --header-h: 70px;
  --rail-w: 70px;
  --bar-h: 46px;

  /* Couleurs */
  --bg: #efefef;          /* fond gris léger (vidéo à venir plus tard) */
  --ink: #1c1c1c;
  --paper: #fff;
  --pink: #f7d9d9;
  --red: #970000;
  --gray-1: #d9d9d9;
  --gray-2: #cccccc;
  --gray-3: #bfbfbf;
  --gray-4: #b0b0b0;
  --placeholder: rgba(28, 28, 28, 0.08);

  /* Typographie */
  --font-serif: "cormorant-garamond", "Cormorant Garamond", "Noto Serif JP", serif;
  --font-sans: "gotham", "Noto Sans JP", sans-serif;
}

/* Couleur d'accent de chaque catégorie (DA) — utilisée par les pages
   catégorie (mot géant, bandeau) et par le filet de rollover du rail. */
.cat--graphic-design { --cat-accent: #9999ff; }
.cat--publishing     { --cat-accent: #cb8e19; }
.cat--web-design     { --cat-accent: #ffca99; }
.cat--motion-design  { --cat-accent: #73ab9e; }

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 12px;
  line-height: 2;
  letter-spacing: 0.06em;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

img, svg, video {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* Bloc de texte courant (Gotham regular 9pt / Noto Sans JP) */
.text-block {
  max-width: 620px;
  margin-inline: auto;
  text-align: center;
}

:lang(fr) .text-block {
  line-height: 1.9;
}

/* ============================================================
   Césure & rythme typographique par langue
   Micro-typographie (insécables, apostrophe) : filtre `typo` au
   build. Ici on gère la césure et les veuves/orphelines, qui
   dépendent de la largeur — donc responsive desktop ET mobile
   sans media query.
   ============================================================ */

/* Défaut global : pas de césure automatique (titres, labels, nav) */
html {
  hyphens: manual;
  -webkit-hyphens: manual;
}

/* --- Français : pas de césure sur le texte courant (composition
   centrée / justifiée soignée), mais orphelines maîtrisées. --- */
:lang(fr) .text-block {
  hyphens: none;
  -webkit-hyphens: none;
  text-wrap: pretty; /* évite veuves / dernières lignes trop courtes */
}

/* Titres FR : jamais coupés, lignes équilibrées */
:lang(fr) h1,
:lang(fr) h2,
:lang(fr) h3,
:lang(fr) .hero__title,
:lang(fr) .cat-hero__title {
  hyphens: none;
  -webkit-hyphens: none;
  text-wrap: balance;
}

/* --- Japonais : pas de césure latine, kinsoku (禁則処理) strict --- */
:lang(ja) {
  hyphens: none;
  -webkit-hyphens: none;
  line-break: strict;   /* interdit 、。！？ en début de ligne, etc. */
  word-break: normal;
  overflow-wrap: normal;
}

:lang(ja) .text-block,
:lang(ja) h1,
:lang(ja) h2,
:lang(ja) h3,
:lang(ja) .hero__title,
:lang(ja) .cat-hero__title {
  text-wrap: pretty;
}

/* Amélioration progressive : coupe aux frontières de bunsetsu
   (文節) quand le navigateur sait le faire — mots latins et
   groupes japonais restent entiers. */
@supports (word-break: auto-phrase) {
  :lang(ja) .text-block {
    word-break: auto-phrase;
  }
}

/* Utilitaires */
[hidden] {
  display: none !important;
}

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

.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  padding: 8px 16px;
  background: var(--ink);
  color: var(--paper);
}

.skip-link:focus {
  top: 0;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
