/* =====================================================================
   CT-POLISH: site-wide look-and-feel layer for cristinatravel.net
   Loaded last in <head> by mu-plugins/ct-polish.php.
   Scope: container alignment of header/footer, buttons, cards, links,
   focus states, footer logo, small typographic details.
   NOT here: spacing system + header/mobile menu (Customizer Additional
   CSS, CT-SPACING / CT-HEADER blocks) and entrance animations.
   ===================================================================== */

:root {
  --ct-navy: #242C63;
  --ct-navy-deep: #1B2050;
  --ct-blue: #426AB4;
  --ct-sky: #45B6EF;
  --ct-sky-deep: #2F9BD6;
  --ct-ink: #3D424D;
  --ct-line: oklch(91% 0.012 265);
  --ct-line-strong: oklch(82% 0.03 265);
  --ct-ease: cubic-bezier(.22, 1, .36, 1);
  --ct-radius: 6px;
}

html { scroll-padding-top: 96px; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
::selection { background: var(--ct-navy); color: #fff; }

/* ---------------------------------------------------------------------
   1. One container. Content rows are max 1200px inside 48px section
   padding, so the header and footer rows follow the same edges.
   --------------------------------------------------------------------- */
@media (min-width: 981px) {
  .et-l--header .et_pb_row,
  .et-l--footer .et_pb_row {
    width: calc(100% - 96px) !important;
    max-width: 1200px !important;
  }
}

/* Full-bleed heroes (Home, About, tour pages): text column starts on the
   same 1200px edge as the logo and the rest of the page. */
@media (min-width: 981px) {
  :is(.page-id-1770, .page-id-1825) #main-content .et_pb_section_0 > .et_pb_row_0 > .et_pb_column:first-child {
    padding-left: max(48px, calc((100% - 1200px) / 2)) !important;
  }
  .single-project #main-content .et_pb_section_0 > .et_pb_row_0 > .et_pb_column {
    padding-left: max(48px, calc((100% - 1200px) / 2)) !important;
    padding-right: max(48px, calc((100% - 1200px) / 2)) !important;
  }
}

/* ---------------------------------------------------------------------
   2. Typography details
   --------------------------------------------------------------------- */
#main-content h1, #main-content h2, #main-content h3 { text-wrap: balance; }
#main-content h1, #main-content h2 { font-kerning: normal; font-feature-settings: "kern", "liga"; }

/* ---------------------------------------------------------------------
   3. Buttons: one size, one type treatment, matching heights for
   solid and outline buttons placed side by side.
   --------------------------------------------------------------------- */
#main-content .et_pb_button,
.et-l--footer .et_pb_button {
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  height: 50px;
  padding: 0 30px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  letter-spacing: .09em !important;
  text-transform: uppercase !important;
  line-height: 1.2 !important;
  white-space: nowrap;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .25s var(--ct-ease) !important;
}
#main-content .et_pb_button:hover,
.et-l--footer .et_pb_button:hover { padding: 0 30px !important; }

@media (max-width: 600px) {
  #main-content .et_pb_button { height: 48px; padding: 0 24px !important; font-size: 12.5px !important; }
  #main-content .et_pb_button:hover { padding: 0 24px !important; }
}

/* Keyboard focus, site-wide */
a:focus-visible,
button:focus-visible,
.et_pb_button:focus-visible,
[role="button"]:focus-visible,
.et_pb_toggle_title:focus-visible {
  outline: 2px solid var(--ct-sky) !important;
  outline-offset: 3px !important;
  border-radius: 4px;
}

/* ---------------------------------------------------------------------
   4. Tour and package cards (Tours grid + Home carousel)
   --------------------------------------------------------------------- */
#main-content .ct-tour-card,
#main-content .et_pb_group:has(> .et_pb_image:first-child):has(> .et_pb_text):has(h3) {
  background-color: #fff !important;
  border: 1px solid var(--ct-line) !important;
  border-radius: var(--ct-radius) !important;
  overflow: hidden !important;
  transition: border-color .25s ease, box-shadow .35s var(--ct-ease) !important;
}
#main-content .ct-tour-card .et_pb_image,
#main-content .ct-tour-card .et_pb_image_wrap,
#main-content .et_pb_group:has(> .et_pb_image:first-child):has(> .et_pb_text):has(h3) > .et_pb_image,
#main-content .et_pb_group:has(> .et_pb_image:first-child):has(> .et_pb_text):has(h3) > .et_pb_image .et_pb_image_wrap {
  display: block; overflow: hidden; border-radius: 0 !important; width: 100%;
}
#main-content .ct-tour-card .et_pb_image img,
#main-content .et_pb_group:has(> .et_pb_image:first-child):has(> .et_pb_text):has(h3) > .et_pb_image img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block;
  transition: transform .7s var(--ct-ease);
}
@media (hover: hover) {
  #main-content .ct-tour-card:hover,
  #main-content .et_pb_group:has(> .et_pb_image:first-child):has(> .et_pb_text):has(h3):hover {
    border-color: var(--ct-line-strong) !important;
    box-shadow: 0 22px 44px -28px oklch(25% 0.06 265 / .45) !important;
  }
  #main-content .ct-tour-card:hover .et_pb_image img,
  #main-content .et_pb_group:has(> .et_pb_image:first-child):has(> .et_pb_text):has(h3):hover > .et_pb_image img {
    transform: scale(1.045);
  }
}

/* Text links inside body copy and cards ("Learn more", "Book now") */
#main-content .et_pb_text a:not(.et_pb_button) {
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color .2s ease, text-decoration-color .2s ease;
}
#main-content .et_pb_text a:not(.et_pb_button):hover { text-decoration-color: currentColor; }

/* ---------------------------------------------------------------------
   5. Images
   --------------------------------------------------------------------- */
/* Missing UAP logo: hide the empty tile until the file is uploaded */
.et_pb_image:has(img[src*="/uap.png"]),
.et_pb_group:has(> .et_pb_image:only-child img[src*="/uap.png"]),
.et_pb_module:has(> .et_pb_image_wrap img[src*="/uap.png"]),
img[src*="/uap.png"] { display: none !important; }

/* ---------------------------------------------------------------------
   6. Footer: reversed logo on navy, hairline top edge
   --------------------------------------------------------------------- */
.et-l--footer .et_pb_image:has(img.wp-image-1790) {
  background: transparent !important;
  padding: 0 !important;
}
.et-l--footer .et_pb_image:has(img.wp-image-1790) .et_pb_image_wrap {
  display: block;
  background: url("/wp-content/uploads/ct-polish/logo-reversed.png") left center / contain no-repeat;
}
.et-l--footer img.wp-image-1790 { opacity: 0; }
.et-l--footer .et_pb_section:first-child { border-top: 1px solid rgba(255, 255, 255, .08); }

/* Footer links: quieter at rest, clear on hover */
.et-l--footer .et_pb_text a { transition: color .2s ease, opacity .2s ease; }
.et-l--footer .et_pb_text a:hover { color: var(--ct-sky) !important; }

/* Tours filter pills: 44px touch targets, one row on phones */
.ct-tf { display: flex; flex-wrap: wrap; justify-content: center; }
.ct-tf .ct-tf-btn { min-height: 44px; font-weight: 600; letter-spacing: .02em; }
@media (max-width: 480px) {
  .ct-tf { gap: 8px !important; flex-wrap: nowrap; }
  .ct-tf .ct-tf-btn { padding: 0 18px !important; font-size: 13.5px !important; }
}

/* ---------------------------------------------------------------------
   7. FAQ accordions
   --------------------------------------------------------------------- */
#main-content .et_pb_toggle_title { cursor: pointer; transition: color .2s ease; }
#main-content .et_pb_toggle:not(.et_pb_toggle_open) .et_pb_toggle_title:hover { color: var(--ct-blue) !important; }

@media (prefers-reduced-motion: reduce) {
  #main-content .ct-tour-card .et_pb_image img,
  #main-content .et_pb_group .et_pb_image img { transition: none !important; transform: none !important; }
}
