/* Shared public walk-to-site theme for Google Maps and Leaflet layouts. */
html body:has(#walktosite) {
    min-height: 100vh;
    min-height: 100svh;
    background-color: #f4f7fb !important;
    background-image: linear-gradient(135deg, #eef3ff, #effaf5) !important;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    color: #46536d;
}

/* Remove theme gutters/width caps only from ancestors of this mobile page. */
body :is(.site-container-wrap, .site-container, .site-inner, .wrap,
    .content-sidebar-wrap, main.content, article.entry, .entry-content):has(#walktosite) {
    box-sizing: border-box;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    float: none;
}

#walktosite {
    --wts-blue: #112ea3;
    --wts-border: #d4deef;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 18px 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    color: #46536d;
    line-height: 1.5;
}

#walktosite > br,
#walktosite #walktosite-form > br { display: none; }

#walktosite #walktosite-header h1 {
    margin: 0 0 8px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--wts-blue);
    font-family: inherit;
    font-size: clamp(20px, 3vw, 26px);
    font-weight: 700;
    line-height: 1.3;
}

#walktosite #walktosite-view-full { display: block; position: static; margin-bottom: 8px; }

#walktosite #walktosite-view-full > a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--wts-blue);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: none;
}

#walktosite #walktosite-form {
    height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

#walktosite #walktosite-form h3 {
    margin: 0 0 8px;
    color: var(--wts-blue) !important;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.3;
}

#walktosite #walktosite-form h4 {
    margin: 8px 0;
    color: #59677d !important;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
}

#walktosite .walktosite-2-cols,
#walktosite .walktosite-search-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
    margin: 0;
    width: 100%;
}

#walktosite .walktosite-2-cols > div,
#walktosite .walktosite-search-fields > div {
    min-width: 0;
    width: 100%;
}

#walktosite .walktosite-2-cols > div:only-child { grid-column: 1 / -1; }

#walktosite #walktosite-form .form-control {
    box-sizing: border-box;
    width: 100%;
    height: 46px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--wts-border);
    border-radius: 8px;
    background: #fbfcff;
    color: #18233d;
    font: inherit;
    font-size: 16px;
    line-height: 24px;
    box-shadow: none;
}

#walktosite #walktosite-form .form-control::placeholder { color: #69758a; opacity: 1; }
#walktosite #walktosite-form .input-group .form-control { border-radius: 8px 0 0 8px; }
#walktosite #walktosite-form .input-group-btn > .btn { min-height: 46px; border-radius: 0 8px 8px 0; }

#walktosite #walktosite-search,
#walktosite .walktosite-link-button {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: auto;
    min-height: 48px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: var(--wts-blue);
    color: #fff !important;
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
    text-decoration: none;
    box-shadow: none;
    transition: background-color .15s ease;
}

#walktosite #walktosite-search { margin-top: 8px; }
#walktosite #memorialButton .walktosite-link-button { background: #087f5b; }
#walktosite .walktosite-link-button:hover,
#walktosite #walktosite-search:hover:not(:disabled) { background: #0d247e; }
#walktosite #memorialButton .walktosite-link-button:hover { background: #066448; }
#walktosite #walktosite-view-full > a:hover { background: #f1f4fc; }
#walktosite .faded { opacity: .55; }
#walktosite #walktosite-search:disabled { opacity: .55; cursor: wait; }

#walktosite .walktosite-link-button > div,
#walktosite .walktosite-link-button > span {
    display: inline-flex;
    margin: 0;
    width: auto !important;
    justify-content: center;
    font-size: 16px;
    line-height: 24px;
}

#walktosite .walktosite-link-button br { display: none; }
#walktosite .walktosite-link-button img { width: 26px; height: 30px; object-fit: contain; margin: 0; }

#walktosite :is(.form-control, .btn, .walktosite-link-button):focus-visible {
    outline: 2px solid var(--wts-blue);
    outline-offset: 3px;
}

#walktosite #walktosite-results {
    margin: 0 0 10px;
    border: 1px solid var(--wts-border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

#walktosite #walktosite-scroll {
    height: clamp(144px, 22svh, 240px);
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: #b9c5dc #f5f7fc;
}

/* Don't dedicate a full results list to an empty state. */
#walktosite #walktosite-results:has(#no-results) #walktosite-scroll {
    height: 76px;
}

#walktosite #walktosite-results table { border-collapse: collapse; }
#walktosite #walktosite-results table > tbody > tr { background: #fff; cursor: pointer; }
#walktosite #walktosite-results table > tbody > tr:nth-child(even) { background: #f6f8fd; }
#walktosite #walktosite-results table > tbody > tr:hover { background: #eef2fc; }

#walktosite #walktosite-results table > tbody > tr.walktosite-selected-row {
    background: #e2f4ec !important;
    box-shadow: inset 3px 0 #087f5b;
}

#walktosite #walktosite-scroll td {
    padding: 12px 14px;
    border-bottom: 1px solid #e8edf5;
    color: #46536d !important;
    font-family: inherit;
    font-size: 14px !important;
    line-height: 1.5;
    vertical-align: middle;
    overflow-wrap: anywhere;
}

#walktosite #walktosite-scroll td:first-child { color: var(--wts-blue) !important; font-weight: 600 !important; }
#walktosite .walktosite-result-details { margin-top: 4px; color: #59677d; font-size: 13px; font-weight: 400; }
#walktosite #no-results { padding: 20px; color: #69758a; font-size: 14px; }
#walktosite :is(#walktosite-gradient-top, #walktosite-gradient-bottom) { display: none; }
#walktosite #walktosite-loading { background: rgb(245 247 252 / 85%); }
#walktosite #walktosite-loading-text { color: var(--wts-blue); font-size: 16px; text-shadow: none; }

#walktosite #walktosite-map {
    box-sizing: border-box;
    height: clamp(320px, 48vh, 560px) !important;
    min-height: 320px;
    margin-top: 10px;
    border: 1px solid var(--wts-border);
    border-radius: 10px;
    overflow: hidden;
}

#walktosite #walktosite-footer {
    position: static;
    flex-shrink: 0;
    margin-top: 8px;
    background: rgb(255 255 255 / 70%);
    border: 1px solid var(--wts-border);
    border-radius: 10px;
    box-shadow: none;
}

#walktosite #walktosite-footer :is(h3, #walktosite-need-help) { color: var(--wts-blue); font-size: 14px; }
#walktosite #walktosite-footer img { height: 28px; }
#walktosite #walktosite-footer > div:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 8px 0 12px;
}

#walktosite #walktosite-footer > div:first-child > div:first-child { display: none; }
#walktosite #walktosite-footer > div:first-child > div:nth-child(2) { width: auto; height: 50px; display: flex; align-items: center; }
#walktosite #walktosite-footer #walktosite-need-help { width: auto; height: 50px; display: flex; align-items: center; }

#walktosite .walktosite-help-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    margin: 0;
    padding: 8px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--wts-blue);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 20px;
    text-transform: none;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: none;
}

#walktosite .walktosite-help-toggle:hover,
#walktosite .walktosite-help-toggle[aria-expanded="true"] { background: #eef2fc; }
#walktosite .walktosite-help-toggle:focus-visible { outline: 2px solid var(--wts-blue); outline-offset: -2px; }
#walktosite .walktosite-help-chevron {
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform .15s ease;
}
#walktosite .walktosite-help-toggle[aria-expanded="true"] .walktosite-help-chevron { transform: translateY(2px) rotate(225deg); }

@media (max-width: 600px) {
    #walktosite {
        padding: 8px max(4px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left));
    }
    #walktosite #walktosite-form { padding: 0; border-radius: 0; }
    #walktosite #walktosite-form h3 { font-size: 19px; }
    #walktosite #walktosite-form h4 { font-size: 13px; margin: 6px 0; }
    #walktosite #walktosite-form .form-control { padding: 10px 8px; }
    #walktosite .walktosite-link-button { gap: 6px; padding: 8px; }
    #walktosite .walktosite-link-button > span { font-size: 14px; line-height: 20px; }
    #walktosite .walktosite-link-button img { width: 20px; height: 24px; }
    #walktosite .walktosite-link-button > div { flex-shrink: 0; }
    #walktosite #walktosite-scroll td { padding: 10px 8px; font-size: 13px !important; }
    #walktosite #walktosite-results table > tbody > tr > td:last-of-type { width: auto; }
    #walktosite #walktosite-map { min-height: 260px; height: clamp(260px, 42svh, 400px) !important; }
}

@media (max-width: 359px) {
    #walktosite .walktosite-search-fields { grid-template-columns: minmax(0, 1fr); }
    #walktosite .walktosite-link-button { flex-direction: column; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
    #walktosite :is(#walktosite-search, .walktosite-link-button, .walktosite-help-chevron) { transition: none; }
}
