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

h1,
h2,
h3,
h4,
h5,
h6,
.font-titles {
  letter-spacing: normal;
  font-style: normal;
}

body:not(.wp-admin) .entry-content.wp-block-post-content {
  margin-block-start: 0;
}

/*
 * Ensure spacing and padding are correct theme-wide.
 */

* {
  box-sizing: border-box;
}

/*
 * Font smoothing.
 * This is a niche setting that will not be available via Global Styles.
 * https://github.com/WordPress/gutenberg/issues/35934
 */

body {
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
}

@media (min-width: 783px) {
  .hide-on-desktop:not(.wp-block) {
    display: none !important;
  }
}

@media (max-width: 782px) {
  .hide-on-tablet:not(.wp-block) {
    display: none !important;
  }
}

@media (max-width: 599px) {
  .hide-on-mobile:not(.wp-block) {
    display: none !important;
  }
}

/* -------------------------------------------------------------------------------------------------------------------- */
/* FRAME (zed.dev) */
/* -------------------------------------------------------------------------------------------------------------------- */

/*
 * Cadre du site : lignes pleines sur les bords du conteneur, lignes pointillées sur les marges extérieures.
 * --frame-inner et --frame-outer sont réutilisés par les blocs (gutter, navigation, hero) pour aligner les losanges.
 * 100% se résout là où la variable est utilisée : sur un élément pleine largeur.
 * Déclaré sur body (pas :root) : WordPress y définit --wp--style--root--padding-left, sinon la variable est invalide.
 */
body {
  --frame-line: var(--wp--preset--color--border);
  --frame-node: var(--wp--preset--color--node);
  --frame-outer: var(--wp--custom--frame--outer);
  --frame-inner: max(var(--wp--style--root--padding-left), calc((100% - var(--wp--style--global--content-size)) / 2));
}

body {
  background-color: var(--wp--preset--color--background);
}

/* Grain du fond (même texture que zed.dev). */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("../images/noise.webp") repeat 0 0 / 180px;
  opacity: 0.035;
  pointer-events: none;
}

body:not(.wp-admin) .wp-site-blocks {
  position: relative;
  isolation: isolate;
}

body:not(.wp-admin) .wp-site-blocks::before,
body:not(.wp-admin) .wp-site-blocks::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  /* Au-dessus des fonds de blocs (bandeaux, colonnes), sous les gutters et le header. */
  z-index: 1;
  pointer-events: none;
}

body:not(.wp-admin) .wp-site-blocks::before {
  left: var(--frame-inner);
  right: var(--frame-inner);
  border-inline: 1px solid var(--frame-line);
}

body:not(.wp-admin) .wp-site-blocks::after {
  left: var(--frame-outer);
  right: var(--frame-outer);
  border-inline: 1px dashed var(--frame-line);
}

@media (max-width: 1240px) {
  body:not(.wp-admin) .wp-site-blocks::after {
    display: none;
  }
}

header.wp-block-template-part {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--wp--preset--color--background) 88%, transparent);
  backdrop-filter: blur(8px);
}

/* backdrop-filter crée un bloc conteneur pour position: fixed : sans ça,
   le menu mobile plein écran serait limité à la hauteur du header. */
html.has-modal-open header.wp-block-template-part {
  backdrop-filter: none;
}

/* Le fond du header masque les lignes du cadre : on les redessine par-dessus. */
header.wp-block-template-part::before,
header.wp-block-template-part::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  pointer-events: none;
}

header.wp-block-template-part::before {
  left: var(--frame-inner);
  right: var(--frame-inner);
  border-inline: 1px solid var(--frame-line);
}

header.wp-block-template-part::after {
  left: var(--frame-outer);
  right: var(--frame-outer);
  border-inline: 1px dashed var(--frame-line);
}

@media (max-width: 1240px) {
  header.wp-block-template-part::after {
    display: none;
  }
}

.admin-bar header.wp-block-template-part {
  top: var(--wp-admin--admin-bar--height, 32px);
}

::selection {
  background: color-mix(in srgb, var(--wp--preset--color--secondary) 20%, transparent);
}

code,
kbd {
  font-family: var(--wp--preset--font-family--monospace);
}

/* Colonnes séparées par des lignes, comme la rangée Fast / Agentic / Collaborative de zed.dev. */
.wp-block-columns.is-style-frame-columns {
  gap: 0;
  margin: 0;
}

.wp-block-columns.is-style-frame-columns > .wp-block-column {
  padding: 28px 40px 32px;
}

.wp-block-columns.is-style-frame-columns > .wp-block-column + .wp-block-column {
  border-left: 1px solid var(--frame-line);
}

.wp-block-columns.is-style-frame-columns h3 {
  margin-bottom: 8px;
  font-size: 1.3rem;
}

.wp-block-columns.is-style-frame-columns p {
  color: var(--wp--preset--color--muted);
  line-height: 1.6;
}

@media (max-width: 781px) {
  .wp-block-columns.is-style-frame-columns > .wp-block-column {
    padding: 24px 20px;
  }

  .wp-block-columns.is-style-frame-columns > .wp-block-column + .wp-block-column {
    border-left: 0;
    border-top: 1px solid var(--frame-line);
  }
}

/* Bandeau d'annonce (« News: … » sur zed.dev). */
.is-style-announcement {
  padding: 12px 20px;
  text-align: center;
  font-family: var(--wp--preset--font-family--serif);
  font-size: 1.15rem;
  background: color-mix(in srgb, var(--wp--preset--color--white) 40%, transparent);
}

.is-style-announcement strong {
  font-weight: 400;
  color: var(--wp--preset--color--secondary);
}

.is-style-announcement a {
  color: inherit;
  text-decoration: none;
  font-size: inherit;
}

.is-style-announcement a:hover {
  text-decoration: underline;
}
