/*
 * Maison Florian — transparent HD emblem finish.
 * Load after house-photos.css and motion.css.
 * Each .brand-emblem supplies --emblem-art: url('assets/the-same-logo-as-img.png').
 * Add .is-revealed once when a card enters view; optionally set --emblem-delay.
 * The PNG and its mask must have identical transparent padding.
 */

.brand-emblem,
.houses .house-card .brand-emblem {
  --emblem-delay: 0ms;
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  flex: none;
  width: 170px;
  height: 182px;
  margin: 0 auto 21px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  mix-blend-mode: normal;
  overflow: visible;
  transform: none;
  transform-origin: 50% 58%;
}

.brand-emblem .brand-emblem-image {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  object-position: center;
  image-rendering: auto;
  /* Thin edge relief follows the silhouette; no disc or expanding glow. */
  filter:
    brightness(1.045)
    contrast(1.035)
    saturate(1.06)
    drop-shadow(-.6px -.8px 0 rgba(255, 230, 168, .85))
    drop-shadow(.8px 1.2px 0 rgba(162, 115, 42, .9))
    drop-shadow(0 2px 0 rgba(62, 42, 15, .9))
    drop-shadow(0 8px 8px rgba(0, 0, 0, .6));
}

/* Preserve the existing intro footprint without scaling the raster. */
.page-intro .page-intro-inner .brand-emblem {
  width: 153px;
  height: 163.8px;
  margin: 0;
  background: transparent;
  mix-blend-mode: normal;
  transform: none;
}

/* A missing mask remains fully transparent instead of flashing a rectangle. */
@supports ((mask-image: linear-gradient(#000, #000)) or (-webkit-mask-image: linear-gradient(#000, #000))) {
  .brand-emblem::before,
  .brand-emblem::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    background-image: linear-gradient(
      112deg,
      transparent 39%,
      rgba(255, 231, 169, .08) 44%,
      rgba(255, 245, 211, .78) 49%,
      rgba(255, 253, 235, .92) 50%,
      rgba(255, 231, 169, .12) 55%,
      transparent 61%
    );
    background-size: 300% 100%;
    background-position: 110% 50%;
    -webkit-mask-image: var(--emblem-art, linear-gradient(transparent, transparent));
    mask-image: var(--emblem-art, linear-gradient(transparent, transparent));
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    mix-blend-mode: screen;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .brand-emblem {
    transition: transform 650ms cubic-bezier(.22, 1, .36, 1);
  }

  /* Separate entry and hover layers prevent a second sweep on pointer exit. */
  .brand-emblem.is-revealed::before,
  .page-intro .brand-emblem::before {
    animation: mf-emblem-entry-sheen 1150ms 1 both;
    animation-delay: calc(260ms + var(--emblem-delay, 0ms));
  }

  @media (hover: hover) and (pointer: fine) {
    .houses .house-card.depth-active .brand-emblem {
      /* Follow the existing card tilt with a very small counter-rotation. */
      transform: perspective(900px)
        rotateX(calc(var(--tilt-x, 0deg) * -.25))
        rotateY(calc(var(--tilt-y, 0deg) * -.25))
        translateY(-1px);
    }

    .house-card:hover .brand-emblem::after,
    .page-intro .brand-emblem:hover::after {
      animation: mf-emblem-hover-sheen 1000ms 100ms 1 both;
    }
  }
}

@keyframes mf-emblem-entry-sheen {
  0% { background-position: 110% 50%; opacity: 0; }
  18% { opacity: .56; }
  78% { opacity: .56; }
  100% { background-position: -10% 50%; opacity: 0; }
}

@keyframes mf-emblem-hover-sheen {
  0% { background-position: 110% 50%; opacity: 0; }
  18% { opacity: .42; }
  78% { opacity: .42; }
  100% { background-position: -10% 50%; opacity: 0; }
}

@media (max-width: 760px) {
  .houses .house-card .brand-emblem { margin-bottom: 16px; }
  .page-intro .page-intro-inner .brand-emblem { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .brand-emblem,
  .houses .house-card.depth-active .brand-emblem {
    transform: none !important;
    transition: none !important;
  }
  .brand-emblem::before,
  .brand-emblem::after {
    animation: none !important;
    opacity: 0 !important;
  }
}

.emblem-boucherie .emblem-gold-frame {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: conic-gradient(from 135deg, #73501e, #e5bd68 15%, #fff0c0 23%, #a57b32 38%, #eccc80 57%, #fff4cd 65%, #956822 83%, #73501e);
  box-shadow: 0 3px 0 #63451d, 0 6px 0 #2e2416, 0 12px 16px #0008, 0 0 16px #d2ad5020;
}
.brand-emblem.emblem-boucherie .brand-emblem-original {
  position: absolute;
  inset: 0;
  width: 170px;
  height: 182px;
  margin: 0;
  border-radius: 50%;
  mix-blend-mode: normal;
  box-shadow: none;
  filter: none;
}
.brand-emblem.emblem-boucherie::before,
.brand-emblem.emblem-boucherie::after {
  -webkit-mask-image: none;
  mask-image: none;
  border-radius: 50%;
}
.page-intro .page-intro-inner .emblem-boucherie {
  width: 170px;
  height: 182px;
  transform: scale(.9);
}
.emblem-restaurant { --emblem-art: url("https://static.wixstatic.com/media/ed9c70_f43e61aebb894069979ea76ed00e65f1~mv2.png"); }
.emblem-burger { --emblem-art: url("https://static.wixstatic.com/media/ed9c70_e9b7b356c8074264b4ff31c0f5d4abd1~mv2.png"); }
