/* Les pictos intégrés se chargent aussi lors de l’ouverture locale des cartes. */
@import url("assets/pictos.css");

@font-face {
  font-family: "Cormorant Garamond";
  src: url("assets/cormorant-garamond.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Great Vibes";
  src: url("assets/great-vibes.ttf") format("truetype");
  font-display: swap;
}
:root {
  --marble: url("assets/marbre-blanc.png");
  --gold-shadow: #795d27;
  --gold-text: #9f782f;
  --gold: #d4b66e;
  --gold-light: #f3dfab;
  --gold-outline: #b89245;
  --gold-amber: #c49746;
  --gold-frame: linear-gradient(135deg, #81591f, var(--gold-amber) 19%, var(--gold-light) 32%,
    #ac7b2e 47%, #885d22 60%, var(--gold) 79%, var(--gold-light) 88%, #966824);
  --gold-lettering: linear-gradient(112deg, #604316, #906227 24%, #a4772c 36%,
    #77501b 51%, #9e7027 70%, #a4772c 81%, #654518);
  --gold-control: linear-gradient(115deg, var(--gold), #e6cf9a 48%, var(--gold));
  --gold-emblem: linear-gradient(115deg, var(--gold-shadow), #a4772c 48%, #77501b);
  --gold-glow: 0 0 6px 2px color-mix(in srgb, var(--gold) 70%, transparent),
               0 0 24px 6px color-mix(in srgb, var(--gold-light) 48%, transparent);
  --frame-duration: 1.1s;
  --frame-easing: cubic-bezier(.7, 0, .2, 1);
  --frame-inner-delay: .15s;
}
* { box-sizing: border-box; }
html {
  overflow-x: hidden;
  overflow-x: clip;
  scroll-padding-top: 5.2rem;
}
html:has(dialog[open]) { overflow: hidden; }
body {
  position: relative;
  isolation: isolate;
  margin: 0;
  font: 500 1.35rem/1.4 "Cormorant Garamond", Georgia, serif;
  color: #201d18;
  background: #fff var(--marble) repeat left top;
}
body::before, #couverture::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("assets/fond.jpg") repeat top center / clamp(28rem, 100vw, 72rem) auto;
  opacity: .31;
  pointer-events: none;
}
h1, h2, h3 {
  margin: 0;
  font: 400 clamp(3rem, 6vw, 4.5rem)/1.25 "Great Vibes", cursive;
  color: var(--gold-shadow);
}
@supports (background-clip: text) or (-webkit-background-clip: text) {
  h2, h3, .cover-name, .chabbat-name {
    background-image: var(--gold-lettering);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}
h3 { font-size: clamp(2.5rem, 5vw, 3.25rem); }
p, form { margin: 0; }
button, a { font: inherit; color: inherit; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--gold-shadow); outline-offset: 4px; }
#couverture {
  position: fixed;
  isolation: isolate;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  overflow: auto;
  overscroll-behavior: contain;
  background: #fff var(--marble) center center / cover;
  text-align: center;
}
#couverture[open] {
  display: flex;
  padding: clamp(1rem, 4vw, 2rem);
}
#couverture::backdrop { background: transparent; }
.welcome {
  position: relative;
  isolation: isolate;
  width: min(100%, 39rem);
  margin: auto;
  padding: clamp(1.25rem, 4vh, 2.25rem) clamp(.75rem, 4vw, 2rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: clamp(1rem, 2.5vh, 1.5rem);
  border: 2px solid transparent;
}
.welcome::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #fff var(--marble) repeat center top;
  pointer-events: none;
}
.panel {
  border: 4px solid transparent;
  background: var(--marble) repeat center top padding-box,
              linear-gradient(#fff, #fff) padding-box,
              var(--gold-frame) border-box;
  box-shadow: var(--gold-glow);
}
.cover-frame {
  position: absolute;
  pointer-events: none;
}
.cover-frame--outer {
  --line-width: 2px;
  inset: -2px;
}
.cover-frame--outer::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: var(--gold-glow);
}
.cover-frame--inner {
  --line-width: 1px;
  --frame-delay: var(--frame-inner-delay);
  inset: .4rem;
  opacity: .72;
}
.cover-frame > span {
  position: absolute;
  background: var(--gold-frame);
}
.cover-frame > span:nth-child(odd) { inset-inline: 0; height: var(--line-width); }
.cover-frame > span:nth-child(even) { inset-block: 0; width: var(--line-width); }
.cover-frame > span:nth-child(1) {
  top: 0;
  transform-origin: left;
  --line-start: scaleX(0);
}
.cover-frame > span:nth-child(2) {
  right: 0;
  transform-origin: top;
  --line-start: scaleY(0);
}
.cover-frame > span:nth-child(3) {
  bottom: 0;
  transform-origin: right;
  --line-start: scaleX(0);
}
.cover-frame > span:nth-child(4) {
  left: 0;
  transform-origin: bottom;
  --line-start: scaleY(0);
}
.cover-frame > span:nth-child(2) { --line-delay: .25s; }
.cover-frame > span:nth-child(3) { --line-delay: .5s; }
.cover-frame > span:nth-child(4) { --line-delay: .75s; }
.logo { display: block; width: min(57vw, 18rem); height: auto; }
.cover-star { width: min(55vw, 32vh, 17rem); }
.cover-star .logo { width: 100%; }
.cover-blessing {
  margin-bottom: -.5rem;
  color: var(--gold-shadow);
  font: 400 1.1rem/1 "Times New Roman", David, serif;
}
.welcome h1, .cover-guest {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
}
.welcome h1 { font-size: clamp(1.8rem, 5vw, 3rem); }
.welcome h1:focus { outline: none; }
.cover-title { display: block; }
.cover-name {
  display: block;
  margin-top: .35rem;
  font-family: "Great Vibes", cursive;
  font-size: clamp(3.35rem, 10vw, 5.5rem);
  font-weight: 400;
}
.welcome form { margin-top: .75rem; }
.cover-guest {
  margin-bottom: .9rem;
  color: var(--gold-shadow);
  font-size: clamp(1.625rem, 5.25vw, 2.3rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.gold-button, nav a {
  color: #302719;
  font-weight: 500;
  text-transform: uppercase;
}
.gold-button {
  display: inline-block;
  font-size: 1rem;
  border: 0;
  border-radius: 0;
  padding: .65rem 1.5rem;
  text-decoration: none;
  background: var(--gold-control);
  cursor: pointer;
}
.welcome .gold-button {
  font-size: .9375rem;
  line-height: 1.5;
  box-shadow: 0 4px 12px #33261133;
}
@media (hover: hover) and (pointer: fine) {
  .gold-button:hover { filter: brightness(1.05); }
}
nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1;
  display: flex;
  justify-content: center;
  gap: clamp(.15rem, 1vw, .65rem);
  padding: .75rem;
  background: var(--gold-control);
  box-shadow: 0 4px 16px #795d271c;
}
nav a {
  display: block;
  min-width: 0;
  font-size: clamp(.8125rem, 2.65vw, .875rem);
  line-height: 1.5;
  padding: .45rem clamp(.35rem, 1.7vw, 1.1rem);
  overflow-wrap: anywhere;
  text-align: center;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
html[lang="he"] nav a { font-size: clamp(1.0625rem, 3.8vw, 1.375rem); }
nav a:focus-visible { outline-offset: -2px; }
.music-toggle, .language-toggle {
  position: fixed;
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--gold-outline);
  border-radius: .55rem;
  color: #302719;
  background: var(--gold-control);
  box-shadow: 0 3px 12px #795d2733;
  cursor: pointer;
}
.music-toggle { right: max(1rem, env(safe-area-inset-right)); }
.language-toggle {
  left: max(1rem, env(safe-area-inset-left));
  border-radius: 50%;
}
.language-flag {
  width: 1.65rem;
  height: 1.1rem;
  border-radius: .1rem;
  background: #fff url("assets/drapeau-israel.png") center / contain no-repeat;
  box-shadow: 0 0 0 1px #0002;
  forced-color-adjust: none;
}
html[lang="he"] .language-flag {
  background: linear-gradient(to right, #002654 33.333%, white 33.333% 66.667%, #ce1126 66.667%);
}
.music-toggle[hidden] { display: none; }
.music-icon {
  width: .75rem;
  height: .85rem;
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.music-toggle.is-playing .music-icon {
  background: transparent;
  border-inline: .24rem solid currentColor;
  clip-path: none;
}
main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(3rem, 6vw, 4.5rem);
  padding: 6.25rem 1rem 3rem;
}
.panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(.85rem, 2vw, 1.25rem);
  padding: clamp(2.75rem, 5vw, 4rem) clamp(1.1rem, 4vw, 2rem);
  text-align: center;
}
.panel::after {
  content: "";
  position: absolute;
  inset: .4rem;
  border: 1px solid var(--gold-outline);
  border-radius: inherit;
  pointer-events: none;
}
@supports (mask-composite: exclude) {
  .panel::after {
    border: 0;
    padding: 1px;
    background: var(--gold-frame);
    opacity: .72;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  }
}
.panel > * { max-width: 100%; }
.announcement .logo { margin-block: .25rem .6rem; }
.hebrew-name {
  color: var(--gold-text);
  font: 400 clamp(2.65rem, 7vw, 3.75rem)/1.2 "Times New Roman", David, serif;
}
.invitation-text {
  width: min(100%, 30rem);
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  line-height: 1.55;
  text-wrap: pretty;
}
.date { font-weight: 600; }
.rsvp-form {
  display: grid;
  gap: 1.25rem;
  width: min(100%, 30rem);
  text-align: start;
}
.rsvp-field, .rsvp-event { display: grid; gap: .4rem; }
.rsvp-event {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.rsvp-event legend { margin-bottom: .4rem; padding: 0; font-weight: 600; }
.rsvp-choice { display: flex; align-items: center; gap: .5rem; width: fit-content; }
.rsvp-choice input { margin: 0; accent-color: var(--gold-shadow); }
.rsvp-field :is(input, textarea) {
  width: 100%;
  min-width: 0;
  padding: .45rem .65rem;
  border: 1px solid var(--gold-outline);
  border-radius: 0;
  color: inherit;
  background: #fffdf9;
  font: inherit;
}
.rsvp-field input:disabled { opacity: .55; }
.rsvp-field textarea { resize: vertical; }
.rsvp-form[hidden] { display: none; }
.rsvp-event .rsvp-field { margin-top: .35rem; }
.rsvp-counts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.rsvp-form .gold-button { justify-self: center; margin-top: .5rem; }
.rsvp-status { text-align: center; }
.rsvp-status:empty { display: none; }
.rsvp-summary { text-align: start; overflow-wrap: anywhere; }
.rsvp-summary dt { font-weight: 600; }
.rsvp-summary dd { margin: 0 0 .6rem; white-space: pre-wrap; }
.rsvp-progress {
  width: min(26rem, calc(100% - 2rem));
  padding: 1.5rem 1.25rem 1.1rem;
  border: 2px solid transparent;
  background: var(--marble) center / cover padding-box,
              linear-gradient(#fff, #fff) padding-box, var(--gold-frame) border-box;
  color: var(--gold-shadow);
  text-align: center;
}
.rsvp-progress::before {
  content: "";
  position: absolute;
  inset: .35rem;
  border: 1px solid var(--gold-outline);
  pointer-events: none;
}
.rsvp-progress p { font: 400 clamp(2rem, 7vw, 2.6rem)/1.25 "Great Vibes", cursive; }

html[lang="he"] [data-french-only] { display: none; }
html[lang="he"] :is(body, h1, h2, h3, .cover-name, .cover-guest, .chabbat-name, .rsvp-progress p) {
  font-family: "David", "Times New Roman", serif;
}
html[lang="he"] .event-title-hebrew {
  display: inline;
  margin: 0;
  font: inherit;
  color: inherit;
  -webkit-text-fill-color: inherit;
}
.rsvp-progress-dots {
  display: flex;
  justify-content: center;
  gap: .4rem;
  margin-bottom: .45rem;
}
.rsvp-progress-dots > span {
  width: .4rem;
  height: .4rem;
  border-radius: 50%;
  background: var(--gold-frame);
}
.rsvp-progress::backdrop { background: rgb(32 29 24 / 35%); }
@keyframes rsvp-dot-rise {
  0%, 65%, 100% { transform: translateY(0); opacity: .65; }
  30% { transform: translateY(-.22rem); opacity: 1; }
}
@media (prefers-reduced-motion: no-preference) {
  .rsvp-progress[open] .rsvp-progress-dots > span { animation: rsvp-dot-rise 1.15s ease-in-out infinite; }
  .rsvp-progress[open] .rsvp-progress-dots > :nth-child(2) { animation-delay: .13s; }
  .rsvp-progress[open] .rsvp-progress-dots > :nth-child(3) { animation-delay: .26s; }
}
.save-date .date {
  font-size: clamp(1.55rem, 4vw, 1.85rem);
  font-style: normal;
  font-weight: 500;
}
address { font-style: italic; }
.countdown { display: flex; justify-content: center; gap: clamp(.55rem, 4vw, 3rem); margin-top: .65rem; }
.countdown[hidden] { display: none; }
.countdown span { display: grid; gap: .35rem; }
.countdown b {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.countdown small { font-size: 1.15rem; }
.event {
  isolation: isolate;
  padding-block: clamp(4.5rem, 10vw, 9rem) 3.25rem;
}
.event::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("assets/logo-ron.png") center / min(76%, 33rem) auto no-repeat;
  opacity: .08;
  pointer-events: none;
}
.event h2 { font-size: clamp(4.15rem, 10vw, 6.25rem); }
.event-title-hebrew {
  display: block;
  margin-block-start: -.85rem;
  font: 400 clamp(1.5rem, 4.5vw, 2.25rem)/1.1 "Times New Roman", David, serif;
  color: var(--gold-text);
  -webkit-text-fill-color: currentColor;
}
.event .date { margin-block: .25rem; }
.event address { line-height: 1.55; }
.event h3:has(+ address) { text-wrap: balance; }
.tephilines {
  border-radius: 999rem;
  padding-bottom: clamp(4.5rem, 9vw, 7.5rem);
}
.tephilines :is(h2, h3) {
  margin-bottom: clamp(.45rem, 1.5vw, .9rem);
  text-wrap: balance;
}
.tephilines .celebrant {
  margin-block: clamp(.7rem, 2vw, 1.2rem);
  font-size: clamp(3rem, 7vw, 4.5rem);
}
.tephilines h3:has(+ address) {
  margin-block: clamp(.7rem, 2vw, 1.2rem);
}
.tephilines .date {
  font-size: clamp(1.1rem, 5.6vw, 2.25rem);
  text-wrap: balance;
}
.chabbat {
  border-radius: 999rem 999rem 0 0;
  padding-block: clamp(4rem, 9vw, 7.5rem);
}
.chabbat .invitation-text { width: min(80%, 32rem); }
.chabbat-name {
  display: block;
  width: fit-content;
  margin-inline: auto;
  margin-bottom: .35rem;
  color: var(--gold-shadow);
  font-family: "Great Vibes", cursive;
  font-weight: 400;
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  line-height: 1.15;
}
.chabbat .paracha-title { font-size: clamp(3.5rem, 8vw, 5rem); }
.chabbat .paracha-title + .hebrew-name { margin-block-start: -.6rem; }
.chabbat .date { max-width: 86%; }
.event-emblem {
  display: block;
  width: min(32vw, 11rem);
  background: var(--gold-emblem);
  -webkit-mask: var(--event-mask) center / contain no-repeat;
  mask: var(--event-mask) center / contain no-repeat;
}
.tephilines-emblem {
  --event-mask: var(--emblem-tephilines);
  margin-top: -.75rem;
  margin-bottom: clamp(1.75rem, 5vw, 3rem);
  aspect-ratio: 659 / 425;
}
.hallot-emblem {
  --event-mask: var(--emblem-hallot);
  aspect-ratio: 680 / 683;
  margin-block: clamp(-.95rem, -1.7vw, -.6rem) clamp(2rem, 5vw, 3rem);
}
.hebrew-art {
  width: min(96%, 35rem);
  height: auto;
  margin-top: .75rem;
}
.calendar { margin-top: .85rem; font-size: 1.12rem; font-weight: 600; }
@keyframes draw-cover-frame {
  from { transform: var(--line-start); }
}
@keyframes light-cover {
  from { opacity: 0; }
}
@keyframes turn-cover-star {
  from { opacity: 0; transform: perspective(700px) translateY(24px) scale(.88) rotateY(-70deg); }
  60% { opacity: 1; }
}
@keyframes reveal-cover-title {
  from { opacity: 0; clip-path: inset(0 100% 0 0); }
  to { opacity: 1; clip-path: inset(-20% -5%); }
}
@keyframes reveal-cover-title-rtl {
  from { opacity: 0; clip-path: inset(0 0 0 100%); }
  to { opacity: 1; clip-path: inset(-20% -5%); }
}
@media (prefers-reduced-motion: no-preference) {
  #couverture[open] :is(.cover-title, .cover-name) {
    animation: reveal-cover-title 1.3s cubic-bezier(.22,.8,.2,1) 1.1s backwards;
  }
  html[lang="he"] #couverture[open] :is(.cover-title, .cover-name) {
    animation-name: reveal-cover-title-rtl;
  }
  #couverture[open] .cover-name { animation-delay: 1.5s; }
  #couverture[open] .cover-star .logo {
    animation: turn-cover-star 1.5s cubic-bezier(.22,.8,.2,1) .5s backwards;
  }
  @media (hover: hover) and (pointer: fine) {
    .cover-star .logo {
      transform: perspective(700px) rotateY(var(--star-y, 0deg)) rotateX(var(--star-x, 0deg));
    }
  }
  html { scroll-behavior: smooth; }
  #couverture[open] .cover-frame > span {
    animation: draw-cover-frame var(--frame-duration) var(--frame-easing) both;
    animation-delay: calc(var(--frame-delay, 0s) + var(--line-delay, 0s));
  }
  #couverture[open] .cover-frame--outer::after { animation: light-cover .7s ease var(--frame-duration) both; }
  #couverture.is-opening .welcome::before,
  #couverture.is-opening .welcome > :is(.cover-frame, .cover-blessing, h1, form) {
    opacity: 0;
    transition: opacity .42s ease-in-out;
  }
  .gold-button { transition: transform 140ms cubic-bezier(.23, 1, .32, 1); }
  @media (hover: hover) and (pointer: fine) {
    .gold-button:hover { transform: translateY(-1px); }
  }
  .gold-button:active { transform: scale(.985); }
}
@media (forced-colors: active) {
  h2, h3, .cover-name, .chabbat-name, .event-title-hebrew { -webkit-text-fill-color: CanvasText; }
  .panel { border-color: CanvasText; }
  .cover-frame > span { forced-color-adjust: none; background: CanvasText; }
}
