/* Leadership directory (templates/leader/*.html.twig). Everything is scoped under .ld. */
.ld {
    --ld-navy: #17334d; --ld-teal: #277e77; --ld-ink: #263747; --ld-muted: #6d7d8e; --ld-line: #dfe6ec;
    --ld-gold: #c6a05c; --ld-purple: #7665a8; --ld-slate: #647f9a;
    color: var(--ld-ink); font-size: 14px; line-height: 1.45;
}
.ld a { text-decoration: none; }
.ld-crumb { font-size: 12px; color: var(--ld-muted); margin-bottom: 10px; }
.ld-crumb a { color: var(--ld-muted); }
.ld-crumb strong { color: var(--ld-ink); }

.ld-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 22px; }
.ld-eyebrow { text-transform: uppercase; font-size: 10px; letter-spacing: 1.7px; color: var(--ld-teal); font-weight: 800; }
.ld-heading h1 { font-size: 29px; font-weight: 700; letter-spacing: -.7px; color: var(--ld-navy); margin: 5px 0; }
.ld-heading p { margin: 0; color: var(--ld-muted); }
.ld-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ld-btn { border: 1px solid #d5dfe6; border-radius: 9px; background: #fff; color: var(--ld-navy); padding: 10px 14px; font-weight: 700; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.ld-btn:hover { background: #f4f7f9; color: var(--ld-navy); }
.ld-btn.primary { background: var(--ld-navy); border-color: var(--ld-navy); color: #fff; }
.ld-btn.primary:hover { background: #0f263b; color: #fff; }

.ld-hero { background: linear-gradient(115deg, #17334d, #245d70); color: #fff; border-radius: 16px; padding: 24px 26px; display: grid; grid-template-columns: 1.5fr 1fr;
    gap: 20px; align-items: center; margin-bottom: 18px; position: relative; overflow: hidden; }
.ld-hero::after { content: "✦"; position: absolute; font-size: 210px; color: #ffffff0a; right: 25%; top: -80px; pointer-events: none; }
.ld-hero h2 { font-size: 21px; font-weight: 700; margin: 0 0 8px; position: relative; z-index: 1; }
.ld-hero p { font-size: 12px; color: #d1e1e9; margin: 0; max-width: 580px; position: relative; z-index: 1; }
.ld-hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; position: relative; z-index: 1; }
.ld-hero-stat { border: 1px solid #ffffff2b; background: #ffffff0c; border-radius: 10px; padding: 12px; }
.ld-hero-stat strong { display: block; font-size: 25px; }
.ld-hero-stat span { font-size: 10px; color: #c5d9e2; }


.ld-toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; margin: 18px 0; }
.ld-search { position: relative; flex: 1; min-width: 220px; max-width: 410px; }
.ld-search::before { content: "⌕"; position: absolute; left: 12px; top: 8px; color: #81909e; font-size: 20px; line-height: 1; }
.ld-search input { width: 100%; border: 1px solid #d6e0e7; border-radius: 9px; padding: 11px 12px 11px 35px; background: #fff; font-size: 13px; }
.ld-filters { display: flex; gap: 7px; flex-wrap: wrap; }
.ld-chip { border: 1px solid #dbe3e9; background: #fff; border-radius: 25px; padding: 8px 12px; font-size: 11px; color: #647487; font-weight: 750; cursor: pointer; }
.ld-chip.active { background: #e6f2f0; border-color: #b9dcd7; color: #176d66; }

.ld-section { margin-top: 25px; scroll-margin-top: 16px; }
.ld-section[hidden], .ld-card[hidden] { display: none; }
.ld-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.ld-section-heading h2 { font-size: 18px; font-weight: 700; color: var(--ld-navy); margin: 0; }
.ld-section-heading p { font-size: 12px; color: var(--ld-muted); margin: 4px 0 0; }
.ld-badge { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--ld-teal); font-weight: 800; background: #e4f1ef; padding: 6px 10px; border-radius: 20px; white-space: nowrap; }

.ld-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.ld-card { --accent: var(--ld-teal); background: #fff; border: 1px solid var(--ld-line); border-radius: 14px; overflow: hidden; transition: transform .15s, box-shadow .15s; min-width: 0; }
/* Accent by the section's position in the church's list (cycles every 4); "other" = no section. */
.ld-card.c0 { --accent: var(--ld-gold); }
.ld-card.c1 { --accent: var(--ld-teal); }
.ld-card.c2 { --accent: var(--ld-purple); }
.ld-card.c3, .ld-card.other { --accent: var(--ld-slate); }
.ld-card:hover { transform: translateY(-2px); box-shadow: 0 9px 25px #17334d12; }
.ld-card-top { height: 6px; background: var(--accent); }
.ld-card-body { padding: 17px 15px 15px; }
.ld-person { display: flex; align-items: center; gap: 12px; }
.ld-person-text { min-width: 0; }
.ld-portrait { width: 66px; height: 66px; flex: 0 0 66px; border-radius: 50%; overflow: hidden; border: 3px solid #fff; box-shadow: 0 0 0 1px #dce4ea; }
.ld-portrait > * { width: 100% !important; height: 100% !important; }
.ld-name { display: block; font-size: 14px; font-weight: 800; color: var(--ld-navy); line-height: 1.3; }
.ld-name:hover { color: var(--ld-teal); }
.ld-title { font-size: 11px; color: var(--ld-muted); margin-top: 4px; }
.ld-divider { border-top: 1px solid #edf0f3; margin: 13px 0 11px; }
.ld-detail { display: flex; gap: 8px; align-items: flex-start; font-size: 11px; color: #617184; margin: 7px 0; min-width: 0; }
.ld-detail .ico { width: 15px; flex: 0 0 15px; color: #8a9aa8; }
.ld-detail span:last-child { overflow-wrap: anywhere; }
.ld-detail a { color: var(--ld-navy); }
.ld-card-actions { display: flex; gap: 7px; margin-top: 13px; }
.ld-card-actions:empty { display: none; }
.ld-card-actions a { flex: 1; text-align: center; font-size: 11px; padding: 8px 7px; border-radius: 7px; border: 1px solid #dce4e9; background: #fff; color: var(--ld-navy); font-weight: 700; }
.ld-card-actions a:first-child { background: #f3f7f9; }
.ld-card-actions form { flex: 1; margin: 0; display: flex; }
.ld-card-actions button { flex: 1; font-size: 11px; padding: 8px 7px; border-radius: 7px; border: 1px solid #f1c9c9; background: #fff; color: #b42318; font-weight: 700; }
.ld-empty { padding: 35px; text-align: center; background: #fff; border: 1px dashed #cfd9e1; border-radius: 12px; color: var(--ld-muted); margin-top: 18px; }
.ld-empty[hidden] { display: none; }

.ld-org { background: #fff; border: 1px solid var(--ld-line); border-radius: 14px; padding: 20px; margin-top: 28px; }
.ld-org-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ld-org-title h2 { font-size: 16px; font-weight: 700; color: var(--ld-navy); margin: 0; }
.ld-org-title p { font-size: 11px; color: var(--ld-muted); margin: 4px 0 0; }
.ld-tree { display: flex; flex-direction: column; align-items: center; margin-top: 18px; }
.ld-node { border: 1px solid #cbd9e2; background: #f7fafb; border-radius: 10px; padding: 10px 16px; text-align: center; min-width: 170px; font-weight: 800; color: var(--ld-navy); font-size: 12px; }
.ld-node small { display: block; font-weight: 500; color: var(--ld-muted); font-size: 10px; margin-top: 3px; }
.ld-line { height: 22px; width: 1px; background: #c7d4de; }
/* Sections under the top one: compact boxes in a single row (scrolls sideways inside the card if
   there are very many). Each cell draws its part of the horizontal connector, so the line runs
   exactly from the first box's center to the last one's, whatever the count. */
.ld-tree-row { display: flex; justify-content: center; width: 100%; overflow-x: auto; }
.ld-tree-cell { position: relative; flex: 0 1 132px; min-width: 96px; padding: 0 4px; display: flex; flex-direction: column; align-items: center; }
.ld-tree-cell::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: #c7d4de; }
.ld-tree-cell:first-child::before { left: 50%; }
.ld-tree-cell:last-child::before { right: 50%; }
.ld-tree-cell:only-child::before { display: none; }
.ld-vert { height: 16px; width: 1px; background: #c7d4de; }
.ld-node.sub { min-width: 0; width: 100%; padding: 7px 6px; border-radius: 8px; background: #fff; font-size: 11px; line-height: 1.25; overflow-wrap: anywhere; }
.ld-node.sub:hover { border-color: var(--ld-teal); }
.ld-node.sub strong { display: block; }
.ld-node.sub span { display: block; color: var(--ld-muted); font-size: 9.5px; font-weight: 500; margin-top: 2px; }

/* Add / edit page, styled like the mockup's dialog. */
.ld-form-card { width: min(680px, 100%); margin: 0 auto; background: #fff; border: 1px solid var(--ld-line); border-radius: 16px; box-shadow: 0 20px 60px #0f263b14; }
.ld-form-head { display: flex; justify-content: space-between; align-items: center; padding: 19px 22px; border-bottom: 1px solid var(--ld-line); }
.ld-form-head h1 { font-size: 17px; font-weight: 700; color: var(--ld-navy); margin: 0; }
.ld-x { background: #f1f4f6; border-radius: 8px; width: 32px; height: 32px; font-size: 19px; color: #546678; display: grid; place-items: center; }
.ld-form-body { padding: 21px 22px; }
.ld-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 13px; }
.ld-form-grid .full { grid-column: 1 / -1; }
.ld-form-grid .form-label { font-size: 11px; font-weight: 750; color: #657588; margin-bottom: 6px; }
.ld-form-grid .form-control, .ld-form-grid .form-select { border: 1px solid #d7e0e7; border-radius: 8px; padding: 10px; font-size: 14px; }
.ld-form-grid .form-control:focus, .ld-form-grid .form-select:focus { border-color: var(--ld-teal); box-shadow: 0 0 0 3px #277e7717; }
.ld-form-grid .form-text { font-size: 10px; }
.ld-form-footer { padding: 14px 22px; border-top: 1px solid var(--ld-line); display: flex; justify-content: flex-end; gap: 8px; }
.ld-form-danger { padding: 0 22px 16px; text-align: right; }

@media (max-width: 1200px) {
    .ld-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ld-hero { grid-template-columns: 1.2fr 1fr; }
}
@media (max-width: 900px) {
    .ld-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ld-hero { grid-template-columns: 1fr; }
    .ld-tree-row { flex-wrap: wrap; gap: 8px; overflow-x: visible; }
    .ld-tree-cell { flex: 1 1 140px; padding: 0; }
    .ld-tree-cell::before, .ld-vert { display: none; }
}
@media (max-width: 560px) {
    .ld-heading { flex-direction: column; }
    .ld-heading h1 { font-size: 25px; }
    .ld-grid { grid-template-columns: 1fr; }
    .ld-form-grid { grid-template-columns: 1fr; }
    .ld-hero-stats { gap: 6px; }
    .ld-hero-stat { padding: 9px; }
    .ld-hero-stat strong { font-size: 21px; }
}
@media print {
    .ld-actions, .ld-toolbar, .ld-card-actions { display: none !important; }
    .ld-hero { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .ld-grid { grid-template-columns: repeat(3, 1fr); }
    .ld-card { break-inside: avoid; box-shadow: none; }
    .ld-card[hidden], .ld-section[hidden] { display: block; }
    .ld-org { break-before: page; }
}

a.ld-node { display: block; text-decoration: none; }
