/* =========================================================
   形象報 共用影片元件（七個提案共用）
   - 有 data-yt：顯示縮圖，點擊後才載入 YouTube（nocookie）
   - 沒有 data-yt：顯示「影片製作中」佔位
   ========================================================= */
.ml-video {
  position: relative; width: 100%; overflow: hidden; border-radius: 8px;
  background: #1c1a18; color: #fff; cursor: pointer; isolation: isolate;
  aspect-ratio: 16 / 9; margin: 18px 0 22px;
  font-family: "Noto Sans TC", "PingFang TC", sans-serif; line-height: 1.5;
}
.ml-video[data-ratio="9x16"] { aspect-ratio: 9 / 16; margin: 0; }
.ml-video .mv-poster {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 25%;
  filter: saturate(.85); transform: scale(1.02); transition: transform .5s ease, filter .3s;
}
.ml-video::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(0,0,0,.05) 30%, rgba(0,0,0,.72) 100%);
}
.ml-video:hover .mv-poster { transform: scale(1.06); }
.ml-video .mv-play {
  position: absolute; z-index: 2; left: 50%; top: 46%; transform: translate(-50%, -50%);
  width: 68px; height: 68px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.92); display: grid; place-items: center; transition: transform .2s, background .2s;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.ml-video[data-ratio="9x16"] .mv-play { width: 52px; height: 52px; }
.ml-video .mv-play::before {
  content: ""; margin-left: 5px; border-left: 18px solid #1c1a18; border-top: 11px solid transparent; border-bottom: 11px solid transparent;
}
.ml-video:hover .mv-play { transform: translate(-50%, -50%) scale(1.08); }
.ml-video .mv-title, .ml-video .mv-meta { display: block; }
.ml-video .mv-info { position: absolute; z-index: 2; left: 16px; right: 16px; bottom: 14px; }
.ml-video .mv-title { font-weight: 700; font-size: 1rem; letter-spacing: .04em; text-shadow: 0 1px 6px rgba(0,0,0,.4); }
.ml-video[data-ratio="9x16"] .mv-title { font-size: .88rem; }
.ml-video .mv-meta { font-size: .78rem; opacity: .85; margin-top: 2px; }
.ml-video .mv-badge {
  position: absolute; z-index: 2; top: 12px; left: 12px; font-size: .72rem; letter-spacing: .1em;
  background: rgba(255,255,255,.9); color: #1c1a18; padding: 3px 10px; border-radius: 99px; font-weight: 700;
}
.ml-video .mv-note {
  position: absolute; z-index: 3; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px;
  background: rgba(20,18,16,.82); font-size: .9rem; opacity: 0; pointer-events: none; transition: opacity .25s;
}
.ml-video.show-note .mv-note { opacity: 1; }
.ml-video iframe, .ml-video .mv-player { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; z-index: 4; background: #000; object-fit: contain; }
.ml-video:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }

/* 短影音一排 */
.ml-shorts { margin: 18px 0 24px; }
.ml-shorts-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; font-family: "Noto Sans TC", "PingFang TC", sans-serif; }
.ml-shorts-head b { font-size: .95rem; }
.ml-shorts-head span { font-size: .8rem; opacity: .7; }
.ml-shorts-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 600px) {
  .ml-shorts-row { grid-template-columns: repeat(4, 62%); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .ml-shorts-row .ml-video { scroll-snap-align: start; }
  .ml-video .mv-play { width: 56px; height: 56px; }
}
@media (prefers-reduced-motion: reduce) { .ml-video .mv-poster, .ml-video .mv-play { transition: none; } }

/* 橫式影片寬度上限，避免在單欄版面過於搶眼 */
.ml-video[data-ratio="16x9"] { max-width: 860px; }

/* =========================================================
   出版與教材示意圖（七個提案共用）
   ========================================================= */
.ml-products { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin: 18px 0 22px; font-family: "Noto Sans TC", "PingFang TC", sans-serif; }
.ml-products figure { margin: 0; background: #f6f2ec; border-radius: 8px; overflow: hidden; position: relative; }
.ml-products img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.ml-products figcaption { font-size: .82rem; padding: 8px 10px 10px; color: #3b3732; line-height: 1.45; background: #fff; }
.ml-products figcaption small { display: block; color: #8a827a; font-size: .72rem; }
.ml-products .mp-tag { position: absolute; top: 8px; left: 8px; font-size: .66rem; letter-spacing: .1em; background: rgba(255,255,255,.92); color: #6b645c; padding: 2px 8px; border-radius: 99px; }


/* =========================================================
   放大播放視窗
   ========================================================= */
.ml-video .mv-zoom {
  position: absolute; z-index: 2; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,.88) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231c1a18' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M14 4h6v6M10 20H4v-6M20 4l-7 7M4 20l7-7'/%3E%3C/svg%3E") center / 15px no-repeat;
  transition: transform .2s;
}
.ml-video:hover .mv-zoom { transform: scale(1.1); }

.ml-lightbox {
  position: fixed; inset: 0; z-index: 9999; display: none;
  align-items: center; justify-content: center; gap: 12px;
  background: rgba(12, 11, 10, .9); backdrop-filter: blur(4px);
  font-family: "Noto Sans TC", "PingFang TC", sans-serif; color: #fff;
}
.ml-lightbox.open { display: flex; animation: ml-lb-in .2s ease; }
@keyframes ml-lb-in { from { opacity: 0; } to { opacity: 1; } }
.ml-lb-body { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 100%; }
.ml-lb-stage { position: relative; background: #000; border-radius: 10px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.ml-lb-stage[data-ratio="9x16"] { aspect-ratio: 9 / 16; width: min(88vw, calc((100dvh - 120px) * 9 / 16)); }
.ml-lb-stage[data-ratio="16x9"] { aspect-ratio: 16 / 9; width: min(88vw, calc((100dvh - 120px) * 16 / 9), 1280px); }
.ml-lb-stage video, .ml-lb-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: contain; background: #000; }
.ml-lb-cap { margin: 0; display: flex; gap: 12px; align-items: baseline; font-size: .95rem; text-align: center; flex-wrap: wrap; justify-content: center; }
.ml-lb-cap span { opacity: .7; font-size: .85rem; }
.ml-lb-cap em { font-style: normal; opacity: .6; font-size: .85rem; }
.ml-lb-close, .ml-lb-nav {
  border: 0; cursor: pointer; color: #fff; background: rgba(255,255,255,.14); display: grid; place-items: center;
  transition: background .2s; font-family: inherit;
}
.ml-lb-close:hover, .ml-lb-nav:hover { background: rgba(255,255,255,.28); }
.ml-lb-close:focus-visible, .ml-lb-nav:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.ml-lb-close { position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border-radius: 50%; font-size: 1.2rem; z-index: 2; }
.ml-lb-nav { flex: none; width: 52px; height: 52px; border-radius: 50%; font-size: 2rem; line-height: 1; padding-bottom: 4px; }
.ml-lb-nav[hidden] { display: none; }
@media (max-width: 640px) {
  .ml-lightbox { gap: 0; }
  .ml-lb-nav { position: absolute; bottom: 18px; width: 46px; height: 46px; }
  .ml-lb-prev { left: calc(50% - 64px); }
  .ml-lb-next { right: calc(50% - 64px); }
  .ml-lb-stage[data-ratio="9x16"] { width: min(94vw, calc((100dvh - 170px) * 9 / 16)); }
  .ml-lb-stage[data-ratio="16x9"] { width: 96vw; }
  .ml-lb-body { margin: 56px 0 60px; }
}
@media (prefers-reduced-motion: reduce) { .ml-lightbox.open { animation: none; } }

/* 五支一排的短影音（彩妝篇） */
.ml-shorts-row.ml-row-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 760px) { .ml-shorts-row.ml-row-5 { grid-template-columns: repeat(5, 62%); overflow-x: auto; scroll-snap-type: x mandatory; } }

/* 短影音封面已燒錄標題，卡片上不再重複顯示文字 */
.ml-shorts .ml-video .mv-info { display: none; }
.ml-shorts .ml-video::after { background: linear-gradient(180deg, rgba(0,0,0,0) 60%, rgba(0,0,0,.25) 100%); }
