/* JOULS global chrome: reusable header, footer, icon and search components. */

.jouls-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

body.admin-bar .jouls-header { top: 32px; }

.jouls-header {
  position: relative;
  z-index: 100;
  background: rgba(255, 255, 255, .98);
  border-bottom: 1px solid color-mix(in srgb, var(--jouls-stone) 86%, var(--jouls-white));
  backdrop-filter: saturate(115%) blur(10px);
}

.jouls-header-inner {
  min-height: 80px;
  gap: clamp(18px, 2.5vw, 34px);
}

.jouls-brand { flex: none; }
.jouls-brand img { display: block; width: 158px; }

.jouls-nav-list { gap: clamp(18px, 2.1vw, 30px); }
.jouls-nav-list a { font-size: .95rem; font-weight: 650; }

.jouls-header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 2px;
}

.jouls-header-search {
  position: relative;
  flex: none;
}

.jouls-header-search > summary {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  list-style: none;
  border: 1px solid var(--jouls-stone);
  border-radius: 8px;
  background: var(--jouls-white);
  color: var(--jouls-ink);
  cursor: pointer;
}

.jouls-header-search > summary::-webkit-details-marker { display: none; }
.jouls-header-search > summary:hover { border-color: var(--jouls-ink); }

.jouls-header-search-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 12px);
  right: 0;
  width: min(470px, calc(100vw - 40px));
  padding: 20px;
  border: 1px solid var(--jouls-stone);
  border-radius: 10px;
  background: var(--jouls-white);
  box-shadow: 0 18px 48px rgba(16, 20, 17, .12);
}

.jouls-header-search-title {
  margin: 0 0 12px;
  font-size: .9rem;
  font-weight: 700;
}

.jouls-header-cta .jouls-icon,
.jouls-mobile-cta .jouls-icon { width: 18px; height: 18px; }

.jouls-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  width: 100%;
  max-width: none;
}

.jouls-search-field {
  position: relative;
  min-width: 0;
}

.jouls-search-field > .jouls-icon {
  position: absolute;
  top: 50%;
  left: 15px;
  width: 18px;
  height: 18px;
  color: var(--jouls-graphite);
  transform: translateY(-50%);
  pointer-events: none;
}

.jouls-search-field input[type=search] {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px 10px 44px;
  border: 1px solid var(--jouls-ink);
  border-radius: 8px;
  background: var(--jouls-white);
  color: var(--jouls-ink);
  font: inherit;
}

.jouls-search-field input[type=search]::placeholder { color: #6c726b; opacity: 1; }

.jouls-mobile-menu { position: relative; }

.jouls-mobile-panel {
  position: absolute;
  z-index: 30;
  top: 60px;
  right: 0;
  width: min(92vw, 410px);
  padding: 12px 0 0;
  overflow: hidden;
  border: 1px solid var(--jouls-stone);
  border-radius: 10px;
  background: var(--jouls-white);
  box-shadow: 0 20px 50px rgba(16, 20, 17, .14);
}

.jouls-mobile-panel nav { padding: 4px 20px 10px; }
.jouls-mobile-search { padding: 14px 20px 18px; border-top: 1px solid var(--jouls-stone); }
.jouls-mobile-search .jouls-search-form { grid-template-columns: 1fr; }

.jouls-mobile-utility-links {
  display: flex;
  gap: 18px;
  padding: 0 20px 18px;
  color: var(--jouls-graphite);
  font-size: .92rem;
}

.jouls-mobile-utility-links a { text-decoration: none; }
.jouls-mobile-cta { width: calc(100% - 40px); margin: 0 20px 20px; }

.jouls-mobile-menu[open] summary span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.jouls-mobile-menu[open] summary span:nth-child(2) { opacity: 0; }
.jouls-mobile-menu[open] summary span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.jouls-mobile-menu summary span { transition: transform 160ms ease, opacity 160ms ease; }

/* Footer: one brand lockup, one approved tagline, existing links preserved. */
.jouls-footer {
  position: relative;
  padding: 0 0 24px;
  border-top: 1px solid var(--jouls-ink);
  background: var(--jouls-white);
}

.jouls-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: min(180px, 28vw);
  height: 3px;
  background: var(--jouls-volt);
}

.jouls-footer-brand-stage {
  display: grid;
  grid-template-columns: minmax(180px, .55fr) minmax(0, 1.45fr);
  gap: clamp(36px, 8vw, 120px);
  align-items: end;
  padding-top: clamp(52px, 7vw, 84px);
  padding-bottom: clamp(42px, 6vw, 68px);
  border-bottom: 1px solid var(--jouls-ink);
}

.jouls-footer-logo { align-self: start; }
.jouls-footer-logo img { display: block; width: 184px; }
.jouls-footer-tagline {
  max-width: 760px;
  margin: 0;
  font-size: clamp(1.8rem, 3.8vw, 3.6rem);
  font-weight: 740;
  line-height: .98;
  letter-spacing: -.035em;
}

.jouls-footer-links-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding-top: 0;
  border-bottom: 1px solid var(--jouls-stone);
}

.jouls-footer-links-grid > div {
  min-width: 0;
  padding: 42px clamp(22px, 4vw, 54px) 46px 0;
  border-right: 1px solid var(--jouls-stone);
}

.jouls-footer-links-grid > div:nth-child(2),
.jouls-footer-links-grid > div:nth-child(3) { padding-left: clamp(22px, 4vw, 54px); }
.jouls-footer-links-grid > div:last-child { padding-right: 0; border-right: 0; }

.jouls-footer-title {
  margin: 0 0 20px;
  color: var(--jouls-graphite);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: .74rem;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.jouls-footer ul { gap: 10px; }
.jouls-footer a { text-decoration-thickness: .1em; text-underline-offset: .22em; }
.jouls-footer a:hover,
.jouls-footer a:focus-visible { text-decoration: underline; text-decoration-color: var(--jouls-volt); }

.jouls-footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  margin-top: 0;
  padding-top: 22px;
  padding-bottom: 4px;
  color: var(--jouls-graphite);
  font-size: .88rem;
}

.jouls-footer-bottom p { margin: 0 auto 0 0; }

@media (max-width: 980px) {
  .jouls-header-tools { display: none; }
  .jouls-header-inner { min-height: 72px; }
  .jouls-brand img { width: 142px; }
  .jouls-footer-brand-stage { grid-template-columns: 1fr; gap: 24px; }
  .jouls-footer-links-grid > div:last-child { grid-column: auto; }
}

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

@media (max-width: 720px) {
  .jouls-footer-links-grid { grid-template-columns: 1fr; }
  .jouls-footer-links-grid > div,
  .jouls-footer-links-grid > div:nth-child(2),
  .jouls-footer-links-grid > div:nth-child(3) {
    padding: 28px 0 30px;
    border-right: 0;
    border-bottom: 1px solid var(--jouls-stone);
  }
  .jouls-footer-links-grid > div:last-child { border-bottom: 0; }
  .jouls-search-form { grid-template-columns: 1fr; }
  .jouls-search-form .jouls-button { width: 100%; }
  .jouls-footer-bottom p { width: 100%; }
}

@media (max-width: 480px) {
  .jouls-mobile-panel { right: -4px; width: min(94vw, 390px); }
  .jouls-footer-tagline { font-size: clamp(1.65rem, 9vw, 2.5rem); }
}

@media (prefers-reduced-motion: reduce) {
  .jouls-mobile-menu summary span { transition: none; }
}
