/* Site search popup (round 20, 2026-10-15). Markup: partials/site-search.blade.php, behaviour: js/site-search.js.
   Overrides the old .searchoverlay rules in style.css (display none/block, black backdrop). */
.mds { --ink: #0a2540; --text: #33465b; --muted: #5f7186; --blue: #0073ad; --blue-soft: #eaf4fa; --line: #e6edf3; --bg: #f5f8fb; --green: #15803d;
    position: fixed; inset: 0; z-index: 100050; display: block !important; visibility: hidden; opacity: 0; padding: 4vh 24px 24px;
    background: rgba(6, 22, 40, .5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    font-family: var(--font-body, "Manrope", sans-serif); transition: opacity .2s ease, visibility 0s linear .2s; }
.mds.active { visibility: visible; opacity: 1; transition: opacity .2s ease; }
html.mds-lock, html.mds-lock body { overflow: hidden !important; }
.mds .visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

.mds-panel { position: relative; display: flex; flex-direction: column; width: min(1120px, 100%); max-height: 92vh; margin: 0 auto; border-radius: 24px; background: #fff; overflow: hidden;
    box-shadow: 0 40px 100px -30px rgba(4, 22, 40, .6), 0 0 0 1px rgba(10, 37, 64, .06); transform: translateY(-14px) scale(.985); transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
.mds.active .mds-panel { transform: none; }

/* ---- search bar ---- */
.mds-bar { position: relative; display: flex; align-items: center; gap: 12px; flex-shrink: 0; height: 76px; padding: 0 18px 0 28px; border-bottom: 1px solid var(--line); }
.mds-bar-icon { font-size: 20px; color: var(--blue); }
.mds-input { flex: 1 1 auto; min-width: 0; height: 100%; margin: 0 !important; padding: 0 4px !important; border: 0 !important; outline: 0 !important; box-shadow: none !important; background: transparent !important;
    font: inherit; font-size: 21px !important; font-weight: 600; letter-spacing: -.015em; color: var(--ink) !important; -webkit-appearance: none; appearance: none; }
.mds-input::placeholder { color: #9aa9b8; font-weight: 500; }
.mds-input::-webkit-search-cancel-button, .mds-input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.mds-spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #d5e3ee; border-top-color: var(--blue); opacity: 0; animation: mds-spin .7s linear infinite; transition: opacity .15s; }
.mds.is-busy .mds-spin { opacity: 1; }
@keyframes mds-spin { to { transform: rotate(360deg); } }
.mds-clear { height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--bg); color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.mds-clear:hover { background: var(--line); color: var(--ink); }
.mds kbd { display: inline-grid; place-items: center; min-width: 26px; height: 24px; padding: 0 6px; border-radius: 6px; border: 1px solid #dbe4ec; border-bottom-width: 2px; background: #fff;
    font: 700 11.5px/1 var(--font-body, "Manrope", sans-serif); color: var(--muted); box-shadow: none; }
.mds-close { display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--bg); color: var(--ink); font-size: 17px; cursor: pointer; transition: background .2s, transform .2s; }
.mds-close:hover { background: var(--ink); color: #fff; transform: rotate(90deg); }

/* ---- body ---- */
.mds-body { flex: 1 1 auto; min-height: 260px; overflow-y: auto; overscroll-behavior: contain; padding: 26px 28px 30px; scrollbar-width: thin; scrollbar-color: #cdd9e3 transparent; }
.mds-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 30px; align-items: start; }
.mds-grid.is-single { grid-template-columns: minmax(0, 1fr); }
.mds-side { position: sticky; top: 0; padding: 4px 20px 20px; border-radius: 20px; background: var(--bg); }
.mds-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 24px 0 12px; }
.mds-main > .mds-h:first-child, .mds-side > .mds-h:first-child, .mds-anim > .mds-h:first-child { margin-top: 0; }
.mds-side > .mds-h:first-child { margin-top: 16px; }
.mds-h h3 { display: flex; align-items: center; gap: 8px; margin: 0 !important; padding: 0 !important; font-size: 12px !important; font-weight: 800 !important; letter-spacing: .1em; text-transform: uppercase; color: var(--muted) !important; line-height: 1.2 !important; }
.mds-h h3::before { display: none !important; }
.mds-count { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: 11.5px; letter-spacing: 0; }
.mds-link { padding: 0; border: 0; background: none; color: var(--blue); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.mds-link:hover { text-decoration: underline; }
.mds mark { padding: 0; background: linear-gradient(transparent 58%, rgba(0, 128, 192, .18) 58%); color: inherit; font-weight: inherit; }
.mds a { text-decoration: none !important; }
.mds [data-mds-item] { outline: none; }

/* chips */
.mds-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.mds-chips.is-center { justify-content: center; }
.mds-chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 15px; border: 1px solid #dce6ee; border-radius: 999px; background: #fff; color: var(--ink); font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; transition: border-color .15s, background .15s, color .15s, transform .15s; }
.mds-chip i { font-size: 11.5px; color: var(--blue); }
.mds-chip.is-recent i { color: var(--muted); }
.mds-chip:hover, .mds-chip.is-active { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); transform: translateY(-1px); }

/* best-selling cards */
.mds-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.mds-card { display: flex; flex-direction: column; min-width: 0; border-radius: 18px; background: #fff; border: 1px solid var(--line); overflow: hidden; color: var(--ink) !important; transition: transform .2s, box-shadow .2s, border-color .2s; }
.mds-card-img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: #e8eef3; transition: transform .5s ease; }
.mds-card-img.is-empty, .mds-thumb.is-empty, .mds-pthumb.is-empty, .mds-region-img.is-empty { display: grid; place-items: center; color: #9fb3c5; font-size: 20px; }
.mds-card-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; }
.mds-card-body b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 15px; font-weight: 800; line-height: 1.3; letter-spacing: -.01em; }
.mds-kicker { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--blue); }
.mds-card:hover, .mds-card.is-active { transform: translateY(-3px); border-color: #cfe0ec; box-shadow: 0 22px 40px -28px rgba(10, 37, 64, .55); }
.mds-card:hover .mds-card-img, .mds-card.is-active .mds-card-img { transform: scale(1.04); }
.mds-card { position: relative; }
.mds-card-img { position: relative; z-index: 0; }
.mds-card-body { position: relative; z-index: 1; background: #fff; }

/* meta line */
.mds-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.mds-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.mds-dot { width: 7px; height: 7px; border-radius: 50%; background: #9fb3c5; }
.mds-dot.g-easy { background: #22a35a; } .mds-dot.g-mid { background: #f0a020; } .mds-dot.g-hard { background: #e0533d; }
.mds-rate i { color: #f5a524; font-size: 11px; }
.mds-rate { color: var(--ink); }
.mds-rate small { font-size: 11.5px; color: var(--muted); font-weight: 600; }

/* regions */
.mds-regions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.mds-region { position: relative; isolation: isolate; display: flex; align-items: flex-end; height: 104px; padding: 12px 14px; border-radius: 16px; overflow: hidden; background: var(--ink); color: #fff !important; }
.mds-region-img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.mds-region::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(6, 22, 40, 0) 20%, rgba(6, 22, 40, .82)); }
.mds-region span { display: flex; flex-direction: column; line-height: 1.15; }
.mds-region b { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.mds-region small { margin-top: 2px; font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, .78); }
.mds-region:hover .mds-region-img, .mds-region.is-active .mds-region-img { transform: scale(1.07); }
.mds-region.is-active { box-shadow: 0 0 0 3px rgba(0, 128, 192, .45); }

/* side lists */
.mds-styles { display: flex; flex-direction: column; gap: 2px; }
.mds-style { display: flex; align-items: center; gap: 12px; padding: 9px 10px; margin: 0 -10px; border-radius: 12px; color: var(--ink) !important; font-size: 14.5px; font-weight: 650; transition: background .15s; }
.mds-style > i { display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px; border-radius: 10px; background: #fff; color: var(--blue); font-size: 14px; box-shadow: 0 1px 0 var(--line); }
.mds-style > span { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; line-height: 1.25; }
.mds-style b { font-weight: inherit; }
.mds-style em { margin-top: 1px; font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.mds-style > small { flex-shrink: 0; font-size: 12px; font-weight: 700; color: var(--muted); }
.mds-style:hover, .mds-style.is-active { background: #fff; box-shadow: 0 10px 22px -18px rgba(10, 37, 64, .5); }
.mds-style:hover > i, .mds-style.is-active > i { background: var(--blue); color: #fff; }

.mds-posts { display: flex; flex-direction: column; gap: 4px; }
.mds-posts.is-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; }
.mds-post { display: flex; align-items: center; gap: 12px; padding: 8px; margin: 0 -8px; border-radius: 14px; color: var(--ink) !important; transition: background .15s; }
.mds-pthumb { flex-shrink: 0; width: 64px; height: 50px; border-radius: 10px; object-fit: cover; background: #e3ebf2; }
.mds-post > span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mds-post b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13.5px; font-weight: 700; line-height: 1.32; }
.mds-post small { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.mds-post:hover, .mds-post.is-active { background: #fff; box-shadow: 0 10px 22px -18px rgba(10, 37, 64, .5); }
.mds-main .mds-post:hover, .mds-main .mds-post.is-active { background: var(--bg); box-shadow: none; }

/* trip result rows */
.mds-list { display: flex; flex-direction: column; gap: 2px; }
.mds-row { position: relative; display: flex; align-items: center; gap: 14px; padding: 9px 12px 9px 9px; margin: 0 -9px; border-radius: 16px; color: var(--ink) !important; transition: background .15s; }
.mds-thumb { flex-shrink: 0; width: 76px; height: 58px; border-radius: 12px; object-fit: cover; background: #e3ebf2; }
.mds-row-body { display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; min-width: 0; }
.mds-row-body b { font-size: 15.5px; font-weight: 750; line-height: 1.3; letter-spacing: -.01em; }
.mds-go { flex-shrink: 0; font-size: 13px; color: var(--blue); opacity: 0; transform: translateX(-6px); transition: opacity .15s, transform .15s; }
.mds-row:hover, .mds-row.is-active { background: var(--blue-soft); }
.mds-row:hover .mds-go, .mds-row.is-active .mds-go { opacity: 1; transform: none; }
.mds-more { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; height: 40px; padding: 0 16px; border: 1.5px solid #d3e0ea; border-radius: 999px; background: #fff; color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 750; cursor: pointer; }
.mds-more:hover, .mds-more.is-active { border-color: var(--blue); color: var(--blue); }
.mds-more i { font-size: 10px; }

.mds-note { display: flex; align-items: center; gap: 9px; margin: 0 0 18px !important; padding: 10px 14px; border-radius: 12px; background: #fff7e8; color: #7a5410 !important; font-size: 13.5px !important; font-weight: 650; }
.mds-note i { color: #e09a1a; }

/* nothing found */
.mds-empty { max-width: 560px; margin: 6px auto 30px; text-align: center; }
.mds-empty-art { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 20px; background: var(--blue-soft); color: var(--blue); font-size: 26px; }
.mds-empty h3 { margin: 0 0 6px !important; font-size: 20px !important; font-weight: 800 !important; color: var(--ink) !important; }
.mds-empty h3::before { display: none !important; }
.mds-empty p { margin: 0 0 18px !important; font-size: 14.5px !important; color: var(--muted) !important; }

/* loading skeleton */
.mds-skel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.mds-skel i { height: 150px; border-radius: 18px; background: linear-gradient(90deg, #eef3f7 0%, #f7fafc 40%, #eef3f7 80%); background-size: 200% 100%; animation: mds-shine 1.2s linear infinite; }
@keyframes mds-shine { to { background-position: -200% 0; } }

/* footer */
.mds-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-shrink: 0; min-height: 58px; padding: 10px 18px 10px 28px; border-top: 1px solid var(--line); background: #fbfcfd; }
.mds-keys { display: flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.mds-keys kbd + kbd { margin-left: -1px; }
.mds-keys kbd:not(:first-child) { margin-left: 6px; }
.mds-keys kbd:nth-child(2) { margin-left: 2px; }
.mds-ask { display: inline-flex; align-items: center; gap: 10px; padding: 5px 14px 5px 5px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink) !important; font-size: 13px; font-weight: 600; transition: border-color .2s, box-shadow .2s; }
.mds-ask img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.mds-ask b { font-weight: 800; }
.mds-ask i { color: #25d366; font-size: 17px; }
.mds-ask:hover { border-color: #bfe8cf; box-shadow: 0 10px 22px -16px rgba(10, 90, 45, .6); }

/* entrance */
.mds-anim { animation: mds-in .28s ease both; }
@keyframes mds-in { from { opacity: 0; transform: translateY(6px); } }

/* ---- smaller screens ---- */
@media (max-width: 1099.98px) {
    .mds-grid { grid-template-columns: minmax(0, 1fr) 280px; gap: 22px; }
    .mds-regions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 899.98px) {
    .mds-grid { grid-template-columns: minmax(0, 1fr); }
    .mds-side { position: static; }
    .mds-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mds-regions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
    .mds { padding: 0; }
    .mds-panel { width: 100%; height: 100%; max-height: none; border-radius: 0; transform: translateY(16px); }
    .mds-bar { height: 64px; padding: 0 10px 0 18px; gap: 8px; }
    .mds-bar-icon { font-size: 17px; }
    .mds-input { font-size: 17px !important; }
    .mds-kbd, .mds-keys { display: none !important; }
    .mds-body { padding: 18px 16px 24px; }
    .mds-cards { display: flex; gap: 12px; margin: 0 -16px; padding: 0 16px 6px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; scrollbar-width: none; }
    .mds-cards::-webkit-scrollbar { display: none; }
    .mds-card { flex: 0 0 72%; scroll-snap-align: start; }
    .mds-regions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mds-region { height: 92px; }
    .mds-posts.is-grid { grid-template-columns: minmax(0, 1fr); }
    .mds-side { padding: 2px 16px 14px; }
    .mds-thumb { width: 64px; height: 52px; }
    .mds-row-body b { font-size: 14.5px; }
    .mds-foot { justify-content: center; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
    .mds-skel { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .mds, .mds-panel, .mds-card, .mds-card-img, .mds-region-img, .mds-chip, .mds-close, .mds-go { transition: none !important; }
    .mds-anim, .mds-skel i { animation: none !important; }
}

/* round 24 (audit M16): keyboard hints mean nothing on a phone */
@media (max-width: 767.98px) { .mds-kbd, .mds-keys { display: none !important; } }
