/**
 * サイト（フロント）用スタイル上書き
 * デザイン調整・ブロックやテーマのデフォルトCSSの上書きはここに記述
 */

/* ===== ブロックレイアウト・blockGap（グループ・カラム） ===== */
.is-layout-flex {
  display: flex;
  gap: var(--wp--style--block-gap, 1.5em);
}
.is-layout-flex.is-vertical { flex-direction: column; }
.is-layout-flex.is-horizontal { flex-direction: row; }
.is-layout-flex.is-nowrap { flex-wrap: nowrap; }
@media (max-width: 781px) {
  .is-column-mobile {
    flex-direction: column;
  }
  .is-column-mobile > * {
    flex-basis: 100% !important;
  }
}

.is-layout-grid {
  display: grid;
  gap: var(--wp--style--block-gap, 1.5em);
}

/* グループ: flex/grid のとき gap を効かせる。inner-container にも適用 */
.wp-block-group.is-layout-flex,
.wp-block-group.is-layout-grid,
.wp-block-group .wp-block-group__inner-container {
  gap: var(--wp--style--block-gap, 1.5em);
}
.wp-block-group.is-layout-flex .wp-block-group__inner-container,
.wp-block-group .wp-block-group__inner-container.is-layout-flex {
  display: flex;
}
.wp-block-group.is-layout-grid .wp-block-group__inner-container,
.wp-block-group .wp-block-group__inner-container.is-layout-grid {
  display: grid;
}

/* デフォルト（縦積み / flow）グループのブロック間隔 */
.wp-block-group.is-layout-flow > *,
.wp-block-group.wp-block-group-is-layout-flow > *,
.is-layout-flow.wp-block-group > * {
  margin-block-start: var(--wp--style--block-gap, 1.5em);
  margin-block-end: 0;
}

.wp-block-group.is-layout-flow > *:first-child,
.wp-block-group.wp-block-group-is-layout-flow > *:first-child,
.is-layout-flow.wp-block-group > *:first-child {
  margin-block-start: 0;
}

/* カラム: flex と gap を明示（コアスタイルが読まれない場合のフォールバック） */
.wp-block-columns {
  display: flex;
  flex-wrap: wrap;
  gap: var(--wp--style--block-gap, 1.5em);
  margin-bottom: 0;
}
@media (min-width: 782px) {
  .wp-block-columns:not(.is-not-stacked-on-mobile) {
    flex-wrap: nowrap;
  }
}
.is-layout-flex.is-content-justification-center { justify-content: center; }
.is-layout-flex.is-content-justification-right { justify-content: flex-end; }
.is-layout-flex.is-content-justification-left { justify-content: flex-start; }
.is-layout-flex.is-content-justification-space-between { justify-content: space-between; }

@media (max-width: 767px) {
  .wp-block-group-is-layout-flex {
    flex-direction: column;
  }
  .wp-block-group-is-layout-flex > * {
    flex-basis: 100% !important;
  }
}

:where(figure) {
  margin: 0;
  max-width: 100%;
}

/* ボタンブロックのスタイル */
.wp-block-buttons {
  width: 100%;
  flex-grow: 1;
}
.wp-block-buttons > .wp-block-button {
  display: block;
  width: 100%;
  max-width: 280px;
}
.wp-block-button.is-style-outline .wp-block-button__link {
  width: 100%;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--wp--preset--color--white);
  color: var(--wp--preset--color--contrast);
  border-color: var(--wp--preset--color--contrast);
  border-width: 1px;
  border-radius: 9999px;
  padding: 0;
  font-size: var(--wp--preset--font-size--text-20);
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.wp-block-button.is-style-outline .wp-block-button__link:hover {
  background-color: rgba(0, 0, 0, 0.8);
  color: var(--wp--preset--color--white);
}

/* Word版ダウンロードボタン */
.wp-block-buttons > .wp-block-button.is-style-download-word {
  display: inline-block;
  width: auto;
  max-width: none;
}

.wp-block-button.is-style-download-word .wp-block-button__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 150px;
  height: 42px;
  padding: 0 2rem 0 1rem;
  font-size: var(--text-size-14, 14px);
  line-height: 1;
  border-radius: 9999px;
  border: 1px solid var(--color-contrast, #000);
  background-color: var(--color-white, #fff);
  color: var(--color-blue, #1371a1);
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.wp-block-button.is-style-download-word .wp-block-button__link:hover {
  background-color: var(--color-blue, #1371a1);
  border-color: var(--color-blue, #1371a1);
  color: var(--color-white, #fff);
}

.wp-block-button.is-style-download-word .wp-block-button__link::after {
  content: "";
  position: absolute;
  right: 0.75rem;
  top: 50%;
  width: 10px;
  height: 5px;
  transform: translateY(-50%);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10.62 5.03'%3E%3Cpolyline points='.31 .39 5.31 4.39 10.31 .39' fill='none' stroke='%23000' stroke-miterlimit='10'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  pointer-events: none;
}

.wp-block-button.is-style-download-word .wp-block-button__link:hover::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10.62 5.03'%3E%3Cpolyline points='.31 .39 5.31 4.39 10.31 .39' fill='none' stroke='%23fff' stroke-miterlimit='10'/%3E%3C/svg%3E");
}

/* PDF版ダウンロードボタン */
.wp-block-buttons > .wp-block-button.is-style-download-pdf {
  display: inline-block;
  width: auto;
  max-width: none;
}

.wp-block-button.is-style-download-pdf .wp-block-button__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-width: 150px;
  height: 42px;
  padding: 0 2rem 0 1rem;
  font-size: var(--text-size-14, 14px);
  line-height: 1;
  border-radius: 9999px;
  border: 1px solid var(--color-contrast, #000);
  background-color: var(--color-white, #fff);
  color: var(--color-orange, #df5b3e);
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.wp-block-button.is-style-download-pdf .wp-block-button__link:hover {
  background-color: var(--color-orange, #df5b3e);
  border-color: var(--color-orange, #df5b3e);
  color: var(--color-white, #fff);
}

.wp-block-button.is-style-download-pdf .wp-block-button__link::after {
  content: "";
  position: absolute;
  right: 0.75rem;
  top: 50%;
  width: 10px;
  height: 5px;
  transform: translateY(-50%);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10.62 5.03'%3E%3Cpolyline points='.31 .39 5.31 4.39 10.31 .39' fill='none' stroke='%23000' stroke-miterlimit='10'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  pointer-events: none;
}

.wp-block-button.is-style-download-pdf .wp-block-button__link:hover::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10.62 5.03'%3E%3Cpolyline points='.31 .39 5.31 4.39 10.31 .39' fill='none' stroke='%23fff' stroke-miterlimit='10'/%3E%3C/svg%3E");
}

@media (max-width: 767px) {
  .wp-block-buttons {
    display: flex;
    justify-content: center;
  }
}

a:where(:not(.wp-element-button)){
  text-decoration: none;
}

.entry-content a:not(.wp-element-button) {
  text-decoration: underline;
}
.entry-content a:not(.wp-element-button):hover {
  text-decoration: none;
}

.entry-content > * + * {
  margin-top: 1lh;
}

.has-text-33-font-size,
.has-text-25-font-size,
.has-text-23-font-size,
.has-text-22-font-size,
.has-text-20-font-size {
  line-height: 1.4;
}

.wp-element-caption {
  font-size: var(--text-size-14);
  line-height: 1.4;
}

.entry-content .wp-block-heading {
  font-size: var(--text-size-25);
  font-family: var(--font-sans);
  font-weight: 500;
}

@media (max-width: 767px) {
  .entry-content .wp-block-heading {
    font-size: var(--text-size-23);
  }
}

ol.wp-block-list {
  list-style: decimal;
  margin-left: 2em;
}

/* ===== 貸しホール（ブロック編集ページ） ===== */
.rental-entry-content {
  line-height: 2.125;
  letter-spacing: 0.075em;
}

.rental-entry-content h1.wp-block-heading {
  font-family: var(--font-serif);
  font-size: var(--text-size-33);
  font-weight: 700;
  line-height: 1.4;
}

.rental-entry-content h2.wp-block-heading {
  font-family: var(--font-sans);
  font-size: var(--text-size-25);
  font-weight: 500;
  letter-spacing: 0.1em;
  line-height: 1.4;
}

.rental-entry-content h3.wp-block-heading {
  font-size: var(--text-size-20);
  letter-spacing: 0.1em;
  line-height: 1.4;
}

@media (max-width: 767px) {
  .rental-entry-content h2.wp-block-heading {
    font-size: var(--text-size-23);
  }
}

/* ===== 表ブロック（ホール） ===== */
.entry-content .wp-block-table,
.rental-entry-content .wp-block-table {
  overflow-x: auto;
  margin-top: 1.25rem;
}

.entry-content .wp-block-table table,
.rental-entry-content .wp-block-table table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--color-contrast, #000);
  table-layout: fixed;
}

/* 列幅（%）: wcols-* クラス / colgroup / 固定レイアウト */
.entry-content .wp-block-table.has-fixed-layout table,
.rental-entry-content .wp-block-table.has-fixed-layout table,
.entry-content .wp-block-table[class*="wcols-"] table,
.rental-entry-content .wp-block-table[class*="wcols-"] table {
  table-layout: fixed;
}

.entry-content .wp-block-table th,
.entry-content .wp-block-table td,
.rental-entry-content .wp-block-table th,
.rental-entry-content .wp-block-table td {
  border: 1px solid var(--color-contrast, #000);
  padding: 1rem 1.5rem;
  text-align: center;
  font-weight: 400;
  vertical-align: middle;
  word-break: break-word;
}

/* 列の配置（tbody のみ。thead は下記で常に中央） */
.entry-content .wp-block-table tbody td[data-align="left"],
.entry-content .wp-block-table tbody th[data-align="left"],
.entry-content .wp-block-table tbody td.has-text-align-left,
.entry-content .wp-block-table tbody th.has-text-align-left,
.rental-entry-content .wp-block-table tbody td[data-align="left"],
.rental-entry-content .wp-block-table tbody th[data-align="left"],
.rental-entry-content .wp-block-table tbody td.has-text-align-left,
.rental-entry-content .wp-block-table tbody th.has-text-align-left {
  text-align: left;
}

.entry-content .wp-block-table tbody td[data-align="right"],
.entry-content .wp-block-table tbody th[data-align="right"],
.entry-content .wp-block-table tbody td.has-text-align-right,
.entry-content .wp-block-table tbody th.has-text-align-right,
.rental-entry-content .wp-block-table tbody td[data-align="right"],
.rental-entry-content .wp-block-table tbody th[data-align="right"],
.rental-entry-content .wp-block-table tbody td.has-text-align-right,
.rental-entry-content .wp-block-table tbody th.has-text-align-right {
  text-align: right;
}

.entry-content .wp-block-table tbody td[data-align="center"],
.entry-content .wp-block-table tbody th[data-align="center"],
.entry-content .wp-block-table tbody td.has-text-align-center,
.entry-content .wp-block-table tbody th.has-text-align-center,
.rental-entry-content .wp-block-table tbody td[data-align="center"],
.rental-entry-content .wp-block-table tbody th[data-align="center"],
.rental-entry-content .wp-block-table tbody td.has-text-align-center,
.rental-entry-content .wp-block-table tbody th.has-text-align-center {
  text-align: center;
}

/* tbody 1列目の背景（スタイル指定時 / 貸しホールのデフォルト） */
.entry-content .wp-block-table.is-style-hall-table tbody td:first-child,
.entry-content .wp-block-table.is-style-hall-table tbody th:first-child,
.rental-entry-content .wp-block-table.is-style-hall-table tbody td:first-child,
.rental-entry-content .wp-block-table.is-style-hall-table tbody th:first-child,
.rental-entry-content .wp-block-table:not(.is-style-hall-table-plain) tbody td:first-child,
.rental-entry-content .wp-block-table:not(.is-style-hall-table-plain) tbody th:first-child {
  background-color: var(--color-background-light, #fff8f2);
}

.entry-content .wp-block-table thead th,
.rental-entry-content .wp-block-table thead th {
  line-height: 1.375;
}

/* 背景なし（tbody のみ。thead は下記で常に白） */
.entry-content .wp-block-table.is-style-hall-table-plain tbody td,
.entry-content .wp-block-table.is-style-hall-table-plain tbody th,
.rental-entry-content .wp-block-table.is-style-hall-table-plain tbody td,
.rental-entry-content .wp-block-table.is-style-hall-table-plain tbody th {
  background-color: transparent;
}

/* thead は常に白背景・中央寄せ（列配置・ブロック設定より優先） */
.entry-content .wp-block-table thead th,
.entry-content .wp-block-table thead td,
.rental-entry-content .wp-block-table thead th,
.rental-entry-content .wp-block-table thead td {
  background-color: var(--color-background-light, #fff8f2) !important;
  text-align: center !important;
}

.entry-content .wp-block-table thead,
.rental-entry-content .wp-block-table thead {
  border-bottom: none;
}

@media (max-width: 767px) {
  .entry-content .wp-block-table,
  .rental-entry-content .wp-block-table {
    font-size: var(--text-size-13);
  }

  .entry-content .wp-block-table th,
  .entry-content .wp-block-table td,
  .rental-entry-content .wp-block-table th,
  .rental-entry-content .wp-block-table td {
    padding: 0.75rem 0.25rem;
  }
}

.rental-entry-content ul.wp-block-list {
  list-style: none;
  margin-left: 0;
  padding-left: 0;
}

.rental-entry-content ul.wp-block-list li {
  border-bottom: 1px solid var(--color-contrast, #000);
  padding: 1.25rem 0;
}

.rental-entry-content ul.wp-block-list li:first-child {
  border-top: 1px solid var(--color-contrast, #000);
}

.rental-entry-content .wp-block-buttons {
  width: auto;
  flex-grow: 0;
}
