/*
   FOOTER (2.9.1: rewritten for two lines)
   Scoped to #tt-custom-footer to prevent theme conflicts.

   Main line:   copyright | social | location | portals
                Thin dividers sit in the middle of the gap between groups. The line
                hides anything to its left, so when the groups wrap, each new line
                starts flush left without a divider in front.
   Bottom line: Privacy · Cookies · Terms, under a hairline.

   The right-hand side stays clear for the assistant launcher ("Ask Think Tanks",
   fixed bottom right, about 190px wide).
*/
#tt-custom-footer {
    --bg-color: #F8F8F6;
    --text-color: var(--tt-ink, #253D3D);
    --heading-color: var(--tt-green, #3A5F5F);
    --hover-color: #3A5F5F;
    --meta-color: var(--tt-meta, #526666);
    --border-color: var(--tt-line, #CAD6D4);
    --font-mono: "Menlo", monospace;
    --space-md: 2rem;
    --group-gap: 3rem;          /* between groups on the main line; the divider sits in the middle */
    --launcher-room: 260px;     /* kept clear on the right for the assistant launcher */

    width: 100% !important;
    background: var(--bg-color) !important;
    border-top: 1px solid var(--border-color) !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
}

#tt-custom-footer .tt-inner-footer {
    display: block !important;
    max-width: 1600px !important;
    margin: 0 auto !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 1.75rem var(--launcher-room) 1.5rem var(--space-md) !important;
    font-family: var(--font-mono) !important;
    font-size: 0.8rem !important;
    line-height: 1.5 !important;
    color: var(--meta-color) !important;
}

#tt-custom-footer p { margin: 0 !important; padding: 0 !important; line-height: 1.5 !important; }

/* ---------------- Main line ---------------- */
#tt-custom-footer .tt-footer-main {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    column-gap: var(--group-gap) !important;
    row-gap: 0.75rem !important;
    /* Hides the divider in front of whichever group starts a line. The 4px of
       padding (cancelled by the margin) keeps keyboard focus rings visible. */
    overflow: hidden !important;
    padding: 4px !important;
    margin: -4px !important;
}
#tt-custom-footer .tt-footer-section {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    margin: 0 !important;
}
#tt-custom-footer .tt-footer-section::before {
    content: "" !important;
    position: absolute !important;
    left: calc(var(--group-gap) / -2) !important;
    top: 50% !important;
    width: 1px !important;
    height: 1.1em !important;
    transform: translateY(-50%) !important;
    background: var(--border-color) !important;
}
#tt-custom-footer .tt-footer-copy { color: var(--text-color) !important; }
#tt-custom-footer .tt-social-links,
#tt-custom-footer .tt-footer-portal { gap: 1.25rem !important; flex-wrap: wrap !important; }

/* Links on the main line */
#tt-custom-footer .tt-social-links a,
#tt-custom-footer .tt-member-link {
    color: var(--meta-color) !important;
    text-decoration: none !important;
    border-bottom: 1px solid transparent !important;
    transition: color 0.2s ease, border-color 0.2s ease !important;
}
#tt-custom-footer .tt-social-links a:hover,
#tt-custom-footer .tt-member-link:hover { color: var(--hover-color) !important; border-bottom-color: var(--hover-color) !important; }
#tt-custom-footer .tt-member-link { display: inline-flex !important; align-items: center !important; gap: 0.5rem !important; }
#tt-custom-footer .tt-member-link i {
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free", "FontAwesome" !important;
    font-weight: 900 !important; /* Required for solid Font Awesome icons */
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    display: inline-block !important;
}

/* ---------------- Bottom line: the legal pages ---------------- */
#tt-custom-footer .tt-footer-legal {
    display: block !important;
    /* The hairline runs the footer's full width (into the launcher's space); the links stay left. */
    margin: 1.25rem calc(var(--space-md) - var(--launcher-room)) 0 0 !important;
    padding: 1rem 0 0 !important;
    border-top: 1px solid var(--border-color) !important;
    font-size: 0.72rem !important;
}
#tt-custom-footer .tt-footer-legal ul {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
#tt-custom-footer .tt-footer-legal li { margin: 0 !important; padding: 0 !important; display: flex !important; align-items: center !important; }
#tt-custom-footer .tt-footer-legal li + li::before {
    content: "\00B7" !important; /* a middle dot */
    margin: 0 0.75rem !important;
    color: var(--meta-color) !important;
    opacity: 0.6 !important;
}
#tt-custom-footer .tt-footer-legal a {
    color: var(--meta-color) !important;
    text-decoration: none !important;
    border-bottom: 1px solid transparent !important;
    transition: color 0.2s ease, border-color 0.2s ease !important;
}
#tt-custom-footer .tt-footer-legal a:hover { color: var(--hover-color) !important; border-bottom-color: var(--hover-color) !important; }

/* ---------------- Small screens: one group per line ---------------- */
@media (max-width: 768px) {
    #tt-custom-footer .tt-inner-footer { padding: 1.75rem 2rem 96px !important; } /* room under the last line for the launcher */
    #tt-custom-footer .tt-footer-main { flex-direction: column !important; align-items: flex-start !important; row-gap: 0.9rem !important; }
    #tt-custom-footer .tt-footer-section::before { display: none !important; }
    #tt-custom-footer .tt-footer-legal { margin-right: 0 !important; }
}
