/*
Theme Name: Tanoshimi
Theme URI: https://tanoshimi.fr
Author: Simon Moinet
Description: Carnet de voyage. Thème sur mesure pour tanoshimi.fr : un journal de trois mois au Japon, où chaque entrée porte son sceau et son numéro de jour. Polices embarquées, aucune dépendance externe.
Version: 1.0.1
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tanoshimi
Tags: blog, two-columns, custom-menu, featured-images, translation-ready, editor-style
*/

/* ---------------------------------------------------------------- polices */

@font-face {
  font-family: "Zen Kaku Gothic New";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/zen-kaku-gothic-new-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Zen Kaku Gothic New";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/zen-kaku-gothic-new-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Zen Kaku Gothic New";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/zen-kaku-gothic-new-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Zen Kaku Gothic New";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/zen-kaku-gothic-new-latin-ext-500-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Zen Kaku Gothic New";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/zen-kaku-gothic-new-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Zen Kaku Gothic New";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/zen-kaku-gothic-new-latin-ext-700-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Shippori Mincho B1";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/shippori-mincho-b1-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Shippori Mincho B1";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/shippori-mincho-b1-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Shippori Mincho B1";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/shippori-mincho-b1-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Shippori Mincho B1";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/shippori-mincho-b1-latin-ext-700-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ----------------------------------------------------------------- socle  */

:root {
  --papier: #f4efe6;
  --papier-clair: #fbf8f2;
  --encre: #1c1a17;
  --vermillon: #c4432f;
  --vermillon-fonce: #9c3524;
  --indigo: #2a3a54;
  --gris: #5b5349;
  --trait: #dfd5c5;

  --sans: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Yu Gothic", system-ui, sans-serif;
  --serif: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", Georgia, serif;

  --mesure: 36rem;
  --lecture: 40rem;
  --page: 74rem;
  --gouttiere: 1.5rem;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--indigo); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--vermillon); }

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

.lien-evitement {
  position: absolute; left: -9999px; top: 0;
  background: var(--encre); color: var(--papier);
  padding: 0.75rem 1.25rem; z-index: 100;
}
.lien-evitement:focus { left: 0; }

.invisible {
  position: absolute !important; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.enveloppe {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: var(--gouttiere);
}
.enveloppe--etroite { max-width: calc(var(--mesure) + var(--gouttiere) * 2); }

/* La colonne de lecture d'un article ou d'une page simple : centrée dans la
   fenêtre, et c'est elle qui donne la mesure du texte. */
.enveloppe--lecture { max-width: calc(var(--lecture) + var(--gouttiere) * 2); }
.enveloppe--lecture .prose,
.enveloppe--lecture p { max-width: none; }

/* ------------------------------------------------------------ typographie */

h1, h2, h3, h4 {
  font-family: var(--sans);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.6em;
  letter-spacing: -0.005em;
}
h1 { font-size: clamp(2.1rem, 1.4rem + 2.6vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.1vw, 1.9rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1.2em; }

.sceau-mot { font-family: var(--serif); font-weight: 700; }

/* le nom du site, toujours en bas de casse et espacé */
.marque {
  display: inline-flex; align-items: center; gap: 0.7rem;
  text-decoration: none; color: inherit;
}
.marque__sceau { width: 2.6rem; height: 2.6rem; flex: none; }
.marque__nom {
  font-size: 1.25rem; font-weight: 500;
  letter-spacing: 0.14em; margin-right: -0.14em;
}

/* ------------------------------------------------------------------ menu  */

.entete {
  position: sticky; top: 0; z-index: 40;
  background: var(--papier);
  border-bottom: 1px solid var(--trait);
}
.entete__interieur {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 4.6rem;
}
.navigation ul {
  display: flex; align-items: center; gap: 1.6rem;
  list-style: none; margin: 0; padding: 0;
}
.navigation a {
  display: block; padding: 0.45rem 0;
  color: var(--encre); text-decoration: none; font-size: 0.97rem;
  border-bottom: 2px solid transparent;
}
.navigation a:hover { border-bottom-color: var(--trait); }
.navigation .current-menu-item > a,
.navigation .current_page_parent > a { border-bottom-color: var(--vermillon); }

.bascule-menu {
  display: none; align-items: center; gap: 0.5rem;
  font: inherit; font-size: 0.95rem; color: var(--encre);
  background: none; border: 1px solid var(--trait); border-radius: 4px;
  padding: 0.6rem 0.9rem; cursor: pointer; min-height: 44px;
}
.bascule-menu:hover { border-color: var(--vermillon); }

@media (max-width: 46rem) {
  .bascule-menu { display: inline-flex; }
  .navigation {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--papier); border-bottom: 1px solid var(--trait);
    padding: 0.5rem var(--gouttiere) 1.2rem;
  }
  .navigation.est-ouvert { display: block; }
  .navigation ul { flex-direction: column; align-items: stretch; gap: 0; }
  .navigation a { padding: 0.85rem 0; border-bottom: 1px solid var(--trait); }
  .navigation li:last-child a { border-bottom: 0; }
  .entete { position: relative; }
}

/* ------------------------------------------------------------- accueil    */

.ouverture {
  padding: clamp(3rem, 8vw, 6.5rem) 0 clamp(2.5rem, 5vw, 4rem);
  border-bottom: 1px solid var(--trait);
}
.ouverture__sceau { width: 5.5rem; height: 5.5rem; margin-bottom: 2rem; }
.ouverture h1 { max-width: 18ch; margin-bottom: 1.2rem; }
.ouverture__texte {
  font-family: var(--serif);
  font-size: 1.15rem; line-height: 1.85; color: var(--gris);
  max-width: var(--mesure);
}
.ouverture__texte strong { color: var(--encre); font-weight: 400; }

.compteur {
  display: inline-flex; align-items: baseline; gap: 0.55rem;
  margin-top: 2rem; padding: 0.5rem 0.9rem;
  background: var(--papier-clair); border: 1px solid var(--trait);
  font-size: 0.92rem; color: var(--gris);
}
.compteur b { font-size: 1.5rem; font-weight: 700; color: var(--vermillon); }

/* ------------------------------------------------- l'index du carnet      */

.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section + .section { border-top: 1px solid var(--trait); }
.section__titre {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem;
}
.section__titre h2 { margin: 0; }
.section__titre a { font-size: 0.95rem; }

.index { list-style: none; margin: 0; padding: 0; }
.index__entree { border-top: 1px solid var(--trait); }
.index__entree:last-child { border-bottom: 1px solid var(--trait); }

.entree {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr) 12rem;
  gap: 2rem; align-items: start;
  padding: 1.9rem 0;
}
.entree__jour {
  font-size: 0.9rem; color: var(--gris); line-height: 1.45;
  padding-top: 0.35rem;
}
.entree__jour b {
  display: block; font-size: 1.05rem; font-weight: 700; color: var(--encre);
}
.entree h3 { margin: 0 0 0.45rem; font-size: 1.35rem; font-weight: 500; }
.entree h3 a { color: inherit; text-decoration: none; }
.entree h3 a:hover { color: var(--vermillon); }
.entree__resume { margin: 0; color: var(--gris); font-size: 0.97rem; }
.entree__lieu {
  display: inline-block; margin-top: 0.7rem;
  font-size: 0.85rem; color: var(--vermillon);
}
.entree__vignette {
  display: block; overflow: hidden; background: var(--papier-clair);
  aspect-ratio: 4 / 3;
}
.entree__vignette img { width: 100%; height: 100%; object-fit: cover; }
.entree__vignette--vide {
  display: grid; place-items: center; border: 1px solid var(--trait);
}
.entree__vignette--vide svg { width: 2.4rem; height: 2.4rem; opacity: 0.55; }

@media (max-width: 58rem) {
  .entree { grid-template-columns: 5.5rem minmax(0, 1fr); gap: 1.2rem; }
  .entree__vignette { grid-column: 1 / -1; grid-row: 1; aspect-ratio: 16 / 9; margin-bottom: 0.6rem; }
  .entree__jour { grid-row: 2; }
  .entree__corps { grid-row: 2; }
}
@media (max-width: 34rem) {
  .entree { grid-template-columns: 1fr; }
  .entree__jour { grid-row: 2; padding-top: 0; }
  .entree__corps { grid-row: 3; }
  .entree__jour b { display: inline; margin-right: 0.5rem; }
}

/* ------------------------------------------------------------ l'article   */

.article-entete { padding: clamp(2.5rem, 6vw, 4.5rem) 0 2rem; }
.article-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1.4rem;
  font-size: 0.92rem; color: var(--gris); margin-top: 1.4rem;
}
.article-meta .jour {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-weight: 500; color: var(--encre);
}
.article-meta .jour svg { width: 1.6rem; height: 1.6rem; }

.image-une {
  margin: 0 0 clamp(2rem, 5vw, 3.5rem);
}
/* La photo garde son cadrage : on la contient dans la fenêtre au lieu de la
   rogner. Sur une image haute, c'est la hauteur qui commande. */
.image-une img {
  width: auto;
  max-width: 100%;
  max-height: 74vh;
  margin-inline: auto;
}
.image-une figcaption {
  font-size: 0.85rem; color: var(--gris); padding-top: 0.6rem;
  max-width: var(--lecture); margin-inline: auto;
}

.prose {
  font-family: var(--serif);
  font-size: 1.16rem;
  line-height: 1.9;
  max-width: var(--mesure);
}
.prose > * { margin-bottom: 1.35em; }
.prose > *:last-child { margin-bottom: 0; }
.prose h2, .prose h3 {
  font-family: var(--sans); margin-top: 2.4em; margin-bottom: 0.7em; line-height: 1.25;
}
.prose h2 { font-size: 1.55rem; }
.prose h3 { font-size: 1.22rem; font-weight: 500; }
.prose a { color: var(--indigo); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 0.5em; }
.prose img, .prose figure { margin-inline: 0; }
.prose figure { margin-bottom: 2em; }
.prose figcaption { font-family: var(--sans); font-size: 0.85rem; color: var(--gris); padding-top: 0.55rem; }
.prose blockquote {
  margin: 2.2em 0; padding-left: 1.4rem;
  border-left: 3px solid var(--vermillon);
  font-size: 1.24rem; line-height: 1.75;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose code {
  font-size: 0.88em; background: var(--papier-clair);
  border: 1px solid var(--trait); padding: 0.1em 0.35em;
}
.prose hr {
  border: 0; height: 1px; background: var(--trait); margin: 3em 0;
}

/* les images larges peuvent sortir de la mesure du texte */
.prose .alignwide, .prose .alignfull {
  max-width: none; width: min(100%, var(--page));
}
.prose .alignfull { width: 100%; }

.article-pied {
  margin-top: clamp(3rem, 7vw, 5rem);
  padding-top: 2rem; border-top: 1px solid var(--trait);
  display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between;
  font-size: 0.95rem;
}

.suite {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.5rem; margin-top: 3rem;
}
.suite a {
  display: block; padding: 1.3rem; text-decoration: none; color: inherit;
  background: var(--papier-clair); border: 1px solid var(--trait);
}
.suite a:hover { border-color: var(--vermillon); }
.suite span { display: block; font-size: 0.85rem; color: var(--gris); margin-bottom: 0.35rem; }
.suite strong { font-weight: 500; font-size: 1.05rem; }

/* --------------------------------------------------------------- pages    */

.page-entete {
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 2.5rem;
  border-bottom: 1px solid var(--trait);
}
.page-entete p {
  font-family: var(--serif); font-size: 1.1rem; line-height: 1.85;
  color: var(--gris); max-width: var(--mesure); margin: 1rem 0 0;
}
.page-corps { padding: clamp(2.5rem, 6vw, 4rem) 0; }

.deux-colonnes {
  display: grid; grid-template-columns: minmax(0, 1fr) 20rem;
  gap: clamp(2rem, 5vw, 4rem); align-items: start;
}
@media (max-width: 58rem) { .deux-colonnes { grid-template-columns: 1fr; } }

.encadre {
  background: var(--papier-clair); border: 1px solid var(--trait);
  padding: 1.6rem; font-size: 0.95rem;
}
.encadre h2 { font-size: 1.05rem; margin-bottom: 0.7rem; }
.encadre p:last-child { margin-bottom: 0; }
.encadre__sceau { width: 3rem; height: 3rem; margin-bottom: 1rem; }

/* ------------------------------------------------------------ formulaire  */

.formulaire { max-width: var(--mesure); }
.champ { margin-bottom: 1.3rem; }
.champ label { display: block; font-size: 0.92rem; margin-bottom: 0.4rem; }
.champ .obligatoire { color: var(--vermillon); }
.champ input[type="text"],
.champ input[type="email"],
.champ textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--encre);
  background: var(--papier-clair); border: 1px solid var(--trait);
  padding: 0.8rem 0.9rem; min-height: 48px; border-radius: 3px;
}
.champ textarea { min-height: 11rem; line-height: 1.6; resize: vertical; }
.champ input:focus, .champ textarea:focus {
  outline: 2px solid var(--vermillon); outline-offset: -1px; border-color: transparent;
}
.champ--miel { position: absolute; left: -9999px; }

.bouton {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-size: 1rem; font-weight: 500; cursor: pointer;
  background: var(--vermillon); color: var(--papier-clair);
  border: 1px solid var(--vermillon); border-radius: 3px;
  padding: 0.85rem 1.6rem; min-height: 48px; text-decoration: none;
}
.bouton:hover { background: var(--vermillon-fonce); border-color: var(--vermillon-fonce); color: var(--papier-clair); }

.message {
  padding: 1rem 1.2rem; margin-bottom: 1.8rem;
  border: 1px solid var(--trait); background: var(--papier-clair);
  font-size: 0.95rem;
}
.message--ok { border-left: 3px solid var(--vermillon); }
.message--erreur { border-left: 3px solid var(--vermillon); }
.message ul { margin: 0.5rem 0 0; padding-left: 1.2rem; }
.message p:last-child, .message li:last-child { margin-bottom: 0; }

/* -------------------------------------------------------------- pagination */

.pagination {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-top: 3rem; font-size: 0.95rem;
}
.pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.7rem; min-height: 2.7rem; padding: 0 0.6rem;
  border: 1px solid var(--trait); text-decoration: none; color: var(--encre);
}
.pagination .page-numbers:hover { border-color: var(--vermillon); }
.pagination .current {
  background: var(--vermillon); border-color: var(--vermillon); color: var(--papier-clair);
}

/* ------------------------------------------------------------------ pied  */

.pied {
  background: var(--encre); color: var(--papier);
  padding: clamp(2.5rem, 6vw, 4rem) 0 2rem; margin-top: 0;
}
.pied a { color: var(--papier); }
.pied a:hover { color: #e0705c; }
.pied__haut {
  display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between;
  padding-bottom: 2.2rem; border-bottom: 1px solid #38332c;
}
.pied__mot { max-width: 30ch; font-size: 0.95rem; color: #a89c8b; margin: 1rem 0 0; }
.pied .marque__nom { color: var(--papier); }
.pied__liens { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; font-size: 0.95rem; }
.pied__bas {
  padding-top: 1.5rem; font-size: 0.85rem; color: #8a8073;
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between;
}

/* ------------------------------------------------------------------ divers */

.vide {
  padding: clamp(3rem, 8vw, 5rem) 0;
  max-width: var(--mesure);
}
.vide h1 { margin-bottom: 1rem; }

.galerie-instagram {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.6rem; margin-top: 1.6rem;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

@media print {
  .entete, .pied, .bascule-menu, .pagination { display: none; }
  body { background: #fff; }
  .prose { max-width: none; }
}

.champ input.champ-recherche {
  width: 100%; font: inherit; font-size: 1rem; color: var(--encre);
  background: var(--papier-clair); border: 1px solid var(--trait);
  padding: 0.8rem 0.9rem; min-height: 48px; border-radius: 3px;
}
