/* About page (財団概要). */

/* Overview table section. */
.ab-table-section { background: #fff; padding: clamp(32px, 5vw, 40px) 0 clamp(48px, 6vw, 60px); }
.ab-table-inner { max-width: 960px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 2rem); }

/* Overview wrapper */
.ab-overview-wrap {
  display: flex;
  flex-direction: column;
  gap: 40px;
  position: relative;
  isolation: isolate;
}

/* Section title — bottom border only */
.ab-section-title-wrap {
  box-sizing: border-box;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 0 0 10px;
  gap: 10px;
  border-bottom: 3px solid rgba(0, 143, 141, 0.7);
  backdrop-filter: blur(6px);
  align-self: stretch;
  flex-grow: 0;
  z-index: 0;
}
.ab-section-title-wrap::before,
.ab-section-title-wrap::after { display: none; }
.ab-section-title {
  font-family: 'Noto Sans JP', sans-serif;
  font-style: normal;
  font-weight: 700;
  font-size: 26px;
  line-height: 31px;
  letter-spacing: -0.02em;
  color: #008F8D;
  display: flex;
  align-items: center;
  white-space: nowrap;
  flex: none;
  flex-grow: 0;
}
/* Table card — allow horizontal scroll when the table is wider than viewport */
.ab-table-card {
  background: #FFFFFF;
  border: 1px solid #F3F3F3;
  border-radius: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

/* Info table */
.ab-info-table { width: 100%; border-collapse: collapse; }
.ab-info-table tr {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid #EAECF0;
  margin: 0; padding: 0;
}
.ab-info-table tr:last-child { border-bottom: none; }
.ab-info-table th {
  width: 308px;
  min-width: 308px;
  flex-shrink: 0;
  min-height: 72px;
  padding: 16px 24px;
  background: #F5F6F7;
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 700; font-size: 18px; line-height: 24px;
  color: #008F8D;
  text-align: left;
  display: flex;
  align-items: center;
  border: none;
  box-sizing: border-box;
}
.ab-info-table td {
  flex: 1;
  min-height: 72px;
  padding: 16px 24px;
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 500; font-size: 16px; line-height: 24px;
  color: #42526B;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

/* ── Body layout: sidebar + main ── */
.ab-body-layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 33px clamp(16px, 4vw, 2rem) clamp(72px, 9vw, 119px);
  display: flex;
  align-items: flex-start;
  gap: 40px;
}
.ab-main { flex: 1; min-width: 0; }

/* Neutralize standalone section spacing when nested in the layout */
.ab-body-layout .ab-table-section,
.ab-body-layout .ab-org-section {
  max-width: none;
  margin: 0;
  padding: 0;
  background: transparent;
}
.ab-body-layout .ab-table-inner { max-width: none; margin: 0; padding: 0; }
.ab-body-layout .ab-table-section { margin-bottom: 56px; }

/* Sidebar */
.ab-sidebar {
  width: 270px;
  flex: none;
  position: sticky;
  /* Offset below sticky .site-header-wrap (105px). Matches .sn-req-sidebar. */
  top: 129px;
}
.ab-sidebar-menu {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
}
.ab-sidebar-title {
  display: flex;
  align-items: center;
  min-height: 62px;
  padding: 20px;
  box-sizing: border-box;
  background: #006E6C;
  color: #E9ECEE;
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 700; font-size: 18px; line-height: 22px;
  border-bottom: 1px solid #FFFFFF;
}
.ab-sidebar-link {
  display: flex;
  align-items: center;
  min-height: 62px;
  padding: 20px;
  box-sizing: border-box;
  background: #E9ECEE;
  color: #006E6C;
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 700; font-size: 18px; line-height: 22px;
  border-bottom: 1px solid #FFFFFF;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.ab-sidebar-link:last-child { border-bottom: none; }
.ab-sidebar-link:hover,
.ab-sidebar-link[aria-current="page"] {
  background: #006E6C;
  color: #FFFFFF;
}

/* Org chart section. */
.ab-org-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 2rem) clamp(56px, 7vw, 76px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}
.ab-org-section .ab-section-title-wrap { align-self: stretch; }
.ab-org-date {
  align-self: stretch;
  text-align: right;
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 500; font-size: 16px; line-height: 24px;
  color: #42526B;
  margin: -24px 0 0;
}
.ab-org-chart {
  width: 100%;
  text-align: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.ab-org-chart img { display: block; max-width: 833px; width: 100%; height: auto; margin: 0 auto; }

/* Responsive */
@media (max-width: 960px) {
  .ab-body-layout { flex-direction: column; padding-top: 32px; gap: 24px; }
  .ab-sidebar { width: 100%; position: static; top: auto; }
  .ab-sidebar .sn-mm-sidebar-nav { max-width: none; margin-bottom: 0; }
}

@media (max-width: 768px) {
  .ab-body-layout { gap: 24px; padding-bottom: 64px; }
  .ab-body-layout .ab-table-section { margin-bottom: 40px; }
  .ab-overview-wrap,
  .ab-org-section { gap: 24px; }
  .ab-section-title-wrap { padding-bottom: 8px; border-bottom-width: 2px; }
  .ab-section-title { font-size: 22px; line-height: 1.35; }
  .ab-table-card { overflow: visible; border-radius: 10px; }
  .ab-info-table,
  .ab-info-table tbody {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .ab-info-table tr {
    display: block;
    border-bottom: 1px solid #EAECF0;
  }
  .ab-info-table th,
  .ab-info-table td {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 0;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.65;
  }
  .ab-info-table th {
    background: #F5F6F7;
    border-bottom: 1px solid #EAECF0;
  }
  .ab-sidebar .sn-mm-sidebar-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border-radius: 12px;
    background: #fff;
  }
  .ab-sidebar .sn-mm-sidebar-title {
    grid-column: 1 / -1;
    border-radius: 0;
  }
  .ab-sidebar .sn-mm-sidebar-link {
    min-height: 48px;
    border: 0;
    border-radius: 0 !important;
  }
  .ab-org-chart img {
    width: max(100%, 560px);
    max-width: none;
  }
}

@media (max-width: 480px) {
  .ab-body-layout { padding-top: 24px; padding-bottom: 52px; gap: 20px; }
  .ab-info-table th,
  .ab-info-table td { padding: 10px 14px; font-size: 13px; }
  .ab-sidebar .sn-mm-sidebar-title,
  .ab-sidebar .sn-mm-sidebar-link {
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.45;
  }
  .ab-org-chart img { width: max(100%, 520px); }
}

/* Multi-frame hero banner: teal band left + 3 diagonal slivers middle + large image right. */
.ab-hero {
  --scale-len: 1px;
  --hero-h: calc(340 * var(--scale-len));
  --slant: calc(120 * var(--scale-len));
  --gap: calc(6 * var(--scale-len));
  --margin-mid: calc(-1 * var(--slant) + var(--gap));

  position:relative;
  max-width:1280px;
  margin:0 auto;
  padding: 0 2rem;
  box-sizing: border-box;
  background-clip: content-box;
  display:flex;
  align-items:stretch;
  height:var(--hero-h);
  overflow:hidden;
}

@media (max-width: 1344px) {
  .ab-hero {
    --scale-len: calc((100vw - 4rem) / 1280);
  }
}

@media (max-width: 768px) {
  .ab-hero {
    padding: 0 16px;
    --scale-len: clamp(0.58px, calc((100vw - 32px) / 900), 0.78px);
  }
}
/* Left zone: teal title band on white. */
.ab-hero-left{
  flex:0 0 35%;
  display:flex;
  align-items:center;
  padding-left:calc(50 * var(--scale-len));
  background:#F3F2F7 url('../images/build-webp/service_bg.webp') center/cover no-repeat;
  position:relative;
  z-index:2;
  clip-path: polygon(0 0, 100% 0, calc(100% - var(--slant)) 100%, 0 100%);
}
.ab-hero-band{
  display:inline-flex;
  flex-direction:column;
  align-items:center;
  gap:calc(10 * var(--scale-len));
  background:#006E6C;
  color:#fff;
  padding:calc(8 * var(--scale-len)) calc(40 * var(--scale-len));
}
.ab-hero-band-main{
  margin:0;
  font-family:'Noto Sans JP',sans-serif;
  font-weight:700;
  font-size:calc(36 * var(--scale-len));
  line-height:1.25;
  letter-spacing:.1em;
  color:#fff;
}
.ab-hero-band-sub{
  font-family:'Noto Sans JP',sans-serif;
  font-weight:500;
  font-size:max(calc(17 * var(--scale-len)), 9px);
  letter-spacing:.12em;
}
/* Middle zone: 3 diagonal slivers stacked vertically. */
.ab-hero-mid{
  flex:0 0 24%;
  display:flex;
  flex-direction:column;
  margin-left:var(--margin-mid);
  z-index:1;
}
.ab-hero-slice{
  display:block;
  flex:1 1 0;
  min-height:0;
  position:relative;
  clip-path:polygon(var(--slant) 0, 100% 0, calc(100% - var(--slant)) 100%, 0 100%);
}
/* Right zone: large 社屋 image with diagonal left edge. */
.ab-hero-main{
  flex:1 1 auto;
  margin-left:var(--margin-mid);
  position:relative;
  clip-path:polygon(var(--slant) 0, 100% 0, 100% 100%, 0 100%);
}

.ab-hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.ab-hero-slice:hover .ab-hero-bg,
.ab-hero-main:hover .ab-hero-bg {
  transform: scale(1.06);
}

@media (max-width: 520px) {
  .ab-hero {
    height: clamp(210px, 58vw, 250px);
    margin: 0 16px;
    padding: 0;
    border-radius: 12px;
  }
  .ab-hero-left {
    position: absolute;
    inset: 0;
    width: 100%;
    padding-left: 20px;
    background: linear-gradient(90deg, rgba(243, 242, 247, 0.9) 0%, rgba(243, 242, 247, 0.48) 55%, rgba(243, 242, 247, 0.08) 100%);
    clip-path: none;
  }
  .ab-hero-mid { display: none; }
  .ab-hero-main {
    position: absolute;
    inset: 0;
    margin-left: 0;
    clip-path: none;
  }
  .ab-hero-band {
    padding: 8px 20px;
    gap: 6px;
  }
  .ab-hero-band-main {
    font-size: clamp(24px, 7vw, 30px);
    letter-spacing: .06em;
  }
  .ab-hero-band-sub {
    font-size: clamp(12px, 3.8vw, 15px);
    letter-spacing: .08em;
  }
}

/* Removed mobile override to keep proportional scaling */
.sn-breadcrumb-wrap { max-width: 1280px; }

/* Shared title-band sizing for every about-cluster child page. Page-specific
   files previously mixed line-height 1 vs 1.3, causing the band height to jump
   when navigating through the shared sidebar. */
.am-title-band,
.pv-title-band,
.dc-title-band,
.qa-title-band,
.rs-title-band,
.eap-title-band,
.wsr-title-band,
.hm-title-band {
  display: inline-flex !important;
  align-items: center;
  box-sizing: border-box;
  min-height: 63px;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
  font-size: 26px !important;
  line-height: 1.3 !important;
}

@media (max-width: 991px) {
  .am-title-band,
  .pv-title-band,
  .dc-title-band,
  .qa-title-band,
  .rs-title-band,
  .eap-title-band,
  .wsr-title-band,
  .hm-title-band {
    min-height: 56px;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    font-size: 22px !important;
  }
}

@media (max-width: 768px) {
  .am-title-band,
  .pv-title-band,
  .dc-title-band,
  .qa-title-band,
  .rs-title-band,
  .eap-title-band,
  .wsr-title-band,
  .hm-title-band {
    min-height: 52px;
    font-size: 20px !important;
  }
}

@media (max-width: 480px) {
  .am-title-band,
  .pv-title-band,
  .dc-title-band,
  .qa-title-band,
  .rs-title-band,
  .eap-title-band,
  .wsr-title-band,
  .hm-title-band {
    min-height: 48px;
    padding-top: 7px !important;
    padding-bottom: 7px !important;
    font-size: 18px !important;
  }
}

/* Editor-only: make the editor iframe render .ab-body-layout matching the
   frontend. Gutenberg wraps each InnerBlocks child in .wp-block, so we need
   explicit overrides so the .ab-body-layout flex applies to those wrappers. */
/* ab-body wrapper takes full editor width; centering handled by base rule. */
.editor-styles-wrapper .wp-block[data-type="sunatec/ab-body"] {
    max-width: none !important;
    width: auto !important;
    margin: 0 !important;
}

/* The 2-col flex — apply to Gutenberg's inner-blocks wrapper inside .ab-body-layout */
.editor-styles-wrapper .ab-body-layout > .block-editor-inner-blocks,
.editor-styles-wrapper .ab-body-layout > .block-editor-inner-blocks > .block-editor-block-list__layout {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 40px !important;
    width: 100% !important;
}

/* Sidebar block: fixed 270px */
.editor-styles-wrapper .wp-block[data-type="sunatec/ab-sidebar"] {
    flex: 0 0 270px !important;
    width: 270px !important;
    max-width: 270px !important;
    margin: 0 !important;
}

/* Main content block: grow */
.editor-styles-wrapper .wp-block[data-type="sunatec/ab-content"] {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
}
/* Also make .ab-main (inside ab-content edit) fill available width */
.editor-styles-wrapper .wp-block[data-type="sunatec/ab-content"] > .ab-main {
    width: 100%;
}

/* Stack on tablet/mobile — mirrors frontend responsive rule */
@media (max-width: 960px) {
    .editor-styles-wrapper .ab-body-layout > .block-editor-inner-blocks,
    .editor-styles-wrapper .ab-body-layout > .block-editor-inner-blocks > .block-editor-block-list__layout {
        flex-direction: column !important;
        gap: 24px !important;
    }
    .editor-styles-wrapper .wp-block[data-type="sunatec/ab-sidebar"] {
        flex: 0 0 auto !important;
        width: 100% !important;
        max-width: none !important;
    }
}
