/* ---------------------------------------------------------
   TURFSCOUT SHARED SLIDE-OUT MENU
--------------------------------------------------------- */

/* Hamburger button */
.ts-menu-toggle {
    position: absolute;
    top: 14px;
    left: max(16px, calc((100vw - var(--max, 1100px)) / 2));
    z-index: 40;

    width: 38px;
    height: 36px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;

    padding: 0;

    color: var(--ink, #171a18);
    background: var(--paper, #ffffff);

    border: 1px solid var(--ink, #171a18);
    border-radius: var(--radius-sm, 2px);

    box-shadow: 2px 2px 0 #d6dad6;

    cursor: pointer;
}

.ts-menu-toggle span {
    display: block;

    width: 18px;
    height: 2px;

    background: var(--ink, #171a18);
    border-radius: 2px;
}

.ts-menu-toggle:hover,
.ts-menu-toggle:focus-visible {
    background: var(--brand, #2f7d32);
    outline: none;
}

.ts-menu-toggle:hover span,
.ts-menu-toggle:focus-visible span {
    background: #ffffff;
}


/* Invisible backdrop.
   Tapping outside still closes the sidebar, but there is no grey wash. */
.ts-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1998;

    background: transparent;

    opacity: 0;

    transition: opacity .22s ease;
}

.ts-menu-backdrop.open {
    opacity: 1;
}

.ts-menu-backdrop[hidden] {
    display: none;
}


/* Sidebar */
.ts-sidebar {
    position: fixed;

    top: 0;
    bottom: 0;
    left: 0;

    z-index: 1999;

    width: min(390px, 88vw);
    height: 100vh;
    height: 100dvh;

    color: var(--text, #2c312e);
    background: var(--paper, #ffffff);

    border-right: 1px solid var(--ink, #171a18);

    box-shadow:
        8px 0 30px rgba(23, 26, 24, .18);

    transform: translateX(-105%);

    transition: transform .24s ease;

    overflow: hidden;

    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);

    overscroll-behavior: contain;
}

.ts-sidebar.open {
    transform: translateX(0);
}


/* Views */
.ts-menu-view,
.ts-menu-resource {
    position: absolute;

    inset: 0;

    display: flex;
    flex-direction: column;

    min-width: 0;

    background: var(--paper, #ffffff);
}

.ts-menu-view[hidden],
.ts-menu-resource[hidden] {
    display: none;
}


/* Header */
.ts-menu-header {
    flex: 0 0 auto;

    min-height: 58px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    padding: 12px 14px 12px 17px;

    color: var(--ink, #171a18);
    background: var(--paper, #ffffff);

    border-bottom: 1px solid var(--ink, #171a18);
}

.ts-menu-header strong {
    min-width: 0;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    font-size: .94rem;
    font-weight: 900;
    letter-spacing: -.01em;
}


/* X / back button */
.ts-menu-x {
    flex: 0 0 auto;

    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    padding: 0;

    color: var(--ink, #171a18);
    background: var(--paper, #ffffff);

    border: 1px solid var(--ink, #171a18);
    border-radius: var(--radius-sm, 2px);

    font-size: 1.35rem;
    line-height: 1;
    font-weight: 500;

    cursor: pointer;
}

.ts-menu-x:hover,
.ts-menu-x:focus-visible {
    color: #ffffff;
    background: var(--ink, #171a18);
    outline: none;
}


/* Main menu */
.ts-menu-content {
    flex: 1;

    overflow-y: auto;
    -webkit-overflow-scrolling: touch;

    padding: 14px;
}

.ts-menu-link {
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 14px;

    min-height: 48px;

    margin: 0 0 8px;

    padding: 11px 12px;

    color: var(--ink, #171a18);
    background: var(--paper, #ffffff);

    border: 1px solid var(--line-dark, #9ca59f);
    border-radius: var(--radius-sm, 2px);

    text-align: left;
    text-decoration: none;

    font: inherit;
    font-size: .86rem;
    font-weight: 800;

    cursor: pointer;

    transition:
        background .14s ease,
        color .14s ease,
        border-color .14s ease;
}

.ts-menu-link:hover,
.ts-menu-link:focus-visible {
    color: #ffffff;
    background: var(--brand, #2f7d32);
    border-color: var(--ink, #171a18);
    outline: none;
}

.ts-menu-arrow {
    flex: 0 0 auto;

    color: var(--brand-dark, #205d24);

    font-size: 1rem;
    font-weight: 900;
}

.ts-menu-link:hover .ts-menu-arrow,
.ts-menu-link:focus-visible .ts-menu-arrow {
    color: #ffffff;
}


/* Add to Home Screen */
.ts-install-app {
    width: 100%;

    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    align-items: center;

    gap: 11px;

    min-height: 72px;

    margin: 14px 0 8px;

    padding: 8px 10px;

    color: var(--ink, #171a18);
    background: var(--brand-soft, #e9f3e9);

    border: 1px solid var(--ink, #171a18);
    border-radius: var(--radius-sm, 2px);

    box-shadow: 2px 2px 0 #d6dad6;

    text-align: left;

    font: inherit;

    cursor: pointer;

    transition:
        background .14s ease,
        color .14s ease,
        transform .14s ease,
        box-shadow .14s ease;
}

.ts-install-app:hover,
.ts-install-app:focus-visible {
    color: #ffffff;
    background: var(--brand, #2f7d32);

    box-shadow: 3px 3px 0 var(--ink, #171a18);

    transform: translate(-1px, -1px);

    outline: none;
}

.ts-install-app:hover .ts-menu-arrow,
.ts-install-app:focus-visible .ts-menu-arrow {
    color: #ffffff;
}

.ts-install-app:disabled {
    cursor: default;
    opacity: .72;
    transform: none;
}

.ts-install-app.installed {
    background: var(--paper-2, #fafaf7);
    box-shadow: none;
}

.ts-install-app-icon {
    width: 54px;
    height: 54px;

    display: block;

    object-fit: cover;

    background: #ffffff;

    border: 1px solid rgba(23, 26, 24, .18);
    border-radius: 12px;
}

.ts-install-app-copy {
    min-width: 0;

    display: flex;
    flex-direction: column;

    gap: 3px;
}

.ts-install-app-copy strong {
    color: inherit;

    font-size: .84rem;
    line-height: 1.25;

    font-weight: 900;
}

.ts-install-app-copy small {
    color: var(--muted, #69716c);

    font-size: .70rem;
    line-height: 1.25;

    font-weight: 700;
}

.ts-install-app:hover .ts-install-app-copy small,
.ts-install-app:focus-visible .ts-install-app-copy small {
    color: rgba(255, 255, 255, .88);
}

.ts-install-help {
    text-align: center;
}

.ts-install-help-icon {
    width: 92px;
    height: 92px;

    display: block;

    margin: 0 auto 18px;

    object-fit: cover;

    background: #ffffff;

    border: 1px solid rgba(23, 26, 24, .18);
    border-radius: 20px;

    box-shadow: 3px 3px 0 #d6dad6;
}

.ts-install-help p,
.ts-install-help ol {
    text-align: left;
}


/* Resource content */
.ts-resource-content {
    flex: 1;

    min-height: 0;

    overflow-y: auto;
    -webkit-overflow-scrolling: touch;

    padding: 20px 18px 40px;

    background: var(--paper, #ffffff);
}

.ts-resource-content h1,
.ts-resource-content h2 {
    margin: 0 0 13px;

    color: var(--ink, #171a18);

    font-size: 1.15rem;
    line-height: 1.2;

    font-weight: 900;
    letter-spacing: -.025em;
}

.ts-resource-content h3 {
    margin: 22px 0 8px;

    color: var(--ink, #171a18);

    font-size: .93rem;
    font-weight: 900;
}

.ts-resource-content p {
    margin: 0 0 14px;

    color: var(--text, #2c312e);

    font-size: .86rem;
    line-height: 1.58;
}

.ts-resource-content ul,
.ts-resource-content ol {
    margin: 0 0 16px;
    padding-left: 20px;

    color: var(--text, #2c312e);

    font-size: .86rem;
    line-height: 1.55;
}

.ts-resource-content a {
    color: var(--brand-dark, #205d24);

    font-weight: 800;
    text-underline-offset: 2px;
}


/* Mobile */
@media (max-width: 600px) {
    .ts-sidebar {
        width: min(360px, 90vw);
    }

    .ts-menu-toggle {
        top: 12px;
        left: 12px;
    }
}


/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .ts-sidebar,
    .ts-menu-backdrop {
        transition: none;
    }
}

/* ---------------------------------------------------------
   MENU CONTACT / SOCIAL LINKS
--------------------------------------------------------- */

.ts-menu-contact-links {
    margin-top: 18px;
    padding-top: 16px;

    border-top: 1px solid var(--line-dark, #d8ddd9);

    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ts-menu-contact-links a {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    width: fit-content;

    color: var(--muted, #5d665f);

    font-size: .78rem;
    line-height: 1.4;
    font-weight: 700;

    text-decoration: none;
}

.ts-menu-contact-links a:hover,
.ts-menu-contact-links a:focus-visible {
    color: var(--brand, #2f7d32);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---------------------------------------------------------
   ADD CLUB FORM
--------------------------------------------------------- */

.ts-club-form {
    margin-top: 20px;

    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ts-club-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;

    color: var(--ink, #171a18);

    font-size: .78rem;
    font-weight: 800;
}

.ts-club-form input {
    width: 100%;

    min-height: 44px;

    padding: 10px 11px;

    color: var(--ink, #171a18);
    background: var(--paper, #fff);

    border: 1px solid var(--line-dark, #9ca59f);
    border-radius: var(--radius-sm, 2px);

    font: inherit;
    font-size: .86rem;

    box-sizing: border-box;
}

.ts-club-form input:focus {
    border-color: var(--brand, #2f7d32);

    outline: 2px solid
        rgba(47, 125, 50, .15);

    outline-offset: 1px;
}

.ts-club-submit {
    min-height: 46px;

    margin-top: 4px;

    padding: 10px 14px;

    color: #fff;
    background: var(--brand, #2f7d32);

    border: 1px solid var(--ink, #171a18);
    border-radius: var(--radius-sm, 2px);

    font: inherit;
    font-size: .86rem;
    font-weight: 900;

    cursor: pointer;
}

.ts-club-submit:hover,
.ts-club-submit:focus-visible {
    filter: brightness(.94);
}

.ts-club-submit:disabled {
    opacity: .6;
    cursor: wait;
}

.ts-club-form-status {
    min-height: 20px;

    margin: 2px 0 0 !important;

    font-size: .78rem !important;
    font-weight: 700;
}

.ts-club-form-status.success {
    color: var(--brand-dark, #205d24);
}

.ts-club-form-status.error {
    color: #a12626;
}


/* Spam honeypot */

.ts-club-hp {
    position: absolute !important;

    width: 1px !important;
    height: 1px !important;

    overflow: hidden !important;

    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;

    white-space: nowrap !important;
}

/* Local match alerts only — does not change existing menu/club form styling. */
.ts-alerts-panel, .ts-alerts-panel * { box-sizing: border-box; }
.ts-alerts-panel [hidden] { display: none !important; }
.ts-alerts-panel .ts-alerts-form { display: grid; gap: 10px; margin: 18px 0; }
.ts-alerts-form label { font-size: .82rem; font-weight: 800; color: var(--ink, #171a18); }
.ts-alerts-form input { width: 100%; min-height: 46px; padding: 10px 11px; border: 1px solid var(--line-dark, #9ca59f); border-radius: var(--radius-sm, 2px); color: var(--ink, #171a18); background: #fff; font: 16px Helvetica, Arial, sans-serif; }
.ts-alerts-form input:focus-visible, .ts-alerts-panel button:focus-visible, .ts-alerts-privacy summary:focus-visible { outline: 3px solid var(--brand, #2f7d32); outline-offset: 3px; }
.ts-alerts-panel small { display: block; color: var(--muted, #69716c); font-size: .74rem; line-height: 1.5; }
.ts-alerts-panel button { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--ink, #171a18); border-radius: var(--radius-sm, 2px); font: 800 .84rem Helvetica, Arial, sans-serif; cursor: pointer; }
.ts-alerts-panel .ts-alerts-primary { color: #fff; background: var(--brand, #2f7d32); }
.ts-alerts-panel .ts-alerts-secondary { color: var(--ink, #171a18); background: var(--paper, #fff); }
.ts-alerts-panel button:disabled { opacity: .6; cursor: not-allowed; }
.ts-alerts-actions { display: grid; gap: 10px; }
.ts-alerts-panel .ts-alerts-note { padding: 11px; border: 1px solid #bacdbb; background: var(--brand-soft, #e9f3e9); }
.ts-alerts-panel .ts-alerts-status { margin: 15px 0; font-weight: 750; font-size: .8rem; }
.ts-alerts-panel .ts-alerts-status.is-error { color: var(--danger, #b42318); }
.ts-alerts-privacy { margin-top: 22px; border-top: 1px solid var(--line, #cfd4cf); padding-top: 14px; }
.ts-alerts-privacy summary { cursor: pointer; font-size: .8rem; font-weight: 800; margin-bottom: 12px; }
.ts-alerts-privacy p { font-size: .75rem; }
