.video-search {
  flex: 0 1 400px;
}

.video-heading {
  gap: 20px;
  margin-bottom: 24px;
}

.video-heading p {
  margin-top: 10px;
}

.video-result-count {
  flex: none;
  margin: 0;
  font-weight: 800;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.video-card {
  display: flex;
  flex-direction: column;
  outline: 3px solid transparent;
  transition: outline-color 0.24s ease, box-shadow 0.24s ease;
}

/* hover：橘色外框＋淡橘陰影，不位移。 */
.video-card:hover {
  outline-color: var(--color-accent);
  box-shadow: var(--shadow-hover);
}

.video-cover {
  position: relative;
  display: grid;
  width: 100%;
  height: 200px;
  padding: 0;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(135deg, rgb(5 37 74 / 88%), rgb(12 120 199 / 72%)),
    var(--blue-800);
  border: 0;
  cursor: pointer;
  place-items: center;
}

.video-cover[data-accent="orange"] {
  background: linear-gradient(135deg, #9a4e00, var(--orange));
}

.video-cover[data-accent="teal"] {
  background: linear-gradient(135deg, #075c62, #18a1a8);
}

.video-cover[data-accent="purple"] {
  background: linear-gradient(135deg, #43306e, #7758b2);
}

/* 影片縮圖：疊於漸層底色之上、置中裁切撐滿；漸層樣式保留供未來無縮圖時使用 */
.video-cover-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.video-cover-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.video-cover::after {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, transparent 0 58%, rgb(255 255 255 / 10%) 58% 61%, transparent 61%),
    radial-gradient(circle at 20% 25%, rgb(255 255 255 / 14%), transparent 28%);
  content: "";
}

.video-cover-label {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 1;
  padding: 5px 10px;
  background: rgb(5 37 74 / 78%);
  font-size: 12px;
  font-weight: 900;
}

.video-play {
  position: relative;
  z-index: 1;
  display: grid;
  width: 62px;
  height: 62px;
  background: rgb(255 255 255 / 92%);
  border-radius: 50%;
  box-shadow: 0 8px 24px rgb(0 0 0 / 22%);
  place-items: center;
  transition: transform 0.25s ease;
}

.video-play::before {
  width: 0;
  height: 0;
  margin-left: 5px;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  border-left: 16px solid var(--orange);
  content: "";
}

.video-cover:hover .video-play,
.video-cover:focus .video-play {
  transform: scale(1.1);
}

.video-duration {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 1;
  padding: 3px 8px;
  background: rgb(5 37 74 / 86%);
  font-size: 12px;
  font-weight: 800;
}

.video-card-body {
  display: flex;
  height: auto;
  padding: 17px 18px 18px;
  flex: 1;
  flex-direction: column;
}

.video-card-meta {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
}

.video-card-title {
  margin: 0 0 8px;
  color: var(--blue-800);
  font-size: 19px;
  font-weight: 900;
  line-height: 1.45;
}

.video-title-button {
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  font: inherit;
  text-align: left;
}

.video-title-button:hover,
.video-title-button:focus {
  color: var(--orange-dark);
}

.video-card-summary {
  display: -webkit-box;
  margin: 0 0 14px;
  overflow: hidden;
  color: #475569;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.video-tags {
  display: flex;
  gap: 6px;
  margin-top: auto;
  flex-wrap: wrap;
}

.video-tag {
  padding: 4px 8px;
  color: var(--blue-800);
  background: #eef3f8;
  border: 0;
  font-size: 12px;
  font-weight: 800;
}

.video-tag:hover,
.video-tag:focus {
  color: #fff;
  background: var(--blue-800);
}

/* 影片彈窗比照電子報 dialog：直角、深藍框、橘色頂線、偏移硬陰影。 */
.video-modal .modal-content {
  overflow: hidden;
  border: 2px solid var(--color-brand);
  border-top: var(--accent-bar-xl) solid var(--color-accent);
  border-radius: var(--radius-block);
  box-shadow: var(--shadow-dialog);
}

.video-modal .modal-header {
  align-items: start;
  padding: 18px 20px;
  border-bottom-color: var(--line);
}

.video-modal .modal-title {
  padding-right: 20px;
  color: var(--color-brand);
  font-size: 21px;
  font-weight: var(--font-weight-heading);
  letter-spacing: -0.02em;
}

/* 關閉鈕比照電子報 dialog：深藍方塊、白色叉號。 */
.video-modal .btn-close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  margin: 0;
  background: var(--color-brand) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center / 12px auto no-repeat;
  border-radius: var(--radius-block);
  opacity: 1;
  transition: background-color 0.18s ease;
}

.video-modal .btn-close:hover,
.video-modal .btn-close:focus-visible {
  background-color: var(--color-accent-dark);
}

.video-modal .modal-body {
  padding: 0;
}

.video-player {
  aspect-ratio: 16 / 9;
  background: var(--blue-900);
}

.video-player iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-modal-copy {
  padding: 18px 20px 20px;
}

.video-modal-meta {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
}

.video-modal-summary {
  margin: 0 0 14px;
  color: #475569;
}

@media (max-width: 991px) {
  .video-search {
    flex-basis: auto;
  }

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

@media (max-width: 767px) {
  .video-modal .modal-content {
    box-shadow: 8px 8px 0 rgba(23, 26, 29, 0.2);
  }

  .video-series-nav {
    flex-wrap: nowrap;
    padding-bottom: 4px;
    overflow-x: auto;
  }

  .video-series-link {
    white-space: nowrap;
  }

  .video-search {
    width: 100%;
  }

  .video-search-input {
    min-width: 0;
    flex: 1 1 95%;
  }

  .video-search .site-button {
    flex: 0 0 auto;
  }

  .video-heading {
    align-items: start;
    flex-direction: column;
  }

  .video-grid {
    grid-template-columns: 1fr;
  }
}
