/*
 * Canonical Ikigai SPA header.
 * Mirrors the approved Home header across all public pages.
 */

.site-header {
  position: relative;
  min-height: clamp(92px, 9.2vw, 142px);
  display: flex;
  align-items: center;
  padding: clamp(10px, 1vw, 16px) clamp(24px, 4vw, 72px);
  background: url("../optimized/textures/home-textures-header-wood-texture-rustic-mandala-2000.webp") center / cover no-repeat;
  box-shadow:
    inset 0 4px 12px rgba(71, 35, 10, 0.28),
    inset 0 -5px 12px rgba(77, 41, 13, 0.22),
    0 2px 10px rgba(48, 31, 13, 0.22);
}

.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(114, 72, 26, 0), rgba(114, 72, 26, 0.46), rgba(114, 72, 26, 0));
  pointer-events: none;
}

.site-header .header-inner {
  width: min(100%, 1534px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(270px, 330px) minmax(380px, 1fr);
  align-items: center;
  gap: clamp(14px, 1.5vw, 26px);
}

.site-header .nav-left,
.site-header .nav-right {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: clamp(14px, 1.55vw, 26px);
  white-space: nowrap;
}

.site-header .nav-right {
  justify-content: flex-end;
}

.site-header a {
  position: relative;
  color: #2d1d10;
  font-size: clamp(16px, 1.22vw, 21px);
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  text-shadow:
    0 1px 0 rgba(255, 220, 154, 0.34),
    0 2px 4px rgba(74, 38, 13, 0.25);
  transition: color 180ms ease, text-shadow 180ms ease, transform 180ms ease;
}

.site-header a:hover,
.site-header a:focus-visible {
  color: #7d581d;
  transform: translateY(-1px);
  text-shadow:
    0 1px 0 rgba(255, 235, 182, 0.55),
    0 3px 7px rgba(78, 44, 16, 0.34);
  outline: none;
}

.site-header a.active::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: -10px;
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg, #6d4916, #c79a3e 48%, #6d4916);
  box-shadow: 0 1px 3px rgba(59, 31, 9, 0.4);
}

.site-header .brand-text {
  width: 100%;
  min-width: 0;
  text-align: center;
  line-height: 1;
}

.site-header .brand-name {
  position: relative;
  font-family: Cinzel, "Playfair Display", "Cormorant Garamond", Georgia, serif;
  font-size: clamp(40px, 3.45vw, 56px);
  font-weight: 400;
  line-height: 0.86;
  letter-spacing: 0;
  color: #f1cc75;
  background:
    linear-gradient(180deg, #fff7c8 0%, #f2c66a 19%, #a66a20 44%, #f8d888 64%, #704012 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow:
    0 1px 0 rgba(255, 250, 218, 0.92),
    1px 1px 0 rgba(118, 70, 17, 0.74),
    0 3px 0 rgba(74, 40, 9, 0.48),
    0 7px 8px rgba(54, 31, 10, 0.4);
  filter:
    drop-shadow(1px 0 0 rgba(255, 250, 213, 0.7))
    drop-shadow(-1px 0 0 rgba(72, 40, 10, 0.76))
    drop-shadow(0 4px 3px rgba(57, 32, 9, 0.34));
}

.site-header .brand-subtitle {
  display: grid;
  grid-template-columns: minmax(52px, 1fr) auto minmax(52px, 1fr);
  grid-template-areas:
    "line-left ornament line-right"
    "text text text";
  align-items: center;
  justify-content: center;
  column-gap: 10px;
  row-gap: 10px;
  width: min(100%, 300px);
  margin: 13px auto 0;
  color: #8a5d23;
  font-size: clamp(12px, 0.95vw, 15px);
  letter-spacing: 0.28em;
  text-shadow:
    0 1px 0 rgba(255, 235, 178, 0.72),
    0 1px 1px rgba(74, 42, 13, 0.28);
}

.site-header .brand-subtitle::before,
.site-header .brand-subtitle::after {
  content: "";
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 99px;
  background: linear-gradient(90deg, rgba(120, 72, 18, 0), #7b4a13 5%, #fff0b8 48%, #9b641b 95%, rgba(120, 72, 18, 0));
  box-shadow:
    0 1px 0 rgba(255, 241, 186, 0.58),
    0 2px 3px rgba(67, 36, 9, 0.34);
}

.site-header .brand-subtitle::before {
  grid-area: line-left;
}

.site-header .brand-subtitle::after {
  grid-area: line-right;
}

.site-header .brand-ornament {
  grid-area: ornament;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, #fff5c8 0 18%, #e4ad48 36%, #7f4c13 72%);
  box-shadow:
    0 1px 0 rgba(255, 243, 190, 0.8),
    0 2px 3px rgba(67, 36, 9, 0.42);
}

.site-header .brand-subtitle-text {
  grid-area: text;
  -webkit-text-fill-color: currentColor;
  filter: none;
}

.site-header .header-cta {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: clamp(226px, 17vw, 292px);
  min-height: 52px;
  padding: 12px clamp(26px, 2.6vw, 42px);
  border: 1px solid rgba(124, 78, 20, 0.72);
  border-radius: 16px;
  color: #42280d;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0) 46%),
    linear-gradient(180deg, #f3d58d, #c9953e);
  box-shadow:
    inset 0 1px 0 rgba(255, 249, 220, 0.78),
    inset 0 -1px 0 rgba(99, 58, 13, 0.26),
    0 5px 12px rgba(69, 37, 11, 0.2);
  font-size: clamp(13px, 0.9vw, 14.5px);
  font-weight: 800 !important;
  letter-spacing: 0.012em;
  line-height: 1;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 241, 195, 0.46);
  white-space: nowrap;
}

.site-header .header-cta:hover,
.site-header .header-cta:focus-visible {
  border-color: #9f641d;
  color: #382108;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.52), rgba(255, 255, 255, 0) 48%),
    linear-gradient(180deg, #f6db98, #d0a04a);
  box-shadow:
    inset 0 1px 0 rgba(255, 252, 229, 0.86),
    inset 0 -1px 0 rgba(99, 58, 13, 0.3),
    0 7px 15px rgba(69, 37, 11, 0.24);
}

.site-header .mobile-menu-toggle,
.site-header .mobile-menu-panel {
  display: none;
}

@media (max-width: 1180px) {
  .site-header {
    min-height: auto;
    padding: 12px clamp(16px, 3vw, 30px);
  }

  .site-header .header-inner {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "nav-left"
      "nav-right";
    gap: 10px;
  }

  .site-header .brand-text {
    grid-area: brand;
  }

  .site-header .nav-left {
    grid-area: nav-left;
  }

  .site-header .nav-right {
    grid-area: nav-right;
  }

  .site-header .nav-left,
  .site-header .nav-right {
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px clamp(16px, 3vw, 28px);
  }

  .site-header a {
    font-size: clamp(12.5px, 1.55vw, 15px);
  }

  .site-header .brand-name {
    font-size: clamp(36px, 5vw, 50px);
  }

  .site-header .brand-subtitle {
    width: min(100%, 300px);
    grid-template-columns: minmax(52px, 1fr) auto minmax(52px, 1fr);
    row-gap: 7px;
    font-size: clamp(11px, 1.25vw, 13px);
    letter-spacing: 0.22em;
  }

  .site-header .header-cta {
    align-items: center;
    flex: 0 1 auto;
    justify-content: center;
    min-height: 42px;
    padding: 9px 18px;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
  }
}

@media (max-width: 620px) {
  .site-header {
    z-index: 20;
    min-height: 124px;
    padding: 10px 12px 12px;
  }

  .site-header .header-inner {
    position: relative;
    width: 100%;
    min-height: 102px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "brand"
      "nav-right";
    align-items: center;
    row-gap: 8px;
  }

  .site-header .nav-left {
    display: none;
  }

  .site-header .nav-right {
    display: contents;
  }

  .site-header .nav-right > a:not(.header-cta) {
    display: none;
  }

  .site-header .brand-text {
    grid-area: brand;
    position: relative;
    left: auto;
    top: auto;
    z-index: 1;
    width: clamp(188px, 64vw, 282px);
    min-width: 0;
    justify-self: center;
    text-align: center;
    transform: none;
    pointer-events: none;
  }

  .site-header .brand-name {
    font-size: clamp(28px, 8.6vw, 42px);
    line-height: 0.86;
    transform: none;
    transform-origin: center;
  }

  .site-header .brand-subtitle {
    width: min(100%, 228px);
    margin-top: 7px;
    grid-template-columns: minmax(34px, 1fr) auto minmax(34px, 1fr);
    column-gap: 7px;
    row-gap: 5px;
    font-size: clamp(7.4px, 2vw, 10px);
    letter-spacing: 0.16em;
  }

  .site-header .brand-ornament {
    width: 5px;
    height: 5px;
  }

  .site-header .nav-right .header-cta {
    grid-area: nav-right;
    position: relative;
    z-index: 2;
    width: clamp(208px, 68vw, 286px);
    min-width: 0;
    max-width: none;
    min-height: 40px;
    padding: 8px 18px;
    border-radius: 14px;
    font-size: clamp(10px, 2.55vw, 12px);
    letter-spacing: 0.018em;
    line-height: 1.05;
    white-space: normal;
    justify-self: center;
  }

  .site-header .mobile-menu-toggle {
    grid-area: brand;
    position: relative;
    z-index: 2;
    width: 44px;
    height: 44px;
    justify-self: end;
    align-self: center;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 1px solid rgba(124, 78, 20, 0.58);
    border-radius: 13px;
    color: #56350f;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.06)),
      rgba(246, 212, 147, 0.72);
    box-shadow:
      inset 0 1px 0 rgba(255, 249, 220, 0.72),
      0 3px 8px rgba(69, 37, 11, 0.14);
    cursor: pointer;
  }

  .site-header .mobile-menu-toggle span {
    width: 16px;
    height: 2px;
    border-radius: 99px;
    background: currentColor;
    transition: transform 220ms ease, opacity 180ms ease;
  }

  .site-header .mobile-menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .site-header .mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  .site-header .mobile-menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .site-header .mobile-menu-toggle:focus-visible {
    outline: 2px solid rgba(244, 205, 121, 0.82);
    outline-offset: 3px;
  }

  .site-header .mobile-menu-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    z-index: 30;
    display: grid;
    gap: 0;
    padding: 8px;
    border: 1px solid rgba(174, 121, 40, 0.42);
    border-radius: 18px;
    background:
      linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(247, 235, 214, 0.96)),
      #fffaf1;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.78),
      0 18px 32px rgba(54, 34, 13, 0.22);
  }

  .site-header .mobile-menu-panel[hidden] {
    display: none;
  }

  .site-header .mobile-menu-panel a {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    border-radius: 12px;
    color: #2f431d;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    text-shadow: none;
  }

  .site-header .mobile-menu-panel a + a {
    border-top: 1px solid rgba(174, 121, 40, 0.16);
  }

  .site-header .mobile-menu-panel a::after {
    content: "";
    width: 8px;
    height: 8px;
    border-top: 1.4px solid #a87324;
    border-right: 1.4px solid #a87324;
    transform: rotate(45deg);
  }

  .site-header .mobile-menu-panel a:hover,
  .site-header .mobile-menu-panel a:focus-visible {
    color: #5f3d12;
    background: rgba(255, 248, 232, 0.72);
    transform: none;
    outline: none;
  }
}

@media (max-width: 340px) {
  .site-header {
    min-height: 120px;
    padding-inline: 10px;
  }

  .site-header .header-inner {
    min-height: 98px;
    grid-template-columns: minmax(0, 1fr);
    row-gap: 7px;
  }

  .site-header .brand-text {
    width: clamp(176px, 62vw, 202px);
  }

  .site-header .brand-name {
    font-size: 27px;
    transform: none;
  }

  .site-header .brand-subtitle {
    width: 176px;
    margin-top: 6px;
    font-size: 7px;
    letter-spacing: 0.14em;
  }

  .site-header .nav-right .header-cta {
    width: 208px;
    min-height: 40px;
    padding-inline: 14px;
    font-size: 9.8px;
  }

  .site-header .mobile-menu-toggle {
    width: 42px;
    height: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header .mobile-menu-toggle span {
    transition: none;
  }
}
