/* Lovers: shared header (PC top menu + smartphone hamburger) / bottom nav */

/* ---- Prevent horizontal page scroll (all viewports) ---- */
html {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  overflow-x: hidden;
  max-width: 100%;
  position: relative;
  box-sizing: border-box;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

img,
video,
iframe,
embed,
object {
  max-width: 100%;
  height: auto;
}

.site-header,
.header-bar,
.contents,
footer,
.bottom-nav,
.bottom-bars {
  max-width: 100%;
}

.contents,
.contents section,
.contents p {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Wide tables/galleries scroll inside their container only */
.photo-scroll,
.contents div[align="center"] {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.photo-scroll table,
.contents div[align="center"] table {
  width: max-content;
  max-width: none;
}

.contents table.form,
.contents .form {
  width: 100% !important;
  max-width: 100%;
}

/* Standard 16:9 video embed (YouTube etc.) */
.video-embed {
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 0 auto 20px;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none;
  border: 0;
}

.contents .form th,
.contents .form td {
  word-break: break-word;
}

/* ---- Desktop / tablet: sticky logo + detail menu ---- */
header.site-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 200 !important;
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  text-align: left !important;
  background: rgba(255, 252, 247, 0.98) !important;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(85, 72, 37, 0.18);
  box-shadow: 0 8px 24px rgba(85, 72, 37, 0.08);
}

.header-bar {
  display: flex !important;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 8px;
  width: min(1120px, 94%);
  margin: 0 auto;
  min-height: 0;
  padding: 14px 0 12px;
}

.header-bar > #logo {
  display: block !important;
  flex: 0 0 auto;
  width: auto;
  max-width: 100%;
  margin: 0 !important;
  text-align: left;
}

.header-bar > #logo a {
  display: inline-block !important;
  line-height: 0;
}

/* Override style.css (#logo img { width:100%; opacity:0.6 }) */
.site-header #logo img,
.header-bar #logo img {
  display: block !important;
  width: auto !important;
  max-width: min(280px, 70vw) !important;
  height: auto !important;
  max-height: 56px !important;
  opacity: 1 !important;
}

.nav-toggle {
  display: none !important;
}

.primary-nav {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 6px 8px;
  width: 100%;
  margin: 0 !important;
  padding: 8px 0 0 !important;
  border-top: 1px solid rgba(85, 72, 37, 0.12);
  list-style: none;
  position: static !important;
  top: auto !important;
}

.primary-nav a {
  display: inline-block !important;
  width: auto !important;
  min-width: 0 !important;
  line-height: 1.35 !important;
  padding: 8px 10px !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.75);
  color: #554825 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: normal !important;
  text-decoration: none !important;
  text-shadow: none !important;
  white-space: nowrap;
}

.primary-nav a:hover,
.primary-nav a:focus-visible,
.primary-nav a.is-active {
  color: #de3973 !important;
  background: rgba(222, 57, 115, 0.12) !important;
  text-decoration: none !important;
}

/* Hide legacy circular menu only on pages using the shared site header */
.site-header #menubar {
  display: none !important;
}

.bottom-nav,
.bottom-bars,
.ship-global-bottom-nav,
.ship-global-bottom-panel {
  display: none;
}

.contents {
  margin-bottom: 40px;
}

footer {
  margin-top: 0 !important;
}

/* ---- Smartphone: hamburger + bottom nav ---- */
@media screen and (max-width: 900px) {
  html {
    scroll-behavior: smooth;
    scroll-padding-top: 72px;
  }

  body {
    padding-bottom: calc(102px + env(safe-area-inset-bottom, 0px));
  }

  .header-bar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
    min-height: 64px;
    padding: 8px 14px;
    gap: 12px;
  }

  .header-bar > #logo {
    flex: 1 1 auto;
  }

  .site-header #logo img,
  .header-bar #logo img {
    max-width: min(220px, 58vw) !important;
    max-height: 48px !important;
  }

  .nav-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 220;
    order: 2;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(85, 72, 37, 0.25);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .nav-toggle-bars,
  .nav-toggle-bars::before,
  .nav-toggle-bars::after {
    display: block;
    width: 20px;
    height: 2px;
    background: #554825;
    border-radius: 2px;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  .nav-toggle-bars {
    position: relative;
  }

  .nav-toggle-bars::before,
  .nav-toggle-bars::after {
    content: "";
    position: absolute;
    left: 0;
  }

  .nav-toggle-bars::before { top: -6px; }
  .nav-toggle-bars::after { top: 6px; }

  .nav-toggle[aria-expanded="true"] .nav-toggle-bars {
    background: transparent;
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::before {
    top: 0;
    transform: rotate(45deg);
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::after {
    top: 0;
    transform: rotate(-45deg);
  }

  .primary-nav {
    display: none !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    order: 3;
    flex: 1 0 100%;
    width: 100% !important;
    max-height: none;
    overflow: visible;
    gap: 0 !important;
    padding: 0 !important;
    border-top: 1px solid rgba(85, 72, 37, 0.12);
    background: #fffaf3;
  }

  .primary-nav.is-open,
  .site-header.is-nav-open .primary-nav {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
  }

  .primary-nav a,
  .primary-nav.is-open a,
  .site-header.is-nav-open .primary-nav a {
    display: block !important;
    flex: 0 0 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 7px 12px !important;
    border: 0 !important;
    border-radius: 0 !important;
    border-bottom: 1px solid rgba(85, 72, 37, 0.12) !important;
    background: transparent !important;
    color: #554825 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    text-align: left !important;
    white-space: normal !important;
  }

  .primary-nav a:last-child {
    border-bottom: 0 !important;
  }

  .primary-nav a.is-active,
  .primary-nav a:hover,
  .primary-nav a:focus-visible {
    background: rgba(222, 57, 115, 0.1) !important;
    color: #de3973 !important;
  }

  .contents {
    margin-bottom: 24px;
    padding: 5% 3% 8%;
  }

  footer {
    padding: 20px 12px 28px;
  }

  .bottom-bars {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 210;
    background: rgba(255, 252, 247, 0.96);
    border-top: 1px solid rgba(85, 72, 37, 0.18);
    backdrop-filter: blur(14px);
    box-shadow: 0 -8px 24px rgba(85, 72, 37, 0.1);
  }

  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: auto;
    min-height: 56px;
    padding: 4px 4px 2px;
    background: transparent;
    border-top: 0;
    box-shadow: none;
    backdrop-filter: none;
  }

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 52px;
    padding: 4px 2px;
    border-radius: 12px;
    color: #554825;
    font-size: 9px;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }

  .bottom-nav-item:hover,
  .bottom-nav-item:focus-visible,
  .bottom-nav-item.is-active {
    background: rgba(222, 57, 115, 0.1);
    color: #de3973;
    text-decoration: none;
  }

  .bottom-nav-icon {
    font-size: 20px;
    line-height: 1;
  }

  .ship-global-bottom-nav {
    display: block;
    position: relative;
    width: 100%;
    margin: 0;
    background: #fff6ea;
    border-top: 1px solid rgba(85, 72, 37, 0.12);
  }

  .ship-global-bottom-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-height: 32px;
    margin: 0;
    padding: 0 8px calc(4px + env(safe-area-inset-bottom, 0px));
    border: 0;
    background: transparent;
    color: #de3973;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    font-family: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .ship-global-bottom-toggle:hover,
  .ship-global-bottom-toggle:focus-visible,
  .bottom-bars.is-open .ship-global-bottom-toggle {
    color: #c22e64;
  }

  .ship-global-bottom-chevron {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-135deg) translateY(1px);
    transition: transform 0.2s ease;
  }

  .bottom-bars.is-open .ship-global-bottom-chevron {
    transform: rotate(45deg) translateY(-2px);
  }

  .ship-global-bottom-panel {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    z-index: 3;
    max-height: min(58vh, 420px);
    overflow-y: auto;
    padding: 10px 12px 12px;
    background: #ffffff;
    border-top: 1px solid rgba(85, 72, 37, 0.18);
    box-shadow: 0 -10px 28px rgba(85, 72, 37, 0.12);
    -webkit-overflow-scrolling: touch;
  }

  .bottom-bars.is-open .ship-global-bottom-panel,
  .ship-global-bottom-panel:not([hidden]) {
    display: block;
  }

  .ship-global-bottom-category + .ship-global-bottom-category {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed rgba(85, 72, 37, 0.18);
  }

  .ship-global-bottom-category-title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 6px;
    color: #554825;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.3;
  }

  .ship-global-bottom-links {
    display: grid;
    gap: 4px;
  }

  .ship-global-bottom-links a {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 7px 8px;
    border-radius: 10px;
    color: #de3973;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }

  .ship-global-bottom-links a img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex: 0 0 auto;
  }

  .ship-global-bottom-links a span[aria-hidden="true"] {
    flex: 0 0 auto;
    width: 1.4em;
    text-align: center;
  }

  .ship-global-bottom-links a:hover,
  .ship-global-bottom-links a:focus-visible,
  .ship-global-bottom-links a.is-active {
    background: rgba(222, 57, 115, 0.1);
    color: #c22e64;
    text-decoration: none;
  }

  .contents div[align="center"],
  .photo-scroll {
    margin-bottom: 12px;
  }

  .contents img[width],
  .contents img[height] {
    width: auto;
    max-width: 100%;
    height: auto;
  }

  .bottom-nav-item span:not(.bottom-nav-icon) {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
  }

  h2 {
    padding: 10px 16px;
    font-size: 1.05rem;
    border-radius: 18px;
  }

  h3 {
    padding: 8px 16px;
    font-size: 0.98rem;
    border-radius: 18px;
  }

  #new dt,
  #new dd {
    float: none;
    width: auto;
    padding-left: 0;
  }

  #new dt {
    margin-top: 10px;
  }

  #new dd {
    padding-bottom: 8px;
  }

  .list2 {
    display: block;
    margin-bottom: 16px;
  }

  .list2 figure img {
    width: 100%;
    max-width: 280px;
    border-radius: 16px;
  }

}
