/* hojokin.css — styles for subsidy-guide (補助金案内) and subsidy-detail (補助金詳細) pages
 *
 * Design tokens are sourced from /css/foundation/_tokens.css and
 * /css/foundation/_typography.css (loaded via foundation/index.css in _Layout).
 * This file must not redeclare :root tokens; it only uses var(--sjmn-*).
 * Off-palette colors from Figma that have no design token are noted inline.
 */

/* ============================================================
 * 1. Page-level layout overrides
 * ============================================================ */

.hojokin-page main {
  padding: 0;
  background-color: var(--sjmn-color-background-application-screen);
}

/* ============================================================
 * 1b. Breadcrumb and page title
 * ============================================================ */

.hojokin-breadcrumb {
  padding: 16px 24px 0;
  max-width: calc(1200px + 48px);
  margin: 0 auto;
  box-sizing: border-box;
}

.hojokin-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--sjmn-color-text-color-gray);
  font-size: var(--sjmn-size-14);
  line-height: 1.6;
}

.hojokin-breadcrumb li {
  display: inline-flex;
  align-items: center;
}

.hojokin-breadcrumb li + li::before {
  content: ">";
  margin: 0 8px;
  color: var(--sjmn-color-text-color-gray);
}

.hojokin-breadcrumb a {
  color: var(--sjmn-color-text-color-link);
  text-decoration: none;
}

.hojokin-breadcrumb a:hover,
.hojokin-breadcrumb a:focus-visible {
  text-decoration: underline;
}

.hojokin-page__title {
  padding: 12px 24px 0;
  max-width: calc(1200px + 48px);
  margin: 0 auto;
  box-sizing: border-box;
  font-size: var(--sjmn-size-32);
  font-weight: 400;
  line-height: 1.5;
  color: var(--sjmn-color-text-color-base);
}

/* ============================================================
 * 2. Subsidy-guide page (补助金案内)
 * ============================================================ */

.hojokin-guide {
  padding: 16px 24px 48px;
}

.hojokin-guide__list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Card */
.hojokin-guide__card {
  background-color: var(--sjmn-color-base-white);
  border: 1px solid var(--sjmn-color-border-color-gray);
  border-radius: 12px;
  padding: 24px 32px 32px;
}

/* Card top row: title (left) + deadline block (right) */
.hojokin-guide__card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

.hojokin-guide__card-title {
  flex: 1;
  min-width: 0;
  font-size: var(--sjmn-size-24);
  font-weight: 700;
  color: var(--sjmn-color-text-color-base);
  margin: 0;
}

.hojokin-guide__card-deadline-block {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hojokin-guide__card-deadline-label {
  font-size: var(--sjmn-size-14);
  color: var(--sjmn-color-text-color-gray);
}

.hojokin-guide__card-deadline-value {
  font-size: var(--sjmn-size-18);
  font-weight: 700;
  color: var(--sjmn-color-text-color-base);
}

.hojokin-guide__card-description {
  font-size: var(--sjmn-size-18);
  color: var(--sjmn-color-text-color-base);
  margin: 0 0 8px;
}

.hojokin-guide__card-operator {
  font-size: var(--sjmn-size-16);
  color: var(--sjmn-color-text-color-gray);
  margin: 0 0 20px;
}

.hojokin-guide__card-operator-label {
  font-size: var(--sjmn-size-16);
  font-weight: 400;
}

.hojokin-guide__card-operator-name {
  font-size: var(--sjmn-size-16);
  font-weight: 700;
  color: var(--sjmn-color-text-color-base);
}

/* Waku panels row */
.hojokin-guide__waku-panels {
  display: flex;
  gap: 16px;
}

.hojokin-guide__waku-panel {
  flex: 1;
  background-color: var(--sjmn-color-basic-background-color-grayplus1);
  border-radius: 10px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.hojokin-guide__waku-upperlimit-label {
  font-size: var(--sjmn-size-14);
  font-weight: 400;
  color: var(--sjmn-color-text-color-base);
  text-align: left;
  align-self: flex-start;
  width: 100%;
  margin: 0 0 4px;
}

.hojokin-guide__waku-upperlimit {
  font-size: var(--sjmn-size-18);
  font-weight: 700;
  color: var(--sjmn-color-text-color-base);
  text-align: left;
  align-self: flex-start;
  width: 100%;
  flex: 1;
  margin: 0 0 16px;
}

/* Pill link button — waku A/B/C */
.hojokin-guide__waku-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: min(300px, 100%);
  height: 64px;
  border-radius: 32px;
  text-decoration: none;
  font-size: var(--sjmn-size-16);
  font-weight: 700;
  color: var(--sjmn-color-text-color-white);
  background-color: var(--waku-color);
  transition: opacity 0.15s ease;
}

.hojokin-guide__waku-btn:hover,
.hojokin-guide__waku-btn:focus-visible {
  color: var(--sjmn-color-text-color-white);
  text-decoration: none;
  opacity: 0.85;
}

.hojokin-guide__waku-btn-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
}

/* ============================================================
 * 3. Subsidy-detail page (補助金詳細)
 * ============================================================ */

.hojokin-detail {
  padding: 16px 24px 48px;
}

.hojokin-detail__card {
  background-color: var(--sjmn-color-base-white);
  border: 1px solid var(--sjmn-color-border-color-gray);
  border-radius: 12px;
  padding: 32px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Header row: title left / apply button right */
.hojokin-detail__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
}

.hojokin-detail__title-area {
  flex: 1;
  min-width: 0;
  padding-right: 32px;
}

.hojokin-detail__title {
  font-size: var(--sjmn-size-32);
  font-weight: 700;
  color: var(--sjmn-color-text-color-base);
  margin: 0 0 8px;
}

.hojokin-detail__waku-label {
  font-size: var(--sjmn-size-32);
  font-weight: 700;
  color: var(--sjmn-color-text-color-base);
  margin: 0;
}

/* Apply button — shared base style */
.hojokin-detail__apply-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 280px;
  height: 64px;
  border-radius: 32px;
  font-size: var(--sjmn-size-16);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  border: none;
}

.hojokin-detail__apply-btn--active {
  position: relative;
  background-color: var(--sjmn-color-site-main-color-main-color);
  color: var(--sjmn-color-text-color-white);
}

.hojokin-detail__apply-btn--inactive {
  background-color: var(--sjmn-color-button-inactive);
  color: var(--sjmn-color-button-inactive-label);
  cursor: default;
}

.hojokin-detail__apply-btn-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  gap: 8px;
}

.hojokin-detail__apply-login-note {
  font-size: var(--sjmn-size-12);
  color: #2d3657;
  margin: 4px 0 0;
}

/* Overview section — 4-column horizontal info row */
.hojokin-detail__overview {
  margin-bottom: 8px;
}

.hojokin-detail__overview-cols {
  display: grid;
  grid-template-rows: auto auto;
  grid-auto-flow: column;
  gap: 4px 32px;
  align-items: center;
}

.hojokin-detail__overview-col {
  display: contents;
}

.hojokin-detail__overview-col-label {
  font-size: var(--sjmn-size-16);
  color: var(--sjmn-color-text-color-gray);
}

.hojokin-detail__overview-col-value {
  font-size: var(--sjmn-size-18);
  font-weight: 700;
  color: var(--sjmn-color-text-color-base);
}

.hojokin-detail__overview-col-value--badge {
  display: inline-block;
  width: fit-content;
  padding: 6px 8px;
  border-radius: 7.5px;
  background-color: var(--sjmn-color-base-white);
  border: 1px solid var(--sjmn-color-border-color-gray);
  font-size: var(--sjmn-size-18);
  font-weight: 700;
  color: var(--sjmn-color-text-color-base);
}

/* Section title + content */
.hojokin-detail__sections {
  margin-top: 24px;
}

.hojokin-detail__section-header {
  padding: 16px 0 8px;
  font-size: var(--sjmn-size-22);
  font-weight: 700;
  color: var(--sjmn-color-text-color-base);
}

.hojokin-detail__section-header > span {
  display: inline-block;
  padding-bottom: 4px;
}

.hojokin-detail__section-content {
  padding: 0 0 16px;
  font-size: var(--sjmn-size-16);
  color: var(--sjmn-color-text-color-base);
}

/* Other-waku link buttons */
.hojokin-detail__other-waku {
  margin-top: 16px;
  display: flex;
  gap: 16px;
  justify-content: flex-start;
}

.hojokin-detail__other-waku-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 379px;
  height: 63px;
  border-radius: 31.5px;
  font-size: var(--sjmn-size-16);
  font-weight: 700;
  color: var(--sjmn-color-text-color-white);
  text-decoration: none;
  border: 1px solid transparent;
  background-color: var(--waku-color);
  transition: opacity 0.15s ease;
}

.hojokin-detail__other-waku-btn:hover,
.hojokin-detail__other-waku-btn:focus-visible {
  color: var(--sjmn-color-text-color-white);
  text-decoration: none;
  opacity: 0.85;
}

.hojokin-detail__other-waku-btn-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
}

/* #0050b0 matches --sjmn-color-subsidy-color-innovative-product-service-frame;
   #1674d9 border — no design token (Figma off-palette stroke for waku-A other-waku button) */
.hojokin-detail__other-waku-btn--a {
  border-color: #1674d9;
}

/* Waku-label theme colors — match guide page waku button background colors */
.hojokin-detail__waku-label--a {
  color: var(--sjmn-color-subsidy-color-innovative-product-service-frame);
}

/* #df227d — no design token (Figma off-palette for waku-B guide card button) */
.hojokin-detail__waku-label--b {
  color: #df227d;
}

.hojokin-detail__waku-label--c {
  color: var(--sjmn-color-subsidy-color-global-frame);
}

/* Divider between sections and other-waku area */
.hojokin-detail__divider {
  border: none;
  border-top: 1px solid var(--sjmn-color-border-color-gray);
  margin: 24px 0 0;
}

.hojokin-detail__apply-btn-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
}

/* Back link to subsidy-guide page */
.hojokin-detail__back-link {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 16px auto 0;
  max-width: 1200px;
  font-size: var(--sjmn-size-16);
  font-weight: 400;
  color: var(--sjmn-color-text-color-base);
  text-decoration: underline;
}

.hojokin-detail__back-link:hover,
.hojokin-detail__back-link:focus-visible {
  text-decoration: none;
}
/* ============================================================
 * 4. Section-content HTML element styles (DB-sourced content)
 * ============================================================ */

/* Body text */
.hojokin-content__body {
  font-size: var(--sjmn-size-18);
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0;
  color: var(--sjmn-color-text-color-base);
  margin: 0;
}

/* Link within body text */
.hojokin-content__body a {
  color: var(--sjmn-color-text-color-link);
  text-decoration: underline;
}

.hojokin-content__body a:hover,
.hojokin-content__body a:focus-visible {
  text-decoration: none;
}

/* Bold body text */
.hojokin-content__body-bold {
  font-size: var(--sjmn-size-18);
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0;
  color: var(--sjmn-color-text-color-base);
  margin: 0;
}

/* Bold body text — frame A color (#0050b0) */
.hojokin-content__body-bold-waku-a {
  font-size: var(--sjmn-size-18);
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0;
  color: var(--sjmn-color-subsidy-color-innovative-product-service-frame);
  margin: 0;
}

/* Bold body text — frame B color (#df227d — no design token, Figma off-palette) */
.hojokin-content__body-bold-waku-b {
  font-size: var(--sjmn-size-18);
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0;
  color: #df227d;
  margin: 0;
}

/* Bold body text — frame C color (#15828c) */
.hojokin-content__body-bold-waku-c {
  font-size: var(--sjmn-size-18);
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0;
  color: var(--sjmn-color-subsidy-color-global-frame);
  margin: 0;
}

/* Content table (matches Figma design: left-column header, gray bg, D2D2D2 borders) */
.hojokin-content__table {
  width: 100%;
  border-collapse: collapse;
}

.hojokin-content__table th,
.hojokin-content__table td {
  border: 1px solid #d2d2d2;
  padding: 12px 16px;
  font-size: var(--sjmn-size-16);
  line-height: 1.6;
  color: var(--sjmn-color-text-color-base);
  vertical-align: top;
  text-align: left;
}

/* #ebeff4 = --sjmn-color-basic-background-color-grayplus1 (table header background from Figma) */
.hojokin-content__table th {
  background-color: #ebeff4;
  font-weight: 700;
  width: 140px;
  vertical-align: middle;
}

/* ※ annotation list — hanging indent so ※ aligns flush and wrapped lines indent */
.hojokin-content__note-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.hojokin-content__note-list li {
  padding-left: 24px;
  text-indent: -24px;
  font-size: var(--sjmn-size-14);
  line-height: 1.6;
  letter-spacing: 0;
  color: var(--sjmn-color-text-color-base);
}

.hojokin-content__note-list li::before {
  content: "※";
  margin-right: 8px;
}

/* ============================================================
 * 5. Responsive — SP (max-width: 767px)
 * ============================================================ */

@media screen and (width <= 767px) {
  .hojokin-breadcrumb {
    padding: 12px 16px 0;
  }

  .hojokin-page__title {
    padding: 8px 16px 0;
  }

  .hojokin-guide {
    padding: 12px 16px 40px;
  }

  /* On SP the card top stacks vertically: deadline-block first, title below */
  .hojokin-guide__card-top {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 8px;
  }

  .hojokin-guide__waku-panels {
    flex-direction: column;
  }

  .hojokin-guide__waku-btn {
    width: 100%;
  }

  .hojokin-detail {
    padding: 12px 16px 40px;
  }

  /* On SP the apply button stacks below the title */
  .hojokin-detail__header {
    flex-direction: column;
  }

  .hojokin-detail__title-area {
    padding-right: 0;
    margin-bottom: 16px;
  }

  .hojokin-detail__apply-btn {
    width: 311px;
  }

  /* Overview columns wrap on SP — restore flex layout */
  .hojokin-detail__overview-cols {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-start;
  }

  .hojokin-detail__overview-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  /* Other-waku buttons stack on SP */
  .hojokin-detail__other-waku {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .hojokin-detail__other-waku-btn {
    width: 310px;
  }
}
