/* ============ Base ============ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --panel: #EEEEEF;
  --brand: #D70027;
  --radius-md: 8px;
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -4px rgba(0, 0, 0, .1);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.center {
  text-align: center;
}

/* ============ Layout Containers ============ */
.container {
  padding: 4.8rem 3.2rem;
  margin-inline: auto;
}

.container-fullwidth {
  width: 100%;
  padding-left: 0;
  padding-right: 0;
}

.container-1440 {
  max-width: 1440px;
}

@media (max-width: 767px) {
  .container {
    padding: 1.6rem;
    margin-inline: auto;
  }

  .container-fullwidth {
    padding-left: 0;
    padding-right: 0;
  }
}

/* ============ Hero ============ */
.hero {
  margin-bottom: 3.2rem;
}

.hero__cap {
  width: 45px;
  height: 5px;
  background: var(--brand);
  margin: 0 auto 30px;
}

.hero__box {
  width: 100%;
  height: 260px;
  background: var(--panel);
  display: grid;
  place-items: center;
}

.hero__title {
  font-size: clamp(4rem, 6vw, 75px);
  line-height: 1.05;
  margin: 0;
  font-weight: 700;
}

/* Meta strip under hero */
.hero__meta {
  margin: 1.5rem auto 0;
  max-width: 998px;
  display: grid;
  gap: 1.6rem;
}

.single-cases .hero__meta {
  margin: 0 auto 0;
}

.hero__meta .service-icon,
.card__body .service-icon {
  width: 2.4rem;
}

.pill-wrap {
  display: block;
}
.pill--flex {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.pill {
  display: inline-block;
  border: 1px solid #333;
  border-radius: 9999px;
  padding: 0.8rem 2.4rem;
  line-height: 1;
}

.pill--sm {
  padding: 0.6rem 1.2rem;
}

.pill--md {
  padding: 0.8rem 1.6rem;
}

.pill--tag {
  padding: 0.5rem 1.2rem;
  border: none;
}

/* Title block */
.title-box {
  font-size: 40px;
  font-weight: 700;
  line-height: 51px;
  overflow-wrap: break-word;
  word-break: break-word;
}
.single-cases .title-box.cases-title {
  margin-bottom: 0.4rem;
}

.title-box__heading {
  margin: 0;
  font-size: 40px;
  font-weight: 700;
}

/* Meta row */
.meta-row {
  display: flex;
  align-items: flex-end;
  gap: 1.6rem;
  font-size: 14px;
  margin-bottom: 10px;
  margin-top: auto;
}

.single-cases .meta-row {
  margin-bottom: 3.3rem;
}

.meta-row--sm {
  gap: 1.2rem;
}

.meta-row--insight {
  margin-top: unset;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
}

.icon {
  width: 1.6rem;
  height: 1.6rem;
  fill: currentColor;
}

.icon--sm {
  width: 1.2rem;
  height: 1.2rem;
}

.icon--md {
  width: 1.6rem;
  height: 1.6rem;
}

.icon--stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ============ Hero Placeholder ============ */
.hero-placeholder {
  width: 100%;
  height: 500px;
  background: #e5e7eb;
  border-radius: 2px;
  display: grid;
  place-items: center;
}

.hero-placeholder__text {
  color: #9ca3af;
  font-size: 2rem;
  margin: 0;
}

/* ============ Highlights ============ */
.highlights {
  display: grid;
  gap: 2.4rem;
}

.cases-detail-content .highlights {
  gap: 2rem;
}

.highlight-card {
  background: var(--panel);
  border-radius: var(--radius-md);
  padding: 16px;
}

.highlight-card__wrap {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 24px;
  align-items: center;
}

.figure__icon {
  margin: 0;
  display: block;
  max-width: 98px;
}

.highlight-card__text {
  font-weight: 700;
  font-size: 14px;
  line-height: 32px;
}

.highlight-card__text p {
  margin: 0 0 0.4rem;
  word-break: break-all;
}

.highlight-card__text p:last-child {
  margin-bottom: 0;
}

@media (max-width: 767px) {
  .highlight-card__wrap {
    align-items: normal;
  }
}

/* ============ Split Heading & Content ============ */
.section {
  margin-bottom: 6.4rem;
}

.section--narrow-5xl {
  max-width: 998px;
  margin-inline: auto;
}

.cases-detail-content .section--narrow-5xl {
  margin-bottom: 4rem;
}

.split-heading {
  display: grid;
  justify-items: center;
}

.split-heading__cap {
  width: 45px;
  height: 5px;
  background: var(--brand);
  margin-bottom: 16px;
}

.split-heading__title {
  margin: 0;
  font-size: 4rem;
  line-height: 1.1;
  font-weight: 700;
}

.content-box {
  background: #fff;
  padding: 24px 0;
}

.single-cases .cases-detail-content .wp-block-cases-client-overview .content-box {
  padding: 2rem 0;
}

.content-box p {
  color: #374151;
  margin: 0 0 1.6rem;
  word-break: break-word;
  font-size: 1.8rem;
}

.content-box p:last-child {
  margin-bottom: 0;
}

.content-section {
  margin-bottom: 2rem;
}

.cases-detail-content .wp-block-cases-client-overview .content-section {
  margin-bottom: 4rem;
}

.content-section__header {
  background: var(--panel);
  padding: 9px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 8px;
}

.content-section__header img {
  max-width: 30px;
}

.content-section__title {
  margin: 0;
  font-size: 3rem;
  line-height: 1.2;
  font-weight: 700;
  color: var(--text);
}

.content-section__body {
  background: #fff;
  padding: 2rem 0;
  word-break: break-all;
  text-align: justify;
}

.content-section__body p {
  color: #374151;
  margin: 0 0 1.6rem;
  font-size: 1.4rem;
}

.content-section__body p:last-child {
  margin-bottom: 0;
}

/* ============ Other Cases ============ */
.section-title {
  font-size: 3rem;
  font-weight: 700;
  margin: 0 0 2.5rem;
}

#other-cases .section-title {
  margin-block: 2.8rem;
}

.card-grid {
  display: grid;
  gap: 2.4rem;
  grid-template-columns: 1fr;
  margin-bottom: 3.2rem;
}

.row-g-40 {
  row-gap: 40px;
}

@media (min-width: 768px) {
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
  background: var(--panel);
  height: 413px;
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--gray-300);
}

.card__media {
  overflow: hidden;
  flex-shrink: 0;
}

.card-image {
  width: 100%;
  height: 17.8rem;
  object-fit: cover;
  transform: scale(1);
  transition: transform .3s ease;
}

.card:hover .card-image {
  transform: scale(1.05);
}

.card__body {
  padding: 2rem;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.insight-card__body {
  padding: 2rem;
  margin-bottom: 0;
  font-size: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 150px;
  height: 100%;
}

/* Insight cards: 420px height instead of 413px */
body.post-type-archive-insight .card,
body.tax-column .card {
  height: 420px;
}

.card__title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0.4rem 0 0.8rem;
  line-height: 1.25;
  word-break: break-word;
  /* Clamp to 3 lines with ellipsis */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card__desc {
  color: #4b5563;
  line-height: 1.6;
  margin: 0 0 1.6rem;
  word-break: break-word;
}

/* Meta row at bottom: service and date stacked vertically on left, arrow on right */
.card__meta-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
}

.card__date {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card__date svg {
  flex-shrink: 0;
}

.card__date time {
  padding-top: 2px;
}

.card__date-row {
  margin-top: auto;
}

.card__cta {
  display: flex;
  justify-content: flex-end;
}

.circle-cta {
  width: 31px;
  height: 30px;
  background: #D70027;
  color: #fff;
  border-radius: 9999px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.card__date time {
  text-align: left;
  padding-top: 3px;
}

.btn {
  width: 100%;
  appearance: none;
  background: transparent;
  border: 2px solid var(--gray-300);
  color: inherit;
  padding: 1.2rem 3.2rem;
  border-radius: 60rem;
  cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease;
  margin: auto;
  background: var(--panel);
}

/* .btn:hover { border-color: #cbd5e1; background: #f8fafc; } */
.btn-noborder {
  border: none;
}

.btn-primary {
  background: #FFFFFF;
}
.btn-secondary {
  background: #EEEEEF;
}

.card__body:after,
.insight-card__body:after {
  position: absolute;
  content: "";
  right: 24px;
  background: url(../images/ja/common/icon_button.png) no-repeat center center / contain;
  width: 31px;
  height: 31px;
  bottom: 24px;
}

.archive-load-more {
  margin-top: 80px;
}

.image-wrapper {
  position: relative;
  width: 100%;
  display: block;
  background: #f5f5f5;
  border: 1px solid #ddd;
  overflow: hidden;

  /* aspect-ratio placeholder */
  aspect-ratio: 16/9;
  /* overridden by inline style if provided */
}

.image-wrapper .image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* fallback placeholder */
.no-image {
  display: none;
  position: absolute;
  inset: 0;
  background-color: #D1D1D3;
  border: 1px solid #ddd;
  color: #999;

  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.no-image-icon svg {
  width: 48px;
  height: 48px;
  opacity: 0.5;
}

.no-image figcaption {
  font-size: 0.875rem;
  color: #777;
}

@media (min-width: 768px) {
  .btn {
    max-width: 355px !important;
  }
}

#other-insights .section-title {
  margin-block: 4.8rem 2.8rem;
}

.single-cases #cases-load-more,
.archive-cases .archive-load-more,
.archive-insights .archive-load-more,
#other-insights #loadmore-insights {
  margin-block: 4.8rem 8rem;
  border: none;
}

@media (min-width: 1024px) {
  .single-cases .hero__meta {
    gap: 1.2rem;
  }

  .single-cases .title-box.cases-title {
    margin-bottom: 1.4rem;
  }

  .single-cases .cases-detail-content .wp-block-cases-client-overview .content-box {
    padding: 2.4rem 0;
  }

  .single-cases .cases-detail-content .wp-block-cases-case-study-hero {
    margin-bottom: 6.4rem;
  }

  .single-cases .cases-detail-content .highlights {
    gap: 1.6rem;
  }

  .single-cases .cases-detail-content .wp-block-cases-highlights-grid {
    margin-bottom: 6.4rem;
  }

  .archive-cases-page .archive-cases,
  .single-cases,
  .archive-insight-page .archive-insights,
  .single-insight {
    padding-bottom: 4rem;
  }

  #other-cases .section-title {
    margin-block: 6rem 4rem;
  }

  #other-insights .section-title {
    margin-block: 8rem 4rem;
  }

  .single-cases #cases-load-more,
  .archive-cases .archive-load-more,
  .archive-insights .archive-load-more,
  #other-insights #loadmore-insights {
    margin-block: 8rem;
  }
}
/* ============ 2-col layout (PC) / 1-col (SP) ============ */
.layout-2col {
  --main-w: 996px;
  --gap-w: 40px;
  --side-w: 242px;
  display: grid;
  grid-template-columns: var(--main-w) var(--gap-w) var(--side-w);
  align-items: start;
  max-width: calc(var(--main-w) + var(--gap-w) + var(--side-w));
  margin-inline: auto;
  padding-inline: 20px;
  padding-top: 120px;
}

.layout-2col__main {
  grid-column: 1 / 2;
  min-width: 0;
}

.layout-2col__side {
  grid-column: 3 / 4;
  min-width: 0;
  position: sticky;
  top: 90px;
}

/* Tablet */
@media (max-width: 1024px) and (min-width: 768px) {
  .layout-2col {
    grid-template-columns: 73% 3% 24%;
  }
}

/* SP: stack */
@media (max-width: 767px) {
  .layout-2col {
    grid-template-columns: 1fr;
    row-gap: 24px;
    padding-inline: 1.6rem;
    padding-top: 60px
  }

  .layout-2col__main,
  .layout-2col__side {
    grid-column: 1 / -1;
  }

  .layout-2col__side {
    position: static;
  }

  .title-box {
    width: 100%;
  }

  /* prevent overflow on SP */
}

/* ============ Sidebar ============ */
.layout-2col__side .sidebar-section {
  margin-bottom: 24px;
}

.layout-2col__side .sidebar-section-box {
  width: 100%;
  background: var(--panel);
  border-radius: 8px;
}

.layout-2col__side .sidebar-section-box__title {
  font-size: 22px;
  font-weight: 700;
  padding: 10px 16px;
  background: #333;
  color: #fff;
  border-radius: 8px 8px 0 0;
}

.layout-2col__side .sidebar-section-box__list {
  padding: 1.6rem;
  font-size: 14px;
  display: grid;
  grid-auto-flow: row;
  line-height: 32px;
  list-style: none;
  margin: 0;
}

.layout-2col__side .sidebar-section-box__list-item {
  position: relative;
  cursor: pointer;
  user-select: none;
  outline: none;
  padding-left: 16px;
}

.layout-2col__side .sidebar-section-box__list-item::before {
  content: "- ";
  position: absolute;
  left: 0;
  top: 0;
  color: #333;
}

.layout-2col__side .sidebar-section-box__list-item:hover {
  color: #111;
}

.layout-2col__side .sidebar-section-box__list-item:focus-visible {
  outline: 2px solid #111;
  border-radius: 4px;
  outline-offset: 2px;
}

.layout-2col__side .sidebar-section-box__list-item.is-selected {
  font-weight: 700;
}

@media (max-width: 767px) {
  .layout-2col__side .sidebar-section {
    width: 100%;
  }

  .layout-2col__side .sidebar-section-box {
    width: 100%;
  }
}

/* Banner under lists */
.layout-2col__side .sidebar-section-banner {
  padding: 0 0 24px;
}

.layout-2col__side .sidebar-section-banner__link {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  transition: transform .15s ease, box-shadow .15s ease;
}

.layout-2col__side .sidebar-section-banner__link:hover,
.layout-2col__side .sidebar-section-banner__link:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  outline: 2px solid #111;
  outline-offset: 2px;
}

.layout-2col__side .sidebar-section-banner__img {
  width: 100%;
  height: auto;
  display: block;
}

@media (min-width: 1024px) {
  .layout-2col__side .sidebar-section-box__list {
    padding: 2.4rem;
  }
}