/* Osaka Castle Today — shared styles
   Palette taken from the castle itself: plaster walls, verdigris copper roofs,
   granite stone walls, gold ornaments. */

:root {
  --plaster: #f6f7f5;
  --paper: #ffffff;
  --ink: #1d2a2e;
  --granite: #5f686b;
  --rule: #d9ddda;
  --verdigris: #2f7468;
  --verdigris-soft: #e3efec;
  --gold: #a7822f;
  --quiet: #2f7468;
  --moderate: #7a8a3a;
  --busy: #a7822f;
  --very-busy: #9b3a2c;

  --serif: "Shippori Mincho B1", "Hiragino Mincho ProN", Georgia, serif;
  --sans: "Zen Kaku Gothic New", "Hiragino Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --measure: 40rem;
  --wide: 60rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: env(safe-area-inset-top, 0px);
}

body {
  margin: 0;
  background: var(--plaster);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

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

a { color: var(--verdigris); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }

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

.wrap {
  width: 100%;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.prose { max-width: var(--measure); }

/* Header */
.site-header {
  background: var(--ink);
  color: var(--plaster);
  padding-top: env(safe-area-inset-top, 0px);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}
.brand {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--plaster);
  text-decoration: none;
}
.brand:hover { color: #fff; }
.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; font-size: 0.95rem; }
.site-nav a { color: #c9d6d3; text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: #fff; text-decoration: underline; }

/* Typography */
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-family: var(--serif); font-weight: 700; font-size: clamp(1.9rem, 5vw, 2.8rem); }
h2 { font-family: var(--serif); font-weight: 700; font-size: 1.55rem; margin-top: 3rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.1rem; font-weight: 700; margin-top: 1.75rem; margin-bottom: 0.4rem; }
p { margin: 0 0 1rem; }
.lede { font-size: 1.2rem; color: var(--ink); }
.muted { color: var(--granite); font-size: 0.95rem; }

main { padding-bottom: 4rem; }
.page-head { padding: 2.5rem 0 1rem; }

/* Live board (the hero) */
.board {
  padding: 2.25rem 0 2rem;
  border-bottom: 1px solid var(--rule);
}
.board h1 { max-width: 18ch; }
.level {
  display: inline-block;
  margin-top: 1.25rem;
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(2.6rem, 9vw, 4.2rem);
  line-height: 1;
  color: var(--level-color, var(--ink));
}
.level-note { margin-top: 0.6rem; color: var(--granite); }

.waits {
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
  max-width: 34rem;
}
.waits li {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 1rem;
  padding: 0.8rem 0;
  border-top: 1px solid var(--rule);
}
.waits li:last-child { border-bottom: 1px solid var(--rule); }
.waits .what { font-weight: 700; }
.waits .what small { display: block; font-weight: 400; color: var(--granite); font-size: 0.9rem; }
.waits .mins {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 2rem;
  line-height: 1;
  white-space: nowrap;
}
.waits .mins span { font-family: var(--sans); font-size: 1rem; font-weight: 400; margin-left: 0.2rem; }
.waits li.stairs { background: var(--verdigris-soft); padding-left: 0.75rem; padding-right: 0.75rem; }
.waits li.stairs .mins { color: var(--verdigris); }

.stamp { margin-top: 1rem; font-size: 0.9rem; color: var(--granite); }

/* Factors */
.factors { margin: 0; padding: 0; list-style: none; max-width: var(--measure); }
.factors li { padding: 0.55rem 0; border-bottom: 1px solid var(--rule); }
.factors b { display: inline-block; min-width: 7.5rem; }

/* Hourly bars */
.hours-strip {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  max-width: var(--wide);
}
.hour {
  flex: 0 0 3.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.85rem;
}
.hour .bar-box { height: 6rem; width: 100%; display: flex; align-items: flex-end; }
.hour .bar { width: 100%; background: var(--level-color, var(--granite)); border-radius: 2px 2px 0 0; }
.hour .t { margin-top: 0.3rem; color: var(--granite); }
.hour .m { font-weight: 700; }

/* 7-day list */
.days { margin: 0; padding: 0; list-style: none; max-width: 34rem; }
.days li {
  display: grid;
  grid-template-columns: 7rem 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--rule);
}
.days .d { font-weight: 700; }
.days .lv { color: var(--level-color, var(--ink)); font-weight: 700; }
.days .why { color: var(--granite); font-size: 0.9rem; text-align: right; }

/* Tables */
.table-scroll { overflow-x: auto; max-width: var(--wide); }
table { border-collapse: collapse; width: 100%; min-width: 32rem; font-size: 0.98rem; }
th, td { text-align: left; vertical-align: top; padding: 0.7rem 0.75rem 0.7rem 0; border-bottom: 1px solid var(--rule); }
th { font-weight: 700; border-bottom: 2px solid var(--ink); }

/* Callout for the stairs tip and verdicts */
.note {
  max-width: var(--measure);
  border-left: 4px solid var(--verdigris);
  padding: 0.25rem 0 0.25rem 1rem;
  margin: 1.5rem 0;
}
.note p:last-child { margin-bottom: 0; }

/* Buttons */
.btn {
  display: inline-block;
  background: var(--verdigris);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  padding: 0.75rem 1.1rem;
  border-radius: 4px;
}
.btn:hover { background: var(--ink); color: #fff; }
.btn-line { background: transparent; color: var(--verdigris); border: 2px solid var(--verdigris); }
.btn-line:hover { background: var(--verdigris); color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1rem 0 1.5rem; }
.aff { font-size: 0.85rem; color: var(--granite); }

/* Figure placeholder for on-site photos */
.photo {
  max-width: var(--measure);
  aspect-ratio: 4 / 3;
  background: repeating-linear-gradient(135deg, #e7eae8 0 12px, #eef1ef 12px 24px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--granite);
  font-size: 0.9rem;
  text-align: center;
  padding: 1rem;
  margin: 1.5rem 0;
}

/* FAQ */
.faq h3 { margin-top: 1.5rem; }

/* Forms */
label { display: block; font-weight: 700; margin: 1rem 0 0.3rem; }
input, textarea {
  width: 100%;
  max-width: var(--measure);
  font: inherit;
  padding: 0.6rem 0.7rem;
  border: 1px solid #b9c0bd;
  border-radius: 4px;
  background: var(--paper);
}
button { font: inherit; cursor: pointer; border: 0; margin-top: 1.25rem; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 2rem 0 3rem;
  font-size: 0.92rem;
  color: var(--granite);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; margin-bottom: 1rem; }
.site-footer a { color: var(--granite); }

@media (prefers-reduced-motion: no-preference) {
  .hour .bar { transition: height 0.4s ease-out; }
}
