/* ============================================================
   custom.css — Hotel Gergovia production overrides
   Loaded LAST. Brand palette locked to site actual theme:
     primary teal  #1B7A62
     primary dark  #0F4F3E
     primary deep  #15604D
     accent orange #E67A2E
   ============================================================ */

/* ---------- Brand tokens ---------- */
:root {
  --hg-primary:       #1B7A62;
  --hg-primary-dark:  #0F4F3E;
  --hg-primary-deep:  #15604D;
  --hg-primary-light: #E0F2F0;
  --hg-accent:        #E67A2E;
  --hg-accent-dark:   #C46420;
  --hg-text:          #1A2A26;
  --hg-text-muted:    #5A6D69;
  --hg-surface:       #FFFFFF;
  --hg-surface-alt:   #F5F9F8;
  --hg-border:        #D5E4E1;
  --hg-danger:        #C0392B;
  --hg-radius:        10px;
  --hg-shadow:        0 6px 20px rgba(27, 122, 98, 0.12);
}

/* ============================================================
   LOGO fix — card / widget logo container is square-ish (89x92)
   but the available asset is 274x70 (ratio 3.9:1). Default <img>
   resizing stretches it into a square → squished look. Force
   aspect-ratio preservation.
   ============================================================ */
.attachment-mercury-100-100,
.attachment-mercury-50-50 {
  object-fit: contain !important;
  object-position: center center;
  background: transparent;
  width: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  height: auto !important;
}

.space-organizations-3-logo-box,
.space-companies-2-archive-item-logo,
.space-organization-content-logo {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.space-organizations-3-logo-box img,
.space-companies-2-archive-item-logo img,
.space-organization-content-logo img {
  max-width: 100% !important;
  max-height: 80px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
}

/* Header logo: 156x40 (correct aspect) — keep native size */
.attachment-mercury-custom-logo {
  width: auto !important;
  height: auto !important;
  max-width: 156px;
  max-height: 40px;
  object-fit: contain;
}

/* ============================================================
   TABLES — brand-aligned, fully readable
   ============================================================ */
figure.wp-block-table,
.wp-block-table {
  margin: 2rem 0;
  overflow-x: auto;
  border-radius: var(--hg-radius);
  box-shadow: var(--hg-shadow);
  background: var(--hg-surface);
  border: 1px solid var(--hg-border);
  -webkit-overflow-scrolling: touch;
}

figure.wp-block-table table,
.wp-block-table table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.55;
  margin: 0;
  color: var(--hg-text);
  background: transparent;
}

figure.wp-block-table thead,
.wp-block-table thead {
  background: linear-gradient(135deg, var(--hg-primary) 0%, var(--hg-primary-deep) 100%);
}

figure.wp-block-table thead th,
.wp-block-table thead th {
  padding: 16px 20px !important;
  text-align: left !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  letter-spacing: 0.6px !important;
  text-transform: uppercase !important;
  color: #FFFFFF !important;
  border: none !important;
  white-space: nowrap;
}

figure.wp-block-table thead th:first-child,
.wp-block-table thead th:first-child {
  border-top-left-radius: var(--hg-radius);
}
figure.wp-block-table thead th:last-child,
.wp-block-table thead th:last-child {
  border-top-right-radius: var(--hg-radius);
}

figure.wp-block-table tbody td,
.wp-block-table tbody td {
  padding: 14px 20px !important;
  border: none !important;
  border-bottom: 1px solid var(--hg-border) !important;
  color: var(--hg-text) !important;
  vertical-align: middle;
  background: var(--hg-surface) !important;
  transition: background .18s ease;
}

figure.wp-block-table tbody tr:nth-child(even) td,
.wp-block-table tbody tr:nth-child(even) td,
figure.wp-block-table.is-style-stripes tbody tr:nth-of-type(even) td,
.wp-block-table.is-style-stripes tbody tr:nth-of-type(even) td {
  background: var(--hg-surface-alt) !important;
  color: var(--hg-text) !important;
}

figure.wp-block-table.is-style-stripes tbody tr:nth-of-type(odd) td,
.wp-block-table.is-style-stripes tbody tr:nth-of-type(odd) td {
  background: var(--hg-surface) !important;
  color: var(--hg-text) !important;
}

figure.wp-block-table tbody tr:hover td,
.wp-block-table tbody tr:hover td {
  background: var(--hg-primary-light) !important;
  color: var(--hg-primary-dark) !important;
}

figure.wp-block-table tbody tr:last-child td,
.wp-block-table tbody tr:last-child td {
  border-bottom: none !important;
}

figure.wp-block-table tbody td:first-child,
.wp-block-table tbody td:first-child {
  font-weight: 600 !important;
  color: var(--hg-primary-dark) !important;
  min-width: 140px;
}

figure.wp-block-table tbody td strong,
.wp-block-table tbody td strong {
  color: var(--hg-primary-dark) !important;
  font-weight: 700;
}

figure.wp-block-table tbody td em,
.wp-block-table tbody td em {
  color: var(--hg-danger) !important;
  font-style: normal;
  font-weight: 500;
}

@media (max-width: 640px) {
  figure.wp-block-table,
  .wp-block-table {
    margin: 1.5rem 0;
    border-radius: var(--hg-radius);
  }
  figure.wp-block-table thead th,
  figure.wp-block-table tbody td,
  .wp-block-table thead th,
  .wp-block-table tbody td {
    padding: 12px 14px !important;
    font-size: 14px !important;
  }
}

/* ============================================================
   STAR RATING — guaranteed visible fill color even without
   Font Awesome webfont glyph (fallback shape using CSS).
   ============================================================ */
.star-rating .star,
.star-rating .star-full,
.star-rating .star-half,
.star-rating .star-empty {
  color: #FDCB6E !important;
}

/* If FA webfont fails to load, content "\f005" shows as box.
   Replace with a literal Unicode star as backup fallback. */
.star-rating .star-full:before,
.star-rating .star-half:before,
.star-rating .star-empty:before {
  font-family: 'Font Awesome 5 Free', 'Font Awesome 6 Free', 'FontAwesome', sans-serif !important;
}

/* ============================================================
   CTA BUTTONS
   ============================================================ */
a[title="RÉCLAMER BONUS"],
a[title="JOUEZ MAINTENANT!"] {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  background: linear-gradient(135deg, var(--hg-accent) 0%, var(--hg-accent-dark) 100%) !important;
  color: #FFFFFF !important;
  font-weight: 700 !important;
  font-size: 14px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  text-decoration: none !important;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(230, 122, 46, 0.35);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

a[title="RÉCLAMER BONUS"]:hover,
a[title="JOUEZ MAINTENANT!"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(230, 122, 46, 0.5);
  filter: brightness(1.08);
  color: #FFFFFF !important;
  text-decoration: none !important;
}

a[title="RÉCLAMER BONUS"] i,
a[title="JOUEZ MAINTENANT!"] i {
  font-size: 16px;
}

/* ============================================================
   Footer placeholders
   ============================================================ */
.legal-link-placeholder,
.author-link-placeholder {
  color: var(--hg-text-muted);
  cursor: default;
  text-decoration: none;
}
.space-footer-menu .legal-link-placeholder {
  display: inline-block;
  padding: 4px 0;
}

img {
  max-width: 100%;
  height: auto;
}
.aces-icon,
.card-suit-icon {
  background: none !important;
}

/* ============================================================
   HERO CARD - mobile stacking
   On mobile, JOUEZ MAINTENANT and RÉCLAMER BONUS buttons were
   overlapping because the hero card container wraps them too
   tightly. Stack them vertically, full width, with clear gap.
   ============================================================ */
@media (max-width: 767px) {
  .space-organizations-3-archive-item-button-ins {
    display: flex !important;
    flex-direction: column;
    gap: 10px;
    padding: 8px 12px 12px;
  }

  .space-organizations-3-archive-item-button-ins a,
  .space-organizations-3-archive-item-button-ins a[title="JOUEZ MAINTENANT!"],
  .space-organizations-3-archive-item-button-ins a[title="RÉCLAMER BONUS"] {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 12px 18px !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    white-space: nowrap;
    box-sizing: border-box;
  }

  /* Hero card card-wide polish: stack sections on mobile */
  .space-organizations-3-archive-item-ins {
    display: flex !important;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
  }

  .space-organizations-3-archive-item-logo,
  .space-organizations-3-archive-item-terms,
  .space-organizations-3-archive-item-rating,
  .space-organizations-3-archive-item-button {
    box-sizing: border-box;
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
  }
}





/* ============================================================
   HG FLOAT BAR — redesigned for 1-second comprehension
   3 elements only: context label → big yellow offer → orange CTA
   ============================================================ */

.hg-floatbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: #0E3B30;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.3);
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.2, .7, .2, 1);
  pointer-events: none;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.hg-floatbar.hg-floatbar--visible {
  transform: translateY(0);
  pointer-events: auto;
}

.hg-floatbar__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.hg-floatbar__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1 1 auto;
  min-width: 0;
}

.hg-floatbar__logo {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  background: #FFFFFF;
  border-radius: 10px;
  padding: 6px;
  object-fit: contain;
  object-position: center;
  box-sizing: border-box;
  display: block;
}

.hg-floatbar__offer {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.hg-floatbar__kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #A8D5CB;
  font-weight: 500;
  line-height: 1;
  margin-bottom: 4px;
}

.hg-floatbar__amount {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  color: #FDCB6E;
  white-space: nowrap;
  letter-spacing: -0.2px;
}

.hg-floatbar__cta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: #E67A2E;
  color: #FFFFFF !important;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  text-decoration: none !important;
  border-radius: 8px;
  border: none;
  box-shadow: 0 4px 14px rgba(230, 122, 46, 0.45);
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
  white-space: nowrap;
  min-height: 48px;
  box-sizing: border-box;
  cursor: pointer;
}

.hg-floatbar__cta:hover,
.hg-floatbar__cta:focus-visible {
  background: #FF8E45;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(230, 122, 46, 0.6);
  color: #FFFFFF !important;
}

.hg-floatbar__cta:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(230, 122, 46, 0.4);
}

.hg-floatbar__cta-arrow {
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  transition: transform .18s ease;
}

.hg-floatbar__cta:hover .hg-floatbar__cta-arrow {
  transform: translateX(4px);
}

/* Reserve bottom space so content isn't hidden */
body.hg-floatbar-active {
  padding-bottom: 88px;
}

/* -------- Tablet (<= 900px) -------- */
@media (max-width: 900px) {
  .hg-floatbar__inner {
    padding: 12px 16px;
    gap: 14px;
  }
  .hg-floatbar__logo {
    width: 44px;
    height: 44px;
    padding: 5px;
    border-radius: 8px;
  }
  .hg-floatbar__kicker {
    font-size: 10px;
    letter-spacing: 0.8px;
  }
  .hg-floatbar__amount {
    font-size: 18px;
  }
  .hg-floatbar__cta {
    padding: 12px 20px;
    font-size: 14px;
    min-height: 46px;
  }
}

/* -------- Mobile (<= 560px) -------- */
@media (max-width: 560px) {
  .hg-floatbar__inner {
    padding: 10px 12px;
    gap: 10px;
  }

  .hg-floatbar__brand {
    gap: 10px;
  }

  .hg-floatbar__logo {
    display: none; /* Save room for the offer + CTA */
  }

  .hg-floatbar__kicker {
    font-size: 10px;
    letter-spacing: 0.6px;
    margin-bottom: 2px;
  }

  .hg-floatbar__amount {
    font-size: 17px;
    letter-spacing: -0.3px;
  }

  .hg-floatbar__cta {
    padding: 12px 16px;
    font-size: 13px;
    letter-spacing: 0.2px;
    min-height: 46px;
    gap: 6px;
  }

  .hg-floatbar__cta-arrow {
    font-size: 16px;
  }

  body.hg-floatbar-active {
    padding-bottom: 72px;
  }
}

/* -------- Very small (<= 360px) -------- */
@media (max-width: 360px) {
  .hg-floatbar__cta-text {
    font-size: 12px;
  }
  .hg-floatbar__amount {
    font-size: 15px;
  }
  .hg-floatbar__kicker {
    display: none; /* On tiny screens drop kicker, keep only the amount */
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hg-floatbar,
  .hg-floatbar__cta,
  .hg-floatbar__cta-arrow {
    transition: none;
  }
}

/* ============================================================
   BACK-TO-TOP button — lift above the sticky float bar
   When float bar is visible (body.hg-floatbar-active), scrolltop
   must move up so it does not overlap the offer CTA.
   ============================================================ */
body.hg-floatbar-active #scrolltop,
body.hg-floatbar-active #scrolltop.show {
  bottom: 104px !important;
  transition: bottom .35s cubic-bezier(.2, .7, .2, 1);
}

/* Tablet — float bar is ~74px tall with padding, lift less */
@media (max-width: 900px) {
  body.hg-floatbar-active #scrolltop,
  body.hg-floatbar-active #scrolltop.show {
    bottom: 92px !important;
  }
}

/* Mobile — float bar ~70px, keep clear gap */
@media (max-width: 560px) {
  body.hg-floatbar-active #scrolltop,
  body.hg-floatbar-active #scrolltop.show {
    bottom: 86px !important;
    right: 12px !important;
  }
}

/* ============================================================
   AUTHOR BOX — E-E-A-T author card with photo
   Placed near end of article, consistent on all 9 pages
   ============================================================ */
.hg-author-box {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 24px;
  margin: 40px 0 32px;
  background: #F5F9F8;
  border: 1px solid #D5E4E1;
  border-left: 4px solid #1B7A62;
  border-radius: 10px;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.hg-author-box__photo-wrap {
  flex: 0 0 auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  background: #FFFFFF;
  box-shadow: 0 4px 12px rgba(27, 122, 98, 0.15);
  border: 3px solid #FFFFFF;
}

.hg-author-box__photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: 50%;
}

.hg-author-box__content {
  flex: 1 1 auto;
  min-width: 0;
  color: #1A2A26;
}

.hg-author-box__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #1B7A62;
  font-weight: 700;
  margin: 0 0 6px;
  line-height: 1;
}

.hg-author-box__name {
  font-size: 20px;
  font-weight: 700;
  color: #0E3B30;
  margin: 0 0 2px;
  line-height: 1.2;
}
.hg-author-box__name strong {
  color: #0E3B30;
  font-weight: 700;
}

.hg-author-box__role {
  font-size: 14px;
  font-weight: 500;
  color: #1B7A62;
  margin: 0 0 12px;
  line-height: 1.3;
}

.hg-author-box__bio {
  font-size: 15px;
  line-height: 1.6;
  color: #1A2A26;
  margin: 0 0 10px;
}

.hg-author-box__bio em {
  color: #5A6D69;
  font-style: italic;
}

.hg-author-box__contact {
  font-size: 13px;
  color: #5A6D69;
  margin: 0;
  line-height: 1.4;
}
.hg-author-box__contact em {
  font-style: italic;
}

/* Tablet */
@media (max-width: 768px) {
  .hg-author-box {
    padding: 20px;
    gap: 16px;
  }
  .hg-author-box__photo-wrap {
    width: 90px;
    height: 90px;
  }
  .hg-author-box__name {
    font-size: 18px;
  }
  .hg-author-box__bio {
    font-size: 14px;
  }
}

/* Mobile — stack photo above content */
@media (max-width: 560px) {
  .hg-author-box {
    flex-direction: column;
    align-items: flex-start;
    padding: 18px;
    gap: 14px;
  }
  .hg-author-box__photo-wrap {
    width: 80px;
    height: 80px;
  }
  .hg-author-box__name {
    font-size: 17px;
  }
  .hg-author-box__role {
    font-size: 13px;
    margin-bottom: 10px;
  }
  .hg-author-box__bio {
    font-size: 14px;
    line-height: 1.55;
  }
  .hg-author-box__contact {
    font-size: 12px;
  }
}

/* Author box — mailto link styling */
.hg-author-box__contact {
  margin-top: 8px;
  font-size: 14px;
  color: var(--hg-text-muted);
}
.hg-author-box__contact em {
  font-style: normal;
  color: var(--hg-text-muted);
  margin-right: 4px;
}
.hg-author-box__contact a[href^="mailto:"] {
  color: var(--hg-primary-dark);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px dotted var(--hg-primary-dark);
  transition: color .15s ease, border-color .15s ease;
  word-break: break-all;
}
.hg-author-box__contact a[href^="mailto:"]:hover {
  color: var(--hg-accent-dark);
  border-bottom-color: var(--hg-accent-dark);
}

/* ============================================================
   HEADER — always fixed (no jump on scroll)
   The original WP theme used JS to toggle .fixed class after
   200px scroll, causing a visible jump. We force fixed from
   the start for a stable UX.
   ============================================================ */
.space-header-wrap,
.space-header-wrap.fixed {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 100;
  background-color: #1B7A62 !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  transition: none !important;
}

/* Reserve space so the page content isn't hidden under the fixed header */
.space-header-height {
  min-height: 70px;
}

@media (max-width: 767px) {
  .space-header-height {
    min-height: 60px;
  }
}

/* ============================================================
   <code> inline tag — readable, not a white square
   ============================================================ */
code {
  display: inline;
  padding: 2px 7px;
  background: #F0F4F3;
  color: #0F4F3E;
  font-family: 'SF Mono', 'Menlo', 'Consolas', 'Roboto Mono', monospace;
  font-size: 0.92em;
  font-weight: 500;
  border-radius: 4px;
  border: 1px solid #D5E4E1;
  white-space: nowrap;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* <code> inside dark-mode containers (footer / floatbar) flips colors */
.space-footer-copy code,
.hg-floatbar code {
  background: rgba(255, 255, 255, 0.12);
  color: #FDCB6E;
  border-color: rgba(255, 255, 255, 0.18);
}

/* Remove any weird inline code wrapping seen on FAQ blocks */
p code,
li code {
  line-height: inherit;
  vertical-align: baseline;
}
