/* ==========================================================================
   AFTV blog and article templates — Figma 113:999 and 128:334
   The header, footer, cards and controls are shared by both templates.
   ========================================================================== */

.aftv-blog-template,
.aftv-single-template {
  & .site-header,
  & .site-footer,
  & .entry-header,
  & .ast-primary-header-bar,
  & .ast-below-header-wrap {
    display: none !important;
  }

  & #content,
  & #primary,
  & .site-content,
  & .site-content > .ast-container,
  & .content-area,
  & .site-main {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
  }
}

.aftv-blog-template #primary,
.aftv-single-template #primary {
  margin: 0 !important;
  padding: 0 !important;
}

.aftv-editorial {
  --aftv-black: #0a0a0a;
  --aftv-white: #ffffff;
  --aftv-wine: var(--aftv-custom-accent, #8f1530);
  --aftv-soft-white: #c4c4c4;
  --aftv-muted: #737373;
  --aftv-light-gray: #f3f3f3;
  --aftv-line: #d0d0d0;
  --aftv-shell: 1140px;

  display: flex;
  flex-direction: column;
  gap: 80px;
  width: 100vw;
  min-width: 0;
  margin-left: calc((100% - 100vw) / 2);
  overflow: clip;
  font-family: "Archivo", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.4;

  &,
  & * {
    box-sizing: border-box;
  }

  & [hidden] {
    display: none !important;
  }

  & .aftv-shell {
    width: min(var(--aftv-shell), calc(100% - 44px));
    margin-inline: auto;
  }

  & h1,
  & h2,
  & h3,
  & h4,
  & p,
  & figure,
  & blockquote {
    margin: 0;
  }

  & h1,
  & h2,
  & h3,
  & h4 {
    color: inherit !important;
  }

  & a {
    color: inherit !important;
    text-decoration: none !important;
  }

  & button,
  & input,
  & textarea {
    font: inherit;
  }

  & img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  & :focus-visible {
    outline: 3px solid var(--aftv-wine);
    outline-offset: 4px;
  }

  & .aftv-eyebrow,
  & .aftv-rubric {
    color: var(--aftv-wine) !important;
    font: 600 13px/16px "Archivo", Arial, sans-serif;
    letter-spacing: 0.52px;
    text-transform: uppercase;
  }

  /* Shared header -------------------------------------------------------- */
  & .aftv-site-header {
    flex: 0 0 auto;
    position: relative;

    & .aftv-shell {
      padding-top: 48px;
    }
  }

  & .aftv-site-header--dark {
    color: var(--aftv-white);
    background: var(--aftv-black);
  }

  & .aftv-site-header--light {
    color: var(--aftv-black);
    background: var(--aftv-white);
  }

  & .aftv-brand-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    height: 112px;
  }

  & .aftv-brand {
    position: relative;
    display: flex;
    width: 520px;
    height: 112px;
  }

  & .aftv-brand::after {
    content: "";
    position: absolute;
    top: 27px;
    left: 250px;
    width: 2px;
    height: 58px;
    background: var(--aftv-wine);
  }

  & .aftv-brand__mark {
    width: 208px;
    font: 600 72px/72px "Newsreader", Georgia, serif;
    letter-spacing: -1.44px;
  }

  & .aftv-brand__name {
    width: 240px;
    margin: 14px 0 0 38px;
    font: 600 18px/22px "Archivo", Arial, sans-serif;
    text-transform: uppercase;
  }

  & .aftv-search-toggle {
    padding: 0;
    border: 0;
    color: inherit;
    background: transparent;
    font: 600 14px/18px "Archivo", Arial, sans-serif;
    cursor: pointer;
  }

  & .aftv-search-panel {
    position: absolute;
    z-index: 30;
    top: 88px;
    right: max(22px, calc((100vw - var(--aftv-shell)) / 2));
    width: min(420px, calc(100% - 44px));
    padding: 16px;
    border: 1px solid currentColor;
    color: var(--aftv-white);
    background: var(--aftv-black);

    & form {
      display: flex;
      gap: 8px;
    }

    & input {
      flex: 1;
      min-width: 0;
      padding: 10px 12px;
      border: 1px solid #777;
      color: var(--aftv-black);
      background: var(--aftv-white);
    }

    & button {
      padding: 10px 16px;
      border: 0;
      color: var(--aftv-white);
      background: var(--aftv-wine);
      cursor: pointer;
    }
  }

  & .aftv-primary-nav {
    display: flex;
    gap: 24px;
    height: 18px;
    margin-top: 32px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;

    &::-webkit-scrollbar {
      display: none;
    }

    & a {
      color: inherit !important;
      font: 500 13px/18px "Archivo", Arial, sans-serif;
      opacity: 0.78;
    }

    & a:hover {
      opacity: 1;
    }
  }

  /* Shared cards --------------------------------------------------------- */
  & .aftv-card {
    min-width: 0;
    color: inherit;

    & h3 {
      margin-top: 8px;
      font: 500 23px/32px "Archivo", Arial, sans-serif;
    }
  }

  & .aftv-card__media {
    position: relative;
    display: block;
    height: 334px;
    overflow: hidden;
    border-radius: 8px;
    background: #151515;
  }

  & .aftv-card__media img {
    transition: transform 260ms ease;
  }

  & .aftv-card__media:hover img {
    transform: scale(1.025);
  }

  & .aftv-rubric {
    position: relative;
    display: flex;
    align-items: center;
    width: min(267px, 100%);
    height: 48px;
    padding-left: 25px;
  }

  & .aftv-rubric::before {
    content: "";
    position: absolute;
    top: 14px;
    left: 12px;
    width: 3px;
    height: 20px;
    background: var(--aftv-wine);
  }

  & .aftv-card__meta {
    margin-top: 8px;
    color: var(--aftv-muted);
    font: 500 13px/18px "Archivo", Arial, sans-serif;
    text-transform: uppercase;
  }

  & .aftv-card__duration {
    position: absolute;
    top: 16px;
    right: 16px;
    display: grid;
    place-items: center;
    min-width: 170px;
    height: 32px;
    padding-inline: 10px;
    border-radius: 16px;
    color: var(--aftv-white);
    background: rgb(10 10 10 / 78%);
    font: 500 13px/18px "Archivo", Arial, sans-serif;
    text-transform: uppercase;
  }

  & .aftv-card__play,
  & .aftv-card__next {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    color: var(--aftv-white);
    background: #191919;
    transform: translate(-50%, -50%);
  }

  & .aftv-card__count {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 8px 10px;
    color: var(--aftv-white);
    background: #191919;
    font: 500 13px/18px "Archivo", Arial, sans-serif;
  }

  & .aftv-card__next {
    right: 16px;
    left: auto;
    width: 48px;
    height: 48px;
    font-size: 28px;
    transform: translateY(-50%);
  }

  /* Shared footer -------------------------------------------------------- */
  & .aftv-site-footer {
    flex: 0 0 566px;
    height: 566px;
    border-top: 1px solid #242424;
    color: var(--aftv-white);
    background: var(--aftv-black);

    & .aftv-shell {
      padding-top: 64px;
    }
  }

  & .aftv-footer-brand {
    height: 152px;

    & p {
      margin-top: 24px;
      font: 500 23px/32px "Archivo", Arial, sans-serif;
    }
  }

  & .aftv-footer-mark {
    display: block;
    width: 216px;
    height: 72px;
    font: 600 64px/64px "Newsreader", Georgia, serif;
    letter-spacing: -1.28px;
  }

  & .aftv-footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    height: 154px;
    margin-top: 48px;

    & h2 {
      font: 600 13px/18px "Archivo", Arial, sans-serif;
      text-transform: uppercase;
    }

    & a {
      display: block;
      margin-top: 16px;
      color: var(--aftv-soft-white) !important;
      font: 500 13px/18px "Archivo", Arial, sans-serif;
    }
  }

  & .aftv-footer-note {
    height: 36px;
    margin-top: 48px;
    color: var(--aftv-soft-white);
    font: 500 13px/18px "Archivo", Arial, sans-serif;
  }
}

