/* ===========================================================================
   Judicial Directory — migrated from the legacy "JudgesDirectory" DNN module.
   Trimmed and rebuilt from the old module's View.ascx styles: dropped everything
   tied to the old skin/Telerik/Kendo/FontAwesome-stack markup and rebuilt the
   judge-card / division-group / floating-nav look with this site's own classes
   and palette (site.css variables).
   =========================================================================== */

/* ---- Layout: sidebar nav + content ---------------------------------------- */
.jd-outer {
    display: flex;
    align-items: flex-start;
    gap: 1.75rem;
}
.jd-content { flex: 1 1 auto; min-width: 0; }

.jd-floating-menu {
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 110px);
    overflow: hidden;   /* without this, max-height caps layout but content still visually spills past it */
    display: flex;
    flex-direction: column;
    width: 260px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #e3e8ee;
    border-radius: 1.4rem;
    padding: 1.25rem 1.4rem;
    box-shadow: var(--jud-card-shadow);
}
/* Search box stays fixed at the top of the panel; only the link list below scrolls. */
.jd-floating-menu > .jd-search-input { flex-shrink: 0; }
#jdFloatingMenuLinks {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 0.35rem;
    max-height: calc(100vh - 200px);
}

/* Each section heading is a collapsible toggle button for the links below it. */
.jd-nav-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    background: none;
    border: 0;
    padding: 0;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-weight: 700;
    color: var(--jud-navy);
    margin: 1rem 0 0.35rem;
    cursor: pointer;
}
.jd-nav-label:first-child { margin-top: 0; }
.jd-nav-label:hover, .jd-nav-label:focus-visible { color: var(--jud-blue); }
.jd-nav-caret { font-size: 0.7rem; transition: transform 0.15s ease; flex-shrink: 0; }
.jd-nav-label[aria-expanded="false"] .jd-nav-caret { transform: rotate(-90deg); }

.jd-nav-group { display: flex; flex-direction: column; margin-bottom: 0.25rem; }
.jd-nav-link {
    display: block;
    padding: 0.35rem 0.5rem;
    font-size: 0.85rem;
    color: var(--jud-ink);
    text-decoration: none;
    border-radius: 0.3rem;
    cursor: pointer;
}
.jd-nav-link:hover, .jd-nav-link:focus-visible, .jd-nav-link.active {
    background: var(--jud-blue);
    color: #fff;
}

.jd-controls-top { margin-bottom: 1rem; }

/* ---- Section / division headings ------------------------------------------ */
.group-header {
    background: var(--jud-page-bg);
    color: var(--jud-navy);
    padding: 0.6rem 1rem;
    font-weight: 700;
    font-size: 1.3rem;
    border-radius: 0.5rem;
    margin: 2rem 0 1.25rem;
}
.jd-section:first-of-type .group-header,
.jd-chief + .jd-section .group-header { margin-top: 1.5rem; }

.jd-grid { display: flex; flex-direction: column; gap: 1.75rem; }
.jd-division-heading {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}
.jd-division-heading a { color: var(--jud-navy); text-decoration: none; }
.jd-division-heading a:hover, .jd-division-heading a:focus-visible { text-decoration: underline; }

.jd-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 0.95rem;
}

/* ---- Judge card ------------------------------------------------------------ */
.jd-card {
    width: 175px;
    background: #fff;
    border: 1px solid #e3e8ee;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--jud-card-shadow);
}
.jd-header {
    background: #0863a2;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.15;
    min-height: 2.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.4rem;
}
.jd-card-admin .jd-header,
.jd-card-admin .jd-footer { background: #9b1b1e; }

.jd-section {
    /*background: #ECEDF2;*/
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
    padding: 0.25rem 0.35rem;
    line-height: 1.15;
}

.jd-picture {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #eef2f6;
}
.jd-picture img {
    width: 100%;
    /*height: 100%;*/
    object-fit: cover;
    display: block;
}
.jd-shade { position: absolute; inset: 0; transition: background-color 0.2s, opacity 0.2s; }
.jd-picture:hover .jd-shade,
.jd-picture:focus-within .jd-shade { background: #000; opacity: 0.45; }

.jd-hover-content {
    position: absolute;
    inset: 0;
    display: none;
    flex-wrap: wrap;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.5rem;
    text-align: center;
    color: #fff;
}
.jd-picture:hover .jd-hover-content,
.jd-picture:focus-within .jd-hover-content { display: flex; }
.jd-hover-content h3 { font-size: 0.9rem; margin: 0 0 0.2rem; }
.jd-hover-content a {
    color: #fff;
    border: 1px solid #fff;
    border-radius: 20px;
    padding: 0.15rem 0.6rem;
    font-size: 0.78rem;
    text-decoration: none;
}
.jd-hover-content a:hover, .jd-hover-content a:focus-visible { background: rgba(255, 255, 255, 0.2); }

.jd-footer {
    background: #0863a2;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.15;
    min-height: 1.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.4rem;
}

/* Chief / Deputy Chief static content */
.jd-chief .jd-card { width: 175px; }

/* On small screens the sidebar nav is replaced by the mobile controls above the content. */
@media (max-width: 991.98px) {
    .jd-cards { justify-content: center; }
}
