/* Header refinement styles. The fallback navigation is fully scoped. */
:root {
  --she-header-ink: #30302e;
  --she-header-line: rgba(48, 48, 46, .16);
  --she-header-paper: rgba(255, 255, 255, .96);
}

#header { position: relative; z-index: 20; }

/* The theme's logo is absolutely positioned, so anchor the fallback menu
 * to the header box instead of relying on #header_inner flex alignment. */
#header_inner { position: relative; }

.she-site-nav {
  position: absolute;
  top: 50%;
  right: 0;
  z-index: 2;
  margin: 0;
  transform: translateY(-50%);
}

.she-site-menu {
  display: flex;
  align-items: center;
  gap: clamp(.9rem, 2vw, 1.8rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.she-site-nav a {
  color: var(--she-header-ink);
  font-size: .88rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-decoration: none;
  white-space: nowrap;
}

.she-site-nav a:focus-visible,
.she-site-menu-button:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.she-site-nav a:hover { opacity: .62; }

.she-site-menu-button {
  display: none;
  position: absolute;
  top: 50%;
  right: 0;
  z-index: 3;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--she-header-line);
  border-radius: 999px;
  background: transparent;
  color: var(--she-header-ink);
  padding: .55rem .8rem;
  font: inherit;
  cursor: pointer;
  transform: translateY(-50%);
}

.she-site-menu-label {
  font-size: .75rem;
  letter-spacing: .12em;
}

/* Keep links visible if the enhancement script is unavailable. */
@media (max-width: 767px) {
  .she-site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 4;
    transform: none;
    padding: .65rem;
    border: 1px solid var(--she-header-line);
    background: var(--she-header-paper);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .08);
  }

  .she-site-menu {
    display: grid;
    gap: 0;
  }

  .she-site-menu li { border-bottom: 1px solid var(--she-header-line); }
  .she-site-menu li:last-child { border-bottom: 0; }
  .she-site-nav a { display: block; padding: .9rem .75rem; }

  .she-site-js .she-site-menu-button {
    display: inline-flex;
  }

  .she-site-js .she-site-nav { display: none; }
  .she-site-js .she-site-nav.is-open { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .she-site-nav,
  .she-site-nav a { transition: none !important; }
}


/* Keep the theme logo usable in the compact PC fixed header. The theme hides
 * these elements while body.header_fix is active; scope the repair so the
 * normal header and the mobile header retain their original behavior. */
@media (min-width: 768px) {
  body.header_fix #header,
  body.header_fix #header_inner {
    height: 50px;
    min-height: 50px;
  }

  body.header_fix #header_inner {
    box-sizing: border-box;
    padding-left: 8rem;
    padding-right: 8rem;
  }

  body.header_fix #logo_image,
  body.header_fix #logo_text {
    display: block !important;
    position: absolute;
    top: 50%;
    left: 0;
    z-index: 3;
    max-height: 42px;
    margin: 0;
    transform: translateY(-50%);
  }

  body.header_fix #logo_image img {
    display: block;
    width: auto;
    max-width: 7.25rem;
    max-height: 42px;
  }

  body.header_fix #logo_text {
    max-width: 7.25rem;
    overflow: hidden;
    font-size: 1rem;
    line-height: 1.2;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  /* Reserve the logo and the right-side controls so either the fallback or
   * the standard WordPress-assigned menu cannot sit underneath the logo. */
  body.header_fix #global_menu,
  body.header_fix .she-site-nav {
    right: 8rem;
    max-width: calc(100% - 16rem);
  }

  body.header_fix #global_menu ul,
  body.header_fix .she-site-menu {
    max-width: 100%;
  }

  body.header_fix #header_button,
  body.header_fix #menu_button,
  body.header_fix .she-site-menu-button {
    z-index: 4;
  }
}

/* Hide only the upper/main navigation on phones. */
@media screen and (max-width: 767px) {
	#global_menu,
	.she-site-nav,
	#menu_button,
	#she-site-menu-button {
		display: none !important;
	}

	body.page-id-51 #main_content {
		padding-left: 0 !important;
		padding-right: 0 !important;
	}
}

/* Reduce only the fixed desktop header logo height without changing its width. */
@media screen and (min-width: 768px) {
	body.header_fix #logo_image,
	body.header_fix #logo_text {
		max-height: 30px;
	}

	body.header_fix #logo_image img {
		max-height: 30px;
	}
}
/* Mobile body copy: match the 15px desktop size and keep Japanese line breaks
 * on phrase boundaries so short continuation lines do not float mid-column. */
@media (max-width: 767px) {
  .she-home-opening__meaning p,
  .she-home-greeting p,
  .she-home-profile__copy > p:last-child,
  .she-home-service li {
    font-size: 15px;
    line-height: 2;
  }

  .she-home-opening__meaning p,
  .she-home-greeting .she-greeting-line,
  .she-home-profile__copy > p:last-child,
  .she-home-service li {
    word-break: auto-phrase;
    line-break: strict;
  }

  .she-home-opening__meaning p,
  .she-home-greeting .she-greeting-line {
    text-wrap: balance;
  }

  /* Give the contact form inputs more room inside the existing card. */
  #wpcf7-f81-p51-o1 form.wpcf7-form {
    margin-left: 12px;
    margin-right: 12px;
  }
}
