/*
 Theme Name:   GeneratePress Child
 Theme URI:    https://generatepress.com
 Description:  Default GeneratePress child theme
 Author:       Tom Usborne
 Author URI:   https://tomusborne.com
 Template:     generatepress
 Version:      0.1
*/

/* ============================================================
   Default tables: horizontal scroll on mobile.
   :not(.aff-tbl) keeps the affiliate table out of these rules.
   ============================================================ */
body .wp-block-table th {
  background-color: #1e5fa8 !important;
  color: #fff !important;
  font-weight: 600 !important;
  border-color: #174a85 !important;
}

body .wp-block-table th a,
body .wp-block-table th a:hover {
  color: #fff !important;
}
/* The figure becomes a scrollable container */
/* Mobile-only behavior */
@media screen and (max-width: 768px) {

  /* The figure becomes a scrollable container */
  body figure.wp-block-table:not(.aff-tbl) {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    border: 1px solid #e3e3e3;
    border-radius: 6px;
	margin-bottom: 30px;

    /* Scroll-shadow hint (optional — delete if you don't want it) */
    background:
      linear-gradient(to right, #fff 30%, rgba(255,255,255,0)),
      linear-gradient(to right, rgba(255,255,255,0), #fff 70%) right,
      radial-gradient(farthest-side at 0 50%, rgba(0,0,0,0.12), transparent),
      radial-gradient(farthest-side at 100% 50%, rgba(0,0,0,0.12), transparent) right;
    background-repeat: no-repeat;
    background-size: 30px 100%, 30px 100%, 14px 100%, 14px 100%;
    background-attachment: local, local, scroll, scroll;
  }

  /* Force the inner table to keep its natural width so it overflows */
  body figure.wp-block-table:not(.aff-tbl) > table {
    min-width: 600px;
    width: max-content;
    border-collapse: collapse;
  }

  /* Tighter padding + no-wrap for mobile readability */
  body figure.wp-block-table:not(.aff-tbl) th,
  body figure.wp-block-table:not(.aff-tbl) td {
    padding: 8px 10px;
    white-space: nowrap;
  }
	
}

 /* ============================================================
     Responsive table for GeneratePress — keyed to .aff-tbl
     ============================================================ */
 
  /* Desktop / tablet baseline */
  body .aff-tbl table {
    width: 100%;
    border-collapse: collapse;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  }
  body .aff-tbl th,
  body .aff-tbl td {
    padding: 12px 14px;
    text-align: left;
    border: 1px solid #e3e3e3;
    vertical-align: middle;
    word-wrap: break-word;
  }
  body .aff-tbl th {
    background-color: #f5f5f5;
    font-weight: 600;
  }
  body .aff-tbl tbody tr:nth-child(even) td {
    background-color: #fafafa;
  }
  body .aff-tbl a {
    color: #0066cc;
    text-decoration: none;
    font-weight: 600;
  }
  body .aff-tbl a:hover { text-decoration: underline; }
 
  /* First column — make the site name stand out (desktop) */
  body .aff-tbl td.aff-site {
    background-color: #f8f5ee !important;
    border-left: 4px solid #c9a14a !important;
    font-size: 1.05em;
    font-weight: 700;
  }
  body .aff-tbl td.aff-site a {
    color: #1a1a1a;
    font-weight: 700;
    font-size: 1.05em;
  }
  body .aff-tbl td.aff-site a:hover {
    color: #c9a14a;
    text-decoration: none;
  }
 
  /* "Bet Now!" button (desktop) */
  body .aff-tbl .aff-btn {
    display: inline-block;
    padding: 10px 18px;
    background-color: #1a8a3a;
    background-image: linear-gradient(180deg, #2aa84a 0%, #178a35 100%);
    color: #fff !important;
    font-weight: 700;
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid #146b2c;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    text-transform: uppercase;
    font-size: 0.9em;
    letter-spacing: 0.5px;
    white-space: nowrap;
    transition: background-color 0.15s ease, transform 0.05s ease;
  }
  body .aff-tbl .aff-btn:hover {
    background-image: linear-gradient(180deg, #34c259 0%, #1a9e3e 100%);
    text-decoration: none !important;
    color: #fff !important;
  }
  body .aff-tbl .aff-btn:active {
    transform: translateY(1px);
  }
 
  /* Last column (CTA) — center the button */
  body .aff-tbl td.aff-cta {
    text-align: center;
    width: 130px;
  }

/* Center Min Age + Visit columns — DESKTOP ONLY */
@media screen and (min-width: 769px) {
  body .aff-tbl td[data-label="Min Age"],
  body .aff-tbl td.aff-cta {
    text-align: center !important;
  }
}

/* Headers stay centered — they're hidden on mobile anyway */
body .aff-tbl th.aff-center {
  text-align: center !important;
}
 
  /* ============================================================
     MOBILE (<= 768px) — stacked card layout
     ============================================================ */
  @media screen and (max-width: 768px) {
 
    body figure.wp-block-table.aff-tbl {
      overflow: visible !important;
      overflow-x: visible !important;
      overflow-y: visible !important;
      display: block !important;
    }
 
    body .aff-tbl table,
    body .aff-tbl tbody,
    body .aff-tbl tr,
    body .aff-tbl td {
      display: block !important;
      width: 100% !important;
      max-width: 100% !important;
      box-sizing: border-box !important;
    }
 
    body .aff-tbl thead,
    body .aff-tbl tr.aff-tbl-head {
      display: none !important;
    }
 
    body .aff-tbl tr {
      margin: 0 0 16px 0 !important;
      border: 1px solid #ddd !important;
      border-radius: 8px !important;
      overflow: hidden !important;
      background-color: #fff !important;
      box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
    }
 
    body .aff-tbl tbody tr:nth-child(even) td {
      background-color: transparent !important;
    }
 
    body .aff-tbl td {
      border: none !important;
      border-bottom: 1px solid #f0f0f0 !important;
      padding: 10px 14px 10px 42% !important;
      position: relative !important;
      min-height: 24px !important;
      text-align: left !important;
    }
 
    body .aff-tbl td:last-child {
      border-bottom: none !important;
    }
 
    body .aff-tbl td::before {
      content: attr(data-label) !important;
      display: block !important;
      position: absolute !important;
      left: 14px !important;
      top: 10px !important;
      width: 38% !important;
      padding-right: 10px !important;
      font-weight: 600 !important;
      color: #555 !important;
      white-space: nowrap !important;
      overflow: hidden !important;
      text-overflow: ellipsis !important;
    }
 
    /* First cell — card title with gold accent (mobile) */
    body .aff-tbl td.aff-site {
      background-color: #f8f5ee !important;
      border-left: none !important;
      border-bottom: 3px solid #c9a14a !important;
      padding: 14px !important;
      font-size: 1.2em !important;
      font-weight: 700 !important;
      text-align: center !important;
    }
    body .aff-tbl td.aff-site::before {
      display: none !important;
    }
    body .aff-tbl td.aff-site a {
      font-size: 1em !important;
    }
 
    /* CTA cell — full-width button on mobile */
    body .aff-tbl td.aff-cta {
      padding: 14px !important;
      text-align: center !important;
      width: 100% !important;
      background-color: #fafafa !important;
    }
    body .aff-tbl td.aff-cta::before {
      display: none !important;
    }
    body .aff-tbl .aff-btn {
      display: block !important;
      width: 100% !important;
      padding: 14px 18px !important;
      font-size: 1em !important;
    }
  }