/* ==========================================================================
   HBA Theme Engine — design tokens + header/menu/footer/cursor components
   Palette: beige + black, ivory/graphite/white support. No gradients/neon.
   ========================================================================== */

:root {
  /* Design tokens — see projects/handmade-by-agata/design-system.md */
  --color-beige: #D8C7AE;
  --color-beige-light: #EEE5D8;
  --color-beige-dark: #B9A487;
  --color-black: #090909;
  --color-graphite: #171717;
  --color-ivory: #F7F3ED;
  --color-white: #FFFFFF;

  --font-display: "Playfair Display", Georgia, serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;

  --header-height: 88px;
  --header-height-compact: 64px;

  --ease-premium: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 0.3s;
  --dur-base: 0.6s;
  --dur-slow: 0.9s;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-6: 24px; --space-8: 32px; --space-12: 48px; --space-16: 64px;
  --space-24: 96px; --space-32: 128px;

  --z-header: 900;
  --z-overlay: 950;
  --z-megamenu: 960;
  --z-fullscreen-menu: 980;
}

/* Reduced motion: kill every custom animation, keep the site fully usable. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

html[data-hba-animation="minimal"] .hba-parallax,
html[data-hba-animation="minimal"] .hba-magnetic {
  transform: none !important;
}

/* ==========================================================================
   Hide the theme's own header/footer template parts — hba-header/hba-footer
   (injected via wp_body_open/wp_footer) fully replace them. Scoped to the
   theme's wrapper class only, never touches our own .hba-header/.hba-footer.
   ========================================================================== */
header.wp-block-template-part,
footer.wp-block-template-part,
#site-header.site-header,
#site-footer.site-footer {
  display: none !important;
}

/* Elementor-built pages (build-page/Elementor canvas) supply their own heading inside the
   design (e.g. the hero) — hide the theme's redundant page-title only where that's true.
   Content pages without an Elementor hero (legal pages, placeholders) keep their title. */
body.elementor-page .page-header,
body.elementor-page .page-title,
body.elementor-page h1.entry-title {
  display: none !important;
}

/* .hba-header is position:fixed and removed from normal flow — push page content below it. */
body {
  padding-top: var(--header-height);
}
@media (max-width: 767px) {
  body { padding-top: 64px; }
}

/* ==========================================================================
   Skip link
   ========================================================================== */
.hba-skip-link {
  position: fixed;
  top: -100px;
  left: var(--space-4);
  z-index: 1000;
  background: var(--color-black);
  color: var(--color-white);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-sans);
  transition: top var(--dur-fast) var(--ease-premium);
}
.hba-skip-link:focus { top: var(--space-4); }

/* ==========================================================================
   Header (Menu 01 — Minimal, always the visible bar)
   ========================================================================== */
.hba-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--z-header);
  height: var(--header-height);
  display: flex;
  align-items: center;
  background-color: rgba(247, 243, 237, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(9, 9, 9, 0.08);
  color: var(--color-black);
  transition: height var(--dur-base) var(--ease-premium),
              background-color var(--dur-base) var(--ease-premium),
              color var(--dur-base) var(--ease-premium),
              backdrop-filter var(--dur-base) var(--ease-premium),
              transform var(--dur-base) var(--ease-premium);
}

/* State: scrolled — beige surface, compact height. Text stays black throughout. */
.hba-header.is-scrolled {
  height: var(--header-height-compact);
  background-color: rgba(216, 199, 174, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* Reserved for a future dark/video hero (ETAP 3) sitting directly under the header. */
.hba-header.is-on-dark {
  color: var(--color-beige-light);
}
.hba-header.is-on-dark.is-scrolled {
  background-color: rgba(9, 9, 9, 0.72);
  color: var(--color-beige-light);
}

/* Scroll-direction awareness: hide header on scroll down, reveal on scroll up */
.hba-header.is-hidden { transform: translateY(-100%); }

.hba-header__inner {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 var(--space-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
}

.hba-header__logo {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.hba-header__nav {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hba-header__nav-item {
  position: relative;
  color: inherit;
  text-decoration: none;
  padding: var(--space-2) 0;
  opacity: 0.92;
  transition: opacity var(--dur-fast) ease;
}
.hba-header__nav-item:hover,
.hba-header__nav-item:focus-visible { opacity: 1; }
.hba-header__nav-item::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 1px;
  background: currentColor;
  transition: width var(--dur-fast) var(--ease-premium);
}
.hba-header__nav-item:hover::after,
.hba-header__nav-item:focus-visible::after { width: 100%; }

.hba-header__nav-item--mega > a { display: inline-block; }

.hba-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.hba-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  position: relative;
  text-decoration: none;
}
.hba-icon-btn svg { width: 20px; height: 20px; }

.hba-cart-count {
  position: absolute;
  top: 2px; right: 2px;
  min-width: 16px; height: 16px;
  border-radius: 999px;
  background: var(--color-beige-dark);
  color: var(--color-black);
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}
.hba-cart-count:empty,
.hba-cart-count[data-hba-cart-count="0"] { display: none; }

.hba-hamburger {
  width: 40px; height: 40px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
}
.hba-hamburger span {
  display: block;
  width: 22px; height: 1.5px;
  background: currentColor;
  transition: transform var(--dur-fast) var(--ease-premium), opacity var(--dur-fast) ease;
}
.hba-hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hba-hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hba-hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ==========================================================================
   Language switcher (shared markup across header / fullscreen / footer / mobile)
   ========================================================================== */
.hba-langswitch {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.hba-langswitch__item {
  color: inherit;
  text-decoration: none;
  opacity: 0.55;
  padding: var(--space-1) var(--space-1);
  transition: opacity var(--dur-fast) ease;
}
.hba-langswitch__item:hover,
.hba-langswitch__item:focus-visible { opacity: 0.85; }
.hba-langswitch__item.is-active { opacity: 1; text-decoration: underline; text-underline-offset: 3px; }
.hba-langswitch__item:not(:last-child)::after { content: "/"; margin-left: var(--space-2); opacity: 0.4; }

/* ==========================================================================
   Mega Menu (Menu 03 — shop category flyout, crossfade + scale media)
   ========================================================================== */
.hba-megamenu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, 8px);
  width: min(920px, 90vw);
  background: var(--color-ivory);
  color: var(--color-black);
  box-shadow: 0 24px 64px rgba(0,0,0,0.18);
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease-premium), transform var(--dur-fast) var(--ease-premium), visibility 0s linear var(--dur-fast);
  z-index: var(--z-megamenu);
}
.hba-header__nav-item--mega:hover .hba-megamenu,
.hba-header__nav-item--mega:focus-within .hba-megamenu,
.hba-megamenu.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
  transition-delay: 0s;
}

.hba-megamenu__list {
  padding: var(--space-8);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2) var(--space-6);
  align-content: start;
}
.hba-megamenu__item {
  display: block;
  padding: var(--space-2) 0;
  color: inherit;
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 14px;
  border-bottom: 1px solid rgba(9,9,9,0.08);
  transition: color var(--dur-fast) ease, padding-left var(--dur-fast) var(--ease-premium);
}
.hba-megamenu__item:hover,
.hba-megamenu__item.is-active {
  color: var(--color-beige-dark);
  padding-left: var(--space-2);
}

.hba-megamenu__media {
  position: relative;
  background: var(--color-beige-light);
  background-size: cover;
  background-position: center;
  transition: background-image var(--dur-base) ease;
}
.hba-megamenu__media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(9,9,9,0) 40%, rgba(9,9,9,0.35) 100%);
  opacity: 0;
  transition: opacity var(--dur-base) ease;
}
.hba-megamenu__media.is-visible::after { opacity: 1; }

/* ==========================================================================
   Cinematic Fullscreen menu (Menu 02)
   ========================================================================== */
.hba-fullscreen-menu {
  position: fixed;
  inset: 0;
  z-index: var(--z-fullscreen-menu);
  background: var(--color-beige-light);
  color: var(--color-black);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  clip-path: inset(0 0 100% 0);
}
.hba-fullscreen-menu[hidden] { display: none; }
.hba-fullscreen-menu.is-open { clip-path: inset(0 0 0% 0); }

.hba-fullscreen-menu__close {
  position: absolute;
  top: var(--space-8); right: var(--space-8);
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(9,9,9,0.2);
  background: none;
  color: var(--color-black);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.hba-fullscreen-menu__links {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-4);
  padding: var(--space-24) var(--space-16);
}
.hba-fullscreen-menu__link {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(36px, 6vw, 88px);
  line-height: 1.05;
  color: inherit;
  text-decoration: none;
  opacity: 0.85;
  transition: opacity var(--dur-fast) ease, color var(--dur-fast) ease;
  overflow: hidden;
}
.hba-fullscreen-menu__link:hover,
.hba-fullscreen-menu__link:focus-visible {
  opacity: 1;
  color: var(--color-beige-dark);
}

.hba-fullscreen-menu__media {
  position: relative;
  background: var(--color-beige-dark);
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity var(--dur-base) ease;
}
.hba-fullscreen-menu__media.is-visible { opacity: 1; }

.hba-fullscreen-menu__footer {
  position: absolute;
  bottom: var(--space-8); left: var(--space-16);
}
.hba-fullscreen-menu .hba-langswitch { color: var(--color-black); }

/* ==========================================================================
   Overlay (used by menu + future page transitions)
   ========================================================================== */
.hba-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  background: rgba(9,9,9,0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-base) ease;
}
.hba-overlay.is-visible { opacity: 1; pointer-events: auto; }

/* ==========================================================================
   Marquee (footer)
   ========================================================================== */
.hba-footer {
  background: var(--color-beige);
  color: var(--color-black);
  font-family: var(--font-sans);
}
.hba-footer__marquee {
  overflow: hidden;
  border-bottom: 1px solid rgba(9,9,9,0.15);
  padding: var(--space-4) 0;
}
.hba-footer__marquee-track {
  display: flex;
  width: max-content;
  animation: hba-marquee 28s linear infinite;
}
.hba-footer__marquee-track span {
  font-family: var(--font-display);
  font-size: clamp(20px, 3vw, 32px);
  white-space: nowrap;
  padding-right: var(--space-8);
}
@keyframes hba-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.hba-footer__inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: var(--space-24) var(--space-8) var(--space-16);
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: var(--space-12);
}
.hba-footer__logo {
  font-family: var(--font-display);
  font-size: 28px;
  margin: 0 0 var(--space-4);
}
.hba-footer__col h3 {
  font-family: var(--font-sans);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.6;
  margin: 0 0 var(--space-4);
}
.hba-footer__col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.hba-footer__col a { color: inherit; text-decoration: none; opacity: 0.85; }
.hba-footer__col a:hover { opacity: 1; text-decoration: underline; }

.hba-newsletter-form { display: flex; gap: var(--space-2); margin-bottom: var(--space-4); }
.hba-newsletter-form input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 1px solid rgba(9,9,9,0.25);
  color: inherit;
  padding: var(--space-3);
  font-family: var(--font-sans);
}
.hba-newsletter-form button {
  background: var(--color-black);
  color: var(--color-beige-light);
  border: 0;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-sans);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.hba-footer__social { display: flex; gap: var(--space-4); }
.hba-footer__social a { color: inherit; text-decoration: none; opacity: 0.7; font-size: 12px; letter-spacing: 0.05em; }

.hba-footer__legal {
  max-width: 1600px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-8) var(--space-8);
  border-top: 1px solid rgba(9,9,9,0.15);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-4);
  font-size: 12px;
  opacity: 0.7;
}
.hba-footer__legal ul { list-style: none; display: flex; gap: var(--space-6); margin: 0; padding: 0; }
.hba-footer__legal a { color: inherit; text-decoration: none; }
.hba-footer__legal a:hover { text-decoration: underline; }

/* ==========================================================================
   Homepage section primitives (ETAP 3) — applied via Elementor's
   "Additional CSS Classes" control on containers/widgets.
   ========================================================================== */
.hba-eyebrow {
  display: inline-flex !important;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-sans) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: var(--space-4);
  color: var(--color-beige-dark) !important;
}
.hba-eyebrow::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: 0.8;
}
/* On dark sections (custom orders CTA), swap the kicker to a lighter warm tone for contrast. */
.hba-section--on-dark .hba-eyebrow { color: var(--color-beige) !important; }

.hba-eyebrow__index {
  font-family: var(--font-display);
  font-style: italic;
  opacity: 0.7;
  margin-right: var(--space-1);
}

/* Oversized ghost numeral behind a section's heading column — quiet editorial marker.
   Free Elementor containers can't carry custom data-attributes, so each index gets its
   own modifier class instead of content:attr(). */
.hba-tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(9,9,9,0.22);
  border-radius: 999px;
  padding: 6px 16px;
  margin: 4px 6px 4px 0;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-graphite);
}

.hba-hero-heading {
  font-family: var(--font-display) !important;
  font-weight: 600 !important;
  line-height: 1.05 !important;
  font-size: clamp(2.75rem, 6vw, 7.5rem) !important;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-6) !important;
}

.hba-section-heading {
  font-family: var(--font-display) !important;
  font-weight: 600 !important;
  line-height: 1.1 !important;
  font-size: clamp(2rem, 4vw, 3.5rem) !important;
  margin: 0 0 var(--space-4) !important;
}

.hba-lede {
  font-family: var(--font-sans) !important;
  font-size: clamp(16px, 1.4vw, 19px) !important;
  line-height: 1.7 !important;
  max-width: 46ch;
}

.hba-btn,
.hba-btn * {
  box-shadow: none !important;
  outline: none !important;
  text-shadow: none !important;
  border-radius: 0 !important;
}
.hba-btn {
  display: inline-flex !important;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-sans) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--space-4) var(--space-8) !important;
  border-width: 1px !important;
  border-style: solid !important;
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease, border-color var(--dur-fast) ease, transform var(--dur-fast) var(--ease-premium);
}
/* Elementor's button widget wraps its label in nested spans that inherit the kit's
   default button colors (border/background/text) independently of the <a> — force them
   to inherit from .hba-btn instead of showing the leftover kit palette. */
.hba-btn .elementor-button-content-wrapper,
.hba-btn .elementor-button-text,
.hba-btn .elementor-button-icon {
  color: inherit !important;
  background: transparent !important;
  border: 0 !important;
}
.hba-btn:hover { transform: translateY(-2px); }

/* Single button style everywhere, per direction: black fill, white letters. The
   --dark/--outline/--light modifier classes are still applied in Elementor for now
   (harmless) but all resolve to the same look — no per-button color variation. */
.hba-btn,
.hba-btn--dark,
.hba-btn--outline,
.hba-btn--light {
  background: var(--color-black) !important;
  color: var(--color-white) !important;
  border: 1px solid var(--color-black) !important;
}
.hba-btn:hover,
.hba-btn--dark:hover,
.hba-btn--outline:hover,
.hba-btn--light:hover {
  background: var(--color-graphite) !important;
  color: var(--color-white) !important;
}

.hba-collection-card {
  position: relative;
  overflow: hidden;
  min-height: 50vh;
}
.hba-collection-card .hba-section-heading { color: var(--color-white) !important; }

/* Guard against flex rows stretching Elementor <img> widgets to match a taller sibling
   column (the "rozciągnięte/ucina zdjęcia" issue) — images keep their natural ratio and
   crop gracefully within whatever box they're given instead of distorting. */
.elementor-widget-image,
.elementor-widget-image .elementor-widget-container {
  align-self: flex-start;
}
.elementor-widget-image img {
  width: 100% !important;
  height: auto !important;
  max-height: 640px;
  object-fit: cover;
}

.hba-split-word { display: inline-block; overflow: hidden; }

.hba-step__number {
  display: block;
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 600;
  color: var(--color-beige-dark);
  line-height: 1;
  margin-bottom: var(--space-3);
}
.hba-step__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 var(--space-2);
}
.hba-step__text {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--color-graphite);
  opacity: 0.85;
  margin: 0;
}

.hba-gallery-caption {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-graphite);
  margin-top: var(--space-3);
}

/* ==========================================================================
   Magnetic buttons / reveal helpers (generic utility classes for later ETAPs)
   ========================================================================== */
.hba-magnetic { display: inline-block; will-change: transform; }
.hba-reveal { opacity: 0; transform: translateY(24px); }
.hba-reveal.is-revealed { opacity: 1; transform: none; transition: opacity var(--dur-slow) var(--ease-premium), transform var(--dur-slow) var(--ease-premium); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1279px) {
  .hba-header__inner { padding: 0 var(--space-4); gap: var(--space-4); }
  .hba-header__nav { gap: var(--space-4); font-size: 13px; }
}

@media (max-width: 1023px) {
  .hba-header__nav { display: none; }
  .hba-langswitch--desktop { display: none; }
  .hba-footer__inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 767px) {
  .hba-header__inner { padding: 0 var(--space-4); }
  .hba-header { height: 64px; }
  .hba-header.is-scrolled { height: 56px; }
  .hba-icon-btn:not(.hba-icon-btn--cart) { display: none; }
  .hba-fullscreen-menu { grid-template-columns: 1fr; }
  .hba-fullscreen-menu__media { display: none; }
  .hba-fullscreen-menu__links { padding: var(--space-16) var(--space-6); }
  .hba-fullscreen-menu__link { font-size: clamp(32px, 11vw, 48px); }
  .hba-footer__inner { grid-template-columns: 1fr; padding: var(--space-16) var(--space-4); }
  .hba-footer__legal { flex-direction: column; }
}
