/*
  Parfums d’Jardestål — v1.9.0 micro polish
  Optical alignment, image focal points, interaction restraint,
  separators, iconography and header/footer precision.
  Loaded last and intentionally limited to refinement rather than redesign.
*/

:root {
  --pdj-rule: rgba(41,35,30,.145);
  --pdj-rule-soft: rgba(41,35,30,.095);
  --pdj-rule-dark: rgba(245,239,228,.17);
  --pdj-ox-soft: rgba(72,27,40,.56);
  --pdj-hover-lift: 2px;
  --pdj-image-scale: 1.018;
  --pdj-ease-quiet: cubic-bezier(.16,1,.3,1);
}

::selection {
  background: rgba(72,27,40,.16);
  color: inherit;
}

/* ----------------------------------------------------------
   Header — optical rather than geometric centring
   ---------------------------------------------------------- */
.site-header {
  border-bottom-color: var(--pdj-rule) !important;
}
.site-header .brand {
  transform: translateY(-.5px);
}
.site-header .brand-logo {
  transform: translateY(-.5px);
}
.site-header .brand-name {
  transform: translateY(.25px);
}
html.js .site-header.staggered-menu .menu-toggle {
  padding-left: 25px !important;
  transform: translateY(-.25px);
}
html.js .site-header.staggered-menu .menu-toggle::before,
html.js .site-header.staggered-menu .menu-toggle::after {
  left: 2px;
  width: 13px !important;
  height: 1px;
  top: calc(50% - .5px);
}
html.js .site-header.staggered-menu .nav.staggered-menu-panel > a {
  border-bottom-color: var(--pdj-rule) !important;
}
html.js .site-header.staggered-menu .nav.staggered-menu-panel > a::after {
  background: var(--oxblood) !important;
  height: 1px;
}

/* ----------------------------------------------------------
   Focus & interaction — visible, quiet, no layout shift
   ---------------------------------------------------------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline-width: 1.5px !important;
  outline-offset: 5px !important;
}

/* Large editorial cards get an inset focus edge instead of a giant halo. */
.fc-media:focus-visible,
.home-material-card:focus-visible,
.home-journal-card:focus-visible,
.journal-feature:focus-visible,
.journal-minor:focus-visible,
.accordion-gallery__item:focus-visible,
.flowing-menu__link:focus-visible {
  outline: 0 !important;
  box-shadow: inset 0 0 0 2px currentColor !important;
}

/* Draw the card focus edge above photographic children, which cover an inset shadow. */
.fc-media,
.home-material-card,
.home-journal-card,
.journal-feature,
.journal-minor { position: relative; }
.fc-media:focus-visible::after,
.home-material-card:focus-visible::after,
.home-journal-card:focus-visible::after,
.journal-feature:focus-visible::after,
.journal-minor:focus-visible::after,
.accordion-gallery__item:focus-visible::after {
  content: "";
  position: absolute;
  inset: 2px;
  z-index: 6;
  border-radius: inherit;
  box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 4px #29231e;
  pointer-events: none;
}

/* Remove app-like motion. Images should feel photographic, not elastic. */
.home-material-media img,
.home-journal-media img,
.collection-page .fc-media img,
.contact-page-shell .contact-visual img {
  transition-duration: .9s, .42s !important;
  transition-timing-function: var(--pdj-ease-quiet), ease !important;
}

@media (hover:hover) and (pointer:fine) {
  .home-material-card:hover .home-material-media img,
  .home-material-card:focus-visible .home-material-media img,
  .home-journal-card:hover .home-journal-media img,
  .home-journal-card:focus-visible .home-journal-media img,
  .collection-page .fc-media:hover img,
  .collection-page .fc-media:focus-visible img,
  .contact-page-shell .contact-visual:hover img {
    transform: scale(var(--pdj-image-scale)) !important;
  }

  .footer-links a:hover,
  .footer-links a:focus-visible {
    color: var(--v2-cream, #f5efe4) !important;
  }
}

/* ----------------------------------------------------------
   Image crops — explicit focal points, no accidental clipping
   ---------------------------------------------------------- */
.home-page .home-hero .hero-media { object-position: 50% 47% !important; }
.home-atelier-media img,
.house-premium .hp-atelier-image img { object-position: 49% 54% !important; }
.home-house-media img { object-position: 51% 48% !important; }
.home-material-card:nth-child(1) .home-material-media img { object-position: 50% 52% !important; }
.home-material-card:nth-child(2) .home-material-media img { object-position: 58% 50% !important; }
.home-material-card:nth-child(3) .home-material-media img { object-position: 52% 51% !important; }

/* The four compositions have different visual centres. */
.accordion-gallery__item:nth-child(1) .accordion-gallery__media img,
.collection-page #london .fc-media img,
.perfume-page .perfume-hero-media img[src*="london-vetiver"] { object-position: 50% 52% !important; }
.accordion-gallery__item:nth-child(2) .accordion-gallery__media img,
.collection-page #faculty .fc-media img,
.perfume-page .perfume-hero-media img[src*="faculty-club"] { object-position: 52% 49% !important; }
.accordion-gallery__item:nth-child(3) .accordion-gallery__media img,
.collection-page #sunday .fc-media img,
.perfume-page .perfume-hero-media img[src*="sunday-bouquet"] { object-position: 55% 50% !important; }
.accordion-gallery__item:nth-child(4) .accordion-gallery__media img,
.collection-page #polite .fc-media img,
.perfume-page .perfume-hero-media img[src*="in-polite-society"] { object-position: 53% 51% !important; }

.contact-page-shell .contact-visual img { object-position: 55% 49% !important; }
.journal-page .journal-feature .journal-media img { object-position: 51% 53% !important; }

/* ----------------------------------------------------------
   Rules / separators — one vocabulary across the site
   ---------------------------------------------------------- */
.home-atelier,
.collection-page .fc-hero,
.collection-page .fc-entry,
.material-page .fc-hero,
.journal-page .journal-index,
.journal-page .statement,
.perfume-page .material-study,
.perfume-page .next-perfume a {
  border-color: var(--pdj-rule) !important;
}

.home-material-label,
.home-journal-card,
.flowing-menu,
.flowing-menu__item,
.journal-page .journal-minor-grid,
.journal-page .journal-edition {
  border-color: var(--pdj-rule) !important;
}

/* Avoid doubled dark rules where blocks meet. */
.home-material-label { border-bottom-color: var(--pdj-rule-soft) !important; }
.home-journal-card { border-bottom-color: var(--pdj-rule) !important; }

/* ----------------------------------------------------------
   CTA / arrows — one optical glyph system
   ---------------------------------------------------------- */
.home-primary-link span,
.home-card-link span,
.accordion-gallery__link b,
.home-journal-card strong b,
.journal-feature-copy i::after,
.journal-minor i::after {
  font-family: var(--sans) !important;
  font-style: normal !important;
  font-weight: 500 !important;
}
.home-primary-link span,
.home-card-link span,
.accordion-gallery__link b,
.home-journal-card strong b {
  display: inline-block;
  line-height: 1;
  transform: translateY(-.5px);
}

.text-link,
.fc-link,
.hp-link,
.home-primary-link,
.home-card-link {
  border-bottom-width: 1px !important;
  border-bottom-color: currentColor !important;
  text-decoration: none !important;
}
.home-primary-link { border-bottom-color: rgba(255,250,241,.66) !important; }

/* ----------------------------------------------------------
   Editorial spacing — small optical corrections only
   ---------------------------------------------------------- */
.home-section-intro h2,
.collection-page .fc-hero h1,
.material-page .fc-hero h1,
.journal-page .journal-hero h1 {
  text-wrap: balance;
}

.home-founding .home-section-intro { margin-bottom: clamp(58px, 7vw, 98px) !important; }
.home-journal-head { margin-bottom: 54px !important; }
.collection-page .fc-intro { align-items: start !important; }
.collection-page .fc-entry { align-items: center !important; }
.collection-page .fc-number { transform: translateY(2px); }
.journal-page .journal-edition { padding-top: 20px !important; }

/* Contact: align the form and photograph by their real visual tops. */
.contact-page-shell .contact-grid-v2,
.contact-page-shell .contact-grid {
  align-items: start !important;
}
.contact-page-shell .contact-visual { padding-top: 0 !important; }
.contact-page-shell .contact-visual figcaption {
  margin-top: 13px !important;
  letter-spacing: .105em !important;
}
.contact-page-shell .field input,
.contact-page-shell .field select,
.contact-page-shell .field textarea {
  border-color: rgba(41,35,30,.27) !important;
}
.contact-page-shell .field input:hover,
.contact-page-shell .field select:hover,
.contact-page-shell .field textarea:hover {
  border-color: rgba(41,35,30,.42) !important;
}
.contact-page-shell .contact-submit {
  min-height: 48px !important;
  transform: none !important;
}
.contact-page-shell .contact-submit:hover { transform: none !important; }

/* ----------------------------------------------------------
   Footer — balanced three-column lockup
   ---------------------------------------------------------- */
.site-footer {
  position: relative;
  padding: 66px 0 54px !important;
}
.site-footer .footer-inner {
  position: relative;
  grid-template-columns: minmax(120px,1fr) auto minmax(120px,1fr) !important;
  align-items: center !important;
  gap: clamp(26px,4vw,64px) !important;
  padding-top: 27px;
}
.site-footer .footer-inner::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: var(--pdj-rule-dark);
}
.site-footer .footer-brand { justify-self: start; }
.site-footer .footer-logo {
  width: 78px !important;
  opacity: .92;
}
.site-footer .footer-links {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: clamp(16px,2vw,28px) !important;
  white-space: nowrap;
}
.site-footer .footer-links a {
  position: relative;
  text-decoration: none;
  transition: color .24s ease, opacity .24s ease;
}
.site-footer .footer-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -5px;
  height: 1px;
  background: currentColor;
  transition: right .28s var(--pdj-ease-quiet);
}
.site-footer .footer-links a:hover::after,
.site-footer .footer-links a:focus-visible::after { right: 0; }
.site-footer .footer-folio { justify-self: end; text-align: right; }

/* ----------------------------------------------------------
   Compact screens
   ---------------------------------------------------------- */
@media (max-width: 900px) {
  .site-header .brand { transform: none; }
  .site-header .brand-logo { transform: none; }
  .home-page .home-hero .hero-media { object-position: 52% 50% !important; }
  .collection-page .fc-entry { align-items: stretch !important; }
  .collection-page .fc-number { transform: none; }
  .site-footer .footer-inner {
    grid-template-columns: 1fr auto !important;
    align-items: end !important;
  }
  .site-footer .footer-links {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: start;
    flex-wrap: wrap;
    white-space: normal;
  }
  .site-footer .footer-folio { grid-column: 2; grid-row: 1; }
}

@media (max-width: 560px) {
  .site-footer { padding: 54px 0 46px !important; }
  .site-footer .footer-inner {
    grid-template-columns: 1fr !important;
    gap: 22px !important;
  }
  .site-footer .footer-brand,
  .site-footer .footer-links,
  .site-footer .footer-folio {
    grid-column: 1;
    justify-self: start;
    text-align: left;
  }
  .site-footer .footer-brand { grid-row: 1; }
  .site-footer .footer-links { grid-row: 2; gap: 16px 22px !important; }
  .site-footer .footer-folio { grid-row: 3; }
  .site-footer .footer-logo { width: 68px !important; }
  .home-material-card:nth-child(2) .home-material-media img { object-position: 60% 50% !important; }
}

@media (prefers-reduced-motion: reduce) {
  .home-material-media img,
  .home-journal-media img,
  .collection-page .fc-media img,
  .contact-page-shell .contact-visual img,
  .site-footer .footer-links a::after {
    transition: none !important;
  }
}

/* Reset the legacy folio divider now that the footer has one shared top rule. */
.site-footer .footer-folio {
  grid-column: auto !important;
  padding-top: 0 !important;
  margin-top: 0 !important;
  border-top: 0 !important;
}
@media (max-width: 900px) {
  .site-footer .footer-folio { grid-column: 2 !important; grid-row: 1 !important; }
}
@media (max-width: 560px) {
  .site-footer .footer-folio { grid-column: 1 !important; grid-row: 3 !important; }
}
