/*
Theme Name: Steine Wunder – Occasio Child
Theme URI: https://example.invalid/steine-wunder
Description: Premium metallisches Child-Theme für Steine Wunder auf Basis von Occasio.
Author: Steine Wunder
Template: occasio
Version: 2.5.0
Text Domain: steine-wunder
*/

:root {
  --sw-ink: #0d0e10;
  --sw-ink-2: #16181b;
  --sw-steel: #b9bdc2;
  --sw-steel-light: #eef0f2;
  --sw-steel-dark: #6e7379;
  --sw-paper: #ffffff;
  --sw-warm: #aa7b3f;
  --sw-line: rgba(20, 22, 24, .34);
  --sw-card-radius: 22px;
  --sw-content-max: 1180px;
  --sw-footer-h: 94px;
  --sw-scroll-progress: 0;
}

html { scroll-behavior: smooth; }
* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  padding-bottom: var(--sw-footer-h);
  color: #22252a;
  background-color: #4c4f53;
  background-image:
    repeating-linear-gradient(135deg, rgba(255,255,255,.035) 0 2px, transparent 2px 19px),
    repeating-linear-gradient(135deg, transparent 0 34px, rgba(16,17,19,.26) 34px 36px),
    linear-gradient(180deg, #5b5e62 0%, #474a4e 100%);
  background-attachment: fixed;
  font-family: "Barlow", "Segoe UI", system-ui, -apple-system, sans-serif;
}

body.admin-bar .sw-site-header { top: 32px; }
@media (max-width: 782px) { body.admin-bar .sw-site-header { top: 46px; } }

a { color: inherit; }

.sw-site {
  width: 100%;
  max-width: none !important;
  margin: 0 !important;
  padding: 0;
  overflow: visible !important;
  background: transparent !important;
}

/* --- Header --- */
.sw-site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  color: var(--sw-steel-light);
  background:
    radial-gradient(circle at 50% -40%, rgba(255,255,255,.09), transparent 52%),
    linear-gradient(180deg, #181a1d 0%, #0c0d0f 100%);
  border-bottom: 1px solid rgba(220,224,228,.22);
  box-shadow: 0 8px 28px rgba(0,0,0,.2);
}

.sw-header-inner {
  position: relative;
  max-width: 1460px;
  min-height: 96px;
  margin: 0 auto;
  padding: 8px clamp(28px, 5vw, 76px);
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(180px,280px) minmax(0,1fr);
  align-items: center;
  gap: clamp(24px, 4vw, 68px);
}

.sw-brand {
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
}
.sw-brand a { display: block; line-height: 0; }
.sw-brand img,
.sw-brand .custom-logo {
  display: block;
  width: auto;
  height: 76px;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 9px rgba(0,0,0,.42));
}

.sw-nav-zone { min-width: 0; }
.sw-nav-zone .menu,
.sw-nav-zone > ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: clamp(24px, 3vw, 54px);
}
.sw-nav-left .menu,
.sw-nav-left > ul { justify-content: flex-end; }
.sw-nav-right .menu,
.sw-nav-right > ul { justify-content: flex-start; }

.sw-nav-zone li { position: relative; margin: 0; }
.sw-nav-zone a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 2px;
  text-decoration: none;
  color: #e6e8eb;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: .025em;
  text-shadow: 0 1px 1px #000, 0 0 8px rgba(255,255,255,.08);
  transition: color .18s ease, opacity .18s ease;
}
.sw-nav-zone > .menu > li > a::after,
.sw-nav-zone > ul > li > a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 5px;
  height: 1px;
  background: linear-gradient(90deg, var(--sw-warm), #d7b782);
  transition: right .18s ease;
}
.sw-nav-zone a:hover,
.sw-nav-zone a:focus-visible { color: #fff; }
.sw-nav-zone > .menu > li > a:hover::after,
.sw-nav-zone > .menu > li > a:focus-visible::after,
.sw-nav-zone > ul > li > a:hover::after,
.sw-nav-zone > ul > li > a:focus-visible::after,
.sw-nav-zone > .menu > li.current-menu-item > a::after,
.sw-nav-zone > .menu > li.current_page_item > a::after,
.sw-nav-zone > .menu > li.current-menu-ancestor > a::after,
.sw-nav-zone > ul > li.current-menu-item > a::after,
.sw-nav-zone > ul > li.current_page_item > a::after,
.sw-nav-zone > ul > li.current-menu-ancestor > a::after { right: 0; }

.sw-nav-zone > .menu > li.current-menu-item > a,
.sw-nav-zone > .menu > li.current_page_item > a,
.sw-nav-zone > .menu > li.current-menu-ancestor > a,
.sw-nav-zone > ul > li.current-menu-item > a,
.sw-nav-zone > ul > li.current_page_item > a,
.sw-nav-zone > ul > li.current-menu-ancestor > a { color: #fff; }

/* Accessible submenu toggles inserted by JS */
.sw-submenu-toggle {
  width: 32px;
  height: 32px;
  margin-left: 4px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #cfd2d5;
  cursor: pointer;
  vertical-align: middle;
}
.sw-submenu-toggle::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .18s ease;
}
.menu-item.sw-submenu-open > .sw-submenu-toggle::before { transform: translateY(2px) rotate(225deg); }

.sw-nav-zone .sub-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  width: max-content;
  min-width: 210px;
  max-width: min(320px, calc(100vw - 24px));
  margin: 0;
  padding: 10px;
  list-style: none;
  background: rgba(15,16,18,.98);
  border: 1px solid rgba(220,224,228,.18);
  border-radius: 12px;
  box-shadow: 0 14px 30px rgba(0,0,0,.3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s linear;
}
/* Critical alignment: left menu opens inward/right; right menu opens inward/left. */
.sw-nav-left .sub-menu { left: 0; right: auto; text-align: left; }
.sw-nav-right .sub-menu { right: 0; left: auto; text-align: right; }
.sw-nav-zone li:hover > .sub-menu,
.sw-nav-zone li:focus-within > .sub-menu,
.sw-nav-zone li.sw-submenu-open > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.sw-nav-zone .sub-menu .sub-menu { top: -10px; }
.sw-nav-left .sub-menu .sub-menu { left: calc(100% + 8px); right: auto; }
.sw-nav-right .sub-menu .sub-menu { right: calc(100% + 8px); left: auto; }
.sw-nav-zone .sub-menu a {
  display: flex;
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  white-space: normal;
}
.sw-nav-zone .sub-menu a:hover,
.sw-nav-zone .sub-menu a:focus-visible { background: rgba(255,255,255,.07); }

/* --- Content --- */
#content.site-content {
  width: min(var(--sw-content-max), calc(100% - clamp(30px, 8vw, 150px)));
  margin: clamp(7px, 1vw, 14px) auto calc(var(--sw-footer-h) + 34px);
  padding: 0;
  background: transparent;
}
#main.site-main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(28px, 4vw, 58px);
  background: rgba(255,255,255,.985);
  border: 1px solid rgba(255,255,255,.8);
  border-radius: var(--sw-card-radius);
  box-shadow: 0 14px 36px rgba(0,0,0,.22), inset 0 0 0 1px rgba(40,42,45,.045);
  overflow: visible;
}
#main.site-main::before { content: none; }.site-main > *:first-child { margin-top: 0; }
.entry-title, .page-title { letter-spacing: -.02em; }
button, .button, input[type="submit"], .wp-block-button__link {
  border-radius: 9px;
}

/* Neutralize parent shell pieces not used by this custom header/footer. */
.header-main, .footer-wrap { max-width: none; }
.sidebar { display: none; }

/* --- Footer --- */
.sw-site-footer {
  position: fixed;
  z-index: 900;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: var(--sw-footer-h);
  color: #d7dadd;
  background:
    linear-gradient(180deg, rgba(31,33,36,.98), rgba(10,11,13,.99));
  border-top: 1px solid rgba(220,224,228,.18);
  box-shadow: 0 -8px 26px rgba(0,0,0,.18);
  backdrop-filter: blur(10px);
}
.sw-footer-inner {
  position: relative;
  max-width: 1460px;
  min-height: var(--sw-footer-h);
  margin: 0 auto;
  padding: 8px clamp(28px, 5vw, 76px) 7px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: 56px 22px;
  align-items: center;
  column-gap: 28px;
  row-gap: 0;
}
.sw-footer-left,
.sw-footer-right,
.sw-footer-center {
  display: flex;
  align-items: center;
}
.sw-footer-left { grid-column: 1; grid-row: 1; justify-content: flex-start; gap: 12px; }
.sw-footer-center { grid-column: 2; grid-row: 1; justify-content: center; }
.sw-footer-right { grid-column: 3; grid-row: 1; justify-content: flex-end; gap: 12px; }
.sw-footer-legal-wrap {
  position: static;
  transform: none;
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  white-space: nowrap;
}
.sw-footer-legal {
  font-size: 11px;
  text-decoration: none;
  color: #d0d3d6;
}
.sw-footer-legal + .sw-footer-legal::before { content: "|"; margin-right: 12px; color: #64686d; }

.sw-social-link,
.sw-social-disabled {
  position: relative;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(225,228,231,.25);
  border-radius: 10px;
  color: #eef0f2;
  background: linear-gradient(145deg, rgba(255,255,255,.055), rgba(0,0,0,.08));
  box-shadow: inset 0 1px rgba(255,255,255,.05), 0 4px 10px rgba(0,0,0,.18);
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.sw-social-link svg,
.sw-social-disabled svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.sw-social-link:hover,
.sw-social-link:focus-visible {
  transform: translateY(-2px);
  color: #d7b782 !important;
  border-color: rgba(215,183,130,.72) !important;
  background: linear-gradient(145deg, rgba(215,183,130,.16), rgba(0,0,0,.06));
  box-shadow: inset 0 1px rgba(255,255,255,.06), 0 0 0 1px rgba(170,123,63,.12), 0 5px 14px rgba(0,0,0,.22);
}
.sw-social-disabled { opacity: .58; }
.sw-social-shop,
.sw-social-shop-disabled {
  width: 154px;
  height: 44px;
  padding: 0 24px;
  border-radius: 999px;
  border-color: rgba(215,183,130,.58);
  color: #f3e4c9;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-decoration: none;
  background: linear-gradient(145deg, rgba(170,123,63,.20), rgba(255,255,255,.04) 48%, rgba(0,0,0,.10));
}
.sw-social-shop:hover,
.sw-social-shop:focus-visible {
  color: #f7e6c7 !important;
  border-color: #d7b782 !important;
  background: linear-gradient(145deg, rgba(215,183,130,.30), rgba(255,255,255,.06) 48%, rgba(0,0,0,.10));
}
.sw-social-shop span,
.sw-social-shop-disabled span { display: inline-block; }

/* --- Mobile: original 2+logo+2 composition and progressive morphing header --- */
.sw-header-wave { display: none; }
@media (max-width: 760px) {
  :root { --sw-footer-h: 94px; }
  body { padding-bottom: var(--sw-footer-h); }

  .sw-site-header {
    position: sticky;
    overflow: visible;
    height: var(--sw-header-height, 126px);
    min-height: 22px;
    transition: box-shadow .18s ease;
  }
  .sw-header-wave {
    position: absolute;
    display: block;
    left: 0;
    top: calc(100% - 1px);
    width: 100%;
    height: var(--sw-wave-height, 0px);
    overflow: visible;
    pointer-events: none;
    z-index: 2;
    opacity: var(--sw-wave-opacity, 0);
  }
  .sw-header-wave path {
    fill: #0c0d0f;
    stroke: rgba(220,224,228,.18);
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
  }
  .sw-header-inner {
    min-height: 0;
    height: 100%;
    padding: 8px 12px;
    grid-template-columns: 1fr 92px 1fr;
    gap: 8px;
  }
  .sw-brand {
    align-self: start;
    transform: translateY(var(--sw-brand-shift, 0px));
    z-index: 4;
  }
  .sw-brand a { cursor: pointer; }
  .sw-brand img,
  .sw-brand .custom-logo {
    height: var(--sw-logo-height, 88px);
    width: auto;
    max-width: none;
    transition: none;
  }
  .sw-nav-zone {
    align-self: center;
    opacity: var(--sw-nav-opacity, 1);
    transform: translateY(var(--sw-nav-shift, 0px));
    pointer-events: auto;
  }
  .sw-site-header.sw-is-compact .sw-nav-zone { pointer-events: none; }
  .sw-nav-zone .menu,
  .sw-nav-zone > ul {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: stretch;
  }
  .sw-nav-left .menu,
  .sw-nav-left > ul { align-items: flex-end; }
  .sw-nav-right .menu,
  .sw-nav-right > ul { align-items: flex-start; }
  .sw-nav-zone a {
    min-height: 38px;
    padding: 5px 5px;
    font-size: clamp(11px, 3.4vw, 14px);
    white-space: nowrap;
  }
  .sw-submenu-toggle { width: 30px; height: 30px; }
  .sw-nav-zone .sub-menu,
  .sw-nav-left .sub-menu,
  .sw-nav-right .sub-menu {
    position: absolute;
    top: 100%;
    min-width: 176px;
    max-width: calc(100vw - 20px);
    text-align: left;
  }
  .sw-nav-left .sub-menu { left: 0; right: auto; }
  .sw-nav-right .sub-menu { right: 0; left: auto; }
  /* Mobile dropdowns open toward the viewport center to prevent edge clipping. */
  .sw-nav-left .sub-menu .sub-menu { left: 12px; right: auto; top: 100%; }
  .sw-nav-right .sub-menu .sub-menu { right: 12px; left: auto; top: 100%; }

  #content.site-content {
    width: calc(100% - 24px);
    margin: 24px auto calc(var(--sw-footer-h) + 20px);
  }
  #main.site-main {
    padding: 24px 18px 30px;
    border-radius: 16px;
  }
  #main.site-main::before { margin-bottom: 24px; }

  .sw-site-footer { min-height: var(--sw-footer-h); }
  .sw-footer-inner {
    padding: 6px 10px 7px;
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: 56px 25px;
    gap: 0 8px;
  }
  .sw-footer-left { grid-column: 1; grid-row: 1; justify-content: flex-end; gap: 7px; }
  .sw-footer-center { grid-column: 2; grid-row: 1; }
  .sw-footer-right { grid-column: 3; grid-row: 1; justify-content: flex-start; gap: 7px; }
  .sw-footer-legal-wrap {
    position: static;
    transform: none;
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
  }
  .sw-footer-legal { font-size: 11px; }
  .sw-footer-legal + .sw-footer-legal::before { margin-right: 10px; }
  .sw-social-link,
  .sw-social-disabled { width: 38px; height: 38px; border-radius: 9px; }
  .sw-social-shop,
  .sw-social-shop-disabled { width: 88px; height: 42px; padding: 0 14px; font-size: 12px; letter-spacing: .12em; }
}

@media (max-width: 390px) {
  .sw-header-inner { grid-template-columns: 1fr 76px 1fr; gap: 4px; padding-inline: 8px; }
  .sw-nav-zone a { font-size: 11px; padding-inline: 2px; }
  .sw-footer-inner { padding-inline: 7px; gap: 0 4px; }
  .sw-footer-left, .sw-footer-right { gap: 4px; }
  .sw-social-link, .sw-social-disabled { width: 34px; height: 34px; }
  .sw-social-shop, .sw-social-shop-disabled { width: 78px; height: 40px; padding-inline: 10px; font-size: 11px; }
}

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


/* --- Fine tuning overrides --- */
.custom-logo-link,
.sw-bundled-logo { background: transparent !important; box-shadow: none !important; }

/* Keep Occasio link states from leaking blue into our custom chrome. */
.sw-site-header a:hover,
.sw-site-header a:focus,
.sw-site-footer a:hover,
.sw-site-footer a:focus { color: inherit; }

.sw-site-footer .sw-social-link:hover,
.sw-site-footer .sw-social-link:focus-visible { color: #d7b782 !important; }

/* Parent theme must not draw decorative rules inside the white content card. */
#main.site-main::before,
#main.site-main > .entry-header::before,
#main.site-main > article > .entry-header::before { content: none !important; display: none !important; }

/* Bundled fallback logo: visually remove its black bitmap canvas on the dark header.
   A real transparent PNG/SVG uploaded as custom logo remains the preferred option. */
.sw-bundled-logo img { mix-blend-mode: screen; }
