/* UWJSA website — styles. Colours: white background, black text, #8C0102 for accents only. */

:root {
  --accent: #8c0102;
  --text: #111;
  --muted: #5f5f5f;
  --line: #dcdcdc;
  --line-strong: #111;
  --bg: #fff;
  --soft: #f6f6f6;
  --serif: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --sans: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  --header-h: 72px;
  --gutter: 24px;
  --max: 1080px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
html.menu-open { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.8 var(--sans);
  overflow-wrap: anywhere;
}
:lang(ja) { line-break: strict; word-break: auto-phrase; }
html[lang="ja"] body { letter-spacing: 0.03em; line-height: 1.9; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 600; line-height: 1.4; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
main:focus { outline: none; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.container { width: 100%; max-width: calc(var(--max) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.container-narrow { max-width: calc(760px + var(--gutter) * 2); }
.section { padding: 88px 0; }
.section + .section { padding-top: 0; }
.noscript, .load-error { padding: 48px var(--gutter); text-align: center; }

/* ---------- TBD chip + photo slots ---------- */
.tbd {
  display: inline-block; padding: 0.1em 0.8em; border: 1px dashed #b5b5b5; border-radius: 999px;
  background: #fafafa; color: var(--muted); font: 500 0.8125rem/1.6 var(--sans); letter-spacing: 0.06em; vertical-align: middle;
}
.photo { position: relative; background: #fff; border: 1px solid var(--line); overflow: hidden; }
.photo img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Section headings: centered, a line on each side ---------- */
.section-heading { margin-bottom: 48px; text-align: center; }
.section-label {
  margin-bottom: 10px; color: var(--accent); font: 500 0.8125rem/1.4 var(--sans); letter-spacing: 0.2em;
}
.section-title { display: flex; align-items: center; gap: 28px; font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); letter-spacing: 0.08em; }
.section-title::before, .section-title::after { content: ""; flex: 1 1 0; height: 1px; background: var(--line-strong); }
.section-title > span { flex: 0 1 auto; max-width: 80%; }
.sub-title { margin-bottom: 20px; font-size: 1.25rem; letter-spacing: 0.06em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em; min-height: 48px; padding: 0 32px;
  border: 1px solid var(--accent); border-radius: 999px; cursor: pointer; font-weight: 500; letter-spacing: 0.08em;
  text-decoration: none; transition: background-color 0.2s, color 0.2s;
}
.btn-outline { background: #fff; color: var(--accent); }
.btn-outline:hover { background: var(--accent); color: #fff; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #6e0001; }

/* ---------- Header ---------- */
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100; padding: 8px 16px; background: var(--accent); color: #fff;
}
.skip-link:focus { top: 12px; }
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h); background: #fff;
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 100%; max-width: calc(var(--max) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; text-decoration: none; min-width: 0; }
.brand-logo { width: auto; height: 44px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.brand-name { font: 700 1.5rem/1.1 var(--serif); letter-spacing: 0.1em; }
.brand-sub { margin-top: 4px; color: var(--muted); font-size: 0.6875rem; letter-spacing: 0.06em; }
.nav-list { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.nav-link { position: relative; display: block; padding: 8px 12px; font-size: 0.9375rem; font-weight: 500; text-decoration: none; white-space: nowrap; }
.nav-link::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; background: var(--accent);
  transform: scaleX(0); transition: transform 0.25s;
}
.nav-link:hover::after, .nav-link[aria-current="page"]::after { transform: scaleX(1); }
.lang-switch { display: flex; align-items: center; flex: none; }
.lang-btn { min-width: 44px; min-height: 44px; padding: 6px 8px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 0.875rem; }
.lang-btn + .lang-btn { border-left: 1px solid var(--line); }
.lang-btn[aria-pressed="true"] { color: var(--accent); font-weight: 700; }
.menu-toggle { display: none; order: 1; flex: none; width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; }
.menu-icon { position: relative; display: block; width: 26px; height: 18px; margin: 0 auto; }
.menu-icon span { position: absolute; left: 0; width: 100%; height: 2px; background: var(--text); transition: transform 0.25s, opacity 0.2s, top 0.25s; }
.menu-icon span:nth-child(1) { top: 0; }
.menu-icon span:nth-child(2) { top: 8px; }
.menu-icon span:nth-child(3) { top: 16px; }
.is-menu-open .menu-icon span:nth-child(1) { top: 8px; transform: rotate(45deg); }
.is-menu-open .menu-icon span:nth-child(2) { opacity: 0; }
.is-menu-open .menu-icon span:nth-child(3) { top: 8px; transform: rotate(-45deg); }

@media (max-width: 1023px) {
  .menu-toggle { display: block; }
  .site-nav {
    position: fixed; inset: var(--header-h) 0 0 0; z-index: 40; display: none; padding: 40px var(--gutter);
    background: #fff; border-top: 1px solid var(--line); overflow-y: auto;
  }
  .is-menu-open .site-nav { display: grid; align-content: safe center; }
  .nav-list { flex-direction: column; align-items: center; gap: 8px; }
  .nav-link { padding: 14px 16px; font-family: var(--serif); font-size: 1.25rem; letter-spacing: 0.08em; }
}
@media (max-width: 640px) {
  :root { --header-h: 60px; --gutter: 16px; }
  .header-inner { gap: 8px; }
  .brand-name { font-size: 1.25rem; }
  .brand-sub { display: none; }
  .brand-logo { height: 36px; }
  .section { padding: 64px 0; }
  .section-heading { margin-bottom: 36px; }
  .section-title { gap: 16px; }
}

/* ---------- Hero: solid black until a photo is set ---------- */
.hero {
  position: relative; display: grid; place-items: center; min-height: max(420px, calc(100svh - var(--header-h)));
  background: #000; color: #fff; text-align: center; overflow: hidden;
}
.hero-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero.has-image::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); }
.hero-content { position: relative; z-index: 1; padding: 48px var(--gutter); }
.hero-title { font-size: clamp(2.25rem, 1.2rem + 6vw, 5.5rem); font-weight: 700; letter-spacing: 0.18em; line-height: 1.25; text-indent: 0.18em; }
.hero-tagline { margin-top: 20px; font-size: clamp(0.9375rem, 0.85rem + 0.4vw, 1.125rem); letter-spacing: 0.12em; text-wrap: balance; }
.hero .tbd { border-color: rgba(255, 255, 255, 0.6); background: transparent; color: rgba(255, 255, 255, 0.85); font-size: 0.875rem; }

/* ---------- News (rows expand on click) ---------- */
.news-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.news-item { border-bottom: 1px solid var(--line); }
.news-heading { font: inherit; }
.news-row {
  display: grid; grid-template-columns: 7.5em 8.5em 1fr 20px; align-items: center; gap: 16px; width: 100%;
  padding: 22px 8px; border: 0; background: none; cursor: pointer; text-align: left; transition: background-color 0.2s;
}
.news-row:hover .news-title { text-decoration: underline; text-underline-offset: 4px; }
.news-date { color: var(--muted); font-size: 0.875rem; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.badge {
  display: inline-block; min-width: 7em; padding: 0.15em 0.9em; border: 1px solid var(--accent); border-radius: 999px;
  color: var(--accent); font-size: 0.8125rem; line-height: 1.6; text-align: center; white-space: nowrap;
}
.badge-notice { border-color: var(--text); color: var(--text); }
.badge-recruiting { background: var(--accent); color: #fff; }
.news-title { font-family: var(--serif); font-weight: 500; }
.news-icon { position: relative; width: 14px; height: 14px; justify-self: end; }
.news-icon::before, .news-icon::after { content: ""; position: absolute; top: 6px; left: 0; width: 14px; height: 2px; background: var(--text); transition: transform 0.25s; }
.news-icon::after { transform: rotate(90deg); }
.is-open .news-icon::after { transform: rotate(0deg); }
.news-panel { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows 0.3s, visibility 0.3s; }
.is-open .news-panel { grid-template-rows: 1fr; visibility: visible; }
.news-panel-inner { overflow: hidden; }
.news-body { display: grid; gap: 1em; margin: 0 8px 24px calc(16em + 40px); padding: 20px 24px; background: var(--soft); }
.news-body a { color: var(--accent); }
.news-more { margin-top: 40px; text-align: center; }
.news-empty { padding: 32px 0; color: var(--muted); text-align: center; }

@media (max-width: 900px) {
  .news-row { grid-template-columns: auto 1fr 20px; gap: 8px 12px; padding: 18px 4px; }
  .news-title { grid-column: 1 / 3; grid-row: 2; }
  .news-icon { grid-column: 3; grid-row: 1 / 3; }
  .news-category { justify-self: start; }
  .news-body { margin: 0 0 20px; padding: 16px; }
}

/* ---------- Cards linking to the inner pages ---------- */
.page-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; margin: 0; padding: 0; list-style: none; }
.page-card {
  position: relative; display: block; height: 100%; border: 1px solid var(--line-strong); background: #fff;
  box-shadow: 6px 6px 0 var(--line); text-decoration: none; transition: transform 0.2s, box-shadow 0.2s;
}
.page-card:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--accent); }
.page-card-photo { aspect-ratio: 16 / 9; border: 0; border-bottom: 1px solid var(--line); }
.page-card-body { display: flex; flex-direction: column; gap: 6px; padding: 24px 64px 28px 28px; }
.page-card-label { color: var(--accent); font-size: 0.75rem; letter-spacing: 0.2em; }
.page-card-title { font: 600 1.375rem/1.4 var(--serif); letter-spacing: 0.06em; }
.page-card-text { color: var(--muted); font-size: 0.9375rem; }
.page-card-arrow { position: absolute; right: 28px; bottom: 34px; width: 22px; height: 1px; background: var(--text); transition: width 0.2s; }
.page-card-arrow::after { content: ""; position: absolute; right: 0; top: 0; width: 9px; height: 1px; background: var(--text); transform: rotate(35deg); transform-origin: right; }
.page-card:hover .page-card-arrow { width: 30px; }
@media (max-width: 640px) {
  .page-cards { grid-template-columns: 1fr; gap: 24px; }
  .page-card-photo { aspect-ratio: 3 / 1; }
}

/* ---------- Schedule ---------- */
.calendar { height: 620px; border: 1px solid var(--line); background: #fff; }
.calendar iframe { display: block; width: 100%; height: 100%; border: 0; }
.calendar.is-empty { display: grid; place-items: center; height: 320px; }
.regular { margin-top: 56px; }
.table { width: 100%; border-collapse: collapse; border-top: 2px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.table th, .table td { padding: 16px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table thead th { font-size: 0.875rem; font-weight: 700; letter-spacing: 0.08em; }
.regular-empty { color: var(--muted); }
@media (min-width: 641px) {
  .table th, .table td:nth-child(-n+2) { white-space: nowrap; }
}
@media (max-width: 640px) {
  .calendar { height: 520px; }
  .calendar.is-empty { height: 220px; }
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table tr { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .table td { display: grid; grid-template-columns: 6.5em 1fr; gap: 12px; padding: 6px 4px; border: 0; }
  .table td::before { content: attr(data-label); content: attr(data-label) / ""; color: var(--muted); font-size: 0.875rem; }
  .table td > * { justify-self: start; }
}

/* ---------- Contact form ---------- */
.contact-intro { margin-bottom: 40px; text-align: center; text-wrap: balance; }
.contact-form { display: grid; gap: 28px; }
.field { margin: 0; padding: 0; border: 0; min-width: 0; }
.field-label { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding: 0; font-weight: 700; }
.req, .opt { padding: 0.05em 0.6em; border-radius: 3px; font-size: 0.75rem; font-weight: 500; line-height: 1.6; }
.req { background: var(--accent); color: #fff; }
.opt { background: #eee; color: var(--muted); }
.field :where(input:not([type="radio"]):not([type="checkbox"]), textarea, select) {
  display: block; width: 100%; padding: 14px 16px; border: 2px solid #8f8f8f; border-radius: 10px; background: #fff;
  font-size: 1rem; transition: border-color 0.2s;
}
.field textarea { min-height: 200px; resize: vertical; line-height: 1.7; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--text); outline: none; }
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible { box-shadow: 0 0 0 3px rgba(140, 1, 2, 0.15); }
.field ::placeholder { color: #767676; }
.has-error input:not([type="radio"]):not([type="checkbox"]), .has-error textarea, .has-error select { border-color: var(--accent); }
.choices { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.choice { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.choice input { width: 18px; height: 18px; accent-color: var(--accent); }
.field-meta { display: flex; justify-content: space-between; gap: 16px; margin-top: 8px; color: var(--muted); font-size: 0.8125rem; }
.field-counter { margin-left: auto; font-variant-numeric: tabular-nums; }
.field-counter.is-over { color: var(--accent); font-weight: 700; }
.field-error { margin-top: 8px; color: var(--accent); font-size: 0.875rem; font-weight: 500; }
.form-note { padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--soft); font-size: 0.875rem; }
.form-actions { text-align: center; }
.btn-submit { width: 100%; min-height: 60px; font-size: 1.0625rem; }
.form-status { min-height: 1.5em; text-align: center; font-weight: 500; }
.form-status.is-invalid, .form-status.is-error { color: var(--accent); }
.form-status.is-preview, .form-status.is-success { padding: 12px 16px; background: var(--soft); }
.contact-others { margin-top: 72px; padding-top: 48px; border-top: 1px solid var(--line); }
.contact-others .sub-title { text-align: center; }
.contact-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 32px; margin: 0; }
.contact-item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.contact-item dt { color: var(--muted); font-size: 0.8125rem; letter-spacing: 0.08em; }
.contact-item dd { margin: 4px 0 0; font-weight: 500; }
.contact-item a { color: var(--accent); text-underline-offset: 3px; }
@media (max-width: 640px) {
  .contact-list { grid-template-columns: 1fr; gap: 0; }
}

/* ---------- Inner pages ---------- */
.page-head { padding: 40px 0 8px; text-align: center; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 48px; padding: 0; list-style: none; font-size: 0.8125rem; text-align: left; }
.breadcrumb li + li::before { content: "/"; content: "/" / ""; margin-right: 6px; color: var(--muted); }
.breadcrumb a { color: var(--muted); }
.page-head .section-heading { margin-bottom: 0; }
.page-head .section-title { font-size: clamp(1.875rem, 1.4rem + 2vw, 2.75rem); }

.about-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: start; }
.lead { margin-bottom: 24px; font: 600 clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem)/1.7 var(--serif); }
.about-body { display: grid; gap: 1em; }
.about-photo { aspect-ratio: 4 / 3; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 48px; margin: 0; border-top: 1px solid var(--line-strong); }
.fact { display: grid; grid-template-columns: 9em 1fr; gap: 16px; padding: 20px 4px; border-bottom: 1px solid var(--line); }
.fact dt { font-weight: 700; }
.fact dd { margin: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 32px; margin: 0; padding: 0; list-style: none; }
.card-photo { aspect-ratio: 4 / 3; }
.card-body { padding-top: 20px; }
.card-title { margin-bottom: 10px; font-size: 1.25rem; letter-spacing: 0.06em; }
.card-text { color: #333; font-size: 0.9375rem; }

.about-intro, .exec-section { padding-top: 56px; }
.exec-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px 32px; margin: 0; padding: 0; list-style: none; }
.exec-photo { aspect-ratio: 1 / 1; }
.exec-body { padding-top: 16px; }
.exec-role { display: block; margin-bottom: 4px; color: var(--accent); font: 700 0.8125rem/1.8 var(--sans); letter-spacing: 0.12em; }
.exec-name { margin: 0 0 6px; padding-bottom: 8px; border-bottom: 1px solid var(--line-strong); font-size: 1.375rem; letter-spacing: 0.06em; }
.exec-program { color: var(--muted); font-size: 0.875rem; }

.back-home { padding-top: 8px; padding-bottom: 88px; text-align: center; }
.back-link { display: inline-flex; align-items: center; gap: 12px; padding: 8px 4px; font-weight: 500; text-decoration: none; border-bottom: 1px solid var(--text); }
.back-arrow { position: relative; width: 20px; height: 1px; background: currentColor; }
.back-arrow::before, .back-arrow::after { content: ""; position: absolute; left: 0; top: 0; width: 8px; height: 1px; background: currentColor; transform-origin: left; }
.back-arrow::before { transform: rotate(-40deg); }
.back-arrow::after { transform: rotate(40deg); }
.back-link:hover { color: var(--accent); border-color: var(--accent); }

@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .facts { grid-template-columns: 1fr; }
  .exec-grid { grid-template-columns: repeat(2, 1fr); gap: 40px 20px; }
}
@media (max-width: 640px) {
  .breadcrumb ol { margin-bottom: 32px; }
  .fact { grid-template-columns: 7.5em 1fr; }
  .exec-name { font-size: 1.125rem; }
}

/* ---------- Footer: a red bar above, then name, note, links, copyright ---------- */
.site-footer { border-top: 6px solid var(--accent); background: #fff; }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 24px 48px; padding-top: 48px; padding-bottom: 32px; }
.footer-name { font: 600 1.125rem/1.5 var(--serif); letter-spacing: 0.06em; }
.footer-note { margin-top: 8px; max-width: 34em; color: var(--muted); font-size: 0.8125rem; }
.footer-nav ul { display: flex; flex-wrap: wrap; gap: 4px 24px; margin: 0; padding: 0; list-style: none; }
.footer-link { font-size: 0.875rem; text-decoration: none; }
.footer-link:hover { color: var(--accent); text-decoration: underline; }
.copyright { grid-column: 1 / -1; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.75rem; letter-spacing: 0.04em; }
@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .footer-nav ul { display: grid; grid-template-columns: 1fr 1fr; }
  .footer-link { display: inline-block; padding: 10px 0; }
}

@media (forced-colors: active) {
  .menu-icon span, .news-icon::before, .news-icon::after, .nav-link::after, .section-title::before, .section-title::after,
  .page-card-arrow, .page-card-arrow::after, .back-arrow, .back-arrow::before, .back-arrow::after { background: CanvasText; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
