/* GRE reusable table treatments — v0.2.5
 * On a Table block, apply classes in Advanced > Additional CSS Class(es):
 *   gre-table-gold-bronze  — cream/bronze visual treatment
 *   gre-table-scrollable  — horizontal mobile scrolling
 *   gre-table-sticky-first — sticky first column on mobile (use with scrollable)
 * Legacy gre-sponsor-comparison continues to provide the prior bronze-tint
 * plus scrolling and sticky-first behavior, preserving existing page content.
 */

/* Legacy comparison: don't change what the currently published page displays. */
.gre-sponsor-comparison tr > :nth-child(2) {
  background-color: rgba(184, 130, 60, 0.17);
}

/* Reusable gold-and-bronze presentation (opt in with class). */
.gre-table-gold-bronze tbody td,
.gre-table-gold-bronze tbody th {
  background: #f5e7ce;
  color: #382518;
  border-color: #c9af89;
}
.gre-table-gold-bronze tbody tr:nth-child(even) > * {
  background: #ead6b7;
}
.gre-table-gold-bronze thead th {
  background: #41291c;
  color: #fff0d8;
  border-color: #b79769;
  font-weight: 700;
}
.gre-table-gold-bronze thead th:nth-child(2) {
  background: linear-gradient(135deg, #bf8c4c, #81532c);
  color: #fff8e9;
}
.gre-table-gold-bronze tbody tr > :nth-child(2) {
  background: #e0c397;
  color: #382518;
}
.gre-table-gold-bronze tbody tr:nth-child(even) > :nth-child(2) {
  background: #d5b586;
}
.gre-table-gold-bronze table,
.gre-table-gold-bronze th,
.gre-table-gold-bronze td {
  border-color: #c2a47a;
}

@media (max-width: 781px) {
  :is(.gre-table-scrollable, .gre-sponsor-comparison) {
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
  }

:is(.gre-table-scrollable, .gre-sponsor-comparison) table {
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
}

/* Standard sponsorship columns */
:is(.gre-table-scrollable, .gre-sponsor-comparison) tr > :not(:first-child) {
  width: 160px;
  min-width: 160px;
  max-width: 160px;
  box-sizing: border-box;
  white-space: normal;
  overflow-wrap: break-word;
}

/* Presenting tier gets extra room */
:is(.gre-table-scrollable, .gre-sponsor-comparison) tr > :nth-child(2) {
  width: 190px;
  min-width: 190px;
  max-width: 190px;
}

  :is(.gre-table-sticky-first, .gre-sponsor-comparison) tr > :first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    width: 125px;
    min-width: 125px;
    max-width: 125px;
    box-sizing: border-box;
    white-space: normal;
    overflow-wrap: break-word;
    background: #2a1b15;
  }
  :is(.gre-table-sticky-first, .gre-sponsor-comparison) thead th:first-child {
    z-index: 3;
  }
  /* Preserve correct opaque alternating surfaces on cream styled tables. */
  .gre-table-gold-bronze.gre-table-sticky-first tbody tr > :first-child {
    background: #f0dfc3;
  }
  .gre-table-gold-bronze.gre-table-sticky-first tbody tr:nth-child(even) > :first-child {
    background: #e6cfaa;
  }
  .gre-table-gold-bronze.gre-table-sticky-first thead th:first-child {
    background: #41291c;
  }
}

/* first column stays left-aligned */
.gre-table-gold-bronze th:first-child,
.gre-table-gold-bronze td:first-child,
.gre-sponsor-comparison th:first-child,
.gre-sponsor-comparison td:first-child {
  text-align: left;
}

/* all other columns centered */
.gre-table-gold-bronze th:not(:first-child),
.gre-table-gold-bronze td:not(:first-child),
.gre-sponsor-comparison th:not(:first-child),
.gre-sponsor-comparison td:not(:first-child) {
  text-align: center;
  vertical-align: middle;
}


/* Swipe instruction: mobile only */
.gre-sponsor-swipe-hint {
  display: none;
}

@media (max-width: 781px) {
  .gre-sponsor-swipe-hint {
    display: block;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 12px;
  }
}


/* Mobile table — right-edge scroll hint */
@media (max-width: 781px) {
  .gre-table-fade {
    position: relative;
  }

  .gre-table-fade::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 28px;
    height: 100%;
    pointer-events: none;
    z-index: 5;

background: linear-gradient(
  to right,
  rgba(42, 27, 21, 0),
  rgba(42, 27, 21, 0.65)
);
  }
}

