/* ============================================================
   図書・情報館の特設ページ（library/）
   トップのヒーローの部品（白い紙・淡い虹色の光の帯・軌道の線・縦書きの明朝）に、
   企画ページの図書館のカードの部品（貸出カードの罫線・日付印・しおり）を合わせる。
   入口のアーチ形の屋根にならって、写真の上をアーチにする
   ============================================================ */

.lb { --ink-stamp: #2b6fb7; --rule: rgba(43, 111, 183, 0.16); }

/* ---------- ヒーロー ---------- */
.lb-hero { position: relative; overflow: hidden; background: var(--paper); }
.lb-hero__prism {
  position: absolute; inset: -10% -18%; pointer-events: none;
  background:
    linear-gradient(118deg, transparent 38%, rgba(255, 196, 222, 0.26) 44%, rgba(186, 226, 255, 0.36) 50%, rgba(255, 240, 196, 0.24) 56%, transparent 62%),
    linear-gradient(128deg, transparent 68%, rgba(186, 226, 255, 0.28) 73%, transparent 78%);
  animation: lb-prism 22s ease-in-out infinite alternate;
}
@keyframes lb-prism { from { transform: translate3d(-3%, 0, 0); } to { transform: translate3d(3%, -2%, 0); } }
.lb-hero__orbits { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }
.lb-orbit { fill: none; stroke: var(--blue); stroke-width: 1.1; stroke-opacity: 0.45; vector-effect: non-scaling-stroke; stroke-dasharray: 3200; stroke-dashoffset: 3200; }
.lb-orbit--2 { stroke-opacity: 0.3; }
.lb-hero.is-in .lb-orbit { animation: lb-draw 2s var(--ease) forwards; }
.lb-hero.is-in .lb-orbit--2 { animation-delay: .3s; }
@keyframes lb-draw { to { stroke-dashoffset: 0; } }

.lb-hero__inner {
  position: relative; z-index: 1;
  width: min(100% - 48px, 1240px); margin-inline: auto;
  padding: calc(var(--header-h) + 28px) 0 clamp(64px, 8vw, 104px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "crumb crumb" "head photo" ". stamp";
  column-gap: clamp(28px, 5vw, 80px);
  align-items: start;
}
.lb-hero__crumb { grid-area: crumb; display: flex; gap: 10px; font-size: 12px; color: var(--muted); margin-bottom: clamp(24px, 4vw, 48px); }
.lb-hero__crumb a { color: var(--muted); }
.lb-hero__crumb a:hover { color: var(--blue); }

.lb-hero__head { grid-area: head; display: flex; flex-direction: row-reverse; align-items: flex-start; gap: clamp(18px, 2.4vw, 34px); padding-top: 6px; }
.lb-hero__title { writing-mode: vertical-rl; display: flex; flex-direction: column; gap: 10px; margin: 0; font-weight: 800; }
.lb-hero__org { font-size: clamp(13px, 1.15vw, 16px); font-weight: 500; letter-spacing: 0.34em; color: #1f3f6c; }
.lb-hero__name {
  font-size: clamp(48px, 5.2vw, 76px); line-height: 1.04; letter-spacing: 0.08em;
  background-image: var(--puzzle-tile, none), var(--grad); background-size: 34px 34px, 220% 220%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lb-hero__lead { writing-mode: vertical-rl; font-size: clamp(15px, 1.4vw, 19px); font-weight: 500; letter-spacing: 0.3em; line-height: 2.1; color: #1f3f6c; margin-top: clamp(40px, 6vw, 96px); text-combine-upright: none; }

.lb-hero__photo { grid-area: photo; position: relative; margin: 0; }
.lb-hero__photo img {
  display: block; width: 100%; height: auto; aspect-ratio: 2298 / 1533; object-fit: cover;
  border-radius: 48% 48% 6px 6px / 30% 30% 6px 6px;
  box-shadow: 0 30px 60px -30px rgba(14, 42, 82, 0.45);
}
.lb-hero__photo figcaption { position: absolute; right: 12px; bottom: 8px; font-size: 11px; color: rgba(255, 255, 255, 0.92); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); letter-spacing: 0.08em; }

/* 日付印：貸出カードの返却日のはんこ。二重の枠、青いインク、少し傾ける */
.lb-stamp {
  grid-area: stamp; justify-self: start; position: relative; z-index: 2;
  margin: -64px 0 0 clamp(-60px, -4vw, -20px);
  display: grid; justify-items: center; gap: 2px;
  padding: 14px 26px 12px;
  color: var(--ink-stamp);
  background: rgba(255, 255, 255, 0.92);
  border: 2.5px solid currentColor; border-radius: 10px;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.92), inset 0 0 0 4.5px rgba(43, 111, 183, 0.55), 0 14px 30px -18px rgba(14, 42, 82, 0.5);
  transform: rotate(-4deg);
}
.lb-hero__mlead { display: none; }
.lb-stamp__k { font-family: var(--mincho); font-weight: 700; font-size: 14px; letter-spacing: 0.6em; padding-left: 0.6em; }
.lb-stamp__d { display: flex; align-items: baseline; gap: 6px; font-size: clamp(30px, 3.2vw, 42px); letter-spacing: 0.04em; line-height: 1; }
.lb-stamp__d small { font-size: 0.32em; letter-spacing: 0.16em; }
.lb-stamp__d i { font-style: normal; font-size: 0.6em; padding-inline: 4px; }
.lb-stamp__t { font-size: clamp(16px, 1.5vw, 20px); letter-spacing: 0.14em; border-top: 1px solid rgba(43, 111, 183, 0.4); padding-top: 4px; }
.js .lb-hero .lb-stamp { opacity: 0; }
.lb-hero.is-in .lb-stamp { animation: lb-press .5s cubic-bezier(.3, 1.4, .5, 1) .9s forwards; }
@keyframes lb-press { from { opacity: 0; transform: rotate(-4deg) scale(1.35); } 60% { opacity: 1; } to { opacity: 1; transform: rotate(-4deg) scale(1); } }

/* ---------- 共通 ---------- */
.lb-sec { padding-block: clamp(64px, 8vw, 104px); }
.lb-sec:nth-of-type(even) { background: var(--white); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.lb-meta { display: grid; margin: 28px 0 0; border-top: 3px double var(--rule); }
.lb-meta > div { display: grid; grid-template-columns: 5.6em minmax(0, 1fr); gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.lb-meta dt { font-size: 13px; font-weight: 700; color: var(--blue); letter-spacing: 0.2em; }
.lb-meta dd { margin: 0; font-size: 15px; line-height: 1.7; }
.lb-meta dd small { font-size: 13px; color: var(--muted); }

/* ---------- 図書・情報館のこと ---------- */
.lb-about__grid { display: grid; grid-template-columns: minmax(0, 1fr); }
.lb-about__text { max-width: 40em; }
.lb-about__text p + p { margin-top: 1em; }
.lb-about__lead { font-size: clamp(20px, 2.2vw, 26px); font-weight: 700; line-height: 1.7; letter-spacing: 0.04em; margin-bottom: 0.6em; }
.lb-about__text p.lb-about__src { margin-top: 18px; font-size: 12px; color: var(--muted); letter-spacing: 0.08em; }

/* ---------- 2日間の予定（貸出カードの罫線の上に時間の帯） ---------- */
.lb-card {
  --day: 84px;
  position: relative; background: var(--white);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 18px clamp(16px, 2.4vw, 28px) 10px;
  box-shadow: 0 18px 40px -30px rgba(14, 42, 82, 0.4);
}
.lb-sec:nth-of-type(even) .lb-card { background: var(--paper); }
.lb-card::before { content: ""; position: absolute; top: -1px; left: clamp(22px, 2.6vw, 34px); width: 16px; height: 40px; background: linear-gradient(180deg, #4b90d2, #14305a); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%); filter: drop-shadow(0 3px 4px rgba(14, 42, 82, 0.18)); }
.lb-card__axis { position: relative; height: 22px; margin-left: var(--day); margin-right: 8px; font-family: var(--latin); font-weight: 600; font-size: 13px; color: var(--muted); }
.lb-card__axis span { position: absolute; left: calc(var(--t) / 6 * 100%); transform: translateX(-50%); white-space: nowrap; }
.lb-card__axis span:first-child { transform: none; }
.lb-card__axis span:last-child { transform: translateX(-100%); }
.lb-card__row { display: grid; grid-template-columns: var(--day) minmax(0, 1fr); border-top: 3px double var(--rule); padding: 12px 8px 14px 0; }
.lb-card__row + .lb-card__row { border-top: 1px solid var(--rule); }
.lb-card__day { display: flex; flex-direction: column; line-height: 1; padding-top: 4px; }
.lb-card__day .latin { font-size: 30px; letter-spacing: 0.02em; color: var(--navy); }
.lb-card__day small { font-size: 12px; color: var(--muted); margin-top: 6px; letter-spacing: 0.2em; }
.lb-card__lanes {
  display: grid; gap: 6px; position: relative;
  background-image: repeating-linear-gradient(to right, var(--rule) 0 1px, transparent 1px calc(100% / 6));
  background-size: calc(100% + 1px) 100%;
  border-right: 1px solid var(--rule);
}
.lb-bar { position: relative; margin-left: calc(var(--s) / 6 * 100%); width: calc((var(--e) - var(--s)) / 6 * 100%); }
.lb-bar > span, .lb-bar > a { display: block; padding: 7px 12px; border-radius: 4px; font-size: 14px; font-weight: 500; line-height: 1.4; color: var(--navy); }
.lb-bar small { margin-left: 10px; font-size: 12px; color: var(--muted); font-weight: 400; }
.lb-bar--open > span { padding: 2px 0 4px; font-size: 12px; color: var(--muted); background: linear-gradient(var(--blue), var(--blue)) left bottom / 100% 1.5px no-repeat; border-radius: 0; }
.lb-bar--open > span::after { content: ""; position: absolute; right: 0; bottom: -2.5px; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }
.lb-bar--open > span::before { content: ""; position: absolute; left: 0; bottom: -2.5px; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }
.lb-bar--show > a { background: var(--pale); }
.lb-bar--show > a:hover { background: #d6e7f6; }
/* トークは帯が細いので、名前は帯の左に右寄せで書く */
.lb-bar--talk { margin-left: 0; width: 100%; }
.lb-bar--talk::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--s) / 6 * 100%); width: calc((var(--e) - var(--s)) / 6 * 100%); border-radius: 4px; background: var(--grad); }
.lb-bar--talk > a { padding-right: calc((6 - var(--s)) / 6 * 100% + 12px); text-align: right; }
.lb-bar--talk > a small { display: block; margin: 2px 0 0; }
.lb-bar__t { white-space: nowrap; }
.lb-bar > a:hover { color: var(--blue); }

/* ---------- 催し ---------- */
.lb-event__grid { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.lb-event--show .lb-event__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 340px); }
.lb-event--show .lb-event__poster { order: 2; }
.lb-event__poster { margin: 0; position: sticky; top: calc(var(--header-h) + 24px); }
.lb-event__poster img { display: block; width: 100%; height: auto; border-radius: 4px; background: var(--white); box-shadow: 0 0 0 8px var(--white), 0 0 0 9px var(--line), 0 30px 50px -30px rgba(14, 42, 82, 0.5); }
.lb-event__poster--dark img { box-shadow: 0 0 0 8px var(--white), 0 0 0 9px var(--line), 0 30px 50px -30px rgba(14, 42, 82, 0.6); }
.lb-event__when { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 8px; color: var(--blue); line-height: 1; }
.lb-event__when .latin { font-size: 34px; letter-spacing: 0.02em; }
.lb-event__when small { font-family: var(--latin); font-weight: 600; font-size: 12px; letter-spacing: 0.2em; }
.lb-event__when i { font-style: normal; font-size: 20px; padding-inline: 2px; }
.lb-event__when b { margin-left: 10px; font-size: 22px; font-weight: 600; letter-spacing: 0.08em; }
.lb-event__kind { margin-top: 18px; font-size: 13px; font-weight: 700; letter-spacing: 0.2em; color: var(--muted); }
.lb-event__title { margin-top: 6px; font-size: clamp(26px, 3.2vw, 38px); font-weight: 800; line-height: 1.45; letter-spacing: 0.04em; }
.lb-event__title span { color: var(--blue); }
.lb-event__title--latin .latin { font-size: clamp(44px, 5.6vw, 68px); letter-spacing: 0.06em; color: var(--navy); line-height: 1.1; }
.lb-event__text { margin-top: 22px; max-width: 38em; }
.lb-event__text p + p { margin-top: 0.9em; }
.lb-speakers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.lb-speakers li { display: grid; gap: 6px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 6px; background: var(--white); }
.lb-sec:nth-of-type(even) .lb-speakers li { background: var(--paper); }
.lb-speakers b { font-size: 20px; font-weight: 700; letter-spacing: 0.08em; }
.lb-speakers b small { margin-left: 6px; font-size: 13px; font-weight: 500; }
.lb-speakers span { font-size: 13px; line-height: 1.7; color: var(--ink); }
.lb-event__link { margin-top: 22px; font-size: 14px; }
.lb-event__link a, .lb-floors__src a { display: inline-flex; align-items: center; gap: 4px; }
.lb-event__link svg, .lb-btn svg { width: 14px; height: 14px; }

/* ---------- 館内の案内（上の階から下の階へ、本の背表紙のように積む） ---------- */
.lb-stack { border-top: 3px double var(--rule); }
.lb-floor { display: grid; grid-template-columns: 96px minmax(0, 1fr); border-bottom: 1px solid var(--rule); }
.lb-floor__no { display: grid; place-items: center; font-size: 30px; letter-spacing: 0.04em; color: #fff; background: linear-gradient(170deg, #8fbde6, #5c98d3); border-radius: 3px; margin: 6px 0; }
.lb-floor:nth-child(2) .lb-floor__no { background: var(--grad); }
.lb-floor:nth-child(3) .lb-floor__no { background: linear-gradient(170deg, #9cc7ec, #6aa5da); }
.lb-floor:nth-child(4) .lb-floor__no { background: linear-gradient(170deg, #4b90d2, #1f5fa8); }
.lb-floor:nth-child(5) .lb-floor__no { background: linear-gradient(170deg, #2b5a95, #0b2350); }
.lb-floor__body { padding: 16px 0 16px clamp(16px, 2.4vw, 28px); }
.lb-floor__zone { font-size: 12px; color: var(--muted); letter-spacing: 0.16em; }
.lb-floor__items { display: flex; flex-wrap: wrap; gap: 2px 18px; margin-top: 6px; font-size: 14px; color: var(--ink); }
.lb-floor__items li::before { content: ""; display: inline-block; width: 4px; height: 4px; margin-right: 7px; border-radius: 50%; background: rgba(43, 111, 183, 0.55); vertical-align: middle; }
.lb-floor__picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; margin-top: 10px; }
.lb-floor__picks li > a, .lb-floor__picks li:not(:has(> a)) { display: grid; gap: 2px; height: 100%; padding: 10px 14px; border-radius: 4px; background: var(--pale); color: var(--navy); }
.lb-floor__picks li > a:hover { background: #d6e7f6; color: var(--navy); }
.lb-floor__picks b { font-family: var(--mincho); font-size: 17px; font-weight: 700; letter-spacing: 0.04em; }
.lb-floor__picks span { font-size: 13px; color: var(--ink); line-height: 1.6; }
.lb-floor--main { background: linear-gradient(90deg, rgba(230, 240, 249, 0.6), transparent 70%); }
.lb-floor--main .lb-floor__picks li > a, .lb-floor--main .lb-floor__picks li:not(:has(> a)) { background: var(--white); box-shadow: inset 0 0 0 1px var(--line); }
.lb-floors__src { margin-top: 16px; font-size: 12px; color: var(--muted); }

/* ---------- 来館の案内 ---------- */
.lb-visit__box { max-width: 760px; text-align: left; }
.lb-visit__title { font-size: clamp(20px, 2.2vw, 26px); font-weight: 700; letter-spacing: 0.06em; }
.lb-meta--wide > div { grid-template-columns: 5.6em minmax(0, 1fr); }
.lb-visit__links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.lb-btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 22px; border-radius: 999px; background: var(--navy); color: #fff; font-size: 14px; font-weight: 700; letter-spacing: 0.06em; transition: background .18s var(--ease); }
.lb-btn:hover { background: var(--blue); color: #fff; }
.lb-btn--ghost { background: transparent; color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.lb-btn--ghost:hover { background: var(--navy); color: #fff; }

/* ---------- スマホ ---------- */
@media (max-width: 860px) {
  .lb-event__grid, .lb-event--show .lb-event__grid { grid-template-columns: minmax(0, 1fr); }
  .lb-event__poster, .lb-event--show .lb-event__poster { order: 0; position: static; max-width: 340px; }
}
@media (max-width: 640px) {
  .lb-hero__inner { width: min(100% - 32px, 1240px); padding-top: calc(var(--header-h) + 12px); grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "crumb crumb" "head photo" "stamp stamp"; column-gap: 16px; }
  .lb-hero__head { flex-direction: column; gap: 0; padding-top: 0; }
  .lb-hero__lead { display: none; }
  .lb-hero__name { font-size: clamp(44px, 12.5vw, 56px); }
  .lb-hero__photo img { aspect-ratio: 3 / 4; object-position: 50% 50%; border-radius: 50% 50% 6px 6px / 26% 26% 6px 6px; }
  .lb-stamp { justify-self: center; margin: -36px 0 0; }
  .lb-hero__inner { grid-template-areas: "crumb crumb" "head photo" "stamp stamp" "mlead mlead"; }
  .lb-hero__mlead { display: block; grid-area: mlead; margin-top: 22px; text-align: center; font-size: 16px; font-weight: 500; letter-spacing: 0.14em; color: #1f3f6c; }
  .container { width: min(100% - 32px, var(--container)); }
  .lb-card { --day: 58px; padding-inline: 12px; }
  .lb-card::before { left: 18px; width: 12px; height: 30px; }
  .lb .pdept__name { font-size: 22px; }
  .lb-card__axis span:not(:first-child):not(:last-child) { font-size: 11px; }
  .lb-card__day .latin { font-size: 22px; }
  .lb-bar small { display: block; margin: 2px 0 0; }
  .lb-bar__t { display: block; }
  .lb-bar > span, .lb-bar > a { padding: 6px 9px; font-size: 13px; }
  .lb-bar--talk > a { padding-right: calc((6 - var(--s)) / 6 * 100% + 10px); }
  .lb-speakers { grid-template-columns: minmax(0, 1fr); }
  .lb-floor { grid-template-columns: 62px minmax(0, 1fr); }
  .lb-floor__no { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .lb-hero__prism { animation: none; }
  .lb-orbit { stroke-dashoffset: 0; }
  .lb-hero.is-in .lb-orbit, .lb-hero.is-in .lb-stamp { animation: none; }
  .js .lb-hero .lb-stamp { opacity: 1; }
}
