/*
 * The cruise popup: one dialog, styled as a centred card on a desktop and a bottom sheet
 * on a phone. The sheet is CSS only — the same <dialog>, anchored to the bottom edge —
 * rather than a second code path, so there is one behaviour to reason about.
 */
.cruise-popup {
    max-width: 32rem;
    width: calc(100% - 2rem);
    border: 0;
    border-radius: 12px;
    padding: 1.25rem 1.25rem 1rem;
    box-shadow: 0 18px 48px rgba(0, 0, 0, .28);
    color: #1b1b1b;
    background: #fff;
}

.cruise-popup::backdrop { background: rgba(0, 0, 0, .45); }

.cruise-popup h2 { margin: 0 2rem .25rem 0; font-size: 1.25rem; }
.cruise-popup-sub { margin: 0 0 .75rem; color: #555; font-size: .9rem; }
.cruise-popup-image { width: 100%; height: auto; border-radius: 8px; margin: 0 0 .75rem; }
.cruise-popup-summary { margin: 0 0 .75rem; }

.cruise-popup-facts { display: grid; grid-template-columns: auto 1fr; gap: .2rem .75rem; margin: 0 0 .75rem; }
.cruise-popup-facts dt { color: #555; font-size: .85rem; }
.cruise-popup-facts dd { margin: 0; font-size: .9rem; }

.cruise-popup-calls { margin: 0 0 .75rem; padding-left: 1.1rem; font-size: .9rem; }
.cruise-popup-more { margin: 0; display: flex; gap: .75rem; }
.cruise-popup-link { font-weight: 600; }

.cruise-popup-close-form { float: right; margin: -0.5rem -0.5rem 0 0; }

.cruise-popup-close {
    border: 0;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: .25rem .5rem;
}

/* The hooks look and behave like buttons, because they are. */
[data-cruise-popup] { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 2px; }
[data-cruise-popup]:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* Bottom sheet under 640px: the thumb reaches the bottom of a phone, not its middle. */
@media (max-width: 640px) {
    .cruise-popup {
        width: 100%;
        max-width: none;
        margin: auto auto 0;
        border-radius: 14px 14px 0 0;
        padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    }
}

/* Respect a reader who has asked for less motion; the dialog simply appears. */
@media (prefers-reduced-motion: no-preference) {
    .cruise-popup[open] { animation: cruise-popup-in .16s ease-out; }
    @keyframes cruise-popup-in { from { opacity: 0; transform: translateY(8px); } }
}
