/* ==========================================================================
   Guide pages — shared layout for location / info pages
   (first used by mayan-resort-map.php).

   Builds on new/css/bundle.css (colors, fonts, .container, .btn, .small-title,
   .section-header, .breadcrumb-nav). Load it after header-one.php:
       <link rel="stylesheet" href="new/css/guide-page.css?v=1">
   and wrap the page content in <main class="gp">.

   Components
     .gp-hero            page title block (eyebrow, h1, .gp-lead, .gp-stats)
     .gp-overlap         section that pulls up over .gp-hero--overlap
     .gp-map-layout      map card + side list (.gp-map, .gp-pin, .gp-legend)
     .gp-section         plain section; add .bg-primary-light for a tint
     .gp-cards/.gp-card  photo cards; --wide spans 2 columns, --cta is a dark promo card
     .gp-chips           small tag list
     .gp-facts           row of 3 key numbers (e.g. inside a wide card)
     .gp-split           two columns: text + image (add .is-flipped to swap)
     .gp-prose           long-form text (headings, lists, images)
     .gp-table-wrap      scrollable data table (e.g. weather averages)
     .gp-cta             closing call-to-action band
     .gp-num             numbered circle used by pins, lists and cards
   ========================================================================== */

.gp {
    --gp-ink: #1b2433;
    --gp-muted: #5b6478;
    --gp-line: #dee3ed;
    --gp-soft: #f1f4f9;
    --gp-radius: 12px;
    --gp-shadow: 0 18px 50px rgba(27, 36, 51, .14);
    --gp-shadow-sm: 0 6px 20px rgba(27, 36, 51, .08);
}

.gp h1, .gp h2, .gp h3 { color: var(--gp-ink); }

.gp .btns,
.gp-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* ---------- Numbered circle ---------- */
.gp-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--secondary);
    color: #fff;
    font: 700 14px/1 var(--default-font);
    transition: background-color .2s ease, transform .2s ease;
}

/* ---------- Page title ---------- */
main > section.gp-hero {
    padding: 60px 0 50px;
    background: var(--bg-light-gray);
    text-align: center;
}

main > section.gp-hero.gp-hero--overlap { padding-bottom: 150px; }

.gp-hero-inner {
    max-width: 820px;
    margin: 0 auto;
}

.gp-hero .small-title {
    margin-bottom: 10px;
    font-size: 13px;
}

.gp-hero h1 {
    margin-bottom: 16px;
    font-size: clamp(34px, 4.6vw, 54px);
}

.gp-lead {
    max-width: 680px;
    margin: 0 auto;
    font-size: 18px;
}

.gp-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 36px;
    margin: 28px 0 0;
    padding: 0;
    list-style: none;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--gp-muted);
}

.gp-stats li {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.gp-stats strong {
    font-family: var(--headings-font);
    font-size: 30px;
    line-height: 1;
    color: var(--primary);
}

/* Section that slides up over the hero (map, gallery, form ...) */
main > section.gp-overlap {
    position: relative;
    z-index: 2;
    margin-top: -110px;
    padding: 0 0 70px;
}

main > section.gp-section { padding: 90px 0; }

.gp-note {
    max-width: 760px;
    margin: 22px auto 0;
    font-size: 15px;
    text-align: center;
    color: var(--gp-muted);
}

/* ---------- Map card + location list ---------- */
.gp-map-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    background: #fff;
    border-radius: var(--gp-radius);
    box-shadow: var(--gp-shadow);
    overflow: hidden;
}

.gp-map {
    position: relative;
    align-self: center;
    background: #d7ecfa;
}

.gp-map > img {
    display: block;
    width: 100%;
    height: auto;
}

/* A pin is a zero-size point at (--x, --y); the dot marks the spot, the head floats above it */
.gp-pin {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: 0;
    height: 0;
    z-index: 1;
    color: #fff;
}

.gp-pin:hover,
.gp-pin:focus-visible,
.gp-pin.is-active { z-index: 3; }

.gp-pin:focus-visible { outline: none; }

.gp-pin-dot {
    position: absolute;
    left: -5px;
    top: -5px;
    width: 10px;
    height: 10px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--secondary);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
}

.gp-pin-head {
    position: absolute;
    left: -16px;
    bottom: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--secondary);
    box-shadow: 0 4px 10px rgba(27, 36, 51, .3);
    font: 700 14px/1 var(--default-font);
    transition: background-color .2s ease, transform .2s ease;
    transform-origin: 50% 130%;
}

/* Little pointer under the head */
.gp-pin-head::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border: 6px solid transparent;
    border-top: 8px solid var(--secondary);
    border-bottom: 0;
    transition: border-color .2s ease;
}

/* Pin that points up from below (for two places very close together) */
.gp-pin.is-down .gp-pin-head {
    top: 13px;
    bottom: auto;
    transform-origin: 50% -30%;
}

.gp-pin.is-down .gp-pin-head::after {
    top: auto;
    bottom: 100%;
    border-top: 0;
    border-bottom: 8px solid var(--secondary);
}

.gp-pin:hover .gp-pin-head,
.gp-pin:focus-visible .gp-pin-head,
.gp-pin.is-active .gp-pin-head {
    background: var(--primary);
    transform: scale(1.15);
}

.gp-pin:focus-visible .gp-pin-head { box-shadow: 0 0 0 4px rgba(28, 152, 224, .35); }

.gp-pin:hover .gp-pin-head::after,
.gp-pin:focus-visible .gp-pin-head::after,
.gp-pin.is-active .gp-pin-head::after { border-top-color: var(--primary); }

.gp-pin.is-down:hover .gp-pin-head::after,
.gp-pin.is-down:focus-visible .gp-pin-head::after,
.gp-pin.is-down.is-active .gp-pin-head::after {
    border-top-color: transparent;
    border-bottom-color: var(--primary);
}

/* Name tag shown on hover / focus */
.gp-pin-label {
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    padding: 6px 11px;
    border-radius: 6px;
    background: #fff;
    box-shadow: var(--gp-shadow-sm);
    color: var(--gp-ink);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translate(-4px, -50%);
    transition: opacity .2s ease, transform .2s ease;
}

.gp-pin.is-label-left .gp-pin-label {
    left: auto;
    right: calc(100% + 8px);
    transform: translate(4px, -50%);
}

.gp-pin:hover .gp-pin-label,
.gp-pin:focus-visible .gp-pin-label,
.gp-pin.is-active .gp-pin-label {
    opacity: 1;
    transform: translate(0, -50%);
}

/* Side list */
.gp-legend {
    padding: 26px 22px;
    border-left: 1px solid var(--gp-line);
}

.gp-legend-title {
    margin: 0 0 12px 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--gp-muted);
}

.gp-legend ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

.gp-legend a {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--gp-ink);
    font-weight: 600;
    line-height: 1.3;
    transition: background-color .2s ease;
}

.gp-legend-name small {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    font-weight: 400;
    color: var(--gp-muted);
}

.gp-arrow {
    color: var(--gp-line);
    transition: color .2s ease, transform .2s ease;
}

.gp-legend a:hover,
.gp-legend a:focus-visible,
.gp-legend a.is-active { background: var(--primary-light); }

.gp-legend a:hover .gp-num,
.gp-legend a:focus-visible .gp-num,
.gp-legend a.is-active .gp-num { background: var(--primary); }

.gp-legend a:hover .gp-arrow,
.gp-legend a:focus-visible .gp-arrow,
.gp-legend a.is-active .gp-arrow {
    color: var(--primary);
    transform: translateX(3px);
}

/* ---------- Cards ---------- */
.gp-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 30px;
}

.gp-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--gp-line);
    border-radius: var(--gp-radius);
    overflow: hidden;
    scroll-margin-top: 20px;
    transition: box-shadow .25s ease, border-color .25s ease;
}

.gp-card:hover,
.gp-card.is-active {
    border-color: transparent;
    box-shadow: var(--gp-shadow);
}

.gp-card-media {
    position: relative;
    display: block;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: var(--gp-soft);
}

.gp-card-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s ease;
}

.gp-card:hover .gp-card-media img { transform: scale(1.04); }

.gp-card-media .gp-num {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 34px;
    height: 34px;
    border: 2px solid #fff;
    box-shadow: 0 4px 10px rgba(27, 36, 51, .3);
    font-size: 15px;
}

.gp-card:hover .gp-card-media .gp-num,
.gp-card.is-active .gp-card-media .gp-num { background: var(--primary); }

/* No photo: zoomed-in map. The page sets background-position to centre the place. */
.gp-card-media--map {
    background: #d7ecfa url("../images/resort-map/mexico-map-plain.svg") no-repeat;
    background-size: 300% auto;
}

.gp-card-media-pin {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 8px rgba(28, 152, 224, .25), 0 2px 6px rgba(0, 0, 0, .3);
}

.gp-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 24px 26px 26px;
}

.gp-region {
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--primary);
}

.gp-card h3 {
    margin: 0 0 12px;
    font-size: 25px;
}

.gp-card h3 a { color: inherit; }
.gp-card h3 a:hover { color: var(--primary); }

.gp-card p {
    margin-bottom: 18px;
    font-size: 15px;
}

.gp-card-link {
    display: block;
    margin-top: auto;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: var(--primary);
}

.gp-card-link svg {
    margin-left: 6px;
    vertical-align: -3px;
    transition: transform .2s ease;
}
.gp-card-link:hover svg { transform: translateX(4px); }

/* Wide card: photo beside the text, spans two columns */
.gp-card--wide {
    grid-column: span 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.gp-card--wide .gp-card-media {
    aspect-ratio: auto;
    min-height: 100%;
}

.gp-card--wide .gp-card-body {
    justify-content: center;
    padding: 32px 34px;
}
.gp-card--wide h3 { font-size: 30px; }
.gp-card--wide .gp-card-link { margin-top: 0; }

/* Key numbers inside a card */
.gp-facts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 0 0 22px;
    padding: 0;
    list-style: none;
}

.gp-facts li {
    padding: 12px 8px;
    border-radius: 8px;
    background: var(--bg-light-gray);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    color: var(--gp-muted);
}

.gp-facts strong {
    display: block;
    margin-bottom: 4px;
    font-family: var(--headings-font);
    font-size: 26px;
    line-height: 1;
    color: var(--primary);
}

/* Dark promo card that fills a gap in the grid */
.gp-card--cta {
    justify-content: center;
    padding: 36px 30px;
    border: 0;
    background: var(--secondary);
    color: rgba(255, 255, 255, .85);
    text-align: center;
}

.gp-card--cta .small-title {
    margin-bottom: 10px;
    font-size: 12px;
    color: #8fd0f7;
}

.gp-card--cta h3 {
    margin-bottom: 12px;
    color: #fff;
    font-size: 26px;
}

.gp-card--cta p { margin-bottom: 22px; }
.gp-card--cta .btn { align-self: center; }

/* ---------- Chips ---------- */
.gp-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
}

.gp-chips li {
    padding: 4px 11px;
    border-radius: 30px;
    background: var(--gp-soft);
    color: var(--secondary);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
}

/* ---------- Text + image row ---------- */
.gp-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 50px;
}

.gp-split.is-flipped > :first-child { order: 2; }

.gp-split img {
    display: block;
    width: 100%;
    border-radius: var(--gp-radius);
}

/* ---------- Long-form text ---------- */
.gp-prose {
    max-width: 820px;
    margin: 0 auto;
}

.gp-prose h2 { margin: 40px 0 16px; }
.gp-prose h3 { margin: 30px 0 12px; }
.gp-prose h2:first-child,
.gp-prose h3:first-child { margin-top: 0; }

.gp-prose ul {
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
}

.gp-prose ul li {
    position: relative;
    padding: 0 0 8px 26px;
}

.gp-prose ul li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: .6em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
}

.gp-prose img {
    border-radius: var(--gp-radius);
}

/* ---------- Data table ---------- */
.gp-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--gp-line);
    border-radius: var(--gp-radius);
    background: #fff;
}

.gp-table-wrap table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
    font-size: 14px;
    text-align: center;
}

.gp-table-wrap th,
.gp-table-wrap td {
    padding: 11px 10px;
    border-bottom: 1px solid var(--gp-line);
}

.gp-table-wrap thead th {
    background: var(--secondary);
    color: #fff;
    font-weight: 600;
    letter-spacing: .5px;
}

.gp-table-wrap tbody tr:nth-child(even) { background: var(--bg-light-gray); }
.gp-table-wrap tbody tr:last-child td { border-bottom: 0; }

.gp-table-wrap tbody th,
.gp-table-wrap td:first-child {
    text-align: left;
    font-weight: 600;
    color: var(--gp-ink);
    white-space: nowrap;
}

/* ---------- Closing band ---------- */
main > section.gp-cta {
    padding: 70px 0;
    background: linear-gradient(120deg, var(--secondary) 0%, #24527a 55%, var(--primary) 130%);
    color: rgba(255, 255, 255, .85);
}

.gp-cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.gp-cta h2 {
    margin-bottom: 8px;
    color: #fff;
}

.gp-cta p { margin: 0; font-size: 17px; }
.gp-cta .gp-btns { flex: none; }

/* ---------- Tablet ---------- */
@media (max-width: 1023px) {
    .gp-map-layout { grid-template-columns: 1fr; }

    .gp-legend {
        border-left: 0;
        border-top: 1px solid var(--gp-line);
    }

    .gp-legend ol {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2px 10px;
    }

    .gp-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gp-card--cta { grid-column: 1 / -1; }

    .gp-split { gap: 30px; }

    .gp-cta-inner {
        flex-direction: column;
        text-align: center;
    }
    .gp-cta .gp-btns { justify-content: center; }
}

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
    main > section.gp-hero { padding: 40px 0 36px; }
    main > section.gp-hero.gp-hero--overlap { padding-bottom: 90px; }
    main > section.gp-overlap { margin-top: -60px; padding-bottom: 50px; }
    main > section.gp-section { padding: 60px 0; }

    .gp-lead { font-size: 16px; }
    .gp-stats { gap: 8px 20px; font-size: 12px; }
    .gp-stats strong { font-size: 24px; }

    .gp-pin-dot { left: -4px; top: -4px; width: 8px; height: 8px; }
    .gp-pin-head {
        left: -12px;
        bottom: 10px;
        width: 24px;
        height: 24px;
        border-width: 1.5px;
        font-size: 11px;
    }
    .gp-pin.is-down .gp-pin-head { top: 10px; }
    .gp-pin-head::after { margin-left: -4px; border-width: 4px; border-top-width: 6px; }
    .gp-pin.is-down .gp-pin-head::after { border-bottom-width: 6px; }
    .gp-pin-label { display: none; }

    .gp-legend { padding: 16px 12px; }
    .gp-legend ol { grid-template-columns: 1fr; }

    .gp-cards { grid-template-columns: 1fr; gap: 20px; }

    .gp-card--wide {
        grid-column: auto;
        display: flex;
    }
    .gp-card--wide .gp-card-media { aspect-ratio: 3 / 2; min-height: 0; }
    .gp-card--wide .gp-card-body,
    .gp-card-body { padding: 20px 20px 22px; }
    .gp-card--wide h3,
    .gp-card h3 { font-size: 23px; }

    .gp-split { grid-template-columns: 1fr; }
    .gp-split.is-flipped > :first-child { order: 0; }

    main > section.gp-cta { padding: 50px 0; }
    .gp-cta .gp-btns { flex-direction: column; width: 100%; }
    .gp-cta .btn { width: 100%; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    .gp-card-media img,
    .gp-pin-head,
    .gp-pin-label,
    .gp-arrow,
    .gp-card-link svg { transition: none; }
    .gp-card:hover .gp-card-media img { transform: none; }
}
