/* chary2 — biography / history pages (legacy HTML + modern shell) */

body.chary2-page {
  margin: 0 auto;
  padding: 0 1rem 3rem;
  max-width: 920px;
}

.chary2-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 -1rem 1.25rem;
  padding: 0.85rem 1rem 1rem;
  background: linear-gradient(
    180deg,
    rgba(15, 13, 11, 0.98) 0%,
    rgba(15, 13, 11, 0.92) 75%,
    rgba(15, 13, 11, 0) 100%
  );
}

.chary2-nav-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
}

.chary2-nav-home {
  display: inline-flex;
  padding: 0.45rem 0.85rem;
  font-family: var(--font-serif);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--carved-bright);
  text-decoration: none;
  background: linear-gradient(155deg, #3a3530 0%, #28241e 100%);
  border: 1px solid #14110e;
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 248, 230, 0.06);
}

.chary2-nav-home:hover {
  color: #f0e6d0;
}

.chary2-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chary2-nav-links a {
  display: inline-flex;
  padding: 0.45rem 0.85rem;
  font-family: var(--font-serif);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--carved);
  text-decoration: none;
  background: rgba(58, 53, 48, 0.45);
  border: 1px solid rgba(20, 17, 14, 0.8);
  border-radius: 999px;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.chary2-nav-links a:hover {
  color: var(--carved-bright);
  border-color: rgba(168, 148, 120, 0.35);
  background: rgba(58, 53, 48, 0.75);
}

.chary2-nav-links a[aria-current="page"] {
  color: var(--carved-bright);
  background: linear-gradient(155deg, #3a3530 0%, #2a261f 100%);
  border-color: rgba(168, 148, 120, 0.3);
}

/* hub page */
.chary2-hub-title {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  letter-spacing: 0.1em;
  color: var(--carved-bright);
}

.chary2-hub-lead {
  margin: 0 0 1.25rem;
  color: var(--carved-dim);
  font-size: 0.9rem;
  line-height: 1.6;
}

.chary2-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.chary2-hub-card {
  display: block;
  padding: 1rem 1.1rem;
  text-decoration: none;
  color: var(--carved);
  background: linear-gradient(165deg, #2c2822 0%, #1a1714 100%);
  border: 1px solid rgba(30, 26, 22, 0.95);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 248, 230, 0.05), 0 6px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.chary2-hub-card:hover {
  transform: translateY(-2px);
  color: var(--carved-bright);
  border-color: rgba(168, 148, 120, 0.35);
}

.chary2-hub-card strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.92rem;
  color: var(--carved-bright);
}

.chary2-hub-card span {
  font-size: 0.8rem;
  line-height: 1.5;
  opacity: 0.85;
}

.chary2-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.65rem;
}

.chary2-gallery img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid rgba(20, 17, 14, 0.9);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.chary2-back {
  display: inline-block;
  margin-top: 1.5rem;
  font-size: 0.85rem;
}

/* legacy content overrides */
body.chary2-page center {
  text-align: left;
}

body.chary2-page font {
  font-size: inherit !important;
  color: inherit !important;
}

body.chary2-page font[size="-2"],
body.chary2-page font[size="-1"],
body.chary2-page font[size="-3"],
body.chary2-page font[size="-4"] {
  font-size: 0.88rem;
}

body.chary2-page font[size="+2"] {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--carved-bright);
}

body.chary2-page table {
  width: 100% !important;
  max-width: 100%;
  margin: 1rem 0 1.5rem;
  border-collapse: separate;
  border-spacing: 0;
  background: linear-gradient(165deg, #2c2822 0%, #1a1714 55%, #151310 100%) !important;
  background-color: transparent !important;
  border: 1px solid rgba(30, 26, 22, 0.95) !important;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 248, 230, 0.04), 0 6px 22px rgba(0, 0, 0, 0.32);
}

body.chary2-page table[bgcolor],
body.chary2-page tr[bgcolor],
body.chary2-page td[bgcolor],
body.chary2-page th[bgcolor] {
  background-color: transparent !important;
  background-image: none !important;
}

body.chary2-page tr {
  background: transparent !important;
}

body.chary2-page td[background],
body.chary2-page th[background] {
  background-image: none !important;
  background-color: transparent !important;
}

body.chary2-page tr:first-child td {
  padding: 0.9rem 1rem;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  color: var(--carved-bright) !important;
  background: linear-gradient(180deg, rgba(58, 53, 48, 0.55) 0%, transparent 100%) !important;
  border-bottom: 1px solid rgba(168, 148, 120, 0.12) !important;
}

body.chary2-page td {
  padding: 0.75rem 1rem !important;
  vertical-align: top;
  line-height: 1.7;
  color: var(--carved) !important;
  background: transparent !important;
  border: none !important;
}

body.chary2-page tr + tr td {
  border-top: 1px solid rgba(168, 148, 120, 0.08) !important;
}

body.chary2-page td:first-child:not([colspan]) {
  width: 7.5rem;
  min-width: 5.5rem;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--carved-dim) !important;
  border-right: 1px solid rgba(168, 148, 120, 0.1) !important;
}

body.chary2-page td[colspan="2"]:first-child {
  width: auto;
  border-right: none !important;
}

body.chary2-page p {
  margin: 0.65rem 0;
  line-height: 1.75;
  color: var(--carved);
}

body.chary2-page a {
  color: #c4b08a;
  text-underline-offset: 2px;
}

body.chary2-page a:hover {
  color: #f0e6d0;
}

body.chary2-page img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

body.chary2-page img[src*="dream.cgi"] {
  display: none;
}

body.chary2-page .chary2-continue {
  display: inline-flex;
  margin: 1rem 0 0.5rem;
  padding: 0.55rem 1rem;
  font-family: var(--font-serif);
  font-size: 0.85rem;
  color: var(--carved-bright);
  text-decoration: none;
  background: linear-gradient(155deg, #3a3530 0%, #28241e 100%);
  border: 1px solid #14110e;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

body.chary2-page .chary2-continue:hover {
  color: #f0e6d0;
  border-color: rgba(168, 148, 120, 0.35);
}

/* timeline pages (chary2a / chary2b) — match つぶやき tone */
body.chary2-timeline table {
  background: linear-gradient(165deg, #2c2822 0%, #1a1714 100%) !important;
}

body.chary2-timeline tr:not(:first-child) td {
  padding: 1rem 1.15rem !important;
  background: transparent !important;
}

body.chary2-timeline tr:not(:first-child) + tr:not(:first-child) td {
  border-top: 1px solid rgba(168, 148, 120, 0.1) !important;
}

body.chary2-timeline td:first-child:not([colspan]) {
  color: var(--carved-dim) !important;
  background: rgba(0, 0, 0, 0.12) !important;
  border-right: 1px solid rgba(168, 148, 120, 0.08) !important;
}

body.chary2-timeline td font[color="#000000"],
body.chary2-timeline td font[color="#000033"],
body.chary2-timeline td font[color] {
  color: inherit !important;
}

body.chary2-timeline strong {
  color: var(--carved-bright);
  font-weight: 600;
}

@media (max-width: 640px) {
  body.chary2-page td:first-child:not([colspan]) {
    display: block;
    width: 100%;
    border-right: none !important;
    padding-bottom: 0.25rem !important;
    border-bottom: none !important;
  }

  body.chary2-page td:not(:first-child),
  body.chary2-page tr td:last-child {
    display: block;
    width: 100%;
  }

  body.chary2-timeline td:first-child:not([colspan]) {
    background: transparent !important;
    border-right: none !important;
    padding-bottom: 0.35rem !important;
  }

  .chary2-nav-links {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    scrollbar-width: thin;
  }

  .chary2-nav-links a {
    flex-shrink: 0;
  }
}
