/* =========================================================
   KIMAMA STAGE 10C.1
   Shared editorial header for category archives + single posts

   HOME remains untouched.
   ========================================================= */

:root {
  --kimama-shell-dark: #080c11;
  --kimama-shell-ivory: #f3efe6;
  --kimama-shell-muted: rgba(243, 239, 230, 0.58);
  --kimama-shell-gold: #b08b5b;
  --kimama-shell-line: rgba(176, 139, 91, 0.28);
}

/* ---------------------------------------------------------
   Scope
   --------------------------------------------------------- */

body.single-post #header-container,
body.single-post .header-container,
body.category #header-container,
body.category .header-container {
  margin: 0;
  padding: 0;
  background: var(--kimama-shell-dark) !important;
}

body.single-post #header-container-in,
body.single-post .header-container-in,
body.category #header-container-in,
body.category .header-container-in {
  background: var(--kimama-shell-dark) !important;
}

/* ---------------------------------------------------------
   Main header
   Cocoon structure:
   #header > #header-in > .tagline + .logo-header
   --------------------------------------------------------- */

body.single-post #header,
body.single-post .header,
body.category #header,
body.category .header {
  min-height: 0 !important;
  margin: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--kimama-shell-line);
  background: var(--kimama-shell-dark) !important;
  background-image: none !important;
  box-shadow: none !important;
}

body.single-post #header-in,
body.single-post .header-in,
body.category #header-in,
body.category .header-in {
  display: grid;
  grid-template-columns: minmax(260px, auto) minmax(0, 1fr);
  grid-template-areas: "logo tagline";
  align-items: center;
  column-gap: clamp(34px, 5vw, 86px);
  width: min(100% - 64px, 1480px) !important;
  max-width: 1480px !important;
  min-height: 90px;
  margin: 0 auto !important;
  padding: 16px 0 !important;
  box-sizing: border-box;
  background: transparent !important;
}

/* ---------------------------------------------------------
   Site identity
   --------------------------------------------------------- */

body.single-post .logo-header,
body.category .logo-header {
  grid-area: logo;
  display: flex !important;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1;
  text-align: left !important;
}

body.single-post .logo-header::before,
body.category .logo-header::before {
  content: "MY KIMAMA ROUTE";
  display: block;
  margin-bottom: 8px;
  color: var(--kimama-shell-gold);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 8px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.23em;
}

body.single-post .site-name,
body.single-post .site-name-text-link,
body.category .site-name,
body.category .site-name-text-link {
  display: inline-flex !important;
  align-items: center;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--kimama-shell-ivory) !important;
  text-decoration: none !important;
}

body.single-post .site-name-text,
body.category .site-name-text {
  color: var(--kimama-shell-ivory) !important;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "Hiragino Mincho Pro", "Noto Serif JP", serif;
  font-size: clamp(20px, 1.65vw, 27px) !important;
  font-weight: 400 !important;
  line-height: 1.2 !important;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

/* ---------------------------------------------------------
   Tagline
   --------------------------------------------------------- */

body.single-post #header-in .tagline,
body.category #header-in .tagline {
  grid-area: tagline;
  justify-self: end;
  max-width: 620px;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--kimama-shell-muted) !important;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "Hiragino Mincho Pro", "Noto Serif JP", serif;
  font-size: 11px !important;
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: 0.055em;
  text-align: right;
}

/* ---------------------------------------------------------
   Global navigation, if Cocoon outputs one
   --------------------------------------------------------- */

body.single-post #navi,
body.single-post .navi,
body.category #navi,
body.category .navi {
  margin: 0;
  border: 0;
  border-bottom: 1px solid rgba(243, 239, 230, 0.08);
  background: var(--kimama-shell-dark) !important;
  box-shadow: none !important;
}

body.single-post .navi-in,
body.category .navi-in {
  max-width: 1480px;
  margin-inline: auto;
  background: transparent !important;
}

body.single-post .navi-in a,
body.category .navi-in a {
  color: rgba(243, 239, 230, 0.7) !important;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.11em;
}

@media (hover: hover) and (pointer: fine) {
  body.single-post .site-name-text-link:hover .site-name-text,
  body.category .site-name-text-link:hover .site-name-text {
    color: #ffffff !important;
  }

  body.single-post .navi-in a:hover,
  body.category .navi-in a:hover {
    color: var(--kimama-shell-ivory) !important;
    background: rgba(255,255,255,0.03) !important;
  }
}

/* ---------------------------------------------------------
   Remove legacy header spacing/shadows
   --------------------------------------------------------- */

body.single-post .header-container,
body.category .header-container {
  box-shadow: none !important;
}

body.single-post .header-container-in,
body.category .header-container-in {
  min-height: 0 !important;
}

/* ---------------------------------------------------------
   Mobile
   --------------------------------------------------------- */

@media screen and (max-width: 834px) {
  body.single-post #header-in,
  body.single-post .header-in,
  body.category #header-in,
  body.category .header-in {
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(100% - 36px) !important;
    min-height: 72px;
    padding: 12px 0 !important;
  }

  body.single-post .logo-header,
  body.category .logo-header {
    align-items: center;
    text-align: center !important;
  }

  body.single-post .logo-header::before,
  body.category .logo-header::before {
    margin-bottom: 7px;
    font-size: 7px;
    letter-spacing: 0.21em;
  }

  body.single-post .site-name-text,
  body.category .site-name-text {
    font-size: clamp(19px, 5.4vw, 23px) !important;
    line-height: 1.2 !important;
  }

  /* The existing Japanese tagline is long. On a reading screen,
     keep it semantically in the HTML but remove it visually. */
  body.single-post #header-in .tagline,
  body.category #header-in .tagline {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
  }

  /* If a desktop navigation menu exists, keep mobile reading chrome quiet.
     Cocoon's fixed footer menu is already disabled by Stage 10A.6. */
  body.single-post #navi,
  body.single-post .navi,
  body.category #navi,
  body.category .navi {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.single-post #header *,
  body.category #header * {
    transition: none !important;
  }
}


/* =========================================================
   KIMAMA STAGE 10D.1
   Extend the shared editorial shell to non-front static pages.
   HOME stays excluded because it never receives .kimama-static-page.
   ========================================================= */

body.kimama-static-page #header-container,
body.kimama-static-page .header-container,
body.kimama-static-page #header-container-in,
body.kimama-static-page .header-container-in {
  margin: 0;
  padding: 0;
  background: var(--kimama-shell-dark) !important;
}

body.kimama-static-page #header,
body.kimama-static-page .header {
  min-height: 0 !important;
  margin: 0;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--kimama-shell-line);
  background: var(--kimama-shell-dark) !important;
  background-image: none !important;
  box-shadow: none !important;
}

body.kimama-static-page #header-in,
body.kimama-static-page .header-in {
  display: grid;
  grid-template-columns: minmax(260px, auto) minmax(0, 1fr);
  grid-template-areas: "logo tagline";
  align-items: center;
  column-gap: clamp(34px, 5vw, 86px);
  width: min(100% - 64px, 1480px) !important;
  max-width: 1480px !important;
  min-height: 90px;
  margin: 0 auto !important;
  padding: 16px 0 !important;
  box-sizing: border-box;
  background: transparent !important;
}

body.kimama-static-page .logo-header {
  grid-area: logo;
  display: flex !important;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1;
  text-align: left !important;
}

body.kimama-static-page .logo-header::before {
  content: "MY KIMAMA ROUTE";
  display: block;
  margin-bottom: 8px;
  color: var(--kimama-shell-gold);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 8px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.23em;
}

body.kimama-static-page .site-name,
body.kimama-static-page .site-name-text-link {
  display: inline-flex !important;
  align-items: center;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--kimama-shell-ivory) !important;
  text-decoration: none !important;
}

body.kimama-static-page .site-name-text {
  color: var(--kimama-shell-ivory) !important;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "Hiragino Mincho Pro", "Noto Serif JP", serif;
  font-size: clamp(20px, 1.65vw, 27px) !important;
  font-weight: 400 !important;
  line-height: 1.2 !important;
  letter-spacing: 0.015em;
  white-space: nowrap;
}

body.kimama-static-page #header-in .tagline {
  grid-area: tagline;
  justify-self: end;
  max-width: 620px;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--kimama-shell-muted) !important;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "Hiragino Mincho Pro", "Noto Serif JP", serif;
  font-size: 11px !important;
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: 0.055em;
  text-align: right;
}

body.kimama-static-page #navi,
body.kimama-static-page .navi {
  margin: 0;
  border: 0;
  border-bottom: 1px solid rgba(243, 239, 230, 0.08);
  background: var(--kimama-shell-dark) !important;
  box-shadow: none !important;
}

body.kimama-static-page .navi-in {
  max-width: 1480px;
  margin-inline: auto;
  background: transparent !important;
}

body.kimama-static-page .navi-in a {
  color: rgba(243, 239, 230, 0.7) !important;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.11em;
}

@media (hover: hover) and (pointer: fine) {
  body.kimama-static-page .site-name-text-link:hover .site-name-text {
    color: #ffffff !important;
  }

  body.kimama-static-page .navi-in a:hover {
    color: var(--kimama-shell-ivory) !important;
    background: rgba(255,255,255,0.03) !important;
  }
}

body.kimama-static-page .header-container {
  box-shadow: none !important;
}

body.kimama-static-page .header-container-in {
  min-height: 0 !important;
}

@media screen and (max-width: 834px) {
  body.kimama-static-page #header-in,
  body.kimama-static-page .header-in {
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(100% - 36px) !important;
    min-height: 72px;
    padding: 12px 0 !important;
  }

  body.kimama-static-page .logo-header {
    align-items: center;
    text-align: center !important;
  }

  body.kimama-static-page .logo-header::before {
    margin-bottom: 7px;
    font-size: 7px;
    letter-spacing: 0.21em;
  }

  body.kimama-static-page .site-name-text {
    font-size: clamp(19px, 5.4vw, 23px) !important;
    line-height: 1.2 !important;
  }

  body.kimama-static-page #header-in .tagline {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
  }

  body.kimama-static-page #navi,
  body.kimama-static-page .navi {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.kimama-static-page #header * {
    transition: none !important;
  }
}
