/* Three palettes shared by the public table layouts. */
html[data-design][data-theme="emerald"] {
  --page-bg: #080F0B;
  --panel: #0A110D;
  --panel-2: #0E1812;
  --row: #0C150F;
  --row-alt: #0C150F;
  --separator: #2E4939;
  --text: #FFFFFF;
  --muted: #CAD0D6;
  --accent: #246248;
  --accent-2: #9AD8BA;
  --logo-dark: #0A110D;
  --logo-border: #2E4939;
}

html[data-design][data-theme="midnight"] {
  --page-bg: #080D18;
  --panel: #0A101C;
  --panel-2: #101928;
  --row: #0D1522;
  --row-alt: #0D1522;
  --separator: #2E4466;
  --text: #FFFFFF;
  --muted: #CAD0D6;
  --accent: #285DA5;
  --accent-2: #A0C8FF;
  --logo-dark: #0A101C;
  --logo-border: #2E4466;
}

html[data-design][data-theme="aubergine"] {
  --page-bg: #100B15;
  --panel: #130D19;
  --panel-2: #1D1425;
  --row: #170F1E;
  --row-alt: #170F1E;
  --separator: #493653;
  --text: #FFFFFF;
  --muted: #CAD0D6;
  --accent: #654489;
  --accent-2: #D9BAF8;
  --logo-dark: #130D19;
  --logo-border: #493653;
}

html[data-design][data-theme] .affSection a.row {
  background: var(--row) !important;
}

html[data-design][data-theme] .affSection a.row > .goBtn {
  background: var(--accent) !important;
  color: #fff !important;
}

html[data-design][data-theme] .affSection {
  background: var(--panel) !important;
  border: 0 !important;
  box-shadow: none !important;
}

html[data-design][data-theme] .affSection .sectionTop {
  background: var(--panel-2) !important;
}

/* The row-only view uses the width a card would have in the mixed view. */
html[data-design] .match-main-card-width {
  container-type: inline-size;
  --main-card-gap: 7px;
}

html[data-design] .match-main-card-width .hybridList {
  --matched-logo-width: calc((100cqw - 2 * var(--main-card-gap)) / 3 - 2px);
}

@media (max-width: 700px) {
  html[data-design] .match-main-card-width {
    --main-card-gap: 5px;
  }
}

@media (max-width: 360px) {
  html[data-design] .match-main-card-width {
    --main-card-gap: 4px;
  }
}

/* Desktop and tablet sizing. Mobile keeps its existing layout. */
@media (min-width: 701px) {
  html[data-design] {
    --fb-width: 740px;
    --fb-gutter: 18px;
    --fb-header-height: 46px;
    --wide-logo-width: 140px;
    --wide-logo-height: 34px;
    --wide-row-side: 154px;
    --wide-card-gap: 8px;
  }

  html[data-design] body .announcementShell .announcementBar {
    border-radius: 0 0 8px 8px !important;
  }

  html[data-design] body .affSection .sectionTop {
    min-height: 36px !important;
    padding: 7px 12px !important;
  }

  html[data-design] body .affSection .sectionHeading {
    font-size: 14px !important;
    line-height: 1.25 !important;
  }

  html[data-design] body .affSection .sectionRows {
    padding: 7px !important;
    gap: var(--wide-card-gap) !important;
  }

  html[data-design] body .affSection .sectionRows > :is(.hybridList, .hybridCards) {
    gap: var(--wide-card-gap) !important;
    margin: 0 !important;
  }

  html[data-design] body .affSection .sectionRows .hybridList > a.row {
    grid-template-columns: var(--wide-row-side) minmax(0, 1fr) var(--wide-row-side) !important;
    min-height: 52px !important;
    height: auto !important;
    max-height: none !important;
    padding: 6px 10px !important;
    gap: 8px !important;
    align-items: center !important;
    border-radius: 7px !important;
  }

  html[data-design] body .affSection .sectionRows .hybridCards > a.row {
    display: grid !important;
    grid-template-rows: var(--wide-logo-height) minmax(30px, 1fr) 30px;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    align-items: center !important;
    gap: 6px !important;
    min-height: 122px !important;
    height: auto !important;
    padding: 8px !important;
    border-radius: 7px !important;
  }

  html[data-design] body .affSection .sectionRows .hybridCards > a.row > :is(.logoBox, .desc, .goBtn) {
    grid-column: 1 !important;
  }

  html[data-design] body .affSection .sectionRows .hybridCards > a.row > .logoBox {
    grid-row: 1 !important;
  }

  html[data-design] body .affSection .sectionRows .hybridCards > a.row > .desc {
    grid-row: 2 !important;
  }

  html[data-design] body .affSection .sectionRows .hybridCards > a.row > .goBtn {
    grid-row: 3 !important;
  }

  html[data-design] body .affSection .sectionRows .row > .logoBox {
    box-sizing: border-box !important;
    width: var(--wide-logo-width) !important;
    max-width: 100% !important;
    height: var(--wide-logo-height) !important;
    min-height: var(--wide-logo-height) !important;
    max-height: var(--wide-logo-height) !important;
    justify-self: center !important;
    align-self: center !important;
    margin: 0 !important;
    padding: 3px 5px !important;
    border-radius: 5px !important;
    box-shadow: none !important;
  }

  html[data-design] body .affSection .sectionRows .row > .logoBox > img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
  }

  html[data-design] body .affSection .sectionRows .row > .desc {
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    display: grid !important;
    justify-items: center;
    align-content: center;
    text-align: center !important;
    gap: 3px !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  html[data-design] body .affSection .sectionRows .row .descTop {
    font-size: 14px !important;
    line-height: 1.15 !important;
    font-weight: 750 !important;
  }

  html[data-design] body .affSection .sectionRows .row .descBottom {
    font-size: 11px !important;
    line-height: 1.2 !important;
  }

  html[data-design] body .affSection .sectionRows .row > .goBtn {
    box-sizing: border-box !important;
    width: 104px !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    margin: 0 !important;
    padding: 0 8px !important;
    justify-self: center !important;
    align-self: center !important;
    border-radius: 6px !important;
  }

  html[data-design] body .affSection .sectionRows .hybridList .row > .goBtn.goBtnIconOnly {
    width: 34px !important;
  }

  html[data-design] body .affSection .sectionRows .row > .goBtn .goBtnText {
    font-size: 11px !important;
  }
}

@media (min-width: 701px) and (max-width: 850px) {
  html[data-design] {
    --wide-logo-width: 124px;
    --wide-logo-height: 32px;
    --wide-row-side: 136px;
  }
}
