/* Shared editorial layout. Paid placements and floating reader controls retain
 * their own sizing/positioning contracts. Loaded through the theme registry. */
body.cte-archive-render {
  --cte-max: var(--cte-wallpaper-gap-width, 1252px);
}

/* Give landing titles a deliberate hierarchy instead of browser h1 margins. */
body.cte-archive-render .cte-archive__header {
  padding: 20px 24px 18px !important;
}
body.cte-archive-render .cte-archive__header h1 {
  margin: 0;
  font: 800 clamp(28px, 3vw, 40px)/1.12 system-ui, sans-serif;
  letter-spacing: -.025em;
}
body.cte-archive-render .cte-archive__kicker { margin-bottom: 8px; }
body.cte-archive-render .cte-archive__subtitle { margin-top: 8px; }
body.cte-archive-render .cte-archive__resultsLayout { margin-top: 16px; }

/* A video and its queue form one compact feature. The actual video keeps its
 * native proportions; this does not apply to the minimized floating player. */
.cte-fvl__archive:not(.is-minimized) {
  margin: 16px 24px;
  padding: 16px;
  border-radius: 12px;
  box-shadow: none;
  background: #f4f6f8;
}
.cte-fvl__archive:not(.is-minimized) .cte-fvl__playerShell {
  margin-top: 0;
  gap: 12px 20px;
}
.cte-fvl__archive:not(.is-minimized) .cte-fvl__playerWrap {
  border-radius: 10px;
  box-shadow: 0 4px 16px rgb(17 53 93 / 12%);
  align-self: start;
}
.cte-fvl__archive:not(.is-minimized) .cte-fvl__card {
  border-radius: 8px;
  padding: 8px;
  box-shadow: none;
  background: #fff;
}
.cte-fvl__archive:not(.is-minimized) .cte-fvl__thumb { border-radius: 5px; }
.cte-fvl__archive:not(.is-minimized) .cte-fvl__cardTitle {
  margin-top: 8px;
  min-height: 0;
  font-size: 14px;
  line-height: 1.35;
}
.cte-fvl__archive:not(.is-minimized) .cte-fvl__next {
  width: 44px;
  height: 44px;
  min-width: 44px;
  box-shadow: none;
}
@media (min-width: 800px) {
  .cte-fvl__archive:not(.is-minimized) .cte-fvl__playerShell {
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr);
    grid-template-rows: auto 1fr auto;
    grid-template-areas: "player queuehead" "player queue" "meta queue";
    align-items: start;
  }
  .cte-fvl__archive:not(.is-minimized) .cte-fvl__playerShell:has(.cte-fvl__playerWrap.is-portrait) {
    grid-template-columns: 320px minmax(0, 1fr);
  }
  .cte-fvl__archive:not(.is-minimized) .cte-fvl__playerWrap { grid-area: player; }
  .cte-fvl__archive:not(.is-minimized) .cte-fvl__playerWrap.is-portrait {
    width: 100%;
    margin: 0;
  }
  .cte-fvl__archive:not(.is-minimized) .cte-fvl__playerMeta { grid-area: meta; }
  .cte-fvl__archive:not(.is-minimized) .cte-fvl__railHead { grid-area: queuehead; }
  .cte-fvl__archive:not(.is-minimized) .cte-fvl__railRow { grid-area: queue; }
  .cte-fvl__archive:not(.is-minimized) .cte-fvl__cards {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(2, auto);
    grid-auto-columns: calc((100% - 12px) / 2);
    gap: 12px;
    width: 100%;
    min-width: 0;
  }
  .cte-fvl__archive:not(.is-minimized) .cte-fvl__card {
    min-width: 0;
    max-width: none;
  }
}
@media (max-width: 799px) {
  .cte-fvl__archive:not(.is-minimized) { margin: 12px; padding: 12px; }
  .cte-fvl__archive:not(.is-minimized) .cte-fvl__playerWrap.is-portrait {
    width: min(100%, 240px);
  }
  .cte-fvl__archive:not(.is-minimized) .cte-fvl__card {
    flex-basis: 172px;
    min-width: 172px;
    max-width: 172px;
  }
  body.cte-archive-render .cte-archive__header { padding: 18px 16px !important; }
}

/* Keep the two video actions clear of each other on portrait players. */
.cte-fvl__archive:not(.is-minimized) .cte-fvl__playerWrap.is-portrait .cte-fvl__overlayMute {
  top: 62px;
  left: 16px;
  transform: none;
}
.cte-fvl__archive .cte-fvl__next[hidden] { display: none !important; }

/* Custom landing components already supply a card and gutter. Remove the
 * redundant outer card padding, preserving the independent 300px ad rail. */
.cte-native-content:has(> .cte-resources),
.cte-native-content:has(> .cte-contact) {
  padding: 0;
  background: transparent;
  border: 0;
}
.cte-native-content > .cte-resources > .cte-wrap,
.cte-native-content > .cte-contact > .cte-wrap {
  padding: 0 !important;
  max-width: none;
}
.cte-resources .cte-resources__header,
.cte-contact .cte-contact__header { padding: 20px 24px; }
.cte-resources .cte-resources__body,
.cte-contact .cte-contact__body { padding: 20px 24px 24px; }
.cte-contact .cte-contact__title,
.cte-resources .cte-resources__title {
  font: 800 clamp(28px, 3vw, 40px)/1.12 system-ui, sans-serif;
  letter-spacing: -.025em;
}
.cte-contact .cte-contact__person,
.cte-resources .cte-resources__tile,
.cte-resources .cte-resources__featuredBlock,
.cte-resources .cte-resources__linkRow { border-radius: 8px; }
.cte-contact .cte-contact__group:first-child { margin-top: 0; }
.cte-contact .cte-contact__group { margin-top: 24px; }
.cte-resources .cte-resources__moreTopics { grid-column: 1 / -1; }
.cte-resources .cte-resources__moreTopics summary {
  padding: 12px 14px;
  min-height: 44px;
  cursor: pointer;
  border: 1px solid #ccd5df;
  border-radius: 8px;
  color: #173f62;
  font: 700 14px/1.4 system-ui, sans-serif;
  background: #f4f7fa;
}
.cte-resources .cte-resources__moreTopics summary:focus-visible {
  outline: 3px solid #174c75;
  outline-offset: 3px;
}
.cte-resources .cte-resources__grid--moreTopics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}
.cte-resources .cte-resources__links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cte-resources .cte-resources__landingFeed .cte-archive__card {
  border: 0;
  border-radius: 0;
}
.cte-resources .cte-resources__landingFeed .cte-archive__header { padding: 16px 0; }
.cte-resources .cte-resources__landingFeed .cte-archive__header h2 { margin: 0; }
.cte-resources .cte-resources__landingFeed .cte-archive__resultsLayout { padding: 0; }
@media (max-width: 640px) {
  body.cte-contact-render .cte-contact .cte-contact__ctaRow {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .cte-contact .cte-contact__ctaRow .cte-btn { min-height: 48px; }
  .cte-contact .cte-contact__header,
  .cte-resources .cte-resources__header { padding: 18px 16px; }
  .cte-contact .cte-contact__body,
  .cte-resources .cte-resources__body { padding: 16px; }
  .cte-resources .cte-resources__grid--moreTopics { grid-template-columns: 1fr; }
}

/* Issue cover and metadata share a row. Keep the complete cover and both
 * actions visible, avoiding a tall centered cover above short metadata. */
.cte-homepage-display .cte-hp__issueCol--left .cte-hp__issue {
  grid-template-columns: minmax(100px, 42%) minmax(0, 1fr);
  align-items: center;
  justify-items: stretch;
  gap: 16px;
}
.cte-homepage-display .cte-hp__issueCol--left .cte-hp__issueCoverBlock {
  width: 100%;
  max-width: 200px;
}
.cte-homepage-display .cte-hp__issueCol--left .cte-hp__issue_coverLink,
.cte-homepage-display .cte-hp__issueCol--left .cte-hp__issue_img { width: 100%; }
.cte-homepage-display .cte-hp__issueCol--left .cte-hp__issue_meta {
  align-items: flex-start;
  text-align: left;
  gap: 12px;
}
.cte-homepage-display .cte-hp__issueCol--left .cte-hp__issueBrandTitle {
  white-space: normal;
}
.cte-homepage-display .cte-hp__issue_actions { justify-content: flex-start; }
.cte-homepage-display .cte-hp__issue_actions .cte-btn {
  min-height: 44px;
  padding: 8px 12px;
  white-space: normal;
  line-height: 1.25 !important;
  border-radius: 8px;
}
@media (min-width: 981px) {
  .cte-homepage-display .cte-hp__issueDuo { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  body.single-articles .cte-cpt--articles .cte-related__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 640px) {
  .cte-homepage-display .cte-hp__issueCol--left .cte-hp__issue {
    grid-template-columns: minmax(96px, 36%) minmax(0, 1fr);
    padding: 0 12px 16px;
    gap: 12px;
  }
  .cte-homepage-display .cte-hp__issueBrandTitle { font-size: 10px; }
  .cte-homepage-display .cte-hp__issue_title { font-size: 16px; }
}
/* A consistent, quieter card treatment for editorial surfaces only. */
.cte-homepage-display .cte-hp__card--issue-duo,
.cte-homepage-display .cte-hp__card--latest {
  border-radius: 10px;
  box-shadow: none;
}
.cte-contact .cte-contact__grid { align-items: start; }
.cte-contact .cte-contact__top { grid-template-columns: 64px minmax(0, 1fr); }
.cte-contact .cte-contact__meta,
.cte-contact .cte-contact__val { min-width: 0; overflow-wrap: anywhere; }
.cte-contact .cte-contact__ctaRow .cte-btn {
  white-space: normal;
  line-height: 1.3 !important;
  min-width: 0;
}
@media (min-width: 981px) {
  .cte-homepage-display .cte-hp__issueDuo { align-items: stretch; }
  .cte-homepage-display .cte-hp__issueCol--left { display: flex; flex-direction: column; }
  .cte-homepage-display .cte-hp__issueCol--left .cte-hp__issue { flex: 1; align-content: center; }
}
