/**
 * PONO UI Kit
 * 共通UIの見た目は原則としてこのファイルで管理します。
 */

:root {
  --pono-ui-navy: #061f59;
  --pono-ui-navy-soft: #eef3fa;
  --pono-ui-surface: #ffffff;
  --pono-ui-surface-soft: #f7f9fc;
  --pono-ui-border: #dfe5ee;
  --pono-ui-border-strong: #cbd5e3;
  --pono-ui-text: #202734;
  --pono-ui-muted: #647084;
  --pono-ui-radius-sm: 8px;
  --pono-ui-radius-md: 12px;
  --pono-ui-radius-lg: 16px;
  --pono-ui-shadow-sm: 0 4px 14px rgba(6, 31, 89, 0.05);
  --pono-ui-shadow-md: 0 10px 28px rgba(6, 31, 89, 0.07);
  --pono-ui-space-1: 8px;
  --pono-ui-space-2: 12px;
  --pono-ui-space-3: 16px;
  --pono-ui-space-4: 20px;
  --pono-ui-space-5: 24px;
}

/* =========================================================
   Tables: shared
========================================================= */

.wp-block-table.is-style-pono-info,
.wp-block-table.is-style-pono-compact,
.wp-block-table.is-style-pono-compare,
.pono-ui-table-wrap {
  margin-block: 1.5em;
}

.wp-block-table.is-style-pono-info table,
.wp-block-table.is-style-pono-compact table,
table.pono-ui-table--info,
table.pono-ui-table--compact {
  width: 100%;
  margin: 0;
  border: 1px solid var(--pono-ui-border);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--pono-ui-radius-md);
  overflow: hidden;
  background: var(--pono-ui-surface);
  color: var(--pono-ui-text);
  box-shadow: var(--pono-ui-shadow-sm);
  font-size: clamp(14px, 1.4vw, 15px);
  line-height: 1.75;
}

.wp-block-table.is-style-pono-info th,
.wp-block-table.is-style-pono-info td,
.wp-block-table.is-style-pono-compact th,
.wp-block-table.is-style-pono-compact td,
table.pono-ui-table--info th,
table.pono-ui-table--info td,
table.pono-ui-table--compact th,
table.pono-ui-table--compact td {
  padding: 15px 17px;
  border: 0;
  border-right: 1px solid var(--pono-ui-border);
  border-bottom: 1px solid var(--pono-ui-border);
  vertical-align: top;
  text-align: left;
}

.wp-block-table.is-style-pono-info th,
.wp-block-table.is-style-pono-compact th,
table.pono-ui-table--info th,
table.pono-ui-table--compact th {
  width: 28%;
  min-width: 150px;
  background: var(--pono-ui-surface-soft);
  color: var(--pono-ui-navy);
  font-weight: 700;
}

.wp-block-table.is-style-pono-info tr > *:last-child,
.wp-block-table.is-style-pono-compact tr > *:last-child,
table.pono-ui-table--info tr > *:last-child,
table.pono-ui-table--compact tr > *:last-child {
  border-right: 0;
}

.wp-block-table.is-style-pono-info tr:last-child > *,
.wp-block-table.is-style-pono-compact tr:last-child > *,
table.pono-ui-table--info tr:last-child > *,
table.pono-ui-table--compact tr:last-child > * {
  border-bottom: 0;
}

.wp-block-table.is-style-pono-info figcaption,
.wp-block-table.is-style-pono-compact figcaption,
.wp-block-table.is-style-pono-compare figcaption {
  margin-top: 9px;
  color: var(--pono-ui-muted);
  font-size: 0.85em;
  line-height: 1.6;
  text-align: left;
}

/* Compact table */
.wp-block-table.is-style-pono-compact th,
.wp-block-table.is-style-pono-compact td,
table.pono-ui-table--compact th,
table.pono-ui-table--compact td {
  padding: 10px 13px;
}

/* =========================================================
   Tables: comparison
========================================================= */

.wp-block-table.is-style-pono-compare,
.pono-ui-table-wrap--compare {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--pono-ui-border-strong) transparent;
}

.wp-block-table.is-style-pono-compare::-webkit-scrollbar,
.pono-ui-table-wrap--compare::-webkit-scrollbar {
  height: 8px;
}

.wp-block-table.is-style-pono-compare::-webkit-scrollbar-thumb,
.pono-ui-table-wrap--compare::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--pono-ui-border-strong);
}

.wp-block-table.is-style-pono-compare table,
table.pono-ui-table--compare {
  width: 100%;
  min-width: 680px;
  margin: 0;
  border: 1px solid var(--pono-ui-border);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--pono-ui-radius-md);
  overflow: hidden;
  background: var(--pono-ui-surface);
  color: var(--pono-ui-text);
  box-shadow: var(--pono-ui-shadow-sm);
  font-size: clamp(13px, 1.35vw, 15px);
  line-height: 1.7;
}

.wp-block-table.is-style-pono-compare th,
.wp-block-table.is-style-pono-compare td,
table.pono-ui-table--compare th,
table.pono-ui-table--compare td {
  padding: 14px 15px;
  border: 0;
  border-right: 1px solid var(--pono-ui-border);
  border-bottom: 1px solid var(--pono-ui-border);
  vertical-align: top;
  text-align: left;
}

.wp-block-table.is-style-pono-compare thead th,
table.pono-ui-table--compare thead th {
  background: var(--pono-ui-navy);
  color: #fff;
  font-weight: 700;
  text-align: center;
}

.wp-block-table.is-style-pono-compare tbody th,
table.pono-ui-table--compare tbody th {
  width: 24%;
  min-width: 150px;
  background: var(--pono-ui-surface-soft);
  color: var(--pono-ui-navy);
  font-weight: 700;
}

.wp-block-table.is-style-pono-compare tr > *:last-child,
table.pono-ui-table--compare tr > *:last-child {
  border-right: 0;
}

.wp-block-table.is-style-pono-compare tr:last-child > *,
table.pono-ui-table--compare tr:last-child > * {
  border-bottom: 0;
}

/* =========================================================
   Boxes
========================================================= */

.wp-block-group.is-style-pono-summary,
.wp-block-group.is-style-pono-diagnosis,
.wp-block-group.is-style-pono-risk,
.wp-block-group.is-style-pono-card,
.pono-ui-box {
  position: relative;
  margin-block: 1.5em;
  padding: clamp(18px, 3vw, 24px);
  border: 1px solid var(--pono-ui-border);
  border-radius: var(--pono-ui-radius-md);
  background: var(--pono-ui-surface);
  color: var(--pono-ui-text);
  box-shadow: var(--pono-ui-shadow-sm);
}

.wp-block-group.is-style-pono-summary,
.pono-ui-box--summary {
  border-left: 4px solid var(--pono-ui-navy);
  background: linear-gradient(135deg, var(--pono-ui-navy-soft), #fff 72%);
}

.wp-block-group.is-style-pono-diagnosis,
.pono-ui-box--diagnosis {
  border-color: #cfd9e8;
  background: linear-gradient(180deg, #fff, #f8fafd);
}

.wp-block-group.is-style-pono-risk,
.pono-ui-box--risk {
  border-color: var(--pono-ui-border-strong);
  background: #fafbfd;
  box-shadow: none;
}

.wp-block-group.is-style-pono-card,
.pono-ui-box--card {
  box-shadow: var(--pono-ui-shadow-md);
}

.wp-block-group.is-style-pono-summary > :first-child,
.wp-block-group.is-style-pono-diagnosis > :first-child,
.wp-block-group.is-style-pono-risk > :first-child,
.wp-block-group.is-style-pono-card > :first-child,
.pono-ui-box > :first-child {
  margin-top: 0;
}

.wp-block-group.is-style-pono-summary > :last-child,
.wp-block-group.is-style-pono-diagnosis > :last-child,
.wp-block-group.is-style-pono-risk > :last-child,
.wp-block-group.is-style-pono-card > :last-child,
.pono-ui-box > :last-child {
  margin-bottom: 0;
}

.pono-ui-box__label {
  margin: 0 0 8px;
  color: var(--pono-ui-navy);
  font-size: 0.82em;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.pono-ui-box__title {
  margin: 0 0 10px;
  color: var(--pono-ui-navy);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.45;
}

/* =========================================================
   Related links
========================================================= */

ul.is-style-pono-link-list,
ul.pono-ui-link-list {
  display: grid;
  gap: 10px;
  margin: 1.25em 0;
  padding: 0;
  list-style: none;
}

ul.is-style-pono-link-list li,
ul.pono-ui-link-list li {
  margin: 0;
  padding: 0;
}

ul.is-style-pono-link-list a,
ul.pono-ui-link-list a {
  position: relative;
  display: block;
  padding: 14px 44px 14px 16px;
  border: 1px solid var(--pono-ui-border);
  border-radius: var(--pono-ui-radius-sm);
  background: var(--pono-ui-surface);
  color: var(--pono-ui-navy);
  font-weight: 600;
  line-height: 1.55;
  text-decoration: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

ul.is-style-pono-link-list a::after,
ul.pono-ui-link-list a::after {
  content: "›";
  position: absolute;
  top: 50%;
  right: 17px;
  transform: translateY(-52%);
  color: var(--pono-ui-navy);
  font-size: 1.35em;
  line-height: 1;
}

@media (hover: hover) {
  ul.is-style-pono-link-list a:hover,
  ul.pono-ui-link-list a:hover {
    border-color: var(--pono-ui-navy);
    box-shadow: var(--pono-ui-shadow-sm);
    transform: translateY(-1px);
  }
}

/* =========================================================
   Mobile
========================================================= */

@media (max-width: 782px) {
  .wp-block-table.is-style-pono-info {
    overflow: visible;
  }

  .wp-block-table.is-style-pono-info table,
  table.pono-ui-table--info {
    display: block;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .wp-block-table.is-style-pono-info tbody,
  .wp-block-table.is-style-pono-info tr,
  .wp-block-table.is-style-pono-info th,
  .wp-block-table.is-style-pono-info td,
  table.pono-ui-table--info tbody,
  table.pono-ui-table--info tr,
  table.pono-ui-table--info th,
  table.pono-ui-table--info td {
    display: block;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .wp-block-table.is-style-pono-info tr,
  table.pono-ui-table--info tr {
    margin-bottom: 12px;
    overflow: hidden;
    border: 1px solid var(--pono-ui-border);
    border-radius: var(--pono-ui-radius-md);
    background: var(--pono-ui-surface);
    box-shadow: var(--pono-ui-shadow-sm);
  }

  .wp-block-table.is-style-pono-info tr:last-child,
  table.pono-ui-table--info tr:last-child {
    margin-bottom: 0;
  }

  .wp-block-table.is-style-pono-info th,
  table.pono-ui-table--info th {
    padding: 10px 14px 8px;
    border: 0;
    background: var(--pono-ui-surface-soft);
    font-size: 0.9em;
    line-height: 1.5;
  }

  .wp-block-table.is-style-pono-info td,
  table.pono-ui-table--info td {
    padding: 12px 14px 14px;
    border: 0;
    background: var(--pono-ui-surface);
    line-height: 1.75;
  }

  .wp-block-table.is-style-pono-compare,
  .pono-ui-table-wrap--compare {
    margin-inline: -4px;
    padding: 0 4px 8px;
  }

  .wp-block-table.is-style-pono-compare table,
  table.pono-ui-table--compare {
    min-width: 640px;
  }

  .wp-block-table.is-style-pono-compare tbody th,
  table.pono-ui-table--compare tbody th {
    position: sticky;
    left: 0;
    z-index: 2;
    box-shadow: 1px 0 0 var(--pono-ui-border);
  }

  .wp-block-group.is-style-pono-summary,
  .wp-block-group.is-style-pono-diagnosis,
  .wp-block-group.is-style-pono-risk,
  .wp-block-group.is-style-pono-card,
  .pono-ui-box {
    padding: 17px 16px;
    border-radius: 10px;
  }

  ul.is-style-pono-link-list a,
  ul.pono-ui-link-list a {
    padding: 13px 40px 13px 14px;
  }
}

/* =========================================================
   Accessibility / print
========================================================= */

@media (prefers-reduced-motion: reduce) {
  ul.is-style-pono-link-list a,
  ul.pono-ui-link-list a {
    transition: none;
  }
}

@media print {
  .wp-block-table.is-style-pono-compare,
  .pono-ui-table-wrap--compare {
    overflow: visible;
  }

  .wp-block-table.is-style-pono-compare table,
  table.pono-ui-table--compare {
    min-width: 0;
  }

  .wp-block-group.is-style-pono-summary,
  .wp-block-group.is-style-pono-diagnosis,
  .wp-block-group.is-style-pono-risk,
  .wp-block-group.is-style-pono-card,
  .pono-ui-box,
  .wp-block-table.is-style-pono-info table,
  .wp-block-table.is-style-pono-compact table,
  .wp-block-table.is-style-pono-compare table {
    box-shadow: none;
  }
}
