/* =========================================================
   投稿末尾の共通部品：運営者・関連記事・前後の記事
========================================================= */

.sf-end {
  margin: 40px 0 0;
  color: #24483f;
  font-size: 16px;
  line-height: 1.8;
}

.sf-end,
.sf-end * {
  box-sizing: border-box;
}

.sf-end a {
  color: inherit;
  text-decoration: none;
}

.sf-end a:focus-visible {
  outline: 2px solid #a68548;
  outline-offset: 4px;
}

/* =========================================================
   ABOUT THE EDITOR：明るい誌面とプロフィールへの案内
========================================================= */

.sf-end-editor {
  display: grid;
  grid-template-columns: 30% minmax(0, 1fr);
  margin: 0;
  background: #fcfaf5;
  border: 1px solid #ddd1bc;
}

.sf-end-editor__photo {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
  object-position: 40% center;
}

.sf-end-editor__copy {
  min-width: 0;
  padding: 30px;
}

.sf-end-editor__label {
  margin: 0 0 12px;
  color: #ad654b;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.sf-end-editor h2 {
  margin: 0 0 12px;
  font-family: "Noto Serif JP", "Yu Mincho", serif;
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 600;
  line-height: 1.6;
}

.sf-end-editor__name {
  margin: 0 0 16px;
  font-weight: 600;
}

.sf-end-editor__bio {
  margin: 0 0 20px;
  color: #53645c;
  font-size: 15px;
  line-height: 1.9;
}

.sf-end-editor__trust {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.sf-end-editor__trust li {
  padding: 7px 10px;
  border: 1px solid #e3d6bf;
  font-size: 11px;
}

.sf-end-editor__button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
  padding: 12px 18px;
  color: #fffaf0 !important;
  background: #244c42;
  font-size: 15px;
  font-weight: 600;
  transition: background-color 0.2s ease;
}

.sf-end-editor__arrow {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  color: #24483f;
  background: #d6b674;
  border-radius: 50%;
  font-size: 20px;
}

.sf-end-editor__button:hover {
  background: #386557;
}

/* =========================================================
   関連記事：深緑の背景・写真が上の３枚カード
========================================================= */

.sf-end-related {
  margin: 32px 0 0;
  padding: 34px 26px 24px;
  background: #244c42;
  border-radius: 10px;
}

.sf-end-related__head {
  margin: 0 0 26px;
  text-align: center;
}

.sf-end-related__head p {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 0 0 12px;
  color: #d6b674;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11px;
  letter-spacing: 0.15em;
}

.sf-end-related__head p::before,
.sf-end-related__head p::after {
  content: "";
  flex: 1 1 40px;
  max-width: 140px;
  height: 1px;
  background: #ad925e;
}

.sf-end-related__head h2 {
  margin: 0;
  color: #fffaf0;
  font-family: "Noto Serif JP", "Yu Mincho", serif;
  font-size: 25px;
  font-weight: 500;
  line-height: 1.65;
}

.sf-end-related__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.sf-end-story {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: #fcfaf5;
  border-radius: 4px;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.sf-end-story__photo,
.sf-end-story__placeholder {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  margin: 0;
  object-fit: cover;
  object-position: center;
}

.sf-end-story__placeholder {
  display: grid;
  place-items: center;
  background: #e5eadd;
  font-family: Georgia, serif;
}

.sf-end-story__copy {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  padding: 20px 18px;
}

.sf-end-story__label {
  display: block;
  margin-bottom: 10px;
  color: #92723b;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0.1em;
}

.sf-end-story strong {
  display: block;
  margin-bottom: 22px;
  color: #24483f;
  font-family: "Noto Serif JP", "Yu Mincho", serif;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

/* ３枚とも右下に揃える */

.sf-end-story__read {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: auto;
  color: #24483f;
  font-size: 13px;
  font-weight: 600;
}

.sf-end-story__read > span {
  font-size: 22px;
  transition: transform 0.2s ease;
}

.sf-end-story:hover {
  background: #f1ece1;
  transform: translateY(-3px);
}

.sf-end-story:hover .sf-end-story__read > span {
  transform: translateX(3px);
}

.sf-end-story:active {
  background: #e9e3d5;
}

/* テーマへの入口：アイボリーの枠付き横長リンク */

.sf-end-related__foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(214, 182, 116, 0.45);
}

.sf-end-related__foot a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 48px;
  padding: 10px 18px;
  color: #fffaf0;
  border: 1px solid rgba(255, 250, 240, 0.5);
  font-size: 14px;
  transition: background-color 0.2s ease;
}

.sf-end-related__foot a > span:last-child {
  font-size: 23px;
}

.sf-end-related__foot a:hover {
  background: rgba(255, 250, 240, 0.1);
}

/* =========================================================
   D案：紙色と深緑を組み合わせたページをめくる案内
========================================================= */

.sf-end-nav {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 32px 0 0;
  isolation: isolate;
}

.sf-end-nav__card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 26px 32px;
  color: #24483f;
  background: #f8f5ee;
  text-align: left;
  transition: background-color 0.2s ease;
}

.sf-end-nav__card--previous {
  padding-right: 48px;
}

.sf-end-nav__card--next {
  margin-left: -20px;
  padding-left: 48px;
  color: #fffaf0;
  background: #244c42;
  clip-path: polygon(20px 0, 100% 0, 100% 100%, 0 100%);
}

/* 斜めの境目を細いゴールドで示す */

.sf-end-nav__card--next::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #c1a267;
  clip-path: polygon(20px 0, 22px 0, 2px 100%, 0 100%);
  pointer-events: none;
}

.sf-end-nav__label {
  color: #8f7445;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 10px;
  line-height: 1.6;
  letter-spacing: 0.15em;
}

/* 深緑側：リンクの共通色より優先して文字と矢印をアイボリーに */

.sf-end .sf-end-nav__card--next,
.sf-end .sf-end-nav__card--next .sf-end-nav__direction,
.sf-end .sf-end-nav__card--next strong,
.sf-end .sf-end-nav__card--next .sf-end-nav__arrow {
  color: #fffaf0 !important;
}

/* NEXT STORY：深緑の背景でも読める明るいゴールド */

.sf-end .sf-end-nav__card--next .sf-end-nav__label {
  color: #d9c394 !important;
}

.sf-end-nav__direction {
  display: block;
  margin: 10px 0 12px;
  color: inherit;
  font-size: 13px;
}

.sf-end-nav__card strong {
  display: block;
  margin-bottom: 24px;
  color: inherit;
  font-family: "Noto Serif JP", "Yu Mincho", serif;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

/* 丸い装飾は使わず、長い矢印で進む方向を伝える */

.sf-end-nav__arrow {
  position: relative;
  display: block;
  height: 12px;
  margin-top: auto;
  color: inherit;
  border-bottom: 1px solid currentColor;
}

.sf-end-nav__arrow::after {
  content: "";
  position: absolute;
  right: 1px;
  bottom: -5px;
  width: 10px;
  height: 10px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: rotate(45deg);
}

.sf-end-nav__card--previous .sf-end-nav__arrow::after {
  right: auto;
  left: 1px;
  transform: rotate(225deg);
}

.sf-end-nav__card--previous:hover {
  background: #eee8db;
}

.sf-end-nav__card--next:hover {
  background: #356354;
}

.sf-end-nav__card--previous:active {
  background: #e7e0d1;
}

.sf-end-nav__card--next:active {
  background: #1a3d34;
}

/* 内側のフォーカス枠で、斜めの形でも操作位置が分かる */

.sf-end-nav__card:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 3px #a68548;
}

.sf-end-nav--single {
  grid-template-columns: minmax(0, 1fr);
}

.sf-end-nav--single .sf-end-nav__card {
  margin: 0;
  padding: 26px 32px;
  clip-path: none;
}

.sf-end-nav--single .sf-end-nav__card::before {
  display: none;
}

/* =========================================================
   スマホ：３記事を縦に並べ、写真の高さを抑える
========================================================= */

@media (max-width: 680px) {
  .sf-end {
    margin-top: 28px;
  }

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

  .sf-end-editor__photo {
    height: 240px;
    min-height: 0;
    object-position: 40% 30%;
  }

  .sf-end-editor__copy {
    padding: 24px 20px;
  }

  .sf-end-editor h2 {
    font-size: 21px;
  }

  .sf-end-related {
    margin-top: 24px;
    padding: 28px 18px 20px;
  }

  .sf-end-related__head h2 {
    font-size: 22px;
  }

  .sf-end-related__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  /* 横型カード３枚を縦に並べる */

  .sf-end-story {
    display: grid;
    grid-template-columns: 30% minmax(0, 1fr);
    align-items: stretch;
  }

  .sf-end-story__photo,
  .sf-end-story__placeholder {
    width: 100%;
    height: 100%;
    min-height: 120px;
    aspect-ratio: auto;
    object-fit: cover;
  }

  .sf-end-story__copy {
    padding: 16px 14px;
  }

  .sf-end-story__label {
    font-size: 9px;
    margin-bottom: 6px;
  }

  .sf-end-story strong {
    margin-bottom: 12px;
    font-size: 16px;
    line-height: 1.75;
  }

  .sf-end-story__read {
    gap: 8px;
    font-size: 12px;
  }

  .sf-end-related__foot a {
    width: 100%;
    gap: 12px;
    font-size: 13px;
  }

  .sf-end-nav {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    margin-top: 24px;
  }

  .sf-end-nav__card {
    padding: 22px 24px 26px;
  }

  .sf-end-nav__card strong {
    font-size: 17px;
    margin-bottom: 20px;
  }

  .sf-end-nav__card--next {
    margin: -10px 0 0;
    padding-top: 32px;
    clip-path: polygon(0 0, 100% 10px, 100% 100%, 0 100%);
  }

  .sf-end-nav__card--next::before {
    clip-path: polygon(0 0, 100% 10px, 100% 12px, 0 2px);
  }

  .sf-end-nav--single .sf-end-nav__card {
    margin: 0;
    padding: 22px 24px;
    clip-path: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sf-end a,
  .sf-end-story__read > span {
    transition: none;
  }

  .sf-end-story:hover,
  .sf-end-story:hover .sf-end-story__read > span {
    transform: none;
  }
}

