/* Shared media rights components (deal tables, bar charts, badges), used by the golf media rights and Nordic broadcasters pages. Kept out of styles.css so parallel edits there cannot drop it. */
.section-kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--red);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.rights-deal-table + .show-more {
  display: flex;
  width: fit-content;
  margin: 24px auto 0;
}

/* display: flex above would otherwise override the hidden attribute. */
.rights-deal-table + .show-more[hidden] {
  display: none;
}

.pga-share-grid {
  margin-top: 32px;
}

.pga-share-grid .share-card {
  position: relative;
}

.pga-share-grid .share-body {
  grid-template-columns: 240px minmax(0, 1fr);
}

.pga-share-grid .share-pie circle {
  cursor: default;
}

/* Same look as the rights timeline tooltip on the Nordic broadcasters page. */
.pie-tip {
  position: absolute;
  z-index: 5;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 0 0 1px var(--line), 0 12px 32px rgb(0 0 0 / 16%);
  color: var(--ink);
  font-size: 13px;
  line-height: 18px;
  white-space: nowrap;
  pointer-events: none;
}

.pie-tip:not([hidden]) {
  display: grid;
}

.pie-tip strong {
  font-weight: 600;
}

.pie-tip[hidden] {
  display: none;
}

@media (max-width: 820px) {
  .pga-share-grid .share-body {
    grid-template-columns: 160px minmax(0, 1fr);
  }
}

.notice-card {
  margin: 16px 0 20px;
  padding: 14px 18px;
}

.notice-card p {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  line-height: 26px;
}

.bar-chart {
  display: grid;
  gap: 4px;
}

.bar-row {
  display: grid;
  grid-template-columns: 24px minmax(140px, 240px) minmax(0, 1fr) 72px;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  color: var(--ink);
  font-size: 14px;
}

.bar-rank {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.bar-label {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--card);
}

.bar-fill {
  display: block;
  height: 100%;
  min-width: 2px;
  background: var(--blue);
}

.bar-row.is-highlight .bar-fill {
  background: var(--red);
}

.bar-value {
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px 2px 7px;
  border-radius: 360px;
  background: var(--white);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  white-space: nowrap;
}

.status-badge::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  content: "";
}

.status-current {
  background: var(--status-current-light);
  box-shadow: none;
  color: var(--status-current);
}

.status-current::before,
.status-dot-current {
  background: var(--status-current);
}

.status-future {
  background: var(--status-future-light);
  box-shadow: none;
  color: var(--status-future);
}

.status-future::before,
.status-dot-future {
  background: var(--status-future);
}

.status-past {
  background: var(--status-past-light);
  box-shadow: none;
  color: var(--status-past);
}

.status-past::before,
.status-dot-past {
  background: var(--status-past);
}

/* Rights badges: white with a coloured dot, streaming red as on the viewing page. */
.rights-free-to-air::before {
  background: var(--blue);
}

.rights-pay-tv::before {
  background: var(--water);
}

.rights-streaming::before {
  background: var(--red);
}

.rights-highlights::before {
  background: var(--line-strong);
}

.country-badge-plain {
  padding-left: 9px;
}

/* Same density as the tables on the viewing page. */
.rights-deal-table {
  font-size: 13px;
}

.rights-deal-table th {
  font-size: 10px;
}

.rights-deal-table .event-name {
  font-size: 14px;
}

.rights-deal-table .event-meta {
  font-size: 12px;
}

@media (min-width: 821px) {
  .rights-deal-table td {
    padding-top: 10px;
    padding-bottom: 10px;
  }
}

.buyer-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.info-tip-button {
  display: inline-grid;
  width: 16px;
  height: 16px;
  flex: none;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--white);
  color: var(--muted);
  font: italic 600 10px/1 Georgia, serif;
}

/* Rows open the deal dialog. */
.deal-row {
  cursor: pointer;
}

.deal-row:hover td,
.deal-row:focus-visible td {
  background: var(--surface);
}

.deal-row:hover .info-tip-button {
  border-color: var(--ink);
  color: var(--ink);
}

.deal-row:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.deal-dialog {
  width: min(620px, calc(100vw - 32px));
}

.deal-dialog .dialog-spending > div {
  grid-template-columns: 130px minmax(0, 1fr);
}

.deal-dialog .dialog-shared {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

/* One text size for labels and values. */
.deal-dialog .dialog-spending dt,
.deal-dialog .dialog-spending dd {
  color: var(--ink);
  font-size: 14px;
  line-height: 20px;
}

.deal-value {
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}

@media (min-width: 821px) {
  .rights-deal-table td:first-child { width: 20%; }
  .rights-deal-table td:nth-child(2) { width: 27%; }
  .rights-deal-table td:nth-child(3) { width: 19%; }
  .rights-deal-table td:nth-child(4) { width: 10%; }
  .rights-deal-table td:nth-child(5) { width: 10%; }
  .nordic-deal-table td:nth-child(2) { width: 27%; }
  .nordic-deal-table td:nth-child(3) { width: 19%; }
  .nordic-golf-table td:first-child { width: 24%; }
  .nordic-golf-table td:nth-child(2) { width: 18%; }
  .nordic-golf-table td:nth-child(3) { width: 34%; }
  .nordic-golf-table td:nth-child(4) { width: 11%; }
}

@media (max-width: 820px) {
  .bar-row {
    grid-template-columns: 20px minmax(0, 1fr) 64px;
    gap: 4px 10px;
  }

  .bar-track {
    grid-column: 2 / -1;
    grid-row: 2;
  }

  .rights-deal-table tr {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 16px;
  }

  .rights-deal-table td:first-child,
  .rights-deal-table td:nth-child(2),
  .rights-deal-table td:nth-child(3) {
    grid-column: 1 / -1;
  }
}

/* Market overview on the Nordic broadcasters page */
.overview-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 64px;
}

.by-country + .by-country {
  margin-top: 56px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.overview-country-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 32px 0 0;
  font-size: 22px;
  font-weight: 600;
  line-height: 28px;
}

.overview-country-title img {
  width: 24px;
  height: 24px;
}

.overview-country-title span {
  margin-left: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.overview-chart-title {
  margin: 24px 0 16px;
  font-size: 18px;
  font-weight: 600;
  line-height: 24px;
}

.by-country .overview-pie svg {
  width: 180px;
  height: 180px;
}

.overview-legend-none {
  grid-column: span 2;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.overview-chart .country-subhead {
  margin-bottom: 6px;
  font-size: 18px;
}

.overview-chart .table-note {
  margin: 0 0 18px;
}

.overview-bar {
  grid-template-columns: 120px minmax(0, 1fr) 72px;
}

.overview-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.overview-label img {
  width: 18px;
  height: 18px;
}

#overview-bars {
  position: relative;
}

.overview-pie {
  position: relative;
  display: flex;
  align-items: center;
  gap: 40px;
}

.overview-pie svg {
  width: 220px;
  height: 220px;
  flex: none;
}

.overview-pie path {
  stroke: var(--white);
  stroke-width: 1;
  stroke-linejoin: round;
}

.overview-pie path:hover {
  opacity: 0.85;
}

.overview-legend {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}

.overview-legend li {
  display: grid;
  grid-template-columns: 12px minmax(96px, auto) 40px 64px;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.overview-legend strong,
.overview-legend-value {
  text-align: right;
}

.overview-legend-value {
  color: var(--muted);
}

.overview-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

@media (min-width: 821px) {
  .overview-deal-table td:first-child { width: 32px; }
  .overview-deal-table td:nth-child(2) { width: 26%; }
  .overview-deal-table td:nth-child(3) { width: 16%; }
  .overview-deal-table td:nth-child(4) { width: 26%; }
  .overview-deal-table td:nth-child(5) { width: 10%; }
}

.overview-rank {
  color: var(--muted);
}

.overview-deal-table .team-badges + .event-meta,
.overview-deal-table .deal-value + .event-meta {
  display: block;
  margin-top: 6px;
}

.overview-deal-table .deal-value ~ .team-badges {
  margin-top: 8px;
}

.overview-deal-table .deal-value ~ .team-badges:empty {
  display: none;
}

.estimate-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 360px;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  white-space: nowrap;
}

.estimate-model {
  background: var(--blue-light);
  color: var(--blue);
}

.estimate-low {
  background: #fdf0dc;
  color: #8a4b00;
}

@media (max-width: 820px) {
  .overview-charts {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .overview-bar {
    grid-template-columns: minmax(0, 1fr) 64px;
  }

  .overview-bar .bar-track {
    grid-column: 1 / -1;
  }

  .overview-pie {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .overview-pie svg {
    width: 160px;
    height: 160px;
  }

  .overview-rank {
    display: none;
  }
}

/* Nordic spend over time: stacked columns per year */
.history-chart {
  position: relative;
}

.history-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  color: var(--ink);
  font-size: 14px;
}

.history-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-plot {
  position: relative;
  height: 340px;
  margin-left: 56px;
}

.history-tick {
  position: absolute;
  right: 0;
  left: 0;
  border-top: 1px solid var(--line);
}

.history-tick span {
  position: absolute;
  top: -8px;
  right: calc(100% + 10px);
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
  white-space: nowrap;
}

.history-bars {
  position: absolute;
  inset: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
}

.history-col {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 100%;
}

.history-col:hover .history-stack {
  opacity: 0.85;
}

.history-stack {
  display: flex;
  flex-direction: column-reverse;
  gap: 1px;
  width: 64%;
  overflow: hidden;
  border-radius: 4px 4px 0 0;
}

.history-total {
  position: absolute;
  left: 50%;
  margin-bottom: 4px;
  transform: translateX(-50%);
  line-height: 16px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.history-years {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  margin: 8px 0 0 56px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* The last year label is wider than its column: let it overflow to the left. */
.history-years span:last-child {
  direction: rtl;
}

@media (max-width: 820px) {
  .history-plot {
    height: 260px;
    margin-left: 60px;
  }

  .history-years {
    margin-left: 60px;
  }

  .history-years span:not(:nth-child(5n + 1)) {
    visibility: hidden;
  }

  .history-stack {
    width: 76%;
  }

  .history-total {
    display: none;
  }
}

.history-notice {
  margin: 0 0 48px;
}

/* Same type scale as the deal tables on the other pages, one pixel below the default table. */
.overview-deal-table {
  font-size: 13px;
}

.overview-deal-table th {
  font-size: 10px;
}

.overview-deal-table .event-name {
  font-size: 14px;
}

.overview-deal-table .event-meta {
  font-size: 12px;
}

/* Market breakdown in the deal dialog on the Nordic rights market page */
.dialog-markets {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dialog-markets li {
  display: grid;
  grid-template-columns: 18px minmax(80px, auto) 64px 40px;
  align-items: center;
  gap: 8px;
}

.dialog-markets li > span:nth-child(2) {
  color: var(--ink);
  font-size: 14px;
}

.dialog-markets li > span:last-child {
  font-size: 13px;
}

.dialog-markets img {
  width: 18px;
  height: 18px;
}

.dialog-markets strong,
.dialog-markets li > span:last-child {
  text-align: right;
}

.dialog-markets li > span:last-child {
  color: var(--muted);
}

/* The wide TV 2 Denmark mark reads larger than the other buyer icons at the same height. */
.brand-badge img[src$="tv2-denmark.svg"] {
  height: 10px;
}

/* PGA TOUR market timeline: smaller logos and rows, sized so wordmarks read at a similar weight. */
.brand-timeline[data-country="pga"] .brand-row {
  min-height: 56px;
}

.brand-timeline[data-country="pga"] .brand-track {
  height: 56px;
}

.brand-timeline[data-country="pga"] .brand-logo {
  height: 12px;
}

.brand-timeline[data-country="pga"] .brand-logo-golftv,
.brand-timeline[data-country="pga"] .brand-logo-unext,
.brand-timeline[data-country="pga"] .brand-logo-eurosport,
.brand-timeline[data-country="pga"] .brand-logo-cmore {
  height: 9px;
}

.brand-timeline[data-country="pga"] .brand-logo-cbs,
.brand-timeline[data-country="pga"] .brand-logo-nbc,
.brand-timeline[data-country="pga"] .brand-logo-skysports,
.brand-timeline[data-country="pga"] .brand-logo-canal,
.brand-timeline[data-country="pga"] .brand-logo-espn,
.brand-timeline[data-country="pga"] .brand-logo-sbs,
.brand-timeline[data-country="pga"] .brand-logo-spotv,
.brand-timeline[data-country="pga"] .brand-logo-movistar,
.brand-timeline[data-country="pga"] .brand-logo-sky {
  height: 11px;
}

.brand-timeline[data-country="pga"] .brand-logo-foxtel,
.brand-timeline[data-country="pga"] .brand-logo-tsn {
  height: 10px;
}

.brand-timeline[data-country="pga"] .brand-logo-kayo {
  height: 14px;
}

.brand-timeline[data-country="pga"] .brand-logo-iqiyi {
  height: 9px;
}

/* The Golf Channel China file is low resolution with a tagline under the wordmark, so it needs extra height to read. */
.brand-timeline[data-country="pga"] .brand-logo-grt {
  height: 22px;
  margin: -3px 0;
}

.brand-timeline[data-country="pga"] .brand-logo-neo {
  height: 13px;
}

.brand-timeline[data-country="pga"] .brand-logo-magenta,
.brand-timeline[data-country="pga"] .brand-logo-dazn,
.brand-timeline[data-country="pga"] .brand-logo-fancode {
  height: 16px;
}

.brand-timeline[data-country="pga"] .brand-logo-wbd,
.brand-timeline[data-country="pga"] .brand-logo-golfnetwork {
  height: 17px;
}

.brand-timeline[data-country="pga"] .brand-logo-jtbc,
.brand-timeline[data-country="pga"] .brand-logo-ziggo {
  height: 19px;
}

/* Several flags on one row, e.g. the Nordics: slightly overlapping, each with a white ring. */
.brand-flag:has(+ .brand-flag) {
  margin-right: 0;
}

.brand-flag + .brand-flag {
  margin-left: -3px;
}

.brand-flag:has(+ .brand-flag),
.brand-flag + .brand-flag {
  border-radius: 50%;
  box-shadow: 0 0 0 1.5px var(--white);
}

/* Annual value column on the right; ~ and muted for estimates. */
.brand-timeline.has-values .brand-axis,
.brand-timeline.has-values .brand-row {
  grid-template-columns: 210px minmax(0, 1fr) 88px;
}

.brand-timeline.has-values .brand-markers {
  right: 104px;
}

.brand-value-head {
  align-self: end;
  padding-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 12px;
  text-align: right;
}

.brand-value {
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 16px;
  text-align: right;
}

.brand-value.is-estimate {
  color: var(--muted);
  font-weight: 400;
}

@media (max-width: 820px) {
  .brand-timeline.has-values .brand-axis,
  .brand-timeline.has-values .brand-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .brand-timeline.has-values .brand-axis > div,
  .brand-timeline.has-values .brand-track {
    grid-column: 1 / -1;
  }

  .brand-timeline.has-values .brand-markers {
    right: 0;
  }

  .brand-value-head {
    display: none;
  }

  /* Above the Today and end lines, which cross the row's top line on narrow screens. */
  .brand-timeline.has-values .brand-value {
    position: relative;
    z-index: 3;
    grid-row: 1;
    grid-column: 2;
    margin-top: 10px;
    padding-left: 6px;
    background: var(--white);
  }
}

/* Reference lines besides Today, e.g. when deals end. */
.brand-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  margin-left: -1px;
  border-left: 2px dotted var(--muted);
}

.brand-marker b {
  position: absolute;
  bottom: 100%;
  left: -1px;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 14px;
  transform: translateX(-50%);
  white-space: nowrap;
}

/* Nordic golf rights: one row per property, then four markets for each year. */
.golf-rights-table {
  font-size: 12px;
}

.golf-rights-table .event-name {
  font-size: 14px;
}

.golf-rights-table thead th {
  padding-right: 8px;
  vertical-align: bottom;
}

.golf-rights-table thead th[colspan] {
  padding-bottom: 4px;
  color: var(--ink);
  font-size: 18px;
  letter-spacing: 0;
  line-height: 24px;
  text-transform: none;
}

.golf-rights-table thead tr:last-child th {
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}

/* Hairlines between countries, a slightly darker one between years. */
.golf-rights-table thead tr:last-child th,
.golf-rights-table td:not(:first-child) {
  padding-left: 10px;
  border-left: 1px solid rgb(0 0 0 / 5%);
}

.golf-rights-table .year-start,
.golf-rights-table thead tr:last-child th.year-start,
.golf-rights-table td.year-start {
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

.country-head {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.country-head img {
  width: 14px;
  height: 14px;
}

.rights-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.rights-logo {
  width: auto;
  max-width: 64px;
  height: 12px;
  object-fit: contain;
}

/* The stacked HBO Max and Disney+ wordmarks read small at the shared logo height. */
.rights-logo[src$="hbo-max.svg"] {
  height: 16px;
  margin: -2px 0;
}

.rights-logo[src$="liv-golf.svg"] {
  height: 8px;
}

.rights-logo[src$="disney-plus.svg"] {
  height: 20px;
  margin: -4px 0;
}

.golf-rights-table td.is-not-played,
.rights-key.is-not-played {
  background: var(--surface);
}

.golf-rights-table td.is-tba,
.rights-key.is-tba {
  background: #fff6d9;
}

.rights-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
}

.rights-legend + .table-note {
  margin-top: 6px;
}

.rights-key {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  vertical-align: -2px;
}

@media (min-width: 821px) {
  .golf-rights-table td {
    padding-top: 12px;
    padding-bottom: 12px;
    padding-right: 6px;
    vertical-align: middle;
  }

  .golf-rights-table td:first-child { width: 17%; }
  .golf-rights-table td:nth-child(n + 2) { width: auto; }

  /* Logos sit in the middle of each country cell. */
  .golf-rights-table td:not(:first-child) {
    padding-right: 10px;
    text-align: center;
  }

  .golf-rights-table .rights-logos {
    justify-content: center;
  }
}

@media (max-width: 820px) {
  .golf-rights-table tr {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 16px;
  }

  .golf-rights-table td:first-child {
    grid-column: 1 / -1;
  }

  .golf-rights-table td:not(:first-child),
  .golf-rights-table td.year-start {
    padding-left: 0;
    border-left: 0;
  }

  .golf-rights-table td.is-tba,
  .golf-rights-table td.is-not-played {
    padding-left: 8px;
    border-radius: 4px;
  }
}
