/* 色は藤東クリニックのブランド色。#359267 は面と線、文字は #1d6b4a を使う */
:root {
  color-scheme: light;
  --ink: #17201b;
  --ink-soft: #55615a;
  --line: #dce1dd;
  --paper: #ffffff;
  --brand: #359267;
  --brand-dark: #1d6b4a;
  --tint: #e8f4ed;
  --dark: #10241a;
  --on-dark: #4aa87c;
  --on-dark-soft: #a8c6b5;
  --mincho: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", serif;
  --gothic: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic Medium", "Yu Gothic", Meiryo, sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1360px;
  --label: 220px;
}

@view-transition {
  navigation: auto;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--gothic);
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

/* ガラス外壁の縦の方立てを、背景の細い線で通す */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: repeating-linear-gradient(
    to right,
    transparent 0,
    transparent calc((100% - 1px) / 4),
    var(--line) calc((100% - 1px) / 4),
    var(--line) 25%
  );
  opacity: 0.38;
}

h1,
h2,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

a {
  color: var(--brand-dark);
  text-decoration: underline;
  text-decoration-color: var(--brand);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
  transition: color 0.2s, text-decoration-color 0.2s;
}

a:hover {
  color: var(--ink);
  text-decoration-color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--brand-dark);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 10;
  padding: 8px 16px;
  background: var(--paper);
}

.skip:focus {
  top: 8px;
}

.eyebrow {
  color: var(--brand-dark);
  font-size: 12px;
  letter-spacing: 0.16em;
  line-height: 1.6;
}

/* ヘッダー */
.site-header {
  position: relative;
  z-index: 5;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: var(--max);
  min-height: 72px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.brand {
  color: var(--ink);
  font-family: var(--mincho);
  font-size: 16px;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
}

.nav-wide ul {
  display: flex;
  gap: clamp(20px, 2.6vw, 40px);
}

.site-header nav a {
  color: var(--ink);
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}

.nav-wide a {
  display: block;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
}

.nav-wide a:hover,
.nav-wide a[aria-current="page"] {
  border-bottom-color: var(--brand);
}

.nav-narrow {
  display: none;
}

.nav-narrow summary {
  min-height: 44px;
  padding: 0 4px;
  font-size: 14px;
  line-height: 44px;
  list-style: none;
  cursor: pointer;
}

.nav-narrow summary::-webkit-details-marker {
  display: none;
}

/* トップ */
.hero {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(0, 3fr);
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(32px, 5vw, 72px) var(--gutter) 0;
}

.hero__title {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 20px;
  padding-right: 32px;
}

.hero h1 {
  font-family: var(--mincho);
  font-size: clamp(44px, 5vw, 68px);
  font-weight: 500;
  letter-spacing: 0.2em;
  line-height: 1.1;
  writing-mode: vertical-rl;
}

.hero__en {
  color: var(--ink-soft);
  font-family: var(--mincho);
  font-size: 13px;
  letter-spacing: 0.14em;
  line-height: 1.5;
  writing-mode: vertical-rl;
}

.hero__en span {
  margin-right: 8px;
}

.hero__image {
  aspect-ratio: 3 / 2;
  max-width: 1020px;
  overflow: hidden;
  background: var(--tint);
}

.hero__image img {
  animation: settle 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes settle {
  from {
    opacity: 0;
    transform: scale(1.025);
  }
}

.hero__position {
  grid-column: 2;
  padding-top: 20px;
  font-family: var(--mincho);
  font-size: clamp(17px, 1.6vw, 20px);
}

/* 左に見出し、右に内容の二段組 */
.split {
  display: grid;
  grid-template-columns: var(--label) minmax(0, 1fr);
  gap: 32px;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(48px, 7vw, 96px) var(--gutter) 0;
}

.split__label {
  position: relative;
  padding-left: 18px;
  font-family: var(--mincho);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.5;
}

.split__label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  background: var(--brand);
}

.specialties li {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-family: var(--mincho);
  font-size: clamp(21px, 2.4vw, 30px);
  line-height: 1.5;
}

.specialties li:last-child {
  border-bottom: 1px solid var(--line);
}

.qualifications {
  columns: 2 300px;
  column-gap: 48px;
}

.qualifications li {
  padding: 8px 0;
  break-inside: avoid;
  border-bottom: 1px solid var(--line);
}

.gallery {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: clamp(16px, 2vw, 24px);
  align-items: end;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(64px, 9vw, 128px) var(--gutter) 0;
}

.gallery__wide {
  aspect-ratio: 3 / 2;
  overflow: hidden;
}

.gallery__narrow {
  aspect-ratio: 4 / 5;
  overflow: hidden;
}

.index li {
  border-top: 1px solid var(--line);
}

.index li:last-child {
  border-bottom: 1px solid var(--line);
}

.index a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 24px;
  padding: 20px 8px 20px 0;
  color: var(--ink);
  text-decoration: none;
  transition: background-color 0.25s, padding-left 0.25s;
}

.index a::after {
  content: "→";
  grid-row: 1 / span 2;
  grid-column: 2;
  color: var(--brand-dark);
}

.index a:hover {
  padding-left: 16px;
  background: var(--tint);
}

.index__title {
  font-family: var(--mincho);
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.5;
}

.index__meta {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.7;
}

/* 下層ページの冒頭 */
.page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  align-items: end;
  gap: 32px;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(32px, 5vw, 72px) var(--gutter) 0;
}

.page-head h1 {
  margin-top: 8px;
  font-family: var(--mincho);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 500;
  line-height: 1.4;
}

.page-head__image {
  aspect-ratio: 5 / 2;
  max-width: 1000px;
  overflow: hidden;
  background: var(--tint);
}

/* 履歴 */
.timeline > div {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 4px 24px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.timeline > div:last-child {
  border-bottom: 1px solid var(--line);
}

.timeline dt {
  color: var(--ink-soft);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.timeline dd:only-child {
  grid-column: 1 / -1;
}

/* 所属学会 */
.societies li {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 4px 24px;
  align-items: baseline;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.societies li:last-child {
  border-bottom: 1px solid var(--line);
}

.societies a {
  font-family: var(--mincho);
  font-size: 19px;
}

.societies--compact {
  columns: 2 300px;
  column-gap: 48px;
}

.societies--compact li {
  display: block;
  break-inside: avoid;
  border-top: 0;
  border-bottom: 1px solid var(--line);
}

.societies--compact a {
  font-family: var(--gothic);
  font-size: 16px;
}

/* 業績 */
.works {
  display: grid;
  grid-template-columns: var(--label) minmax(0, 1fr);
  gap: 32px;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(48px, 7vw, 96px) var(--gutter) 0;
}

.works__nav ul {
  position: sticky;
  top: 24px;
}

.works__nav a {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 14px;
  text-decoration: none;
}

.works__nav li:last-child a {
  border-bottom: 1px solid var(--line);
}

.works__nav a:hover {
  color: var(--brand-dark);
}

.works__nav span {
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.works__body section + section {
  margin-top: clamp(56px, 7vw, 88px);
}

.works__body h2 {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ink);
  font-family: var(--mincho);
  font-size: clamp(23px, 2.4vw, 28px);
  font-weight: 500;
  line-height: 1.5;
}

.works__list {
  counter-reset: work;
}

.works__list li {
  position: relative;
  counter-increment: work;
  padding: 16px 0 16px 48px;
  border-bottom: 1px solid var(--line);
  line-height: 1.75;
}

.works__list li::before {
  content: counter(work);
  position: absolute;
  left: 0;
  color: var(--ink-soft);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.works__title,
.works__meta {
  display: block;
}

.works__meta {
  color: var(--ink-soft);
  font-size: 14px;
}

/* 手術実績 */
.era {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(48px, 7vw, 96px) var(--gutter) 0;
}

.era h2 {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ink);
  font-family: var(--mincho);
  font-size: clamp(21px, 2.4vw, 28px);
  font-weight: 500;
  line-height: 1.5;
}

.table-wrap {
  margin-top: 40px;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.6;
}

caption {
  padding-bottom: 12px;
  font-family: var(--mincho);
  font-size: 18px;
  text-align: left;
}

th,
td {
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--line);
  font-weight: 400;
  text-align: left;
}

thead th {
  border-bottom-color: var(--ink);
  color: var(--ink-soft);
  font-size: 13px;
  white-space: nowrap;
}

td.num {
  font-variant-numeric: tabular-nums;
}

td.zero {
  color: #6f7a73;
}

/* 記事 */
.article {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(40px, 6vw, 88px) var(--gutter) 0;
}

.article__head {
  margin-bottom: 40px;
}

.article__head h1 {
  margin-top: 8px;
  font-family: var(--mincho);
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 500;
  line-height: 1.45;
}

.article__body > * + * {
  margin-top: 1.4em;
}

.article__body h2 {
  margin-top: 2.4em;
  font-family: var(--mincho);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.5;
}

.article__body ul,
.article__body ol {
  padding-left: 1.4em;
  list-style: revert;
}

.article__back {
  margin-top: 56px;
}

/* フッター */
.site-footer {
  margin-top: clamp(80px, 11vw, 160px);
  background: var(--dark);
  color: var(--on-dark-soft);
}

.site-footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: end;
  max-width: var(--max);
  margin: 0 auto;
  padding: 56px var(--gutter) 32px;
}

.site-footer__name {
  color: #fff;
  font-family: var(--mincho);
  font-size: 22px;
  letter-spacing: 0.1em;
  line-height: 1.5;
}

.site-footer__en,
.site-footer__copy {
  font-size: 12px;
}

.site-footer__clinic {
  text-align: right;
}

.site-footer__clinic a {
  color: #fff;
  text-decoration-color: var(--on-dark);
}

.site-footer__copy {
  grid-column: 1 / -1;
  padding-top: 20px;
  border-top: 1px solid rgb(168 198 181 / 25%);
}

/* スクロールに合わせた控えめな表示 */
@supports (animation-timeline: view()) {
  .gallery img {
    animation: drift linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 60%;
  }

  @keyframes drift {
    from {
      opacity: 0.4;
      transform: scale(1.05);
    }
  }
}

@media (max-width: 1040px) {
  :root {
    --label: 160px;
  }

  .timeline > div {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .nav-wide {
    display: none;
  }

  .nav-narrow {
    display: block;
  }

  .nav-narrow nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    padding: 8px var(--gutter) 16px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
  }

  .nav-narrow a {
    display: block;
    padding: 12px 0;
    font-size: 16px;
    border-top: 1px solid var(--line);
  }

  .nav-narrow a[aria-current="page"] {
    color: var(--brand-dark);
  }

  body::before {
    display: none;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 40px;
  }

  .hero__title {
    flex-direction: column;
    gap: 8px;
    padding: 0 0 28px;
  }

  .hero h1,
  .hero__en {
    writing-mode: horizontal-tb;
  }

  .hero h1 {
    font-size: 44px;
  }

  .hero__en span {
    margin: 0 0 0 8px;
  }

  .hero__image {
    margin: 0 calc(var(--gutter) * -1);
    max-width: none;
  }

  .hero__position {
    grid-column: 1;
  }

  .split,
  .works,
  .page-head {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .page-head__image {
    aspect-ratio: 16 / 9;
    margin: 0 calc(var(--gutter) * -1);
    max-width: none;
  }

  .gallery {
    grid-template-columns: minmax(0, 1fr);
  }

  .gallery__narrow {
    aspect-ratio: 3 / 2;
  }

  .works__nav ul {
    position: static;
  }

  .site-footer__inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .site-footer__clinic {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media print {
  body::before,
  .site-header,
  .site-footer,
  .works__nav,
  .hero__image,
  .page-head__image,
  .gallery {
    display: none;
  }

  .split,
  .works {
    display: block;
    padding-top: 24px;
  }

  .hero {
    display: block;
  }

  .hero h1,
  .hero__en {
    writing-mode: horizontal-tb;
  }

  a {
    color: inherit;
    text-decoration: none;
  }
}
