/* Habillage éditorial d’Éditer un livre : encre, cramoisi, vert et papier. */

:root {
  --ink: #14171c;
  --ink-soft: #3d4450;
  --crimson: #d60b51;
  --crimson-dark: #b10843;
  --green: #7ab51d;
  --green-bright: #93c01f;
  --paper: #f7f7f7;
  --white: #ffffff;
  --line: #e5e7eb;
  --shadow: 0 2px 10px rgba(20, 23, 28, 0.05);
  --radius: 8px;
  --content: 1180px;
  --font-display: "Archivo", "Segoe UI", system-ui, sans-serif;
  --font-body: "Roboto", "Segoe UI", system-ui, sans-serif;
  --header-offset: 4.5rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
}

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

a {
  color: var(--crimson);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--crimson-dark);
}

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

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: 0;
  transform: translateY(-120%);
  z-index: 80;
  background: var(--ink);
  color: var(--white);
  text-decoration: none;
  padding: 0.6rem 1rem;
  border-radius: 0 0 10px 10px;
}

.skip-link:focus {
  transform: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--white);
  border-top: 4px solid var(--crimson);
  box-shadow: 0 1px 0 var(--line);
}

.header-inner {
  width: min(var(--content), calc(100% - 2rem));
  margin: 0 auto;
  min-height: 84px;
  display: flex;
  align-items: center;
  gap: 0.75rem 1rem;
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.brand img {
  width: auto;
  height: 64px;
  max-width: 190px;
}

.header-search {
  width: min(100%, 240px);
  margin-left: auto;
}

.nav-toggle,
.nav-close {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 10px;
  cursor: pointer;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  position: relative;
  border-radius: 2px;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-bars::before {
  top: -6px;
}

.nav-toggle-bars::after {
  top: 6px;
}

.primary-nav {
  flex: 1;
}

.nav-drawer-head {
  display: none;
}

.menu,
.submenu,
.side-links,
.plan-links,
.footer-links,
.notfound-links ul,
.search-results,
.breadcrumbs ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.menu {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-wrap: wrap;
}

.menu > .menu-item > a,
.menu-item-row > a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
}

.menu a:hover,
.menu a[aria-current="page"],
.menu-item.is-current > a,
.menu-item.is-current > .menu-item-row > a {
  color: var(--crimson);
  background: #fde7ef;
}

.menu-item {
  position: relative;
}

.menu-item-row {
  display: flex;
  align-items: center;
}

.submenu-toggle {
  width: 2rem;
  height: 2rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.submenu-toggle svg {
  width: 12px;
  height: 12px;
}

.has-submenu.is-open > .menu-item-row .submenu-toggle svg,
.has-submenu:hover > .menu-item-row .submenu-toggle svg {
  transform: rotate(180deg);
}

.submenu {
  position: absolute;
  top: calc(100% - 2px);
  left: 0;
  z-index: 25;
  min-width: 260px;
  max-width: 320px;
  padding: 0.4rem;
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.has-submenu:hover > .submenu,
.has-submenu:focus-within > .submenu,
.has-submenu.is-open > .submenu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.submenu a {
  display: block;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.92rem;
}

.submenu a:hover,
.submenu a[aria-current="page"] {
  color: var(--crimson);
  background: var(--paper);
}

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 23, 28, 0.45);
  opacity: 0;
  pointer-events: none;
  z-index: 25;
}

body.nav-open .nav-overlay {
  opacity: 1;
  pointer-events: auto;
}

.page-shell {
  width: min(var(--content), calc(100% - 2rem));
  margin: 1.25rem auto 2.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.25rem;
  align-items: start;
}

.breadcrumbs {
  grid-column: 1 / -1;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0;
  font-size: 0.92rem;
}

.breadcrumbs a {
  color: var(--ink-soft);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--crimson);
}

.breadcrumbs [aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin: 0 0.45rem;
  color: #98a0aa;
}

.content-card,
.side-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.content-card {
  padding: clamp(1.1rem, 2vw, 2rem);
  min-width: 0;
}

.content-card h1,
.content-card h2,
.content-card h3,
.side-card h2,
.nav-drawer-title {
  font-family: var(--font-display);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.content-card h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.8rem, 3vw, 2.55rem);
}

.content-card h2 {
  margin: 1.8rem 0 0.7rem;
  font-size: clamp(1.35rem, 2vw, 1.7rem);
}

.content-card h3 {
  margin: 1.4rem 0 0.45rem;
  font-size: 1.2rem;
}

.content-card p,
.content-card ul,
.content-card ol,
.content-card blockquote,
.content-card table {
  margin: 0.8rem 0;
}

.content-card ul,
.content-card ol {
  padding-left: 1.25rem;
}

.content-card li + li {
  margin-top: 0.35rem;
}

.content-card img {
  border-radius: 12px;
}

.content-card img.content-photo {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0.35rem 0 1rem;
}

.content-card img.content-logo {
  display: block;
  width: auto;
  max-width: min(100%, 220px);
  max-height: 104px;
  height: auto;
  margin: 0.35rem 0 1rem;
  border-radius: 0;
  object-fit: contain;
  object-position: left center;
}

.content-card img.content-icon {
  width: 4.5rem;
  height: auto;
  border-radius: 0;
}

.photo-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 0.6rem 0 1rem;
}

.photo-row .content-photo {
  margin: 0;
  width: 100%;
  height: auto;
}

.logo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin: 0.5rem 0 1.2rem;
}

.logo-row a {
  display: flex;
  align-items: center;
  line-height: 0;
}

.logo-row img.content-logo {
  margin: 0;
  max-width: 150px;
  max-height: 84px;
}

.home-step {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  column-gap: 0.85rem;
  align-items: start;
  margin: 0.85rem 0;
}

.home-step img {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.home-step .home-step-title,
.home-step h3 {
  grid-column: 2;
  grid-row: 1;
}

.home-step p:not(.home-step-title) {
  grid-column: 2;
  grid-row: 2;
}

.content-card .home-step img.content-icon {
  width: 4.5rem;
  margin-top: 0.15rem;
}

.content-card .home-step h3,
.content-card .home-step-title {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.25;
}

.home-step-title a,
.content-card .home-step h3 a {
  color: var(--ink);
  text-decoration: none;
}

.home-step-title a:hover,
.content-card .home-step h3 a:hover {
  color: var(--crimson);
}

.content-card .home-step p {
  margin: 0.25rem 0 0;
}

.content-card .editor-links {
  list-style: none;
  padding-left: 0;
  margin: 0.4rem 0 1.2rem;
}

.content-card .editor-links li + li {
  margin-top: 0;
}

.editor-links a {
  display: block;
  padding: 0.28rem 0;
  color: var(--ink);
  text-decoration: none;
}

.editor-links a:hover {
  color: var(--crimson);
}

.article-toc {
  margin: 1rem 0 1.3rem;
}

.article-toc > p {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
}

.article-toc ol {
  margin-top: 0.2rem;
}

.article-toc a {
  text-decoration: none;
}

.article-toc a:hover {
  text-decoration: underline;
}

.content-card blockquote {
  margin-left: 0;
  padding: 0.2rem 0 0.2rem 1rem;
  border-left: 4px solid var(--green);
  color: var(--ink-soft);
}

.content-card table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  display: block;
  overflow-x: auto;
}

.content-card th,
.content-card td {
  border: 1px solid var(--line);
  padding: 0.5rem 0.7rem;
  text-align: left;
  vertical-align: top;
}

.content-card th {
  background: var(--paper);
}

.content-card a.btn-cta,
.content-card a.btn-manuscrit,
.content-card .wp-block-button__link,
.content-card .js-random-editeur {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0.35rem 0.4rem 0.35rem 0;
  padding: 0.75rem 1.1rem;
  border-radius: 6px;
  font-family: var(--font-display);
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  line-height: 1.35;
  max-width: 100%;
}

.content-card a.btn-cta,
.content-card .wp-block-button__link {
  background: var(--green-bright);
  color: #14171c;
}

.content-card a.btn-manuscrit,
.content-card a.js-random-editeur,
.content-card .js-random-editeur {
  background: var(--crimson);
  color: var(--white);
}

.lead,
.result-count {
  color: var(--ink-soft);
}

mark {
  background: #fde7ef;
  color: inherit;
  padding: 0 0.15em;
  border-radius: 4px;
}

.search-results li,
.plan-links li,
.notfound-links li {
  margin: 0.35rem 0;
}

.search-results a {
  font-family: var(--font-display);
  font-weight: 700;
  text-decoration: none;
}

.search-results p {
  margin: 0.2rem 0 0.8rem;
  color: var(--ink-soft);
}

.search-form {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  overflow: hidden;
}

.search-form input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0.55rem 0.9rem;
  font: inherit;
  color: var(--ink);
}

.search-form input:focus {
  outline: none;
}

.search-form button,
.nav-close {
  border: 0;
  background: var(--ink);
  color: var(--white);
  font: inherit;
  font-weight: 700;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
}

.search-form-block {
  max-width: 520px;
  margin: 1rem 0;
}

.related-block {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.plan-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.35rem 1rem;
}

.related-links {
  margin: 0.35rem 0 0.8rem;
  padding-left: 1.15rem;
}

.related-more {
  margin: 0.2rem 0 0;
}

.related-links a,
.plan-links a,
.notfound-links a {
  color: var(--ink);
  text-decoration: none;
}

.related-links a:hover,
.plan-links a:hover,
.notfound-links a:hover,
.side-links a:hover,
.side-links a[aria-current="page"] {
  color: var(--crimson);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.side-card {
  padding: 1rem;
}

.side-card-tools {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.side-card h2 {
  margin: 0 0 0.7rem;
  font-size: 1.15rem;
}

.side-card h2 a {
  color: var(--ink);
  text-decoration: none;
}

.side-card h2 a:hover {
  color: var(--crimson);
}

.side-links a {
  display: block;
  padding: 0.28rem 0;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
}

.side-empty {
  margin: 0;
  color: var(--ink-soft);
}

.btn {
  display: flex;
  width: 100%;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  border-radius: 6px;
  padding: 0.85rem 1rem;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.3;
  text-wrap: balance;
}

.btn-annuaire {
  background: var(--green-bright);
  color: #14171c;
}

.btn-annuaire:hover {
  background: var(--green);
  color: #14171c;
}

.btn-manuscrit {
  background: var(--crimson);
  color: var(--white);
}

.btn-manuscrit:hover {
  background: var(--crimson-dark);
  color: var(--white);
}

.site-footer {
  background: var(--ink);
  color: #e8eaee;
}

.footer-inner {
  width: min(var(--content), calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.4rem 0 1.6rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1.1rem;
}

.footer-links a {
  color: #ffffff;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--green-bright);
}

.copyright {
  margin: 0.8rem 0 0;
  color: #b7bdc7;
  font-size: 0.92rem;
}

code {
  font-size: 0.92em;
  background: var(--paper);
  padding: 0.1em 0.35em;
  border-radius: 6px;
}

@media (max-width: 959px) {
  .brand img {
    height: 52px;
  }

  .nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .header-search {
    order: 4;
    width: 100%;
    margin: 0 0 0.75rem;
  }

  .header-inner {
    flex-wrap: wrap;
    padding: 0.55rem 0 0;
  }

  .primary-nav {
    position: fixed;
    z-index: 40;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(86vw, 360px);
    background: var(--white);
    transform: translateX(-105%);
    visibility: hidden;
    overflow: auto;
    padding: 1rem 1rem 2rem;
    box-shadow: var(--shadow);
  }

  body.nav-open .primary-nav {
    transform: none;
    visibility: visible;
  }

  .nav-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
  }

  .nav-drawer-title {
    margin: 0;
  }

  .nav-close {
    border-radius: 10px;
    padding: 0.4rem 0.7rem;
  }

  .menu {
    flex-direction: column;
    align-items: stretch;
  }

  .menu-item-row,
  .menu > .menu-item > a {
    width: 100%;
  }

  .submenu {
    position: static;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    display: none;
    min-width: 0;
    max-width: none;
    box-shadow: none;
    border: 0;
    padding: 0 0 0.4rem 0.8rem;
    background: transparent;
  }

  .has-submenu.is-open > .submenu {
    display: block;
  }

  .page-shell {
    grid-template-columns: 1fr;
  }

  body.nav-open {
    overflow: hidden;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media print {
  .site-header,
  .sidebar,
  .skip-link,
  .nav-overlay,
  .site-footer,
  .breadcrumbs {
    display: none !important;
  }

  body {
    background: white;
  }

  .page-shell {
    display: block;
    width: auto;
    margin: 0;
  }

  .content-card {
    box-shadow: none;
  }
}

@media (max-width: 640px) {
  .photo-row,
  .home-step {
    grid-template-columns: 1fr;
  }

  .home-step img,
  .home-step .home-step-title,
  .home-step h3,
  .home-step p:not(.home-step-title) {
    grid-column: 1;
    grid-row: auto;
  }

  .content-card .home-step img.content-icon {
    margin-bottom: 0.15rem;
  }
}
