/* ============================================================
   時計の裏側 — YouTubeショートセクション（WordPress版）
   Claudeデザイン「YouTubeショート動画表示デザイン」より実装。
   テーマとの競合を避けるため全クラスに ws- プレフィックスを付与。
   ============================================================ */

.ws-shorts-section,
.ws-shorts-section *,
.ws-modal,
.ws-modal * {
  box-sizing: border-box;
}

.ws-shorts-section {
  --ws-navy: #131c30;
  --ws-navy-hover: #20293f;
  --ws-ink: #1b2434;
  --ws-ink-soft: #2a3448;
  --ws-muted: #5a6273;
  --ws-gold: #c9a86a;
  --ws-card-border: #e7e8ec;
  --ws-btn-border: #ccd0d8;
  --ws-serif: 'Shippori Mincho', serif;
  --ws-sans: 'Noto Sans JP', sans-serif;

  max-width: 1280px;
  margin: 0 auto;
  padding: 64px 40px 80px;
  font-family: var(--ws-sans);
  color: var(--ws-ink);
}

/* ---------- 見出し ---------- */

.ws-heading {
  text-align: center;
  margin-bottom: 52px;
}

.ws-heading-title {
  font-family: var(--ws-serif);
  font-weight: 700;
  font-size: 40px;
  letter-spacing: 0.06em;
  line-height: 1.3;
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--ws-ink);
}

.ws-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 22px auto 20px;
  max-width: 300px;
}

.ws-line {
  flex: 1;
  height: 1px;
}

.ws-line-left {
  background: linear-gradient(90deg, transparent, var(--ws-gold));
}

.ws-line-right {
  background: linear-gradient(90deg, var(--ws-gold), transparent);
}

.ws-diamond {
  width: 8px;
  height: 8px;
  transform: rotate(45deg);
  border: 1px solid var(--ws-gold);
}

.ws-subtitle {
  font-family: var(--ws-serif);
  font-size: 17px;
  color: var(--ws-muted);
  margin: 0;
  letter-spacing: 0.04em;
}

/* ---------- カード ---------- */

.ws-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.ws-card {
  display: grid;
  grid-template-columns: 232px 1fr;
  grid-template-rows: 1fr auto;
  grid-template-areas:
    "thumb body"
    "thumb actions";
  column-gap: 26px;
  border: 1px solid var(--ws-card-border);
  border-radius: 4px;
  padding: 10px 22px 10px 10px;
  margin: 0;
  background: #fff;
  box-shadow: 0 2px 10px rgba(27, 36, 52, 0.06);
}

/* PC: サムネイル/本文をカードのグリッドエリアに直接配置する */
.ws-card-main {
  display: contents;
}

.ws-thumb {
  grid-area: thumb;
  position: relative;
  width: 232px;
  height: 300px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--ws-navy);
}

.ws-thumb[data-ws-yt] {
  cursor: pointer;
}

.ws-thumb img.ws-thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  display: block;
  margin: 0;
  border-radius: 0;
}

.ws-thumb-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--ws-ink-soft), var(--ws-navy) 70%);
}

.ws-thumb-placeholder svg {
  width: 56px;
  height: 56px;
  opacity: 0.55;
}

.ws-thumb-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0) 32%, rgba(0, 0, 0, 0.4));
}

.ws-thumb-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  pointer-events: none;
  background: var(--ws-navy);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: 2px;
  letter-spacing: 0.04em;
  line-height: 1.4;
}

.ws-thumb-play {
  position: absolute;
  top: calc(50% - 30px);
  left: calc(50% - 30px);
  width: 60px;
  height: 60px;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
  transition: background 0.15s ease;
}

.ws-thumb-play:hover,
.ws-thumb-play:active {
  background: rgba(19, 28, 48, 0.85);
}

.ws-play-tri {
  width: 0;
  height: 0;
  border-left: 17px solid #fff;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  margin-left: 4px;
}

.ws-thumb-duration {
  position: absolute;
  bottom: 12px;
  left: 14px;
  pointer-events: none;
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.ws-card-body {
  grid-area: body;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.ws-num {
  font-family: var(--ws-serif);
  font-size: 30px;
  font-weight: 600;
  color: var(--ws-gold);
  line-height: 1;
  margin-bottom: 14px;
}

.ws-title {
  font-family: var(--ws-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--ws-ink);
  margin: 0 0 14px;
  padding: 0;
  border: none;
  background: none;
  line-height: 1.45;
  letter-spacing: 0.01em;
  text-wrap: pretty;
}

.ws-desc {
  font-size: 14px;
  color: var(--ws-muted);
  line-height: 1.85;
  margin: 0;
  text-wrap: pretty;
}

.ws-actions {
  grid-area: actions;
  display: flex;
  gap: 12px;
  margin: 22px 0 16px;
}

.ws-btn-watch {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--ws-navy);
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  padding: 12px 22px;
  margin: 0;
  border-radius: 3px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
  text-shadow: none;
  transition: background 0.15s ease;
}

.ws-btn-watch:hover,
.ws-btn-watch:active,
.ws-btn-watch:focus {
  background: var(--ws-navy-hover);
  color: #fff;
}

.ws-btn-watch .ws-play-tri {
  border-left-width: 9px;
  border-top-width: 6px;
  border-bottom-width: 6px;
  margin-left: 0;
}

.ws-btn-read {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: var(--ws-ink-soft);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  padding: 12px 22px;
  border: 1px solid var(--ws-btn-border);
  border-radius: 3px;
  box-shadow: none;
  transition: border-color 0.15s ease;
}

.ws-btn-read:hover,
.ws-btn-read:active,
.ws-btn-read:focus {
  border-color: var(--ws-navy);
  color: var(--ws-ink-soft);
  text-decoration: none;
}

/* ---------- モーダル ---------- */

.ws-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(10, 14, 22, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.ws-modal-player {
  position: relative;
  width: 340px;
  max-width: 92vw;
  aspect-ratio: 9 / 16;
  max-height: 88vh;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.ws-modal-player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.ws-modal-close {
  position: fixed;
  top: 24px;
  right: 28px;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  -webkit-appearance: none;
  transition: background 0.15s ease;
}

.ws-modal-close:hover,
.ws-modal-close:active {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* ============================================================
   テーマ干渉対策（SWELL等が記事本文内の h2/h3/p に適用する
   高詳細度スタイルの打ち消し）
   - セクションを記事カラム（約860px）から全幅へブレイクアウトし、
     max(40px, calc(50vw - 640px)) の左右パディングで実質1280pxに centering
   - 見出し・段落の寸法/装飾は上記の基本定義と重複するが、
     テーマに負けないよう !important 付きで再宣言している
   ============================================================ */

.ws-shorts-section {
  width: 100vw !important;
  max-width: 100vw !important;
  margin-left: calc(50% - 50vw) !important;
  margin-right: calc(50% - 50vw) !important;
  padding: 64px max(40px, calc(50vw - 640px)) 80px !important;
  background: #fff;
}

.ws-shorts-section h2.ws-heading-title {
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  color: var(--ws-ink) !important;
  font-size: 40px !important;
  line-height: 1.3 !important;
  letter-spacing: 0.06em !important;
  font-weight: 700 !important;
}

.ws-shorts-section h2.ws-heading-title::before,
.ws-shorts-section h2.ws-heading-title::after,
.ws-shorts-section h3.ws-title::before,
.ws-shorts-section h3.ws-title::after {
  content: none !important;
  display: none !important;
}

.ws-shorts-section h3.ws-title {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 0 14px !important;
  color: var(--ws-ink) !important;
  font-size: 22px !important;
  line-height: 1.45 !important;
  font-weight: 700 !important;
}

.ws-shorts-section p.ws-desc {
  font-size: 14px !important;
  line-height: 1.85 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.ws-shorts-section p.ws-subtitle {
  font-size: 17px !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* テーマのフォント設定でボタン文字が縦に潰れるのを防ぐ */
.ws-shorts-section .ws-btn-watch,
.ws-shorts-section .ws-btn-read {
  white-space: nowrap;
  flex-shrink: 0;
}

.ws-shorts-section .ws-actions {
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  .ws-shorts-section {
    padding: 36px 16px 48px !important;
  }

  .ws-shorts-section h2.ws-heading-title {
    font-size: 28px !important;
  }

  .ws-shorts-section h3.ws-title {
    font-size: 17px !important;
    margin: 0 0 8px !important;
    line-height: 1.5 !important;
  }

  .ws-shorts-section p.ws-desc {
    font-size: 12.5px !important;
    line-height: 1.75 !important;
  }

  .ws-shorts-section p.ws-subtitle {
    font-size: 14px !important;
    line-height: 1.7 !important;
  }
}

/* ============================================================
   汎用セクション見出し [watch_shorts_heading]
   「時計の裏側」と同じ見出しデザインを単体ブロックとして提供。
   記事本文内で使うため、テーマのh2装飾打ち消しを含む。
   ============================================================ */

.ws-sec-heading {
  text-align: center;
  margin: 0 auto 44px;
  font-family: 'Noto Sans JP', sans-serif;
}

.ws-sec-heading h2.ws-sec-heading__title {
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  color: #1b2434 !important;
  font-family: 'Shippori Mincho', serif !important;
  font-size: 40px !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  letter-spacing: 0.06em !important;
}

.ws-sec-heading h2.ws-sec-heading__title::before,
.ws-sec-heading h2.ws-sec-heading__title::after {
  content: none !important;
  display: none !important;
}

.ws-sec-heading__divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 22px auto 20px;
  max-width: 300px;
}

.ws-sec-heading__line {
  flex: 1;
  height: 1px;
}

.ws-sec-heading__line--left {
  background: linear-gradient(90deg, transparent, #c9a86a);
}

.ws-sec-heading__line--right {
  background: linear-gradient(90deg, #c9a86a, transparent);
}

.ws-sec-heading__diamond {
  width: 8px;
  height: 8px;
  transform: rotate(45deg);
  border: 1px solid #c9a86a;
}

.ws-sec-heading p.ws-sec-heading__subtitle {
  font-family: 'Shippori Mincho', serif !important;
  font-size: 17px !important;
  color: #5a6273 !important;
  margin: 0 !important;
  padding: 0 !important;
  letter-spacing: 0.04em !important;
}

@media (max-width: 720px) {
  .ws-sec-heading {
    margin: 0 auto 24px;
  }

  .ws-sec-heading h2.ws-sec-heading__title {
    font-size: 28px !important;
  }

  .ws-sec-heading__divider {
    gap: 12px;
    margin: 16px auto 14px;
    max-width: 200px;
  }

  .ws-sec-heading__diamond {
    width: 7px;
    height: 7px;
  }

  .ws-sec-heading p.ws-sec-heading__subtitle {
    font-size: 14px !important;
    line-height: 1.7 !important;
    letter-spacing: 0.03em !important;
  }
}

/* ---------- タブレット: 1カラム ---------- */

@media (max-width: 1024px) {
  .ws-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- モバイル（390px基準デザイン） ---------- */

@media (max-width: 720px) {
  .ws-shorts-section {
    padding: 36px 16px 48px;
  }

  .ws-heading {
    margin-bottom: 28px;
  }

  .ws-heading-title {
    font-size: 28px;
  }

  .ws-divider {
    gap: 12px;
    margin: 16px auto 14px;
    max-width: 200px;
  }

  .ws-diamond {
    width: 7px;
    height: 7px;
  }

  .ws-subtitle {
    font-size: 14px;
    line-height: 1.7;
    letter-spacing: 0.03em;
    text-wrap: pretty;
  }

  .ws-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  .ws-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 10px;
  }

  .ws-card-main {
    display: flex;
    gap: 14px;
  }

  .ws-thumb {
    flex: 0 0 auto;
    width: 124px;
    height: 160px;
  }

  .ws-thumb-placeholder svg {
    width: 40px;
    height: 40px;
  }

  .ws-thumb-badge {
    top: 8px;
    left: 8px;
    font-size: 10px;
    padding: 3px 7px;
  }

  .ws-thumb-play {
    top: calc(50% - 22px);
    left: calc(50% - 22px);
    width: 44px;
    height: 44px;
  }

  .ws-thumb-play .ws-play-tri {
    border-left-width: 13px;
    border-top-width: 8px;
    border-bottom-width: 8px;
    margin-left: 3px;
  }

  .ws-thumb-duration {
    bottom: 8px;
    left: 10px;
    font-size: 12px;
  }

  .ws-num {
    font-size: 22px;
    margin-bottom: 8px;
  }

  .ws-title {
    font-size: 17px;
    margin: 0 0 8px;
    line-height: 1.5;
  }

  .ws-desc {
    font-size: 12.5px;
    line-height: 1.75;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .ws-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0;
  }

  /* 動画または記事の一方のみの場合は1カラムで全幅表示 */
  .ws-actions > :only-child {
    grid-column: 1 / -1;
  }

  .ws-btn-watch,
  .ws-btn-read {
    min-width: 0;
    min-height: 44px;
    padding: 0;
    justify-content: center;
    gap: 7px;
    font-size: 13px;
  }

  .ws-btn-watch .ws-play-tri {
    border-left-width: 8px;
    border-top-width: 5.5px;
    border-bottom-width: 5.5px;
  }

  .ws-modal-overlay {
    background: rgba(10, 14, 22, 0.9);
    padding: 12px;
  }

  .ws-modal-player {
    width: 100%;
    max-width: 366px;
    max-height: 82vh;
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  }

  .ws-modal-close {
    top: 14px;
    right: 14px;
    font-size: 24px;
    background: rgba(255, 255, 255, 0.14);
  }

  .ws-modal-close:hover,
  .ws-modal-close:active {
    background: rgba(255, 255, 255, 0.28);
  }
}
