/*
Theme Name: Ownprod V3 Base
Theme URI: https://ownprod.fr/
Author: Ownprod
Description: Base de thème WordPress Ownprod avec navigation mosaïque plein écran, héros par image mise en avant et direction artistique crème/noir/bordeaux.
Version: 0.1.0
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 8.0
Text Domain: ownprod-v3
*/

:root {
  --op-accent: #660033;
  --op-accent-bright: #9c0b4d;
  --op-ink: #101114;
  --op-ink-soft: #18191d;
  --op-paper: #f5f0e9;
  --op-paper-2: #fbf8f3;
  --op-text: #171419;
  --op-muted: #6f686b;
  --op-line: rgba(34, 24, 29, .14);
  --op-sidebar: 78px;
  --op-max: 1240px;
  --op-radius: 18px;
  --op-shadow: 0 18px 55px rgba(20, 13, 17, .10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--op-paper);
  color: var(--op-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
}
body.menu-open { overflow: hidden; }
a { color: inherit; }
img { max-width: 100%; height: auto; }

/* --- page shell --- */
.site-shell { min-height: 100vh; padding-left: var(--op-sidebar); }
.site-main { min-height: 70vh; }
.op-container { width: min(calc(100% - 48px), var(--op-max)); margin-inline: auto; }

/* --- fixed side navigation --- */
.op-menu-bar {
  position: fixed;
  z-index: 1001;
  inset: 0 auto 0 0;
  width: var(--op-sidebar);
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  align-items: center;
  padding: 16px 10px;
  color: #fff;
  background: rgba(14, 14, 17, .94);
  border-right: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(12px);
}
.op-brand {
  grid-row: 1;
  justify-self: center;
  color: #fff;
  text-decoration: none;
  font-weight: 900;
  font-size: .75rem;
  letter-spacing: .18em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}
.op-menu-toggle {
  grid-row: 2;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  color: #fff;
  cursor: pointer;
  transition: transform .25s ease, background .25s ease, border-color .25s ease;
}
.op-menu-toggle:hover { transform: scale(1.05); background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25); }
.op-menu-toggle svg { width: 24px; height: 24px; }
.op-menu-toggle .icon-close { display: none; }
.menu-open .op-menu-toggle .icon-menu { display: none; }
.menu-open .op-menu-toggle .icon-close { display: block; }

/* --- full screen mosaic menu --- */
.op-menu-overlay {
  position: fixed;
  z-index: 1000;
  inset: 0;
  padding-left: var(--op-sidebar);
  background: #0d0e10;
  opacity: 0;
  pointer-events: none;
  transition: opacity .34s ease;
}
.menu-open .op-menu-overlay { opacity: 1; pointer-events: auto; }
.op-menu-grid {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 3px;
  padding: 12px;
}
.op-menu-link,
.op-close-tile {
  position: relative;
  overflow: hidden;
  border: 0;
  min-width: 0;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  isolation: isolate;
  opacity: 0;
  transform: translateY(14px) scale(.985);
  transition: opacity .42s ease, transform .42s cubic-bezier(.2,.7,.2,1), filter .25s ease;
}
.menu-open .op-menu-link,
.menu-open .op-close-tile { opacity: 1; transform: translateY(0) scale(1); }
.op-menu-link:nth-child(1) { transition-delay: .04s; }
.op-menu-link:nth-child(2) { transition-delay: .08s; }
.op-menu-link:nth-child(3) { transition-delay: .12s; }
.op-menu-link:nth-child(4) { transition-delay: .16s; }
.op-menu-link:nth-child(5) { transition-delay: .20s; }
.op-menu-link:nth-child(6) { transition-delay: .24s; }
.op-menu-link:nth-child(7) { transition-delay: .28s; }
.op-menu-link:nth-child(8) { transition-delay: .32s; }
.op-menu-link::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgba(8,8,10,.83) 0%, rgba(8,8,10,.25) 55%, rgba(8,8,10,.06) 100%);
}
.op-menu-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: center / cover no-repeat var(--op-menu-image, linear-gradient(135deg, #2a2b30, #111216));
  transition: transform .65s cubic-bezier(.2,.7,.2,1), filter .4s ease;
}
.op-menu-link:hover::after,
.op-menu-link:focus-visible::after { transform: scale(1.055); filter: saturate(1.08); }
.op-menu-link:hover,
.op-menu-link:focus-visible { filter: brightness(1.07); }
.op-menu-link--wide { grid-column: span 2; }
.op-menu-link--tall { grid-row: span 2; }
.op-menu-link__content {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(20px, 2.2vw, 34px);
}
.op-menu-kicker {
  display: inline-flex;
  width: max-content;
  margin-bottom: 10px;
  color: #f3a4c5;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.op-menu-link h2 { margin: 0; font-size: clamp(1.15rem, 2vw, 1.8rem); line-height: 1.05; letter-spacing: -.025em; }
.op-menu-link p {
  max-width: 46ch;
  max-height: 0;
  margin: 0;
  overflow: hidden;
  color: rgba(255,255,255,.78);
  line-height: 1.45;
  transition: max-height .3s ease, margin .3s ease;
}
.op-menu-link:hover p,
.op-menu-link:focus-visible p { max-height: 6em; margin-top: 10px; }
.op-close-tile {
  display: grid;
  place-items: center;
  grid-column: 3;
  grid-row: 2;
  background: linear-gradient(145deg, var(--op-accent), #3b0a24);
}
.op-close-tile:hover { filter: brightness(1.13); }
.op-close-tile svg { width: clamp(32px, 5vw, 58px); height: clamp(32px, 5vw, 58px); }

/* --- page hero: featured image = hero background --- */
.op-page-hero {
  position: relative;
  min-height: min(680px, 78vh);
  display: flex;
  align-items: flex-end;
  color: #fff;
  background:
    radial-gradient(circle at 70% 25%, rgba(102,0,51,.28), transparent 26%),
    linear-gradient(135deg, #17181b, #08090b);
  overflow: hidden;
}
.op-page-hero.has-image {
  background-image:
    linear-gradient(90deg, rgba(8,8,10,.93) 0%, rgba(8,8,10,.73) 38%, rgba(8,8,10,.22) 72%, rgba(8,8,10,.38) 100%),
    var(--op-hero-image);
  background-size: cover;
  background-position: center;
}
.op-page-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px 0;
  height: 110px;
  background: var(--op-paper);
  clip-path: polygon(0 72%, 36% 72%, 49% 0, 62% 72%, 100% 72%, 100% 100%, 0 100%);
}
.op-hero-inner {
  position: relative;
  z-index: 2;
  width: min(calc(100% - 56px), var(--op-max));
  margin-inline: auto;
  padding: 120px 0 150px;
}
.op-eyebrow {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 18px;
  color: #f04b91;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.op-eyebrow::before { content: ""; width: 3px; height: 20px; background: var(--op-accent-bright); }
.op-page-hero h1 {
  max-width: 900px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 6.5vw, 6.6rem);
  font-weight: 500;
  line-height: .95;
  letter-spacing: -.045em;
}
.op-page-hero .hero-intro {
  max-width: 690px;
  margin: 24px 0 0;
  color: rgba(255,255,255,.82);
  font-size: 1.08rem;
  line-height: 1.65;
}

/* --- generic content --- */
.op-content {
  background:
    radial-gradient(circle at 18% 10%, rgba(102,0,51,.045), transparent 26%),
    var(--op-paper);
  padding: 76px 0 110px;
}
.op-entry { width: min(calc(100% - 48px), var(--op-max)); margin-inline: auto; }
.op-entry > * { max-width: 820px; }
.op-entry > .alignwide { max-width: var(--op-max); }
.op-entry > .alignfull { max-width: none; width: calc(100% + var(--op-sidebar)); margin-left: calc(var(--op-sidebar) * -1); }
.op-entry h2,
.op-entry h3,
.op-entry h4 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; color: #171217; }
.op-entry h2 { margin-top: 1.9em; font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1.05; }
.op-entry h3 { margin-top: 1.7em; font-size: clamp(1.4rem, 2vw, 2rem); }
.op-entry p,
.op-entry li { color: #4c4549; line-height: 1.78; }
.op-entry a:not(.wp-element-button) { color: var(--op-accent); text-decoration-thickness: 1px; text-underline-offset: .18em; }

/* --- reusable visual sections/classes for Gutenberg --- */
.op-section-light,
.op-section-dark,
.op-section-burgundy {
  padding: clamp(64px, 8vw, 112px) max(24px, calc((100vw - var(--op-max))/2));
}
.op-section-light { background: var(--op-paper-2); color: var(--op-text); }
.op-section-dark {
  background:
    radial-gradient(circle at 80% 20%, rgba(102,0,51,.22), transparent 26%),
    linear-gradient(135deg, #17181b, #0d0e10);
  color: #fff;
}
.op-section-dark p, .op-section-dark li { color: rgba(255,255,255,.74); }
.op-section-dark h2, .op-section-dark h3 { color: #fff; }
.op-section-burgundy {
  background:
    radial-gradient(circle at 12% 60%, rgba(255,255,255,.08), transparent 22%),
    linear-gradient(110deg, #42001f, var(--op-accent), #330019);
  color: #fff;
}
.op-section-burgundy p { color: rgba(255,255,255,.8); }
.op-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.op-card {
  padding: 26px;
  background: rgba(255,255,255,.82);
  border: 1px solid var(--op-line);
  border-radius: var(--op-radius);
  box-shadow: var(--op-shadow);
}
.op-section-dark .op-card { background: rgba(255,255,255,.045); border-color: rgba(255,255,255,.10); box-shadow: none; }

/* --- buttons --- */
.wp-element-button,
.op-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 4px;
  background: var(--op-accent);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  transition: transform .2s ease, filter .2s ease;
}
.wp-element-button:hover,
.op-button:hover { transform: translateY(-2px); filter: brightness(1.08); }

/* --- footer --- */
.site-footer {
  padding: 58px 0 32px;
  color: rgba(255,255,255,.72);
  background: #101114;
  border-top: 1px solid rgba(255,255,255,.06);
}
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 40px; }
.site-footer h2, .site-footer h3 { color: #fff; margin-top: 0; }
.site-footer a { color: rgba(255,255,255,.8); text-decoration: none; }
.site-footer a:hover { color: #fff; }
.footer-bottom { margin-top: 42px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.08); font-size: .85rem; }

/* --- accessibility --- */
:focus-visible { outline: 3px solid #fff; outline-offset: -4px; }
.op-content :focus-visible { outline-color: var(--op-accent); outline-offset: 3px; }

@media (max-width: 980px) {
  :root { --op-sidebar: 68px; }
  .op-menu-grid { grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(4, 1fr); }
  .op-menu-link--wide { grid-column: span 2; }
  .op-close-tile { grid-column: 2; grid-row: 2; }
  .op-cards { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  :root { --op-sidebar: 0px; }
  .site-shell { padding-left: 0; padding-top: 68px; }
  .op-menu-bar {
    inset: 0 0 auto 0;
    width: 100%;
    height: 68px;
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: 1fr;
    padding: 8px 14px;
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .op-brand { grid-column: 1; grid-row: 1; justify-self: start; writing-mode: initial; transform: none; }
  .op-menu-toggle { grid-column: 2; grid-row: 1; width: 48px; height: 48px; }
  .op-menu-overlay { padding-left: 0; padding-top: 68px; }
  .op-menu-grid { grid-template-columns: repeat(2,1fr); grid-template-rows: repeat(4,1fr); padding: 7px; gap: 2px; }
  .op-menu-link--wide,
  .op-menu-link--tall { grid-column: auto; grid-row: auto; }
  .op-close-tile { grid-column: 2; grid-row: 2; }
  .op-menu-link p { display: none; }
  .op-page-hero { min-height: 560px; }
  .op-page-hero::after { height: 72px; clip-path: polygon(0 68%, 30% 68%, 48% 0, 65% 68%, 100% 68%, 100% 100%, 0 100%); }
  .op-hero-inner { width: min(calc(100% - 30px), var(--op-max)); padding: 90px 0 110px; }
  .op-entry { width: min(calc(100% - 30px), var(--op-max)); }
  .op-entry > .alignfull { width: 100vw; margin-left: calc((100vw - 100%) / -2); }
  .op-cards { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}

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