/* Ghost-style header/footer — uses per-theme CSS variables on body.p100-theme-* */

body.has-theme-skin {
  --gh-accent: var(--p100-accent, #ff0000);
  --gh-dark: var(--p100-dark, #000);
  --gh-gray: var(--p100-muted, #585858);
  --gh-stroke: var(--p100-border, #d3d3d3);
  --gh-light: var(--p100-surface, #f6f6f6);
  --gh-white: var(--p100-bg, #fff);
  --gh-max: 1240px;
  --p100-shell-gutter: clamp(1rem, 4vw, 2rem);
  --gh-radius-nav: var(--p100-radius, 4px);
  background: var(--gh-white);
  color: var(--gh-dark);
  font-family: var(--p100-font-body, system-ui, sans-serif);
}

/* Hide legacy header when skin chrome active */
body.has-theme-skin .site-header:not(.site-header--ghost) { display: none; }

.site-header--ghost {
  position: sticky;
  top: 0;
  z-index: 1001;
  pointer-events: none;
  width: 100%;
  margin: 0;
  border-bottom: none;
  padding: 0;
}

.site-header--ghost .site-header__top,
.site-header--ghost .site-header__top,
.site-header--ghost .site-header__bottom,
.site-header--ghost .site-header__actions,
.site-header--ghost .site-header__nav,
.site-header--ghost .nav-toggle {
  pointer-events: all;
}

.site-header__top {
  background: var(--gh-white);
  border-bottom: 1px solid var(--gh-stroke);
  height: 95px;
  display: flex;
  align-items: center;
}

.site-header__bottom {
  background: var(--gh-white);
  border-bottom: 1px solid var(--gh-stroke);
  min-height: 54px;
  display: flex;
  align-items: center;
}

.site-header__container {
  width: 100%;
  max-width: var(--gh-max, 1240px);
  margin: 0 auto;
  padding: 0 var(--p100-shell-gutter, clamp(1rem, 4vw, 2rem));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-sizing: border-box;
}

/* Brand mark (logo + name) */
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--gh-dark);
  min-width: 0;
}

.site-brand:hover {
  color: var(--gh-accent);
  text-decoration: none;
}

.site-brand__logo {
  height: 36px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  flex-shrink: 0;
}

.site-brand__name {
  font-family: var(--p100-font-heading, inherit);
  font-weight: 700;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-footer__brand .site-brand {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.site-footer__brand .site-brand__logo {
  height: 32px;
}

.site-footer__tagline {
  margin: 0.5rem 0 0;
  color: var(--gh-gray);
  font-size: 0.9rem;
  line-height: 1.5;
  max-width: 28rem;
}

.site-header__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.5rem;
}

.site-header__nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gh-dark);
  text-decoration: none;
  transition: color 0.15s ease;
}

.site-header__nav a:hover { color: var(--gh-accent); }

.site-header__cta {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.1rem;
  background: var(--gh-accent);
  color: #fff !important;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--gh-radius-nav);
  transition: filter 0.15s ease;
}

.site-header__cta:hover { filter: brightness(1.08); }

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.site-header--ghost .nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border: 1px solid var(--gh-stroke);
  border-radius: 50%;
  background: var(--gh-light);
  cursor: pointer;
  flex-shrink: 0;
}

.site-header--ghost .nav-toggle__bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--gh-dark);
  border-radius: 1px;
}

/* Drawer chrome — layout/animation in skin-layout.css */
.site-nav__drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--gh-stroke);
  flex-shrink: 0;
}

.site-nav__drawer-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gh-gray);
}

.site-nav__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 50%;
  background: var(--gh-light);
  color: var(--gh-dark);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.site-nav__drawer-links {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 0.5rem 0 1.5rem;
  -webkit-overflow-scrolling: touch;
}

.site-nav.site-nav--drawer a {
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--gh-stroke);
  font-size: 1rem;
  font-weight: 500;
  color: var(--gh-dark);
  text-decoration: none;
}

.site-nav.site-nav--drawer a:hover {
  color: var(--gh-accent);
  background: var(--gh-light);
}

@media (max-width: 900px) {
  .site-header__bottom {
    display: none;
  }

  .site-header--ghost .nav-toggle {
    display: flex;
  }

  .site-header__top {
    height: auto;
    min-height: 64px;
    padding: 0.35rem 0;
  }

  .site-header__actions {
    gap: 0.4rem;
  }

  .site-header__cta {
    padding: 0.45rem 0.75rem;
    font-size: 0.78rem;
  }
}

/* Footer — skin + media-base (4-col reference layout) */
.site-footer,
.site-footer--skin {
  width: 100%;
  margin: 0;
  border-top: 1px solid var(--gh-stroke, var(--color-border));
  background: var(--gh-light, #f6f6f4);
  padding: clamp(2.5rem, 5vw, 3.5rem) 0 0;
  text-align: left;
}

.site-footer--skin {
  background: var(--gh-light, #f6f6f4);
}

.site-footer__inner,
.site-footer__inner--base {
  width: 100%;
  max-width: var(--gh-max, 1240px);
  margin: 0 auto;
  padding: 0 var(--p100-shell-gutter, clamp(1rem, 4vw, 2rem)) clamp(2rem, 4vw, 2.75rem);
  display: grid;
  gap: clamp(1.75rem, 4vw, 2.5rem);
  grid-template-columns: minmax(200px, 1.35fr) minmax(120px, 1fr) minmax(140px, 1fr) minmax(160px, 1.1fr);
  align-items: start;
  box-sizing: border-box;
}

body:not(.has-theme-skin) .site-footer__inner,
body:not(.has-theme-skin) .site-footer__inner--base {
  max-width: var(--content-max, 1100px);
  padding-left: var(--space-md, 1.5rem);
  padding-right: var(--space-md, 1.5rem);
}

.site-footer__col-title {
  margin: 0 0 0.85rem;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--gh-dark, var(--color-text));
}

.site-footer__col--brand .site-brand {
  margin-bottom: 0.35rem;
}

.site-footer__tagline,
.site-footer__col--brand p {
  margin: 0.65rem 0 0;
  color: var(--gh-gray, var(--color-muted));
  max-width: 22rem;
  font-size: 0.875rem;
  line-height: 1.55;
}

.site-footer__col--brand a,
.site-footer__brand a {
  font-family: var(--p100-font-heading, inherit);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--gh-dark, var(--color-text));
  text-decoration: none;
}

.site-footer__col--brand a:hover,
.site-footer__brand a:hover {
  color: var(--gh-accent, var(--color-primary));
}

.site-footer__nav,
.site-footer__legal {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer__nav a,
.site-footer__legal a {
  color: var(--gh-dark, var(--color-text));
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.45;
}

.site-footer__nav a:hover,
.site-footer__legal a:hover {
  color: var(--gh-accent, var(--color-primary));
}

/* Footer social — labeled rows (icon + name) */
.site-footer__social-labeled {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  list-style: none !important;
  margin: 0;
  padding: 0;
}

.site-footer__social-row {
  list-style: none !important;
  margin: 0;
  padding: 0;
}

.site-footer__social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--gh-dark, var(--color-text));
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.3;
}

.site-footer__social-link:hover {
  color: var(--gh-accent, var(--color-primary));
}

.site-footer__social-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  flex-shrink: 0;
  color: var(--gh-accent, var(--p100-accent, var(--color-primary)));
}

.site-footer__social-row.is-muted .site-footer__social-link {
  opacity: 0.45;
  cursor: default;
}

.site-footer__social-row.is-muted .site-footer__social-link:hover {
  color: var(--gh-dark, var(--color-text));
}

.p100-social,
.p100-contact-social,
.site-footer__social {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  list-style: none !important;
  list-style-type: none !important;
  padding: 0;
  margin: 0;
}

.p100-social__item,
.p100-contact-social > li,
.site-footer__social > li {
  list-style: none !important;
  margin: 0;
  padding: 0;
  display: flex;
}

.p100-contact-block--social .p100-social {
  justify-content: flex-start;
}

.site-footer__col--social .p100-social {
  justify-content: flex-start;
}

.p100-social a,
.p100-social__placeholder,
.site-footer__social a,
.p100-contact-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--gh-white, #fff);
  border: 1px solid var(--gh-stroke, var(--color-border));
  color: var(--gh-dark, var(--color-text));
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
  text-decoration: none;
}

.p100-social a:hover,
.p100-contact-social a:hover,
.site-footer__social a:hover {
  border-color: var(--gh-accent, var(--color-primary));
  color: var(--gh-accent, var(--color-primary));
}

.p100-social__item--muted .p100-social__placeholder {
  opacity: 0.45;
  cursor: default;
}

.p100-social__icon,
.site-footer__social-icon {
  display: block;
}

.p100-contact-social {
  margin: 0.25rem 0 0.75rem;
}

.site-footer__bottom {
  width: 100%;
  border-top: 1px solid var(--gh-stroke, var(--color-border));
  background: var(--gh-light, #f6f6f4);
}

.site-footer__bottom-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem 1.5rem;
  max-width: var(--gh-max, 1240px);
  margin: 0 auto;
  padding: 1rem var(--p100-shell-gutter, clamp(1rem, 4vw, 2rem)) 1.25rem;
  box-sizing: border-box;
}

.site-footer__copy {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--gh-gray, var(--color-muted));
  line-height: 1.45;
  text-align: left;
  justify-self: start;
}

.site-footer__bottom-center {
  justify-self: center;
  text-align: center;
  min-width: 0;
}

.site-footer__bottom-credit {
  justify-self: end;
  text-align: right;
  min-width: 0;
}

.site-footer .entity-desc,
.privacy-notice {
  font-size: 0.8125rem;
  color: var(--gh-gray, var(--color-muted));
  margin: 0;
  line-height: 1.45;
}

.privacy-notice a {
  color: var(--gh-dark, var(--color-text));
  text-decoration: none;
  font-weight: 500;
}

.privacy-notice a:hover {
  color: var(--gh-accent, var(--p100-accent));
}

.site-footer__credit {
  margin: 0;
  padding: 0;
}

.site-footer__credit--bar {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem 0.55rem;
  text-align: right;
}

.site-footer__credit-text {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gh-gray, var(--color-muted));
  white-space: nowrap;
}

.site-footer__credit-brand--inline {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  color: var(--gh-dark, var(--color-text));
}

.site-footer__credit-brand--inline:hover {
  text-decoration: none;
}

.site-footer__credit-logo-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.1rem;
  background: linear-gradient(145deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.68));
  border-radius: 10px;
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.28),
    0 2px 6px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.site-footer__credit-logo-chip--compact {
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
}

.site-footer__credit-logo {
  display: block;
  height: 22px;
  width: auto;
  max-width: 110px;
  object-fit: contain;
}

.site-footer__credit-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gh-dark, var(--color-text));
  white-space: nowrap;
}

.site-footer__credit-brand--inline:hover .site-footer__credit-name {
  color: var(--gh-accent, var(--color-primary));
}

@media (max-width: 1024px) {
  .site-footer__inner,
  .site-footer__inner--base {
    grid-template-columns: 1fr 1fr;
  }

  .site-footer__col--brand {
    grid-column: 1 / -1;
  }

  .site-footer__col--social {
    grid-column: auto;
  }
}

@media (max-width: 900px) {
  .site-footer__bottom-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 0.75rem;
  }

  .site-footer__copy,
  .site-footer__bottom-center,
  .site-footer__bottom-credit {
    justify-self: center;
    text-align: center;
  }

  .site-footer__credit--bar {
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 560px) {
  .site-footer__inner,
  .site-footer__inner--base {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 900px) {
  .site-header__top { min-height: 64px; }
  .site-brand__name { max-width: 48vw; }
}

@media (max-width: 480px) {
  .site-brand__name { font-size: 0.95rem; max-width: 46vw; }
  .site-brand__logo { height: 28px; max-width: 90px; }
}

/* Skin sites: no default blue underlined links */
body.has-theme-skin a {
  color: inherit;
  text-decoration: none;
}

body.has-theme-skin a:hover {
  color: var(--gh-accent, var(--color-primary));
  text-decoration: none;
}

body.has-theme-skin .site-brand,
body.has-theme-skin .site-brand:hover,
body.has-theme-skin .site-header__nav a,
body.has-theme-skin .site-footer__nav a,
body.has-theme-skin .site-footer__legal a,
body.has-theme-skin .site-footer__social-link,
body.has-theme-skin .site-footer__brand a,
body.has-theme-skin .privacy-notice a,
body.has-theme-skin .site-footer__credit-brand {
  text-decoration: none;
}

body.has-theme-skin .site-footer__social-link,
body.has-theme-skin .site-footer__credit-name {
  color: var(--gh-dark, var(--color-text));
}

body.has-theme-skin .p100-contact-list a,
body.has-theme-skin .p100-contact-network a,
body.has-theme-skin .article-body a,
body.has-theme-skin .p100-form__checkbox a {
  color: var(--gh-accent, var(--p100-accent, var(--color-primary)));
  text-decoration: none;
}

body.has-theme-skin .p100-contact-list a:hover,
body.has-theme-skin .p100-contact-network a:hover,
body.has-theme-skin .article-body a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}
