/* ============================================
   制作実績 詳細ページ (works/*.html) 専用スタイル
   ============================================ */

.work-detail {
  max-width: 1080px;
  margin: 0 auto;
  padding: 90px 20px 0; /* 固定ヘッダーの下に潜り込まないよう上部を確保 */
}

/* --- タイトルまわり --- */
.work-head {
  text-align: center;
  padding: 2.5em 0 1.5em;
}

.work-head__type {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #d30d30;
  border: 1.5px solid #d30d30;
  border-radius: 20px;
  padding: 0.2em 1.2em;
  margin-bottom: 1em;
}

.work-head__title {
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1.4;
  color: #1e1e1e;
}

.work-head__client {
  font-size: 0.95rem;
  color: #777;
  margin-top: 0.6em;
}

/* --- タグ群 --- */
.work-tags {
  display: flex;
  flex-direction: column;
  gap: 0.8em;
  max-width: 760px;
  margin: 0 auto 2em;
}

.work-tags__row {
  display: flex;
  align-items: baseline;
  gap: 1em;
}

.work-tags__label {
  flex: 0 0 7em;
  font-size: 0.8rem;
  font-weight: 700;
  color: #999;
  text-align: right;
}

.work-tags__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
}

.work-tags__item {
  font-size: 0.78rem;
  font-weight: 700;
  color: #555;
  background: #f4f4f6;
  border-radius: 4px;
  padding: 0.25em 0.9em;
}

/* --- ライブプレビュー（ブラウザ風フレーム） --- */
.work-preview {
  border: 1px solid #ddd;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.work-preview__toolbar {
  display: flex;
  align-items: center;
  gap: 1em;
  background: #ececf0;
  border-bottom: 1px solid #ddd;
  padding: 0.6em 1em;
}

.work-preview__dots {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}

.work-preview__dots span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: block;
}

.work-preview__dots span:nth-child(1) { background: #ff5f57; }
.work-preview__dots span:nth-child(2) { background: #febc2e; }
.work-preview__dots span:nth-child(3) { background: #28c840; }

.work-preview__addr {
  flex: 1 1 auto;
  min-width: 0;
  background: #fff;
  border-radius: 6px;
  font-size: 0.75rem;
  color: #888;
  padding: 0.35em 1em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.05em;
}

.work-preview__devices {
  display: flex;
  gap: 4px;
  flex: 0 0 auto;
}

.work-preview__devices button {
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #666;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 0.3em 1em;
  cursor: pointer;
  transition: all 0.2s;
}

.work-preview__devices button.is-active {
  background: #d30d30;
  border-color: #d30d30;
  color: #fff;
}

/* ステージ */
.work-preview__stage {
  position: relative;
  height: 640px;
  background: #f7f7f9;
  overflow: hidden;
}

.work-preview__stage iframe {
  display: block;
  border: 0;
  background: #fff;
  transform-origin: 0 0;
  width: 100%;
  height: 100%;
}

/* SPモード: 中央にスマホ幅で表示 */
.work-preview__stage.is-sp {
  display: flex;
  justify-content: center;
  padding: 24px 0;
  height: 720px;
}

.work-preview__stage.is-sp iframe {
  width: 390px;
  height: 100%;
  flex: 0 0 390px;
  border: 1px solid #ddd;
  border-radius: 18px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  transform: none !important;
}

/* 読み込み表示 */
.work-preview__loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1em;
  font-size: 0.85rem;
  color: #999;
  background: #f7f7f9;
  z-index: 1;
  transition: opacity 0.4s;
}

.work-preview__loading::before {
  content: "";
  width: 34px;
  height: 34px;
  border: 3px solid #ddd;
  border-top-color: #d30d30;
  border-radius: 50%;
  animation: work-spin 0.9s linear infinite;
}

@keyframes work-spin {
  to { transform: rotate(360deg); }
}

.work-preview__stage.is-loaded .work-preview__loading {
  opacity: 0;
  pointer-events: none;
}

.work-preview__stage iframe {
  position: relative;
  z-index: 2;
}

/* スクリーンショット表示（埋め込み不可サイト用・全ページスクロール閲覧） */
.work-preview__stage.is-shot {
  height: 640px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.work-preview__stage.is-shot img {
  display: block;
  width: 100%;
  height: auto;
}

/* SPモード: スマホ幅の全ページスクリーンショットを中央表示 */
.work-preview__stage.is-shot.is-sp {
  background: #f7f7f9;
  /* iframe用 .is-sp のflex/高さ指定を打ち消してスクロール閲覧を維持 */
  display: block;
  padding: 0;
  height: 640px;
}

.work-preview__stage.is-shot.is-sp img {
  width: 390px;
  max-width: 100%;
  margin: 0 auto;
  border-left: 1px solid #e5e5e8;
  border-right: 1px solid #e5e5e8;
}

.work-preview__note {
  font-size: 0.75rem;
  color: #999;
  text-align: center;
  margin-top: 1em;
}

/* スクロールヒント（スクショ閲覧型のみ・初回スクロールで消える） */
.work-preview {
  position: relative;
}

.work-preview__scrollhint {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30, 30, 30, 0.78);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.5em 1.4em;
  border-radius: 20px;
  pointer-events: none;
  z-index: 3;
  white-space: nowrap;
  transition: opacity 0.4s;
}

.work-preview__scrollhint::after {
  content: "▼";
  font-size: 0.7em;
  margin-left: 0.6em;
  display: inline-block;
  animation: hint-bob 1.5s ease-in-out infinite;
}

@keyframes hint-bob {
  0%, 100% { transform: translateY(-1px); }
  50% { transform: translateY(2px); }
}

.work-preview.is-scrolled .work-preview__scrollhint {
  opacity: 0;
}

/* --- サイトを見るボタン --- */
.work-visit {
  text-align: center;
  margin: 1.8em 0 0;
}

.work-visit a {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  background: #1e1e1e;
  border-radius: 40px;
  padding: 0.9em 3em;
  transition: background 0.3s;
}

.work-visit a:hover {
  background: #d30d30;
}

.work-visit a::after {
  content: " ↗";
  font-size: 0.8em;
}

/* --- 制作のポイント --- */
.work-points {
  max-width: 860px;
  margin: 0 auto;
  display: grid;
  gap: 1.2em;
}

.work-point {
  background: #fff;
  border: 1px solid #eee;
  border-left: 4px solid #d30d30;
  border-radius: 8px;
  padding: 1.4em 1.6em;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.work-point__title {
  font-size: 1rem;
  font-weight: 700;
  color: #1e1e1e;
  margin-bottom: 0.4em;
}

.work-point__text {
  font-size: 0.875rem;
  color: #555;
  line-height: 1.8;
}

/* --- 制作のこだわり --- */
.work-craft {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.3em;
}

.work-craft__item {
  position: relative;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 1.6em 1.6em 1.5em;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.work-craft__num {
  position: absolute;
  top: 0.35em;
  right: 0.6em;
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 1;
  color: #d30d30;
  opacity: 0.14;
  letter-spacing: 0;
}

.work-craft__cat {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #d30d30;
  border: 1px solid #d30d30;
  border-radius: 12px;
  padding: 0.12em 0.9em;
  margin-bottom: 0.8em;
}

.work-craft__tit {
  font-size: 1rem;
  font-weight: 700;
  color: #1e1e1e;
  line-height: 1.5;
  margin-bottom: 0.5em;
}

.work-craft__txt {
  font-size: 0.85rem;
  color: #555;
  line-height: 1.9;
}

@media screen and (max-width: 832px) {
  .work-craft {
    grid-template-columns: 1fr;
  }
}

/* --- 成果 --- */
.work-result {
  max-width: 640px;
  margin: 0 auto;
  background: #fff;
  border: 2px solid #d30d30;
  border-radius: 12px;
  text-align: center;
  padding: 2em 1.5em;
}

.work-result__label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e1e1e;
}

.work-result__number {
  font-size: 1.9rem;
  font-weight: 900;
  color: #d30d30;
  line-height: 1.4;
  margin: 0.3em 0;
}

.work-result__period {
  font-size: 0.75rem;
  color: #999;
}

/* --- 関連実績 --- */
.work-related {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5em;
  max-width: 960px;
  margin: 0 auto;
}

.work-related__item {
  display: block;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s, box-shadow 0.3s;
}

.work-related__item:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
}

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

.work-related__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.work-related__body {
  padding: 0.9em 1em 1.1em;
}

.work-related__tag {
  font-size: 0.68rem;
  font-weight: 700;
  color: #d30d30;
  border: 1px solid #d30d30;
  border-radius: 12px;
  padding: 0.1em 0.8em;
}

.work-related__name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e1e1e;
  margin-top: 0.5em;
}

/* --- 一覧に戻る --- */
.work-back {
  text-align: center;
  margin-top: 2.5em;
}

.work-back a {
  font-size: 0.85rem;
  font-weight: 700;
  color: #d30d30;
}

/* --- レスポンシブ --- */
@media screen and (max-width: 832px) {
  .work-head__title { font-size: 1.35rem; }

  .work-tags__row {
    flex-direction: column;
    gap: 0.3em;
  }

  .work-tags__label {
    flex: none;
    text-align: left;
  }

  .work-preview__stage { height: 480px; }
  .work-preview__stage.is-sp { height: 600px; }

  .work-preview__stage.is-sp iframe {
    width: 100%;
    max-width: 390px;
    flex: 0 1 390px;
    border-radius: 0;
    border: 0;
    box-shadow: none;
  }

  .work-preview__devices { display: none; }

  .work-related { grid-template-columns: 1fr; }
}
