/* ==========================================================================
   安曇野絵本館 — 記録サイト
   Theme: 石積みの文庫 (Washi-Red Museum Archive)
   Deep washi-red lattice backdrop / cream paper panels / charcoal nav /
   gold accents / Shippori Mincho headings + Zen Kaku Gothic New body
   ========================================================================== */

:root {
  /* washi red */
  --red-900: #4a1a14;
  --red-800: #5d211b;
  --red-700: #702a21;
  --red-600: #8a322a;
  --red-500: #9c3a2e;
  --red-100: #f3e2dc;

  /* paper */
  --paper: #fbf6ec;
  --paper-alt: #f4ecdb;
  --paper-edge: #e7dcc4;

  /* ink */
  --ink: #332e29;
  --ink-light: #6b6258;
  --ink-faint: #978c7e;

  /* gold */
  --gold: #b08d4f;
  --gold-dark: #8f7038;
  --gold-pale: #e6d3ab;

  /* charcoal */
  --char: #2a2522;
  --char-light: #3b3530;

  --font-display: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --font-body: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;

  --radius: 4px;
  --shadow: 0 2px 6px rgba(42, 26, 18, 0.28), 0 10px 28px rgba(42, 26, 18, 0.22);
  --shadow-soft: 0 1px 3px rgba(42, 26, 18, 0.18);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.95;
  color: var(--ink);
  letter-spacing: 0.02em;
  background-color: var(--red-700);
  /* subtle lattice over deep washi red — evokes the original red-wallpaper backdrop */
  background-image:
    repeating-linear-gradient(45deg, rgba(255, 240, 220, 0.045) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(-45deg, rgba(255, 240, 220, 0.045) 0 1px, transparent 1px 22px),
    radial-gradient(ellipse at 50% 0%, rgba(255, 214, 170, 0.10), transparent 60%),
    linear-gradient(180deg, var(--red-700), var(--red-800) 70%, var(--red-900));
  background-attachment: fixed;
}

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

a { color: var(--red-500); text-decoration: none; }
a:hover { color: var(--red-600); text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 4px; }

::selection { background: var(--gold-pale); color: var(--red-800); }

/* ---------- frame ---------- */
.frame {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- header ---------- */
.site-header {
  padding-top: 34px;
}

.masthead {
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--shadow);
  text-align: center;
  padding: 34px 24px 26px;
  position: relative;
}

.masthead::after {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 18%, var(--gold) 82%, transparent);
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.85rem, 4.6vw, 2.7rem);
  letter-spacing: 0.22em;
  color: var(--red-800);
  margin: 0;
  line-height: 1.3;
}

.brand a { color: inherit; }
.brand a:hover { text-decoration: none; color: var(--red-600); }

.brand-tagline {
  margin: 10px 0 0;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  color: var(--ink-light);
}

.brand-tagline .sep { color: var(--gold); margin: 0 0.5em; }

/* ---------- nav ---------- */
.site-nav {
  background: var(--char);
  box-shadow: var(--shadow);
  position: relative;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--gold);
  color: var(--gold-pale);
  font-family: var(--font-body);
  font-size: 0.9rem;
  letter-spacing: 0.2em;
  padding: 9px 18px;
  margin: 10px;
  border-radius: var(--radius);
  cursor: pointer;
}

.nav-list {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
}

.nav-list a {
  display: block;
  padding: 15px 30px;
  color: #efe6d5;
  font-size: 0.95rem;
  letter-spacing: 0.24em;
  border-bottom: 3px solid transparent;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.nav-list a:hover {
  color: #fff;
  text-decoration: none;
  border-bottom-color: var(--gold);
  background: var(--char-light);
}

.nav-list a.current {
  color: var(--gold-pale);
  border-bottom-color: var(--gold);
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  margin: 0;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero img { width: 100%; object-fit: cover; max-height: 520px; }

.hero-caption-v {
  position: absolute;
  top: 34px;
  right: 34px;
  writing-mode: vertical-rl;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.15rem, 2.6vw, 1.7rem);
  letter-spacing: 0.34em;
  color: #fdf8ee;
  background: rgba(74, 26, 20, 0.72);
  border: 1px solid rgba(230, 211, 171, 0.65);
  padding: 22px 12px;
  line-height: 1.9;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.hero-credit {
  position: absolute;
  left: 0;
  bottom: 0;
  margin: 0;
  padding: 6px 14px;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: rgba(253, 248, 238, 0.85);
  background: rgba(42, 37, 34, 0.55);
}

/* ---------- layout grid ---------- */
.page-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 30px;
  padding: 30px 0 44px;
  align-items: start;
}

/* ---------- panels ---------- */
.panel {
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.content-panel {
  padding: clamp(26px, 5vw, 52px);
  border-top: 3px double var(--gold);
}

/* ---------- article typography ---------- */
.content-panel h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 3.4vw, 2.05rem);
  line-height: 1.55;
  letter-spacing: 0.08em;
  color: var(--red-800);
  margin: 0.2em 0 0.9em;
}

.content-panel h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.2rem, 2.6vw, 1.45rem);
  line-height: 1.6;
  letter-spacing: 0.06em;
  color: var(--red-700);
  margin: 2.4em 0 0.8em;
  padding-left: 16px;
  border-left: 4px solid var(--gold);
}

.content-panel h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: 0.05em;
  color: var(--ink);
  margin: 2em 0 0.6em;
}

.content-panel h3 a { color: var(--red-700); }

.content-panel p { margin: 0 0 1.35em; }

.content-panel ul {
  list-style: none;
  padding-left: 0.4em;
  margin: 0 0 1.5em;
}

.content-panel ul li {
  position: relative;
  padding-left: 1.5em;
  margin-bottom: 0.65em;
}

.content-panel ul li::before {
  content: "";
  position: absolute;
  left: 0.15em;
  top: 0.75em;
  width: 8px;
  height: 8px;
  background: var(--gold);
  transform: rotate(45deg);
}

.content-panel a { border-bottom: 1px solid var(--gold-pale); }
.content-panel a:hover { text-decoration: none; border-bottom-color: var(--gold); }

/* ---------- post meta ---------- */
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.date-badge {
  display: inline-block;
  background: var(--red-600);
  color: #fdf6ea;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  padding: 5px 14px;
  border-radius: 2px;
  box-shadow: var(--shadow-soft);
}

.cat-pill {
  display: inline-block;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--gold-dark);
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: 3px 14px;
  background: rgba(176, 141, 79, 0.07);
}

.cat-pill:hover { background: var(--gold-pale); color: var(--red-800); text-decoration: none; }

/* ---------- figures ---------- */
figure.photo {
  margin: 2.2em 0;
}

figure.photo img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--paper-edge);
  box-shadow: var(--shadow-soft);
}

figure.photo figcaption {
  margin-top: 0.7em;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  text-align: center;
}

figure.photo figcaption::before { content: "— "; color: var(--gold); }
figure.photo figcaption::after { content: " —"; color: var(--gold); }

/* ---------- archive note ribbon ---------- */
.archive-note {
  margin: 2.4em 0 0;
  padding: 16px 20px;
  font-size: 0.86rem;
  line-height: 1.8;
  color: var(--ink-light);
  background: var(--paper-alt);
  border: 1px solid var(--paper-edge);
  border-left: 4px solid var(--red-500);
  border-radius: var(--radius);
}

.archive-note strong { color: var(--red-700); }

/* ---------- listing cards (category / archive pages) ---------- */
.listing { margin-top: 1.6em; }

.listing-item {
  padding: 22px 0;
  border-top: 1px dashed var(--gold-pale);
}

.listing-item:last-child { border-bottom: 1px dashed var(--gold-pale); }

.listing-item h2 {
  margin: 0 0 0.45em;
  padding-left: 0;
  border-left: none;
  font-size: 1.18rem;
}

.listing-item h2 a { border-bottom: none; }

.listing-item .listing-date {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--gold-dark);
  margin-bottom: 0.4em;
  display: block;
}

.listing-item p { margin: 0; font-size: 0.93rem; color: var(--ink-light); }

.listing-more {
  font-size: 0.88rem;
  letter-spacing: 0.1em;
}

/* ---------- sidebar ---------- */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.widget { padding: 26px 26px 28px; }

.widget-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: 0.14em;
  color: var(--red-800);
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--gold-pale);
  position: relative;
}

.widget-title::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  background: var(--gold);
  transform: rotate(45deg);
  margin-right: 10px;
  vertical-align: 1px;
}

.widget p { margin: 0 0 0.9em; font-size: 0.9rem; line-height: 1.9; }
.widget p:last-child { margin-bottom: 0; }

.widget ul { list-style: none; margin: 0; padding: 0; }

.widget ul li {
  padding: 7px 0;
  border-bottom: 1px dotted var(--paper-edge);
  font-size: 0.9rem;
}

.widget ul li:last-child { border-bottom: none; }

.widget ul li a { color: var(--ink); }
.widget ul li a:hover { color: var(--red-600); }

.widget ul li .count { color: var(--ink-faint); font-size: 0.8rem; margin-left: 0.4em; }

.widget-note {
  background: var(--paper-alt);
  border-top: 3px double var(--gold);
}

.widget dl { margin: 0; font-size: 0.88rem; }
.widget dt { color: var(--gold-dark); letter-spacing: 0.1em; font-size: 0.8rem; margin-top: 12px; }
.widget dt:first-child { margin-top: 0; }
.widget dd { margin: 2px 0 0; }

/* ---------- footer ---------- */
.site-footer {
  background: var(--char);
  color: #c9bfae;
  margin-top: 10px;
  box-shadow: var(--shadow);
}

.footer-inner {
  padding: 36px 24px 30px;
  text-align: center;
}

.footer-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.26em;
  color: #efe6d5;
  margin: 0 0 8px;
}

.footer-tagline {
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  margin: 0 0 18px;
  color: #a89c89;
}

.footer-nav {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 28px;
  margin: 0 0 20px;
  padding: 0;
}

.footer-nav a {
  color: #d8cdba;
  font-size: 0.86rem;
  letter-spacing: 0.16em;
}

.footer-nav a:hover { color: var(--gold-pale); }

.footer-copy {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: #8d8271;
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid rgba(176, 141, 79, 0.25);
}

.site-footer .frame { padding-bottom: 40px; }

/* ---------- 404 ---------- */
.notfound {
  text-align: center;
  padding: clamp(40px, 8vw, 90px) 24px;
}

.notfound .nf-code {
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 10vw, 5.5rem);
  font-weight: 700;
  color: var(--red-600);
  letter-spacing: 0.1em;
  margin: 0;
  line-height: 1.1;
}

.notfound h1 {
  font-family: var(--font-display);
  color: var(--red-800);
  letter-spacing: 0.12em;
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  margin: 0.6em 0 1em;
}

.notfound p { color: var(--ink-light); max-width: 34em; margin: 0 auto 1.2em; }

.btn-home {
  display: inline-block;
  margin-top: 10px;
  background: var(--red-600);
  color: #fdf6ea;
  letter-spacing: 0.2em;
  padding: 13px 38px;
  border-radius: 2px;
  box-shadow: var(--shadow-soft);
  border-bottom: none;
}

.btn-home:hover { background: var(--red-500); color: #fff; text-decoration: none; }

/* ---------- responsive ---------- */
@media (max-width: 920px) {
  .page-body { grid-template-columns: 1fr; }
  .hero-caption-v { top: 20px; right: 20px; padding: 16px 9px; }
}

@media (max-width: 640px) {
  body { line-height: 1.9; }
  .nav-inner { flex-direction: column; align-items: stretch; }
  .nav-toggle { display: block; }
  .nav-list { display: none; flex-direction: column; }
  .nav-list.open { display: flex; }
  .nav-list a { padding: 13px 22px; border-bottom: 1px solid var(--char-light); border-left: 3px solid transparent; }
  .nav-list a:hover, .nav-list a.current { border-bottom-color: var(--char-light); border-left-color: var(--gold); }
  .masthead { padding: 26px 16px 20px; }
  .brand { letter-spacing: 0.14em; }
}
