/*
 * tripcom-cta.css: Trip.com hotel-booking button component.
 *
 * One add-on class, .tc-btn, sits next to a button's existing layout class
 * (nav-stays-btn, dhd-book, bb-book-btn, ...). Those classes keep their size
 * and placement; .tc-btn supplies the Trip.com look: blue fill, white text,
 * official logo on a white badge. cta-polish.css forces booking buttons white
 * with !important, and a sitewide [data-cta-location] rule there reaches
 * specificity (0,4,1). Every rule here therefore carries :not(#tc-n), which adds
 * ID-level specificity (1,0,0) without matching anything, plus !important. Load this file AFTER cta-polish.css.
 *
 * Markup (static pages, written by scripts/tripcom/apply.js; JS-rendered
 * buttons get the same markup from tripcom-cta.js at runtime):
 *   <a class="<layout-class> tc-btn" href="<official Trip.com link>"
 *      data-provider="tripcom" data-hotel="Hotel Name" data-cta-location="..."
 *      aria-label="Check Prices for Hotel Name on Trip.com, opens in a new tab"
 *      target="_blank" rel="nofollow noopener sponsored">
 *     <span class="tc-btn__logo"><img src="/assets/brand/tripcom-logo.webp" alt="" width="58" height="14"></span>
 *     <span class="tc-btn__text">Check Prices</span>
 *   </a>
 *
 * Only hotel-booking links get this class. Navigation, newsletter and other
 * non-hotel buttons are never touched.
 */

:root {
  --tc-blue:        #1d4ed8; /* white text contrast 6.70:1 */
  --tc-blue-hover:  #1e40af; /* 8.72:1 */
  --tc-blue-active: #1e3a8a;
  --tc-focus:       #fbbf24;
  --tc-radius:      8px;
}

/* ── Base button: "Trip.com | <action>" ───────────────────────────────────────
   The Trip.com name is drawn by ::before, so it appears on every booking button (static, JS-rendered, any language)
   without touching a single link or page. With the logo switched on (a .tc-btn__logo child) the text badge is not drawn. */
a.tc-btn:not(#tc-n) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-wrap: nowrap !important;
  gap: .75em !important;
  min-height: 44px !important;
  padding: 9px 18px !important;
  background: var(--tc-blue) !important;
  color: #fff !important;
  border: 1px solid var(--tc-blue) !important;
  border-radius: var(--tc-radius) !important;
  box-shadow: 0 2px 6px rgba(29, 78, 216, .22) !important;
  font-size: .875rem !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  text-decoration: none !important;
  text-transform: none !important;
  letter-spacing: .01em !important;
  white-space: normal !important;
  text-align: left !important;
  cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease, transform .15s ease !important;
}
a.tc-btn:not(#tc-n):not(:has(.tc-btn__logo))::before {
  content: "Trip.com";
  flex: 0 0 auto;
  padding-right: .75em;
  border-right: 1px solid rgba(255, 255, 255, .55);
  font-weight: 800;
  letter-spacing: .005em;
  line-height: 1.1;
  white-space: nowrap;
}
a.tc-btn:not(#tc-n):hover {
  background: var(--tc-blue-hover) !important;
  border-color: var(--tc-blue-hover) !important;
  color: #fff !important;
  box-shadow: 0 6px 16px rgba(29, 78, 216, .3) !important;
  transform: translateY(-1px) !important;
}
a.tc-btn:not(#tc-n):active { background: var(--tc-blue-active) !important; transform: none !important; }
a.tc-btn:not(#tc-n):focus-visible { outline: 3px solid var(--tc-focus) !important; outline-offset: 2px !important; }

/* Logo badge (only when written logo permission exists and the logo is switched on): the logo is blue, so it sits on white. */
a.tc-btn .tc-btn__logo { display: inline-flex; align-items: center; flex: 0 0 auto; padding: 5px 7px; background: #fff; border-radius: 6px; line-height: 0; }
a.tc-btn .tc-btn__logo img { display: block; width: auto !important; height: 14px !important; max-width: none !important; margin: 0 !important; border: 0 !important; box-shadow: none !important; }
a.tc-btn .tc-btn__text { color: inherit !important; min-width: 0; text-wrap: balance; }

/* ── Variants ────────────────────────────────────────────────────────────── */

/* General hotel SEARCH (city lists, "Search stays"): secondary look, so a button for one specific hotel is never mistaken for a search.
   The header and mobile-menu "Search stays" buttons are primary calls to action and stay solid. */
a.tc-btn:not(#tc-n)[data-tc-key^="search:"]:not(.nav-stays-btn):not(.mobile-stays-btn):not(.dn-menu__cta):not(.dn-header__cta),
a.tc-btn:not(#tc-n)[data-tc-key^="city:"]:not(.nav-stays-btn):not(.mobile-stays-btn):not(.dn-menu__cta):not(.dn-header__cta) {
  background: #fff !important; color: var(--tc-blue) !important; border-color: var(--tc-blue) !important; box-shadow: none !important;
}
a.tc-btn:not(#tc-n)[data-tc-key^="search:"]:not(.nav-stays-btn):not(.mobile-stays-btn):not(.dn-menu__cta):not(.dn-header__cta)::before,
a.tc-btn:not(#tc-n)[data-tc-key^="city:"]:not(.nav-stays-btn):not(.mobile-stays-btn):not(.dn-menu__cta):not(.dn-header__cta)::before { border-right-color: rgba(29, 78, 216, .4); }
a.tc-btn:not(#tc-n)[data-tc-key^="search:"]:not(.nav-stays-btn):not(.mobile-stays-btn):not(.dn-menu__cta):not(.dn-header__cta):hover,
a.tc-btn:not(#tc-n)[data-tc-key^="city:"]:not(.nav-stays-btn):not(.mobile-stays-btn):not(.dn-menu__cta):not(.dn-header__cta):hover {
  background: var(--tc-blue) !important; color: #fff !important; border-color: var(--tc-blue) !important;
}
a.tc-btn:not(#tc-n)[data-tc-key^="search:"]:not(.nav-stays-btn):not(.mobile-stays-btn):not(.dn-menu__cta):not(.dn-header__cta):hover::before,
a.tc-btn:not(#tc-n)[data-tc-key^="city:"]:not(.nav-stays-btn):not(.mobile-stays-btn):not(.dn-menu__cta):not(.dn-header__cta):hover::before { border-right-color: rgba(255, 255, 255, .55); }

/* Compact: header nav, map popups, directory rows. */
a.tc-btn:not(#tc-n).tc-btn--compact { min-height: 40px !important; padding: 6px 12px !important; gap: .6em !important; font-size: .8rem !important; }
a.tc-btn.tc-btn--compact .tc-btn__logo { padding: 4px 6px; }
a.tc-btn.tc-btn--compact .tc-btn__logo img { height: 12px !important; }

/* Block: full-width card and mobile-menu buttons. */
a.tc-btn:not(#tc-n).tc-btn--block { display: flex !important; width: 100% !important; }

/* Large: page-level primary calls to action. */
a.tc-btn:not(#tc-n).tc-btn--lg { min-height: 52px !important; padding: 11px 24px !important; font-size: 1rem !important; }
a.tc-btn.tc-btn--lg .tc-btn__logo img { height: 17px !important; }

/* Inline: booking links inside running text stay links, with a small logo
   after the text instead of a button. */
a.tc-link:not(#tc-n) {
  display: inline;
  white-space: normal;
}
a.tc-link .tc-link__logo {
  display: inline-block;
  height: .95em !important;
  width: auto !important;
  margin: 0 0 0 .3em !important;
  vertical-align: -.2em;
  border: 0 !important;
  /* White backing keeps the blue wordmark legible on dark footers too. */
  background: #fff;
  border-radius: 3px;
  padding: 1px 3px !important;
  box-sizing: content-box;
}

/* Header nav: the nav already hides .btn-text on narrow screens; keep the
   logo visible so the button is never unbranded. */
.site-nav a.tc-btn--compact .btn-text { white-space: nowrap; }

/* Touch screens: every booking button keeps a 44px tap target. */
@media (pointer: coarse) {
  a.tc-btn:not(#tc-n).tc-btn--compact { min-height: 44px !important; }
}

/* Narrow phones: let long labels wrap instead of overflowing cards. */
@media (max-width: 380px) {
  a.tc-btn:not(#tc-n) { padding-inline: 14px !important; font-size: .84rem !important; }
}

@media (prefers-reduced-motion: reduce) {
  a.tc-btn:not(#tc-n), a.tc-btn:not(#tc-n):hover { transition: none !important; transform: none !important; }
}

/* Windows high-contrast mode: keep a visible boundary. */
@media (forced-colors: active) {
  a.tc-btn:not(#tc-n) { border: 2px solid ButtonText !important; }
  a.tc-btn .tc-btn__logo { forced-color-adjust: none; }
}

/* ── Sitewide hotel widget (tripcom-widget.js, link mode) ────────────────── */
.tc-widget .tc-widget-note { margin: .35rem 0 .8rem; font-size: .82rem; line-height: 1.4; opacity: .85; }
.tc-widget a.tc-btn:not(#tc-n) { width: 100% !important; margin-top: .25rem; }

/* Homepage hero widget sits on a dark card. */
.bk-widget .tc-widget-note { color: rgba(255, 255, 255, .78); margin: .35rem 0 .8rem; font-size: .82rem; line-height: 1.4; }

/* Narrow hero widgets: stack the logo above the label instead of squeezing it. */
.bk-widget a.tc-btn:not(#tc-n), .tc-widget a.tc-btn:not(#tc-n) { flex-wrap: wrap !important; row-gap: 6px !important; }
