/* ============================================================
   HEADER & FOOTER — one component each, used on every page.
   Measured from toppage.psd: bar 112 tall, logo 250 wide,
   nav gap 58, button 130 × 32, footer columns 300 apart.

   Two header versions, one file:
     .o-header              over a key visual — white
     .o-header--plain       white ground — for pages with no key visual
   The mobile drawer is the same in both.
   ============================================================ */

/* ───────── header ───────── */
.o-header{position:relative;z-index:20;height:112px;
  display:flex;align-items:center;gap:var(--sp-lg);
  padding-inline:var(--gutter);color:var(--white)}
/* over a key visual it floats above the photograph */
.o-header--over{position:absolute;inset:0 0 auto 0}
.o-header--plain{position:relative;background:var(--white);
  color:var(--fukamidori)}

.o-logo{flex:0 0 auto;display:block;line-height:0}
.o-logo img{width:250px;height:auto;display:block}
.o-header--plain .o-logo img{width:230px}

.o-nav{margin-left:auto;display:flex;align-items:center;gap:58px}
.o-nav a{position:relative;display:inline-block;line-height:1;
  font-size:var(--t-body);letter-spacing:.04em;text-decoration:none;
  color:inherit;white-space:nowrap;padding-bottom:2px}
/* the hover rule: 4px high, 6px clear of the text, exactly as wide as the link */
.o-nav a::after{content:"";position:absolute;left:0;right:0;top:calc(100% + 6px);
  height:4px;background:currentColor;
  transform:scaleX(0);transform-origin:left center;
  transition:transform var(--t-fast) var(--ease-move)}
.o-nav a:hover::after,.o-nav a:focus-visible::after{transform:scaleX(1)}
.o-nav a:focus-visible{outline:2px solid currentColor;outline-offset:6px}

.o-header .o-btn--nav{flex:0 0 auto;height:32px;min-width:130px;padding:0 20px;
  font-size:var(--t-note);gap:8px}
/* the bar button is 32 tall, where the standard button is 50 — the 12px arrow
   reads as bulky inside it, so it steps down with the button */
.o-header .o-btn--nav.o-btn--out::after{width:9px;height:9px;flex-basis:9px}
.o-header--plain .o-btn--nav{color:var(--fukamidori);
  box-shadow:inset 0 0 0 2px var(--fukamidori)}
.o-header--plain .o-btn--nav:hover,
.o-header--plain .o-btn--nav:focus-visible{background:var(--fukamidori);
  color:var(--white)}

/* ───────── language toggle ─────────
   One circle that slides. Two <button>s sit above it; the circle is a
   pseudo-element on the track, so there is nothing to keep in sync. */
.o-lang{position:relative;flex:0 0 auto;display:inline-flex;align-items:center;
  background:none;border:0;padding:0}
.o-lang::before{content:"";position:absolute;left:0;top:0;width:28px;height:28px;
  border-radius:50%;background:var(--white);
  transition:transform var(--t-base) var(--ease-move)}
.o-header--plain .o-lang::before{background:var(--fukamidori)}
.o-lang[data-lang="jp"]::before{transform:translateX(28px)}
.o-lang.is-init::before,.o-lang.is-init button{transition:none!important}
.o-lang button{position:relative;z-index:1;width:28px;height:28px;padding:0;
  display:grid;place-items:center;background:none;border:0;cursor:pointer;
  font-family:var(--font-latin);font-size:var(--t-micro);font-weight:700;letter-spacing:.06em;
  color:inherit;transition:color var(--t-base) var(--ease-fade)}
.o-lang[data-lang="en"] button[value="en"],
.o-lang[data-lang="jp"] button[value="jp"]{color:var(--fukamidori)}
.o-header--plain .o-lang[data-lang="en"] button[value="en"],
.o-header--plain .o-lang[data-lang="jp"] button[value="jp"]{color:var(--white)}

/* ───────── hamburger ───────── */
.o-burger{display:none;flex:0 0 auto;width:28px;height:18px;margin-left:auto;
  position:relative;background:none;border:0;padding:0;cursor:pointer;
  color:inherit}
.o-burger i{position:absolute;left:0;right:0;height:2px;border-radius:2px;
  background:currentColor;
  transition:transform var(--t-base) var(--ease-move),opacity var(--t-fast) linear}
.o-burger i:nth-child(1){top:0}
.o-burger i:nth-child(2){top:8px}
.o-burger i:nth-child(3){top:16px}
.is-menu .o-burger i:nth-child(1){transform:translateY(8px) rotate(45deg)}
.is-menu .o-burger i:nth-child(2){opacity:0}
.is-menu .o-burger i:nth-child(3){transform:translateY(-8px) rotate(-45deg)}

/* ───────── the drawer ─────────
   Identical on both header versions: 深緑 ground, white links, 若苔 on hover. */
.o-drawer{position:fixed;inset:0 0 0 auto;width:min(340px,86vw);z-index:40;
  background:var(--fukamidori);color:var(--white);
  padding:112px var(--gutter) 40px;overflow-y:auto;
  transform:translateX(100%);visibility:hidden;
  transition:transform var(--t-base) var(--ease-move),visibility 0s linear .35s}
.is-menu .o-drawer{transform:none;visibility:visible;transition-delay:0s}
.o-drawer nav{display:flex;flex-direction:column;gap:var(--sp-md)}
.o-drawer nav a{color:var(--white);text-decoration:none;font-size:var(--t-lead);
  transition:color var(--t-fast) var(--ease-fade)}
.o-drawer nav a:hover,.o-drawer nav a:focus-visible{color:var(--wakagoke)}
.o-drawer .foot{margin-top:var(--sp-xl);display:flex;flex-direction:column;
  align-items:flex-start;gap:var(--sp-md)}
.o-drawer .o-btn--nav{width:100%;height:46px;min-width:0}
/* the drawer covers the header, logo included. Only the hamburger — now an X —
   is lifted above it, so there is always something to close with, however far
   the page was scrolled.
   The header has to drop its own z-index while this happens: a positioned
   element with a z-index makes a stacking context, and a child cannot climb
   out of its parent's. With z-index:auto the header stops making one and the
   fixed burger lands in the root context, above the drawer. */
.is-menu .o-header{z-index:auto}
.is-menu .o-burger{position:fixed;top:35px;right:var(--gutter);z-index:60;
  color:var(--white)}

.o-scrim{position:fixed;inset:0;z-index:30;background:rgba(16,24,18,.5);
  opacity:0;visibility:hidden;
  transition:opacity var(--t-base) var(--ease-fade),visibility 0s linear .35s}
.is-menu .o-scrim{opacity:1;visibility:visible;transition-delay:0s}

/* ───────── the title band — pages with no key visual ───────── */
.o-titleband{background:var(--fukamidori);color:var(--white);height:200px;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:var(--sp-xs);text-align:center;padding-inline:var(--gutter)}
.o-titleband .crumb{font-size:var(--t-note);color:var(--wakagoke);margin:0}
.o-titleband .crumb a{color:inherit;text-decoration:none}
.o-titleband .crumb a:hover{color:var(--white)}
.o-titleband .crumb span{margin:0 10px;opacity:.6}
.o-titleband h1{font-family:var(--font-mincho);font-weight:600;
  font-size:var(--t-h2);line-height:var(--lh-title);letter-spacing:.04em;margin:0}

/* ───────── footer ───────── */
.o-footer{background:var(--fukamidori);color:var(--white);
  padding:var(--sp-xl) 0 var(--sp-lg)}
.o-footer .inner{max-width:var(--page-max);margin-inline:auto;
  padding-inline:var(--gutter);
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:var(--sp-lg)}
/* the direct child only — the SNS icons also live inside .brand, and an
   unscoped rule here sized them to 200px and made them overlap */
.o-footer .brand > img{width:200px;height:auto;display:block}
.o-footer .sns-label{font-family:var(--font-latin);font-size:var(--t-note);
  font-weight:700;letter-spacing:.1em;margin:var(--sp-xl) 0 var(--sp-sm)}
.o-sns{display:flex;gap:14px}
.o-sns a{display:block;width:34px;height:34px;position:relative}
.o-sns img{width:34px;height:34px;display:block;
  transition:opacity var(--t-fast) var(--ease-fade)}
.o-sns img.on{position:absolute;inset:0;opacity:0}
.o-sns a:hover img.on,.o-sns a:focus-visible img.on{opacity:1}

.o-footer ul{list-style:none;margin:0;padding:0;display:flex;
  flex-direction:column;gap:var(--sp-sm)}
.o-footer ul a{display:inline-flex;align-items:baseline;gap:9px;
  color:var(--white);text-decoration:none;font-size:var(--t-note);
  transition:color var(--t-fast) var(--ease-fade)}
/* drawn, not a glyph: a thin angle the same colour as the link, so it turns
   若苔 with the text on hover. The 「›」 character sat too heavy and too low. */
.o-footer ul a::before{content:"";flex:0 0 auto;align-self:center;
  width:7px;height:7px;border-top:1.5px solid currentColor;
  border-right:1.5px solid currentColor;transform:rotate(45deg);
  margin-right:2px}
.o-footer ul a:hover,.o-footer ul a:focus-visible{color:var(--wakagoke)}
.o-footer .copy{max-width:var(--page-max);margin:var(--sp-xl) auto 0;
  padding-inline:var(--gutter);text-align:center;font-size:var(--t-note);
  font-family:var(--font-latin);color:rgba(255,255,255,.72)}

/* ───────── narrower ───────── */
@media (max-width:1024px){
  .o-header{height:88px;gap:var(--sp-sm)}
  .o-logo img,.o-header--plain .o-logo img{width:190px}
  .o-nav,.o-header > .o-btn--nav,.o-header > .o-lang{display:none}
  .o-burger{display:block}
  .o-drawer{padding-top:88px}
  .o-titleband{height:160px}
  .o-footer .inner{grid-template-columns:minmax(0,1fr);gap:var(--sp-xl)}
  .o-footer .sns-label{margin-top:var(--sp-md)}
}
@media (prefers-reduced-motion:reduce){
  .o-nav a::after,.o-lang::before,.o-burger i,.o-drawer,.o-scrim,
  .o-sns img{transition:none}
}
