:root{
  /* theme tokens */
  --sidebar-w: 230px;
  --divider-w: 1px;
  --orange: #ff9900;
  --text: #333;
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }

body{
  /* base document styling */
  margin: 0;
  color: var(--text);
  background: #ffffff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  line-height: 1.55;
}

a{ color: var(--orange); text-decoration: underline; }
a:hover{ text-decoration-thickness: 2px; }

/* page frame: header + layout */
.frame{
  width: 800px;
  max-width: 100%;
  margin: 0;
  background: #fff;
  border-radius: 0;
  box-shadow: none;
  overflow: clip;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* header banner */
.header-link{
  display: block;
  line-height: 0;
}
.header-link img{
  display: block;
  width: 100%;
  height: auto;
}

/* layout grid: sidebar | divider | main */
.layout{
  display: grid;
  grid-template-columns: var(--sidebar-w) var(--divider-w) minmax(0, 569px);
  flex: 1 1 auto;
}

@media (max-width: 820px){
  /* stack on small screens */
  .layout{ grid-template-columns: 1fr; }
  .divider{ display: none; }
}

/* mobile off-canvas menu */
.mobile-menu-toggle{
  display: none;
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  left: calc(env(safe-area-inset-left, 0px) + 10px);
  z-index: 1005;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,.20);
  border-radius: 10px;
  background: rgba(240,240,240,.65);
  color: #111;
  font: inherit;
  line-height: 1;
  box-shadow: 0 8px 22px rgba(0,0,0,.18);
  cursor: pointer;
}

.mobile-menu-toggle:focus-visible{
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.mobile-menu-scrim{
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}

@media (max-width: 820px){
  body{ overflow-x: hidden; }

  .mobile-menu-toggle{ display: inline-flex; align-items: center; gap: 10px; }

  .sidebar{
    position: fixed;
    top: 0;
    left: 0;
    max-width: 90vw;
    height: 100dvh;
    max-height: 100vh;
    overflow-y: auto;
    z-index: 1002;
    transform: translateX(-105%);
    transition: transform .25s ease;
    box-shadow: 8px 0 24px rgba(0,0,0,.22);
    -webkit-overflow-scrolling: touch;
  }

  .sidebar-inner{ padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); }

  body.menu-open .sidebar{ transform: translateX(0); }
  body.menu-open .mobile-menu-scrim{ opacity: 1; pointer-events: auto; }
  body.menu-open{ overflow: hidden; }
}

/* sidebar */
.sidebar{
  width: 230px;
  background: url("../images/bg.gif") repeat;
  padding: 0;
}

.sidebar-inner{
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0;
}

/* decorative image above the menu */
.menu-top{
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
}

/* menu buttons: single-image rollover driven by js */
.menu{
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0;
}

.menu-btn{
  display: block;
  width: 230px;
  height: 50px;
  line-height: 0;
  margin: 0;
  padding: 0;
}

.menu-btn img{
  display: block;
  width: 230px;
  height: 50px;
  border: 0;
}

.menu-btn.is-disabled{
  pointer-events: none;
  cursor: default;
  opacity: 1;
}

/* sidebar info blocks */
.sidebar-box{
  padding: 10px;
  font-size: 12px;
  line-height: 1.35;
  color: #333;
}

.sidebar-bottom{
  padding: 10px;
  margin-top: auto;
}

/* divider column */
.divider{
  background: var(--orange);
  position: relative;
}

.divider::before{
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 50px;
  background: url("../images/line.gif") no-repeat top left;
}

/* main content area */
.main{
  padding: 0;
  background: #fff;
}

/* stacked hero images (no gaps) */
.hero-stack{
  display: grid;
  gap: 0;
}
.hero-stack img{
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
}

/* images inside posts should scale but not be forced full-width */
.post img{
  display: block;
  max-width: 100%;
  height: auto;
}

/* main-area background image used by content pages */
.main-back{
  background: #ffffff url("../images/back.jpg") no-repeat top center;
}

/* On mobile, hide the back.jpg background on the homepage only */
@media (max-width: 820px){
  body.home .main-back{
    background-image: none;
    background-color: #ffffff;
  }
}

/* content */
.section-title{
  margin: 14px 18px 8px 18px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .02em;
}

.news{
  list-style: none;
  padding: 0 18px 18px 18px;
  margin: 0;
  display: grid;
  gap: 12px;
}

.news-item{
  padding: 12px;
  border: 1px solid rgba(0,0,0,.10);
  border-radius: 12px;
  background: #fff;
}

.news-item img{
  display: block;
  max-width: 100%;
  height: auto;
}

.news-date{
  font-weight: 800;
  margin-bottom: 4px;
}

.content-pad{
  padding: 15px 14px 30px 14px;
}

.page-title{
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 0 15px 0;
}

.post{
  border: 1px solid #999;
  background: #fff;
  padding: 12px;
  margin: 0 0 16px 0;
  scroll-margin-top: 12px;
}

.post h2{
  margin: 0 0 8px 0;
  font-size: 16px;
  line-height: 1.25;
  color: #ff3300;
}

.post .meta{
  margin: 0 0 10px 0;
  font-size: 12px;
  color: #666;
}

.post p{
  margin: 0 0 10px 0;
  font-size: 14px;
  color: #333;
}

.post p:last-child{
  margin-bottom: 0;
}

.post .allowed-news-image{
  display: block;
  max-width: 100%;
  height: auto;
  margin: 10px auto 0 auto;
}

/* accessibility helpers */
.skip-link{
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 10px 12px;
  background: #fff;
  color: #111;
  border: 2px solid #111;
  border-radius: 10px;
  transform: translateY(-200%);
  transition: transform .15s ease;
  z-index: 1100;
}
.skip-link:focus{
  transform: translateY(0);
}

.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;
}

a:focus-visible,
button:focus-visible{
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.menu-btn:focus-visible{
  outline: 2px solid var(--orange);
  outline-offset: 4px;
  border-radius: 8px;
}

/* books/cd media rows */
.media-row{
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.media-slot{
  flex: 0 0 160px;
}

.media-slot img{
  width: 160px;
  height: 160px;
  object-fit: cover;
  border: 1px solid rgba(0,0,0,.15);
  border-radius: 10px;
}

.media-text{
  flex: 1 1 auto;
  min-width: 0;
}

@media (max-width: 520px){
  .media-row{ flex-direction: column; }
  .media-slot{ flex-basis: auto; }
}

/* characters */
.chara-wrap{
  display: grid;
  gap: 16px;
}

.chara-card{
  border: 1px solid #999;
  background: #fff;
  padding: 12px;
  margin: 0;
}

.chara-row{
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.chara-img{
  width: 160px;
  height: 160px;
  object-fit: cover;
  border: 1px solid rgba(0,0,0,.15);
  border-radius: 10px;
}

.chara-desc{
  margin: 0 0 10px 0;
  font-size: 14px;
  color: #333;
}

.chara-desc:last-child{ margin-bottom: 0; }

@media (max-width: 520px){
  .chara-row{ flex-direction: column; }
  .chara-img{ width: 100%; height: auto; }
}

/* quotes */

.quotes-list{
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.quote-card{
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.quote-card figure{ margin: 0; }

.quote-card blockquote{
  margin: 0;
  padding-left: 12px;
  border-left: 4px solid var(--orange);
}

.quote-card p{
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
}

.quote-card figcaption{
  margin-top: 8px;
  font-size: 12px;
  color: #666;
}

/* permalinks + deep links */

.permalink{
  font-size: 12px;
  text-decoration: none;
}
.permalink:hover{ text-decoration: underline; }

/* Currently disabled - highlight targeted posts
.post:target{
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}
/*
