/*
 * Festa theme: layout
 * 配置・寸法・余白・レスポンシブだけを管理します。
 * 配色や装飾を変更するときは style.css を編集してください。
 */

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  line-height: 1.85;
}
img {
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 5%;
  border-top-width: 6px;
  border-top-style: solid;
}
.logo {
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
}
.logo::before {
  margin-right: 1.1em;
}
.nav {
  display: flex;
  gap: 0.4rem;
  font-size: 0.86rem;
}
.nav a {
  padding: 0.45em 0.75em;
}
.menu-toggle {
  display: none;
  padding: 8px;
}
.menu-toggle span:not(.screen-reader-text) {
  display: block;
  width: 26px;
  height: 3px;
  margin: 5px 0;
}
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

.hero {
  position: relative;
  isolation: isolate;
  min-height: 540px;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 78px 7% 64px;
  text-align: center;
}
.hero::before,
.hero::after {
  position: absolute;
  z-index: -1;
}
.hero::before {
  width: 300px;
  height: 300px;
  left: -105px;
  bottom: -125px;
  border-width: 34px;
  border-style: solid;
}
.hero::after {
  width: 190px;
  height: 190px;
  right: -40px;
  top: 45px;
}
.hero-inner {
  position: relative;
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  align-items: center;
  gap: clamp(1rem, 4vw, 4rem);
}
.hero-copy {
  position: relative;
  z-index: 2;
}
.hero-art {
  position: relative;
  z-index: 1;
  margin: 0 -6vw 0 -2vw;
  align-self: center;
}
.hero-art img {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: contain;
}
.hero-art-mobile {
  display: none;
}
.hero-badge {
  display: inline-block;
  padding: 0.45em 1.4em;
  font-size: 0.92rem;
}
h1 {
  margin: 0.28em 0 0.18em;
  font-size: clamp(3rem, 9vw, 6.5rem);
  line-height: 1.08;
}
.hero p {
  margin: 1.2rem 0 1.7rem;
}
.button {
  display: inline-block;
  padding: 0.55em 1.25em;
  border: 0;
}

.section {
  position: relative;
  max-width: 1050px;
  margin: auto;
  padding: 36px 5%;
}
.section-title,
.editable-home-content > h2 {
  margin: 0 0 1.8rem;
  font-size: clamp(1.65rem, 4vw, 2.25rem);
  line-height: 1.4;
  text-align: center;
}
.section-title::after,
.editable-home-content > h2::after {
  display: block;
  width: 112px;
  height: 7px;
  margin: 0.55rem auto 0;
}
.intro,
.editable-home-content > p {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}
.privacy-content {
  text-align: left;
}

.news-list {
  max-width: 760px;
  margin: auto;
  overflow: hidden;
  border-width: 2px;
  border-style: solid;
}
.news-list article {
  display: flex;
  gap: 1.4rem;
  align-items: baseline;
  padding: 1.05rem 1.4rem;
  border-bottom-width: 1px;
  border-bottom-style: dashed;
}
.news-list article:nth-child(n) {
  border-left-width: 7px;
  border-left-style: solid;
}
.news-list article:last-child {
  border-bottom: 0;
}
.news-list article:hover {
  padding-left: 1.7rem;
}
.news-list time,
.post-detail time {
  font-size: 0.82rem;
  white-space: nowrap;
}

.post-detail {
  max-width: 800px;
}
.post-detail article {
  position: relative;
  padding: clamp(1.5rem, 5vw, 3rem);
  border-width: 2px;
  border-style: solid;
}
.post-detail article::before,
.event-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 8px;
}
.post-detail h1 {
  margin: 0.3rem 0 1rem;
  font-size: clamp(2rem, 5vw, 3rem);
}
.entry-content {
  overflow-wrap: anywhere;
}
.entry-content h2 {
  margin-top: 2em;
  padding-left: 0.65em;
  border-left-width: 7px;
  border-left-style: solid;
}
.back-link {
  margin: 3rem 0 0;
  text-align: right;
  font-size: 0.85rem;
}
.back-link a {
  border-bottom-width: 1px;
  border-bottom-style: solid;
}

.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}
.event-card {
  position: relative;
  padding: 22px;
  overflow: hidden;
  border-width: 2px;
  border-style: solid;
}
.event-card img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
}
.event-card h3 {
  margin: 0.8rem 0 0.2rem;
}
.schedule {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 9px;
}
.schedule td,
.schedule th {
  padding: 0.7em 1em;
  text-align: left;
}
.schedule tbody td:first-child {
  border-left-width: 6px;
  border-left-style: solid;
}
.event-list th { padding: 0; }
.event-list td { vertical-align: top; }
.event-list tbody td:last-child { vertical-align: middle; text-align: center; }
.event-list th:last-child .event-sort { text-align: center; }
.event-schedule-slot { padding: 4px 0; line-height: 1.5; }
.event-sort { width: 100%; padding: 10px 8px; text-align: left; cursor: pointer; }
.color-block,
.volunteer {
  border-width: 2px;
  border-style: solid;
}
.event-notice {
  margin: 8px 0;
  padding: 8px;
}
.event-notice h2 {
  margin: 0 0 4px;
  font-size: 1rem;
  line-height: calc(1em + 8px);
}
.event-notice p {
  margin: 0;
  line-height: calc(1em + 8px);
}
.event-draft-label {
  display: inline-block;
  padding: 4px 8px;
  font-size: 0.75rem;
}

.contact {
  max-width: 700px;
  margin: auto;
  padding: clamp(1.2rem, 4vw, 2.2rem);
  border-width: 2px;
  border-style: solid;
}
.contact label {
  display: block;
  margin-top: 1rem;
}
.contact input,
.contact textarea {
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.8rem;
  border-width: 2px;
  border-style: solid;
}
.contact textarea {
  min-height: 130px;
  resize: vertical;
}
.contact > form > p {
  text-align: right;
}
.notice {
  padding: 1em;
  border-left-width: 6px;
  border-left-style: solid;
}
.contact-confirm-lead {
  margin-top: 0;
  text-align: center;
}
.contact-confirm-list {
  margin: 1.5rem 0 2rem;
}
.contact-confirm-list > div {
  display: grid;
  grid-template-columns: 10rem 1fr;
  padding: 1rem 0;
  border-bottom-width: 1px;
  border-bottom-style: dashed;
}
.contact-confirm-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.contact-confirm-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.contact-confirm-actions form {
  margin: 0;
}
.site-footer {
  position: relative;
  padding: 34px 25px;
  font-size: 0.8rem;
  text-align: center;
}
.site-footer::before {
  position: absolute;
  inset: 0 0 auto;
  height: 7px;
}

/* PCのイベント一覧では、長い講座名も表の半分以内で折り返す。 */
@media (min-width: 769px) {
  .schedule.event-list {
    width: 100%;
    table-layout: fixed;
  }
  .event-list .event-name-column {
    width: 50%;
  }
  .event-list col:nth-child(2),
  .event-list col:nth-child(3) {
    width: 20%;
  }
  .event-list col:last-child {
    width: 10%;
  }
  .event-list th,
  .event-list td {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 768px) {
  .site-header {
    min-height: 65px;
    padding: 10px 5%;
    flex-wrap: wrap;
  }
  .menu-toggle {
    display: block;
    margin-left: auto;
  }
  .nav {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0;
    margin: 8px 0 0;
    border-top-width: 1px;
    border-top-style: solid;
  }
  .nav.is-open {
    display: flex;
  }
  .nav a {
    padding: 12px 6px;
    border-bottom-width: 1px;
    border-bottom-style: solid;
  }
  .hero {
    min-height: 460px;
    padding: 58px 5% 32px;
  }
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .hero-inner > .hero-art {
    display: none;
  }
  .hero-art-mobile {
    display: block;
    width: min(300px, 72vw);
    margin: -8px auto -10px;
  }
  .hero-art-mobile img {
    max-height: 260px;
  }
  .section {
    padding: 32px 6%;
  }
  .news-list article {
    display: block;
  }
  .news-list time {
    display: block;
    margin-bottom: 0.15rem;
  }
  .schedule {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  .schedule.event-detail-schedule {
    display: table;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .contact-confirm-list > div {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

/* スマホのイベント一覧は、名前と詳細の2行で表示する。 */
@media (max-width: 768px) {
  .schedule.event-list {
    display: block;
    overflow-x: visible;
    white-space: normal;
  }
  .event-list colgroup {
    display: none;
  }
  .event-list thead {
    display: block;
    margin-bottom: 8px;
  }
  .event-list thead tr { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); }
  .event-list th { min-width: 0; }
  .event-sort { padding: 8px 4px; font-size: .875rem; }
  .event-list tbody {
    display: grid;
    gap: 8px;
  }
  .event-list tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, .8fr);
  }
  .event-list tbody td {
    min-width: 0;
    padding: 4px 8px 8px;
    overflow-wrap: anywhere;
    font-size: .875rem;
  }
  .event-list tbody td:first-child {
    grid-column: 1 / -1;
    padding: 8px;
    font-size: 1rem;
  }
  .event-list tbody td:last-child {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* 時間は各スケジュールを1行で表示し、狭い画面では列内でスクロールする。 */
.event-list tbody td:nth-child(2) {
  white-space: nowrap;
  overflow-wrap: normal;
  overflow-x: auto;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
