/* 工房の質問帳。空から一枚の紙面へ降り、相談窓口の先で街並みと合流する。 */

body.page-faq:has(.question-book) {
  background: linear-gradient(180deg, transparent 5rem, rgb(252 246 232 / 15%) 10rem, var(--sb-world-ground) 29rem),
    url("/assets/img/home-hero-v1/sky-wide-v01.webp") center top / max(100%, 68rem) auto no-repeat,
    var(--sb-world-ground);
}

main:has(> .question-book) {
  max-width: none;
  margin: 0;
  padding: 0;
}

.question-book {
  --book-line: #c8bea1;
  color: var(--sb-world-ink);
  font-family: var(--sb-world-font-body);
  line-height: 1.65;
}

.question-book .question-book__width {
  width: min(71rem, calc(100% - 2 * var(--sb-world-content-gutter)));
  margin-inline: auto;
}

.question-book :where(h1,h2,p,ul,dl,dd) {
  margin: 0;
}

.question-book h1, .question-book h2 {
  font-family: var(--sb-world-font-heading);
  color: var(--sb-world-ink);
}

.question-book a {
  color: var(--sb-world-action);
  text-underline-offset: .23em;
}

.question-book :is(a,summary):focus-visible, .question-chapter:focus-visible {
  outline: 3px solid var(--sb-world-focus);
  outline-offset: 3px;
}

.question-book__opening {
  padding-block: clamp(1rem, 3vw, 2.75rem) clamp(1.3rem, 2.6vw, 2.35rem);
}

.question-book__opening h1 {
  width: fit-content;
  padding: .05em .2em .13em 0;
  font-size: var(--sb-world-type-page-title);
  font-weight: 650;
  letter-spacing: .045em;
  line-height: 1.15;
  text-shadow: 0 2px 12px var(--sb-world-paper);
}

.question-book__filter {
  margin-top: .6rem;
  background: var(--sb-world-paper);
  width: fit-content;
}

.question-book__filter a {
  display: inline-block;
  margin-inline: .4rem;
}

.question-book__spread {
  display: grid;
  grid-template-columns: minmax(11rem, .83fr) minmax(0, 2.22fr);
  align-items: start;
  gap: clamp(1.5rem, 4vw, 4rem);
}

.question-index {
  position: sticky;
  top: calc(var(--site-header-height, 5rem) + 1.25rem);
  color: var(--sb-world-ink);
  padding: 1rem clamp(.85rem, 2vw, 1.75rem) 1.15rem;
  background: linear-gradient(105deg, #f4e3aa, #f9edd2 63%, #fff4d8);
  border-block: 1px solid #af935e;
  box-shadow: 0 3px 0 #e7d2a1;
  scroll-margin-top: .5rem;
}

.question-index h2 {
  font-size: 1.15rem;
  letter-spacing: .12em;
  line-height: 1.3;
}

.question-index ul {
  margin-top: .65rem;
  padding: 0;
  list-style: none;
}

.question-index li {
  border-top: 1px solid #c7af79;
}

.question-index a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .35rem;
  min-height: 2.95rem;
  color: var(--sb-world-action);
  font-weight: 700;
  text-decoration: none;
}

.question-index a span {
  color: #5c6f58;
}

.question-index a:hover {
  text-decoration: underline;
}

.question-paper {
  position: relative;
  min-width: 0;
  padding: .3rem clamp(1rem, 3.2vw, 3rem) 2.2rem;
  background: linear-gradient(to right, #eadbb8 0, #f7eed8 5px, #fffbed 13px, #fffbed 100%);
  border-block: 1px solid var(--book-line);
  border-radius: 3px 12px 5px 3px;
  box-shadow: 0 3px 0 #e1cfab, 0 5px 0 #fff7df, 0 7px 0 #c1a17a, 0 15px 26px rgb(61 53 28 / 9%);
}

.question-paper::before {
  content: "";
  position: absolute;
  right: 1.2rem;
  top: -1px;
  width: 1.06rem;
  height: 2.1rem;
  background: var(--sb-world-action);
  clip-path: polygon(0 0,100% 0,100% 100%,50% 78%,0 100%);
}

.question-chapter {
  scroll-margin-top: .5rem;
}

.question-chapter + .question-chapter {
  margin-top: clamp(1.5rem, 3.5vw, 3.1rem);
}

.question-chapter__tab {
  display: flex;
  align-items: center;
  gap: clamp(.65rem, 1.8vw, 1.35rem);
  padding-block: 1.15rem .7rem;
  border-bottom: 2px solid var(--sb-world-action);
}

.question-chapter__tab img {
  width: clamp(3.4rem, 5.3vw, 5rem);
  height: 3.7rem;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.question-chapter__tab h2 {
  color: var(--sb-world-action);
  font-size: clamp(1.4rem, 2.4vw, 2.15rem);
  line-height: 1.25;
}

.question-entry {
  border-bottom: 1px solid var(--book-line);
  scroll-margin-top: .5rem;
}

.question-entry summary, .question-entry__answer {
  display: grid;
  grid-template-columns: 1.2rem minmax(0,1fr) 1.4rem;
  align-items: baseline;
  gap: .65rem;
  padding: 1.02rem .35rem;
}

.question-entry summary {
  list-style: none;
  cursor: pointer;
  font-weight: 700;
  line-height: 1.6;
}

.question-entry summary::-webkit-details-marker {
  display: none;
}

.question-entry summary:hover {
  background: #fbf1d0;
}

.question-entry[open] > summary {
  background: #fae8b1;
}

.question-entry__q, .question-entry__a {
  color: var(--sb-world-action);
  font: 700 1.15em/1 var(--sb-world-font-heading);
}

.question-entry__toggle {
  align-self: center;
  justify-self: center;
  position: relative;
  width: 1.25rem;
  height: 1.25rem;
  border: 1px solid var(--sb-world-action);
  border-radius: 50%;
}

.question-entry__toggle::before, .question-entry__toggle::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: .55rem;
  height: 2px;
  background: var(--sb-world-action);
  transform: translate(-50%,-50%);
}

.question-entry__toggle::after {
  transform: translate(-50%,-50%) rotate(90deg);
}

.question-entry[open] .question-entry__toggle::after {
  display: none;
}

.question-entry__answer {
  grid-template-columns: 1.2rem minmax(0,1fr);
  color: #263d40;
  line-height: 1.8;
}

.question-entry__answer a {
  font-weight: 700;
}

.question-entry .faq-answer-topics {
  margin: 0;
}

.question-entry .faq-answer-topics > div + div, .question-entry .faq-answer-note {
  margin-top: 1rem;
}

.question-entry .faq-answer-topics dt {
  color: var(--sb-world-action);
  font-weight: 700;
}

.question-entry .faq-answer-topics dd {
  margin: .15rem 0 0;
}

.question-entry__more {
  display: inline-block;
  padding-block: .5rem;
  margin-top: .4rem;
}

.question-chapter__back {
  display: none;
}

.question-desk {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem,4vw,3.5rem);
  padding-block: clamp(3rem,8vw,7rem);
}

.question-desk img {
  height: auto;
  width: clamp(6rem,17vw,13rem);
  mix-blend-mode: multiply;
}

.question-desk h2 {
  font-size: clamp(1.6rem,3.2vw,2.8rem);
  line-height: 1.32;
}

.question-desk p {
  margin-block: .7rem 1rem;
}

.question-desk a {
  display: inline-flex;
  align-items: center;
  gap: 1.1rem;
  padding: .68rem 1.1rem;
  background: var(--sb-world-action);
  color: var(--sb-world-on-action);
  border-radius: 3px;
  font-weight: 700;
  text-decoration: none;
}

.question-desk a:hover {
  text-decoration: underline;
}

@media (max-width: 760px) {
  body.page-faq:has(.question-book) {
    background-image: linear-gradient(180deg, transparent 4rem, rgb(252 246 232 / 28%) 7rem, var(--sb-world-ground) 21rem), url("/assets/img/home-hero-v1/sky-tall-v01.webp");
    background-size: auto, 100% auto;
  }
  .question-book__opening {
    padding-block: 1rem 1.15rem;
  }
  .question-book__spread {
    display: block;
  }
  .question-index {
    position: static;
    padding: .55rem .8rem .35rem;
  }
  .question-index h2 {
    font-size: .85rem;
  }
  .question-index ul {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: .9rem;
    margin-top: .3rem;
  }
  .question-index a {
    min-height: 2.75rem;
    font-size: .94rem;
  }
  .question-paper {
    margin-top: 1.2rem;
    padding: .1rem .75rem 1rem 1rem;
  }
  .question-paper::before {
    right: .7rem;
    width: .7rem;
    height: 1.3rem;
  }
  .question-chapter__tab {
    padding-block: .72rem .52rem;
  }
  .question-chapter__tab img {
    width: 2.85rem;
    height: 2.5rem;
  }
  .question-chapter__tab h2 {
    font-size: 1.35rem;
  }
  .question-entry summary, .question-entry__answer {
    gap: .45rem;
    padding: .8rem .15rem;
  }
  .question-entry__answer {
    font-size: .96rem;
  }
  .question-chapter__back {
    display: block;
    width: fit-content;
    margin-left: auto;
    padding: .6rem .15rem;
    font-size: .85rem;
  }
  .question-chapter + .question-chapter {
    margin-top: .35rem;
  }
  .question-desk {
    gap: .7rem;
  }
  .question-desk img {
    width: clamp(4.2rem,21vw,7.5rem);
  }
  .question-desk h2 {
    font-size: clamp(1.2rem,5.4vw,1.75rem);
  }
  .question-desk p {
    font-size: .93rem;
    line-height: 1.65;
  }
}

@media (max-width: 360px) {
  .question-index a {
    font-size: .875rem;
    text-decoration: underline;
  }
  .question-index a span {
    display: none;
  }
  .question-paper {
    padding-inline: .8rem .55rem;
  }
}
