/*
  KOJOSHO WEBSITE STYLE FILE

  This file controls colors, spacing, and layout.
  Most text changes should be made in the HTML files or site-data.js.
*/

:root {
  --ink: #17130f;
  --ink-soft: #342b25;
  --paper: #f6f0e6;
  --paper-strong: #fffaf0;
  --red: #a40b12;
  --red-dark: #74080d;
  --moss: #3f5b4b;
  --gold: #b8893d;
  --mist: #d6ddd9;
  --line: rgba(23, 19, 15, 0.18);
  --shadow: 0 20px 55px rgba(17, 12, 8, 0.18);
  --font-sans: Arial, Helvetica, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}

.site-shell {
  min-height: 100vh;
  background:
    linear-gradient(rgba(246, 240, 230, 0.5), rgba(246, 240, 230, 0.6)),
    url("../images/ink-landscape.jpg") center top / cover fixed;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 20;
  transform: translateY(-150%);
  background: var(--ink);
  color: white;
  padding: 0.65rem 0.9rem;
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  background: var(--red-dark);
  color: white;
}

.topbar-inner,
.site-header-inner,
.section-inner,
.footer-inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 42px;
  font-size: 0.88rem;
}

.topbar a {
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 250, 240, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 82px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  flex: 1 1 auto;
  min-width: 0;
}

.brand img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.brand strong {
  display: block;
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.1;
}

.brand span {
  display: block;
  color: var(--ink-soft);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  min-width: 0;
}

.menu-button {
  display: none;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
  min-width: 44px;
  min-height: 44px;
  font-size: 1.4rem;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-list a {
  display: block;
  padding: 0.6rem 0.72rem;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 700;
}

.nav-list a:hover,
.nav-list a[aria-current="page"] {
  background: var(--ink);
  color: white;
}

.hero {
  min-height: clamp(540px, 72vh, 720px);
  display: grid;
  align-items: end;
  padding: clamp(3rem, 8vw, 7rem) 0 3rem;
  border-bottom: 1px solid var(--line);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(280px, 0.48fr);
  align-items: end;
  gap: clamp(1.5rem, 4vw, 3.5rem);
}

.hero-grid > *,
.section-head > *,
.split > *,
.feature-band > *,
.event-row > *,
.contact-panel > *,
.footer-inner > * {
  min-width: 0;
}

.hero-copy {
  max-width: 780px;
}

.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--red);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-serif);
  line-height: 1.08;
}

h1 {
  max-width: 860px;
  font-size: clamp(3rem, 6.1vw, 5.7rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 3.25rem);
}

h3 {
  font-size: clamp(1.3rem, 2.4vw, 1.75rem);
}

.lead {
  max-width: 740px;
  margin: 1.15rem 0 0;
  color: var(--ink-soft);
  font-size: clamp(1.08rem, 2vw, 1.32rem);
}

.hero-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.6rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.78rem 1rem;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: var(--ink);
  color: white;
  font-weight: 800;
  text-decoration: none;
}

.button.secondary {
  background: rgba(255, 250, 240, 0.72);
  color: var(--ink);
}

.button:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
  color: white;
}

.hero-panel {
  background: rgba(255, 250, 240, 0.82);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 1.35rem;
}

.hero-panel h2 {
  font-size: 1.55rem;
}

.hero-panel p {
  margin: 0.8rem 0 0;
}

.stat-list {
  display: grid;
  gap: 0.8rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.stat-list li {
  border-top: 1px solid var(--line);
  padding-top: 0.8rem;
}

.stat-list strong {
  display: block;
  color: var(--red);
  font-family: var(--font-serif);
  font-size: 1.55rem;
  line-height: 1;
}

.section {
  padding: clamp(3.2rem, 8vw, 6.5rem) 0;
}

.section.alt {
  background: rgba(255, 250, 240, 0.72);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section.dark {
  background: var(--ink);
  color: white;
}

.section.dark h2,
.section.dark h3 {
  color: white;
}

.section.dark .eyebrow {
  color: #f0bd62;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(260px, 0.28fr);
  align-items: end;
  gap: 2rem;
  margin-bottom: 2rem;
}

.section-head p {
  margin: 0;
  color: var(--ink-soft);
}

.section.dark .section-head p {
  color: rgba(255, 255, 255, 0.72);
}

.notice-grid,
.triad-grid,
.school-grid,
.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.notice-card,
.school-card,
.resource-card,
.principle-card {
  background: rgba(255, 250, 240, 0.88);
  border: 1px solid var(--line);
  padding: 1.2rem;
}

.notice-card h3,
.school-card h3,
.resource-card h3,
.principle-card h3 {
  font-size: 1.45rem;
}

.notice-card p,
.school-card p,
.resource-card p,
.principle-card p {
  margin: 0.7rem 0 0;
}

.section.dark .principle-card h3,
.section.dark .principle-card p {
  color: var(--ink);
}

.section.dark .principle-card .text-link {
  color: var(--red-dark);
}

.text-link {
  display: inline-block;
  margin-top: 0.9rem;
  color: var(--red-dark);
  font-weight: 800;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(280px, 0.46fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.story-block {
  background: rgba(255, 250, 240, 0.84);
  border-left: 5px solid var(--red);
  padding: clamp(1.3rem, 3vw, 2rem);
}

.story-block p {
  margin: 1rem 0 0;
}

.image-frame {
  border: 1px solid var(--line);
  background: var(--paper-strong);
  padding: 0.55rem;
  box-shadow: var(--shadow);
}

.image-frame figcaption {
  margin-top: 0.55rem;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.feature-band {
  display: grid;
  grid-template-columns: 0.72fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}

.kanji-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.2rem;
}

.kanji-chip {
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 0.58rem 0.78rem;
  color: white;
  font-family: var(--font-serif);
  font-size: 1.1rem;
}

.event-list {
  display: grid;
  gap: 0.9rem;
}

.event-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(170px, 0.26fr);
  gap: 1rem;
  background: rgba(255, 250, 240, 0.9);
  border: 1px solid var(--line);
  padding: 1rem;
}

.event-row h3 {
  font-size: 1.35rem;
}

.event-row p {
  margin: 0.35rem 0 0;
}

.event-date {
  color: var(--red);
  font-weight: 800;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.2rem 0.55rem;
  background: var(--moss);
  color: white;
  font-size: 0.78rem;
  font-weight: 800;
}

.small-text {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.school-card dl {
  display: grid;
  gap: 0.55rem;
  margin: 1rem 0 0;
}

.school-card div {
  display: grid;
  gap: 0.05rem;
}

.school-card dt {
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.school-card dd {
  margin: 0;
}

.school-name {
  color: var(--ink-soft);
  font-weight: 800;
}

.leader-profile {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
  background: rgba(255, 250, 240, 0.88);
  border: 1px solid var(--line);
  padding: 1.2rem;
}

.leader-profile img {
  width: 100%;
  background: white;
  border: 1px solid var(--line);
}

.profile-meta {
  color: var(--red-dark);
  font-weight: 800;
}

.page-hero {
  padding: clamp(3rem, 7vw, 5.5rem) 0;
  background: rgba(255, 250, 240, 0.62);
  border-bottom: 1px solid var(--line);
}

.page-hero .section-inner {
  max-width: 980px;
}

.page-hero h1 {
  font-size: clamp(2.7rem, 6vw, 5.2rem);
}

.content-list {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}

.content-list article {
  background: rgba(255, 250, 240, 0.88);
  border: 1px solid var(--line);
  padding: 1.25rem;
}

.contact-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.contact-card {
  background: rgba(255, 250, 240, 0.9);
  border: 1px solid var(--line);
  padding: 1.25rem;
}

.admin-note {
  border: 2px dashed var(--gold);
  background: #fff8d8;
  padding: 1rem;
}

.site-footer {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.78);
  padding: 2.5rem 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: start;
}

.footer-inner a {
  color: white;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: flex-end;
}

@media (max-width: 940px) {
  .menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    display: none;
    background: var(--paper-strong);
    border-bottom: 1px solid var(--line);
    padding: 0.8rem 1rem 1rem;
  }

  .site-header-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.7rem;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
  }

  .menu-button {
    position: static;
    transform: none;
    z-index: 2;
    width: 100%;
  }

  .site-nav[data-open] {
    display: block;
  }

  .nav-list {
    display: grid;
    gap: 0.35rem;
    width: min(100%, var(--max-width));
    margin: 0 auto;
  }

  .hero-grid,
  .section-head,
  .split,
  .feature-band,
  .contact-panel,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .notice-grid,
  .triad-grid,
  .school-grid,
  .resource-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .topbar-inner {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
  }

  .brand img {
    width: 50px;
    height: 50px;
  }

  .brand {
    gap: 0.65rem;
    max-width: 100%;
  }

  .brand strong {
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .brand > span > span {
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  h1 {
    font-size: clamp(1.82rem, 8vw, 2.08rem);
    overflow-wrap: break-word;
  }

  .hero-copy,
  .hero-panel {
    max-width: 330px;
  }

  .lead,
  .hero-panel p,
  .notice-card p,
  .school-card dd,
  .event-row p {
    overflow-wrap: anywhere;
  }

  .hero {
    min-height: auto;
  }

  .notice-grid,
  .triad-grid,
  .school-grid,
  .resource-grid,
  .event-row,
  .leader-profile {
    grid-template-columns: 1fr;
  }

  .leader-profile img {
    max-width: 260px;
  }

  .footer-nav {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .hero-actions .button,
  .button-row .button {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .brand > span > span {
    display: none;
  }

  .brand strong {
    font-size: 0.95rem;
  }
}
