/*
 * DIGITAL TRENDS Creative Works v1.7.1
 * FV / breadcrumb / base typography / Success card grid come from the existing theme.
 * This file only adds compact filters, CASE DATABASE card framing and the detail modal.
 */
.dtcw,
.dtcw * { box-sizing: border-box; }
.dtcw [hidden] { display: none !important; }
.dtcw { width: 100%; }

/* WordPress common.css applies section { padding:50px 0 } globally. Neutralize it inside this feature. */
.dtcw .dtcw-works-region { padding: 0 !important; }
.dtcw .dtcw-related { padding: 42px 0 0 !important; }

/* =========================================================
   Compact filter
   Desktop: three groups in one horizontal row.
   Tablet / mobile: collapsed by default so works remain visible quickly.
   ========================================================= */
.dtcw-filter-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 12px;
}
.dtcw-filter-heading-copy {
  display: flex;
  align-items: baseline;
  gap: 16px;
}
.dtcw-filter-kicker {
  color: #d10000;
  font-family: 'Roboto', sans-serif;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .16em;
}
.dtcw-filter-heading strong {
  color: #333;
  font-size: 16px;
  line-height: 1.5;
}
.dtcw-filter-toggle {
  display: none;
  appearance: none;
  background: #fff;
  color: #333;
  border: 1px solid #ccc;
  border-radius: 2px;
  padding: 10px 14px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.dtcw-filter-toggle span {
  display: inline-block;
  margin-left: 10px;
  color: #d10000;
  font-size: 16px;
  line-height: 1;
  transition: transform .2s ease;
}
.dtcw.is-filter-open .dtcw-filter-toggle span { transform: rotate(45deg); }

.dtcw-filter-bar {
  display: grid;
  grid-template-columns: 1.28fr .95fr 1fr;
  min-height: 88px;
  margin: 0 0 28px;
  background: #fff;
  border: 1px solid #dedede;
  border-radius: 12px;
  box-shadow: none;
  overflow: hidden;
}
.dtcw-filter-group {
  position: relative;
  min-width: 0;
  padding: 15px 24px 14px;
}
.dtcw-filter-group + .dtcw-filter-group::before {
  content: "";
  position: absolute;
  top: 16px;
  bottom: 16px;
  left: 0;
  width: 1px;
  background: #e1e1e1;
}
.dtcw-filter-label {
  display: block;
  margin: 0 0 8px;
  color: #333;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
}
.dtcw-filter-options {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 22px;
}
.dtcw-filter-button {
  display: inline-block;
  position: relative;
  padding: 2px 4px 8px;
  color: #333;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  opacity: 1 !important;
}
.dtcw-filter-button:hover,
.dtcw-filter-button.current { color: #d10000; }
.dtcw-filter-button.current::after {
  content: "";
  position: absolute;
  right: 3px;
  bottom: 0;
  left: 3px;
  height: 2px;
  background: #d10000;
}
.dtcw-filter-industry select {
  display: block;
  width: 100%;
  height: 40px;
  padding: 0 42px 0 14px;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  color: #333;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  /* Re-enable a select arrow after reset.css appearance:none. */
  appearance: auto;
  -webkit-appearance: menulist;
  -moz-appearance: auto;
}
.dtcw-filter-industry select:focus { border-color: #999; outline: none; }

.dtcw-result-count {
  margin: 0 0 14px;
  color: #777;
  font-size: 12px;
  text-align: left;
  font-weight: 700;
}

/* =========================================================
   Work cards
   Keep the existing Success layout but add a visible frame.
   ========================================================= */
.dtcw-success-list li a {
  cursor: pointer;
  overflow: hidden;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 3px;
  box-shadow: 0 3px 12px rgba(0,0,0,.035);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.dtcw-success-list li a:hover {
  opacity: 1;
  border-color: #bcbcbc;
  box-shadow: 0 8px 22px rgba(0,0,0,.07);
  transform: translateY(-2px);
}
.dtcw-success-list li a > img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top center;
  background: #efefef;
  border-bottom: 1px solid #e7e7e7;
}
.dtcw-success-list li a span.title,
.dtcw-success-list li a span.sub-title,
.dtcw-success-list li a ul.cat-tag {
  width: calc(100% - 30px);
  max-width: none;
  margin-right: 15px;
  margin-left: 15px;
}
.dtcw-success-list li a span.title { margin-top: 14px; }
.dtcw-success-list li a span.sub-title { font-weight: 700; }
.dtcw ul.success-list.dtcw-success-list li a { padding-bottom: 12px !important; }
/* success.css has more-specific selectors with fixed min-heights.
   Override them explicitly so CASE DATABASE cards size to their content. */
.dtcw ul.success-list.dtcw-success-list li a span.sub-title {
  min-height: 0 !important;
  margin-top: 5px !important;
  margin-bottom: 8px !important;
  line-height: 1.55;
}
.dtcw ul.success-list.dtcw-success-list li a ul.cat-tag {
  min-height: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-right: 46px;
}
.dtcw ul.success-list.dtcw-success-list li a ul.cat-tag li {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  margin-left: 0;
  line-height: 1.7;
}
.dtcw ul.success-list.dtcw-success-list li a::after { right: 14px; bottom: 13px; }
.dtcw-thumb-missing {
  min-height: 190px;
  background: #efefef;
  display: flex !important;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 11px;
}
.dtcw-match { color: inherit !important; }
.dtcw-success-list li a span.title.dtcw-match {
  display: inline-block !important;
  width: auto !important;
  max-width: calc(100% - 30px);
  padding: 3px 8px;
  background: #d10000;
  color: #fff !important;
  border: 1px solid #d10000;
  border-radius: 2px;
}
.dtcw-success-list li a ul.cat-tag li.dtcw-match {
  background: #d10000 !important;
  color: #fff !important;
  border-color: #d10000 !important;
}

.dtcw-empty {
  clear: both;
  text-align: center;
  padding: 40px 0 70px;
  border-top: 2px solid #ccc;
  border-bottom: 2px solid #ccc;
}
.dtcw-empty-en {
  color: #d10000;
  font-family: 'Roboto', sans-serif;
  font-size: 20px;
  letter-spacing: .15em;
  margin-bottom: 10px;
}
.dtcw-empty h2 { font-size: 22px; margin-bottom: 8px; }
.dtcw-empty > p:not(.dtcw-empty-en) { color: #777; font-size: 13px; }
.dtcw-empty-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 30px;
}
.dtcw-empty .dtcw-empty-actions .button {
  width: 300px;
  margin: 0;
}

.dtcw-related {
  clear: both;
  border-top: 2px solid #ccc;
  margin-top: 55px;
}
.dtcw-related-title-wrap { margin-bottom: 24px; }
.dtcw-related-title-wrap h2 {
  margin: 0;
  color: #333;
  font-size: 20px;
  line-height: 1.5;
}
.dtcw-related .dtcw-more { clear: both; }

/* =========================================================
   Detail modal
   The modal is intentionally more independent than the page UI.
   IMPORTANT: use DIVs rather than HEADER/SECTION elements because
   common.css globally styles header and section.
   ========================================================= */
body.dtcw-modal-open { overflow: hidden; }
.dtcw-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s ease, visibility 0s linear .28s;
}
.dtcw-modal.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0s;
}
.dtcw-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22,22,22,.62);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.dtcw-modal-panel {
  position: absolute;
  top: 2.6vh;
  right: 3vw;
  bottom: 2.6vh;
  left: 3vw;
  display: flex;
  flex-direction: column;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 !important;
  background: #fff;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 18px;
  box-shadow: 0 28px 70px rgba(0,0,0,.24);
  overflow: hidden;
  transform: translateY(10px) scale(.985);
  transition: transform .34s cubic-bezier(.22,1,.36,1);
}
.dtcw-modal.is-open .dtcw-modal-panel { transform: none; }

.dtcw-modal-header {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(190px,1fr) minmax(450px,650px) minmax(44px,1fr);
  align-items: center;
  min-height: 108px;
  padding: 17px 36px;
  background: #fff;
  border-bottom: 1px solid #ececec;
}
.dtcw-modal-meta { min-width: 0; }
.dtcw-modal-industry {
  margin: 0 0 4px;
  color: #777;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
}
.dtcw-modal-meta h2 {
  margin: 0 0 7px;
  color: #333;
  font-size: 21px;
  line-height: 1.4;
}
.dtcw-modal-tags {
  margin: 0;
  color: #333;
  font-size: 12px;
}
.dtcw-modal-tags span { color: inherit; font-size: inherit; }
.dtcw-modal-slash { margin: 0 10px; color: #aaa !important; }

.dtcw-modal-toolbar {
  display: grid;
  grid-template-columns: 92px minmax(230px,340px) 92px;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.dtcw-device-switch {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 44px;
  padding: 3px;
  overflow: hidden;
  background: #f0f0f0;
  border: 1px solid #e1e1e1;
  border-radius: 999px;
}
.dtcw-device-switch::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  background: #d10000;
  border-radius: 999px;
  box-shadow: 0 5px 14px rgba(209,0,0,.16);
  transform: translateX(0);
  transition: transform .32s cubic-bezier(.22,1,.36,1);
}
.dtcw-device-switch.is-sp::before { transform: translateX(100%); }
.dtcw-device-button {
  position: relative;
  z-index: 1;
  appearance: none;
  min-width: 0;
  padding: 0 18px;
  background: transparent;
  color: #555;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: color .22s ease;
}
.dtcw-device-button.current {
  background: transparent;
  color: #fff;
  box-shadow: none;
}
.dtcw-device-button:hover:not(.current) { color: #d10000; }

.dtcw-nav {
  appearance: none;
  height: 40px;
  padding: 0 5px;
  background: transparent;
  color: #555;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  cursor: pointer;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}
.dtcw-nav span { color: inherit; font-size: 13px; }
.dtcw-nav:hover:not(:disabled) { color: #d10000; background: #f7f7f7; opacity: 1; }
.dtcw-nav-back:hover:not(:disabled) { transform: translateX(-2px); }
.dtcw-nav-next:hover:not(:disabled) { transform: translateX(2px); }
.dtcw-nav:disabled { opacity: .22; cursor: default; }

.dtcw-modal-close {
  justify-self: end;
  appearance: none;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  color: #333;
  border: 0;
  border-radius: 50%;
  font: inherit;
  font-size: 36px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}
.dtcw-modal-close:hover {
  background: #f5f5f5;
  color: #d10000;
  transform: rotate(4deg);
  opacity: 1;
}

.dtcw-modal-scroller {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
}
.dtcw-preview {
  position: relative;
  width: calc(100% - 72px);
  min-height: 560px;
  margin: 26px auto 0;
  padding: 20px 24px 46px;
  background: #fafafa;
  border: 1px solid #e7e7e7;
  border-radius: 14px;
  display: flex;
  align-items: center;
  flex-direction: column;
}
.dtcw-preview img {
  display: block;
  height: auto;
  background: #fff;
  border: 1px solid #eee;
  box-shadow: 0 14px 32px rgba(0,0,0,.06);
  transition: opacity .24s ease, filter .2s ease, transform .28s cubic-bezier(.22,1,.36,1);
}
.dtcw-preview.device-pc img { width: min(100%,1180px); max-width: 1180px; }
.dtcw-preview.device-sp img { width: min(100%,390px); max-width: 390px; border-radius: 8px; }
.dtcw-modal-note {
  width: calc(100% - 72px);
  margin: 10px auto 24px;
  color: #777;
  font-size: 10px;
  text-align: left;
}

/* loading */
.dtcw-preview.is-loading-full img { opacity: .34; filter: blur(5px); }
.dtcw-preview.is-load-error img { opacity: .22; filter: blur(6px); }
.dtcw-preview-status {
  position: absolute;
  z-index: 20;
  top: 180px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.dtcw-preview-status.is-visible { opacity: 1; visibility: visible; }
.dtcw-preview-loading,
.dtcw-preview-error {
  min-width: 150px;
  padding: 15px 18px;
  background: rgba(255,255,255,.96);
  border: 1px solid rgba(51,51,51,.09);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0,0,0,.08);
  text-align: center;
}
.dtcw-preview-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}
.dtcw-preview-text { color: #333; font-size: 10px; letter-spacing: .12em; }
.dtcw-preview-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(209,0,0,.14);
  border-top-color: #d10000;
  border-radius: 50%;
  animation: dtcw-spin .72s linear infinite;
}
.dtcw-preview-error { pointer-events: auto; }
.dtcw-preview-error p { margin-bottom: 10px; font-size: 12px; }
.dtcw-preview-retry {
  appearance: none;
  padding: 7px 15px;
  border: 1px solid #d10000;
  border-radius: 999px;
  background: #fff;
  color: #d10000;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}
.dtcw-preview-retry:hover { background: #d10000; color: #fff; }
@keyframes dtcw-spin { to { transform: rotate(360deg); } }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1100px) {
  .dtcw-filter-group { padding-right: 18px; padding-left: 18px; }
  .dtcw-filter-options { column-gap: 14px; }
  .dtcw-modal-header {
    grid-template-columns: minmax(150px,1fr) minmax(410px,560px) 44px;
    padding-right: 22px;
    padding-left: 22px;
  }
  .dtcw-modal-toolbar { grid-template-columns: 75px minmax(220px,300px) 75px; }
}

@media (max-width: 950px) {
  .dtcw-filter-heading { margin-bottom: 14px; }
  .dtcw-filter-heading-copy { display: block; }
  .dtcw-filter-kicker { display: block; margin-bottom: 4px; }
  .dtcw-filter-heading strong { font-size: 15px; }
  .dtcw-filter-toggle { display: inline-flex; align-items: center; white-space: nowrap; }
  .dtcw-filter-bar { display: none; grid-template-columns: 1fr; min-height: 0; border-radius: 6px; }
  .dtcw.is-filter-open .dtcw-filter-bar { display: block; }
  .dtcw-filter-group { padding: 15px 18px; }
  .dtcw-filter-group + .dtcw-filter-group::before {
    top: 0;
    right: 18px;
    bottom: auto;
    left: 18px;
    width: auto;
    height: 1px;
  }
  .dtcw-filter-options { gap: 8px 20px; }
  .dtcw-result-count { margin-top: 0; }

  .dtcw-modal-panel { top: 12px; right: 12px; bottom: 12px; left: 12px; border-radius: 15px; }
  .dtcw-modal-header {
    grid-template-columns: minmax(130px,1fr) minmax(360px,1.7fr) 44px;
    min-height: 96px;
    padding: 13px 16px;
  }
  .dtcw-modal-meta h2 { font-size: 17px; }
  .dtcw-modal-toolbar { grid-template-columns: 60px minmax(190px,260px) 60px; gap: 6px; }
  .dtcw-device-switch { height: 40px; }
  .dtcw-preview { width: calc(100% - 28px); margin-top: 14px; padding: 12px 10px 34px; }
  .dtcw-modal-note { width: calc(100% - 28px); }
}

@media (max-width: 599px) {
  .dtcw-filter-heading { align-items: stretch; flex-direction: column; gap: 10px; }
  .dtcw-filter-toggle { width: 100%; justify-content: space-between; }
  .dtcw-filter-bar { margin-bottom: 18px; }
  .dtcw-filter-options { justify-content: flex-start; gap: 8px 18px; }
  .dtcw-filter-button { font-size: 13px; }

  .dtcw-success-list li a { width: 100%; }
  .dtcw-success-list li a span.title,
  .dtcw-success-list li a span.sub-title,
  .dtcw-success-list li a ul.cat-tag { width: calc(100% - 24px); margin-right: 12px; margin-left: 12px; }

  .dtcw-modal-panel { inset: 6px; border-radius: 13px; }
  .dtcw-modal-header {
    min-height: 146px;
    grid-template-columns: 1fr 42px;
    grid-template-rows: auto auto;
    align-items: start;
    padding: 11px 12px 10px;
  }
  .dtcw-modal-meta { grid-column: 1; grid-row: 1; }
  .dtcw-modal-industry { font-size: 9px; }
  .dtcw-modal-meta h2 { font-size: 15px; margin-bottom: 5px; }
  .dtcw-modal-tags { font-size: 10px; }
  .dtcw-modal-close { grid-column: 2; grid-row: 1; width: 40px; height: 40px; font-size: 30px; }
  .dtcw-modal-toolbar {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    grid-template-columns: 54px minmax(0,1fr) 54px;
    gap: 5px;
    margin-top: 9px;
  }
  .dtcw-nav { font-size: 8px; letter-spacing: .02em; padding: 0 1px; }
  .dtcw-nav span { font-size: 10px; }
  .dtcw-device-switch { height: 38px; }
  .dtcw-device-button { padding: 0 8px; font-size: 11px; }
  .dtcw-preview { width: calc(100% - 12px); min-height: 360px; margin-top: 6px; padding: 6px 5px 24px; border-radius: 8px; }
  .dtcw-preview.device-sp img { width: min(100%,330px); }
  .dtcw-modal-note { width: calc(100% - 16px); margin: 8px auto 18px; font-size: 9px; }
  .dtcw-empty-actions { gap: 10px; }
  .dtcw-empty .dtcw-empty-actions .button { width: 100%; max-width: 300px; }
}

@media (prefers-reduced-motion: reduce) {
  .dtcw-modal,
  .dtcw-modal-panel,
  .dtcw-device-switch::before,
  .dtcw-preview img { transition: none; }
  .dtcw-preview-spinner { animation-duration: 1.4s; }
}


/* =========================================================
   Filter transition / related divider polish (v1.7.1)
   ========================================================= */
.dtcw-works-region > .dtcw-result-count,
.dtcw-works-region > .dtcw-success-list,
.dtcw-works-region > .dtcw-empty,
.dtcw-works-region > .dtcw-related {
  transition:
    opacity .18s ease,
    transform .24s cubic-bezier(.22,1,.36,1);
}

.dtcw-works-region.is-filtering > .dtcw-result-count,
.dtcw-works-region.is-filtering > .dtcw-success-list,
.dtcw-works-region.is-filtering > .dtcw-empty,
.dtcw-works-region.is-filtering > .dtcw-related {
  opacity: 0;
  transform: translateY(6px);
}

/* When NO MATCH is followed by related works, the empty panel's bottom
   border is the single divider. Avoid drawing a second related border. */
.dtcw-related.is-after-empty {
  margin-top: 0;
  border-top: 0;
}

@media (prefers-reduced-motion: reduce) {
  .dtcw-works-region > .dtcw-result-count,
  .dtcw-works-region > .dtcw-success-list,
  .dtcw-works-region > .dtcw-empty,
  .dtcw-works-region > .dtcw-related {
    transition: none;
  }
}
