/* Tour Guide trips: the trip picker and the trip player.
   Loaded by templates/tour_guide.html. The page's older phrasebook
   styles stay inline in the template. */

/* ── Trips ───────────────────────────────────────────────── */
/* scroll-margin: the site header is sticky, so a plain scrollIntoView
   would tuck the top of the trip card underneath it. */
.trips { margin-bottom: 3rem; scroll-margin-top: 220px; }
.trips-intro { color: #555; margin: -0.25rem 0 1rem; font-size: 0.95rem; }

.trip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.9rem;
}
.trip-card {
    font: inherit;
    text-align: left;
    cursor: pointer;
    background: white;
    border: 1px solid #ece4d4;
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.trip-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.1); border-color: var(--royal-gold); }
.trip-card:focus-visible, .tp-choice:focus-visible, .tp-btn:focus-visible, .tp-voice button:focus-visible {
    outline: 3px solid var(--royal-gold); outline-offset: 2px;
}
.trip-photo { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; background: #efe7d6; }
.trip-body { display: flex; flex-direction: column; gap: 0.3rem; padding: 0.9rem 1.15rem 1.1rem; }
.tp-hero { margin: -1.4rem -1.4rem 0; }
.tp-hero img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; max-height: 320px; object-fit: cover; background: #efe7d6; }
.tp-hero figcaption { font-size: 0.72rem; color: #666; padding: 0.35rem 1.4rem 0; }
.tp-hero figcaption a { color: inherit; }
.photo-credits ul { margin: 0; padding-left: 1.1rem; font-size: 0.82rem; }
.trip-region { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-text); font-weight: 700; }
.trip-title { font-size: 1.1rem; font-weight: 700; color: var(--royal-purple); }
.trip-thai { font-size: 1.15rem; color: #333; }
.trip-blurb { font-size: 0.85rem; color: #666; line-height: 1.45; }
.trip-stamp-slot { font-size: 0.8rem; color: var(--hibiscus-red); font-weight: 700; margin-top: 0.3rem; }
.mini-stamp {
    display: inline-block; border: 2px solid var(--hibiscus-red); border-radius: 999px;
    padding: 0 0.5rem; transform: rotate(-6deg); margin-right: 0.3rem;
}

.phrasebook-header {
    font-size: 1.4rem;
    color: var(--royal-purple);
    margin: 0 0 1.25rem;
}

/* Player */
.tp-top { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tp-back { font: inherit; background: none; border: none; color: var(--royal-purple); cursor: pointer; text-decoration: underline; padding: 0; }
.tp-trip-name { font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold-text); font-weight: 700; }

.tp-route { display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; position: relative; margin-bottom: 1.25rem; }
/* The dashed line runs from the middle of the first stop to the middle of the last. */
.tp-route::before { content: ""; position: absolute; left: calc(50% / var(--stops, 5)); right: calc(50% / var(--stops, 5)); top: 9px; border-top: 2px dashed #ddd2bd; }
.tp-stop { display: grid; justify-items: center; gap: 0.35rem; text-align: center; font-size: 0.72rem; color: #666; position: relative; min-width: 0; }
.tp-dot { width: 18px; height: 18px; border-radius: 50%; background: white; border: 2px solid #ddd2bd; }
.tp-stop.done .tp-dot { background: var(--royal-gold); border-color: var(--royal-gold); }
.tp-stop.here .tp-dot { background: var(--hibiscus-red); border-color: var(--hibiscus-red); box-shadow: 0 0 0 4px rgba(220,20,60,0.18); }
.tp-stop.here { color: #333; font-weight: 700; }

.tp-card {
    background: white; border-radius: 14px; border: 1px solid #ece4d4;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    padding: 1.4rem; display: flex; flex-direction: column; gap: 1rem; overflow: hidden;
}
.tp-place { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-text); font-weight: 700; }
.tp-title { margin: 0; font-size: 1.45rem; color: var(--royal-purple); }
.tp-card p { margin: 0; line-height: 1.6; color: #333; }
.tp-bubble { border-left: 3px solid var(--royal-gold); padding: 0.2rem 0 0.2rem 0.9rem; display: flex; flex-direction: column; gap: 0.15rem; }
.tp-who { font-size: 0.8rem; color: #777; }
.tp-said { font-size: 1.6rem; color: var(--royal-purple); line-height: 1.5; }
.tp-pb { color: var(--gold-text); font-style: italic; }
.tp-en { color: #666; font-size: 0.9rem; }
.tp-prompt-row { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; }
.tp-prompt { font-weight: 700; }
.tp-hint { font: inherit; font-size: 0.85rem; background: none; border: none; color: var(--royal-purple); text-decoration: underline; cursor: pointer; padding: 0; }

.tp-choices { display: grid; gap: 0.6rem; }
.tp-choice {
    font: inherit; text-align: left; cursor: pointer; background: #fdfbf6;
    border: 1.5px solid #e6dcc8; border-radius: 10px; padding: 0.75rem 0.9rem;
    display: flex; flex-direction: column; gap: 0.1rem; color: inherit;
}
.tp-choice:hover:not(:disabled) { border-color: var(--royal-purple); }
.tp-choice:disabled { cursor: default; opacity: 0.55; }
.tp-choice .thai { font-size: 1.2rem; color: #222; }
.tp-choice .tp-en { display: none; }
.tp-choices.show-en .tp-choice .tp-en { display: block; }
.tp-choice.picked { opacity: 1; }
.tp-choice.picked.good { border-color: var(--bodhi-green); background: #eef6ea; }
.tp-choice.picked.ok   { border-color: var(--deep-gold);   background: #fbf3df; }
.tp-choice.picked.miss { border-color: var(--hibiscus-red); background: #fcebee; }

.tp-feedback { border-radius: 10px; padding: 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.4rem; }
.tp-feedback.good { background: #eef6ea; } .tp-feedback.ok { background: #fbf3df; } .tp-feedback.miss { background: #fcebee; }
.tp-verdict { font-weight: 700; }
.tp-feedback.good .tp-verdict { color: var(--bodhi-green); }
.tp-feedback.ok .tp-verdict { color: #8a5a00; }
.tp-feedback.miss .tp-verdict { color: var(--hibiscus-red); }
.tp-you-said { font-size: 0.9rem; color: #555; }
.tp-you-said .thai-text { font-size: 1.1rem; color: #222; }
.tp-tip { border-top: 1px solid #eee3cf; padding-top: 0.8rem; font-size: 0.92rem; }
.tp-tip strong { display: block; color: var(--gold-text); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 0.2rem; }
.tp-actions { display: flex; justify-content: flex-end; gap: 0.6rem; flex-wrap: wrap; }
.tp-btn { font: inherit; font-weight: 700; cursor: pointer; border-radius: 10px; padding: 0.65rem 1.2rem; border: 1.5px solid var(--royal-purple); }
.tp-btn.primary { background: var(--royal-purple); color: white; }
.tp-btn.ghost { background: white; color: var(--royal-purple); }
a.tp-btn { text-decoration: none; display: inline-block; }

.tp-intro-thai { font-size: 1.8rem; color: var(--royal-purple); }
.tp-voice { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.tp-voice button {
    font: inherit; cursor: pointer; text-align: left; background: #fdfbf6; border: 1.5px solid #e6dcc8;
    border-radius: 10px; padding: 0.8rem 0.9rem; display: flex; flex-direction: column; gap: 0.1rem; color: inherit;
}
.tp-voice button:hover { border-color: var(--royal-purple); }
.tp-voice button.chosen { border-color: var(--royal-purple); background: #f3eefa; }
.tp-voice .thai { font-size: 1.4rem; }
.tp-voice small { color: #666; }

.tp-stamp-wrap { display: grid; place-items: center; padding: 0.5rem 0 1rem; }
.tp-stamp {
    width: 190px; height: 190px; max-width: 100%; border-radius: 50%;
    border: 4px double var(--hibiscus-red); color: var(--hibiscus-red);
    display: grid; place-items: center; text-align: center; padding: 1.25rem;
    transform: rotate(-9deg); animation: tp-thud 0.5s cubic-bezier(.2,1.6,.4,1) both;
}
.tp-stamp .thai { font-size: 1.35rem; font-weight: 700; display: block; }
.tp-stamp small { display: block; letter-spacing: 0.14em; font-size: 0.68rem; font-weight: 700; }
@keyframes tp-thud { from { transform: rotate(-9deg) scale(1.6); opacity: 0; } to { transform: rotate(-9deg) scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .tp-stamp { animation: none; } .trip-card { transition: none; } }
.tp-draft { font-size: 0.8rem; color: #666; }

@media (max-width: 600px) {
    .trip-grid { grid-template-columns: 1fr; }
    .tp-card { padding: 1.1rem; }
    .tp-hero { margin: -1.1rem -1.1rem 0; }
    .tp-hero figcaption { padding-inline: 1.1rem; }
    .tp-voice { grid-template-columns: 1fr; }
    .tp-stop span:last-child { font-size: 0.62rem; }
}

/* Headings and feedback take focus from the player script (for keyboard and
   screen-reader users); no ring on them unless the visitor is using a keyboard. */
.tp-title:focus:not(:focus-visible), .tp-feedback:focus:not(:focus-visible) { outline: none; }

/* ── Things to do ────────────────────────────────────────── */
/* Activity cards share the trip photo style; the links are what make
   them different, so they get the strongest colour on the card. */
.things-to-do { margin-bottom: 3rem; scroll-margin-top: 220px; }
.affiliate-note { font-size: 0.82rem; color: #666; margin: -0.5rem 0 1rem; }
.ad-label {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.05rem 0.4rem;
    border-radius: 4px;
    background: #f1ece0;
    color: #6b5a2e;
    vertical-align: middle;
}
.activity-jump { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1.25rem; }
.activity-jump a {
    padding: 0.35rem 0.85rem;
    border: 1px solid rgba(212,175,55,0.5);
    border-radius: 999px;
    background: #fffaf0;
    color: var(--royal-purple);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
}
.activity-jump a:hover { background: #f6ecd2; }
.activity-group { margin: 2rem 0 0.75rem; font-size: 1.3rem; color: var(--royal-purple); scroll-margin-top: 220px; }
.activity-group-note { font-size: 0.85rem; color: #666; margin: -0.4rem 0 0.75rem; }
.activity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 0.9rem;
    align-items: start;   /* short cards don't stretch into a gap above their links */
}
.activity-card {
    background: white;
    border: 1px solid #ece4d4;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    scroll-margin-top: 220px;
}
.activity-body { display: flex; flex-direction: column; gap: 0.55rem; padding: 0.9rem 1.15rem 1.1rem; flex: 1; }
.activity-title { margin: 0; font-size: 1.1rem; color: var(--royal-purple); }
.activity-blurb, .activity-where, .activity-tip, .activity-trips { margin: 0; font-size: 0.88rem; color: #444; line-height: 1.55; }
.activity-tip { color: #555; background: #faf6ec; border-radius: 8px; padding: 0.5rem 0.7rem; }
.activity-trips a { color: var(--royal-purple); font-weight: 600; }
.activity-phrases { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; }
.activity-phrases li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; font-size: 0.88rem; }
.activity-phrases .thai-text { font-family: 'Sarabun', sans-serif; font-size: 1.15rem; color: var(--royal-purple); }
.activity-phrases .vocab-paiboon { font-size: 0.88rem; }
.activity-english { color: #555; }
.activity-links { display: flex; flex-direction: column; gap: 0.4rem; padding-top: 0.3rem; }
.activity-link {
    display: block;
    padding: 0.55rem 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--royal-gold);
    color: var(--royal-purple);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
}
.activity-link:hover { background: #fbf5e4; }
.activity-link:focus-visible { outline: 3px solid var(--royal-gold); outline-offset: 2px; }
.activity-link .partner { font-weight: 400; color: #666; font-size: 0.8rem; }

@media (max-width: 600px) {
    .activity-grid { grid-template-columns: 1fr; }
}

/* The section also sits on the locked page, which has neither the Tour Guide
   page's width nor its inline heading styles. */
.locked-container ~ .things-to-do { max-width: 960px; margin: 0 auto 3rem; }
.things-to-do .section-header {
    font-size: 1.15rem; font-weight: 700; color: #f0f0f0;
    border-bottom: 2px solid var(--royal-gold); padding-bottom: 0.4rem; margin-bottom: 1rem;
}
.things-to-do .vocab-paiboon { color: var(--gold-text); font-style: italic; letter-spacing: 0.02em; }
.activity-credits { font-size: 0.75rem; color: #777; margin: 1rem 0 0; line-height: 1.6; }
.activity-credits a { color: inherit; }
