@media (max-width: 768px) {
  body.custom-background {
    background-image: none !important;
  }
  
  #primary,
  #secondary {
    float: none !important;
    width: 100% !important;
  }
  
  .alignright,
  .alignleft {
    float: none !important;
    width: 100% !important;
    margin: 0 0 1em 0 !important;
  }
}/* Override theme link color */
a,
a:visited {
  color: #333;
}
a:hover {
  color: #000;
}
/* Keep nav links white on dark background */
.main-navigation a {
  color: #fff !important;
}
.main-navigation a:hover {
  color: #ccc !important;
}

/* Referral links - purple */
a[href*="i.capitalone.com"],
a[href*="referyourchasecard.com"],
a[href*="referral/hilton-honors"],
a[href*="referral/platinum-card"] {
  color: #663399 !important;
}
a[href*="i.capitalone.com"]:hover,
a[href*="referyourchasecard.com"]:hover,
a[href*="referral/hilton-honors"]:hover,
a[href*="referral/platinum-card"]:hover {
  color: #4B0082 !important;
}
/* Stop oversized caption boxes from forcing the page wide */
.wp-caption,
div[id^="attachment_"] {
  width: auto !important;
  max-width: 100% !important;
}

.wp-caption-text {
  max-width: 100% !important;
}

/* General safety net: no image or embed can overflow */
img, iframe, video, embed, object {
  max-width: 100%;
  height: auto;
}

/* ---- Responsive tables ------------------------------------------ */

/* Safety net: no table can push the page sideways */
.wp-block-table { overflow-x: auto; }

/* Wide tables tagged .wg-rtable stack into cards on phones */
@media (max-width: 600px) {
  .wg-rtable { overflow-x: visible; }

  .wg-rtable table,
  .wg-rtable tbody,
  .wg-rtable tr,
  .wg-rtable td {
    display: block;
    width: 100%;
  }

  .wg-rtable table { border: 0; }

  /* Header row is read from each cell’s data-label instead */
  .wg-rtable thead {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .wg-rtable tbody tr {
    margin: 0 0 1.1em;
    padding: 0.8em 0.95em;
    border: 1px solid #dcdcdc;
    border-radius: 6px;
    background: #fff;
  }

  .wg-rtable tbody td {
    border: 0;
    border-bottom: 1px solid #ededed;
    padding: 0.5em 0;
    font-size: 15px;
    line-height: 1.45;
    text-align: left;
  }

  .wg-rtable tbody td:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  /* First cell is the card title */
  .wg-rtable tbody td:first-child {
    font-size: 17px;
    padding-top: 0;
    padding-bottom: 0.55em;
    border-bottom: 2px solid #dcdcdc;
  }

  /* Column name printed above each value */
  .wg-rtable tbody td[data-label]:not(:first-child)::before {
    content: attr(data-label);
    display: block;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6d6d6d;
    margin-bottom: 0.15em;
  }
}

/* ---- In-content links look like links ---------------------------- */
.entry-content a:not(.wp-block-button__link):not(.wp-element-button) {
  color: #1a5fb4;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.entry-content a:not(.wp-block-button__link):not(.wp-element-button):hover,
.entry-content a:not(.wp-block-button__link):not(.wp-element-button):focus {
  color: #0d3d7a;
  text-decoration-thickness: 2px;
}

/* Image links and buttons keep their own look */
.entry-content a:not(.wp-block-button__link):not(.wp-element-button):has(img) {
  color: inherit;
  text-decoration: none;
}
