/* ============================================================
   Alumni Directory — Main Stylesheet
   ============================================================ */
:root {
  --navy:      #1a2744;
  --gold:      #c9a84c;
  --gold-lt:   #e8c97a;
  --cream:     #f7f4ef;
  --warm-gray: #e8e4dc;
  --text:      #2c2c2c;
  --text-muted:#6b6458;
  --white:     #ffffff;
  --danger:    #8b2020;
  --success:   #2a6040;
  --radius:    6px;
  --shadow:    0 4px 24px rgba(26,39,68,0.10);
  --shadow-lg: 0 8px 48px rgba(26,39,68,0.18);
  --font-head: 'Playfair Display', Georgia, serif;
  --font-body: 'Source Sans 3', 'Segoe UI', sans-serif;
  --nav-h:     60px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-body); color: var(--text); background: var(--cream); min-height: 100vh; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--warm-gray); }
::-webkit-scrollbar-thumb { background: var(--navy); border-radius: 3px; }
.hidden { display: none !important; }
.error-msg { color: var(--danger); font-size: .875rem; margin-top: .5rem; }
.success-msg { color: var(--success); font-size: .875rem; margin-top: .5rem; }

/* BUTTONS */
.btn-primary { display: inline-block; background: var(--navy); color: var(--white); border: none; padding: .7rem 2rem; font-family: var(--font-body); font-size: 1rem; font-weight: 600; letter-spacing: .04em; border-radius: var(--radius); cursor: pointer; transition: background .2s, transform .1s; width: 100%; }
.btn-primary:hover { background: #253561; }
.btn-primary:active { transform: scale(.98); }
.btn-secondary { display: inline-block; background: transparent; color: var(--navy); border: 2px solid var(--navy); padding: .6rem 1.5rem; font-family: var(--font-body); font-size: .9rem; font-weight: 600; border-radius: var(--radius); cursor: pointer; transition: all .2s; }
.btn-secondary:hover { background: var(--navy); color: var(--white); }
.btn-gold { display: inline-block; background: var(--gold); color: var(--navy); border: none; padding: .6rem 1.5rem; font-family: var(--font-body); font-size: .9rem; font-weight: 700; border-radius: var(--radius); cursor: pointer; transition: background .2s; }
.btn-gold:hover { background: var(--gold-lt); }
.btn-sm { padding: .4rem 1rem !important; font-size: .82rem !important; width: auto !important; }
.btn-danger { background: var(--danger); color: var(--white); border: none; padding: .5rem 1rem; font-family: var(--font-body); font-size: .85rem; border-radius: var(--radius); cursor: pointer; }

/* LOGIN */
.login-page { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; background: radial-gradient(ellipse at 20% 50%, rgba(201,168,76,.12) 0%, transparent 60%), radial-gradient(ellipse at 80% 20%, rgba(26,39,68,.08) 0%, transparent 55%), var(--cream); }
.login-wrap { text-align: center; width: 100%; max-width: 400px; padding: 1rem; }
.login-card { background: var(--white); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 3rem 2.5rem 2.5rem; border-top: 4px solid var(--gold); }
.login-crest { font-size: 2.5rem; color: var(--gold); margin-bottom: 1rem; display: block; }
.org-title { font-family: var(--font-head); font-size: 1.75rem; color: var(--navy); margin-bottom: .25rem; }
.login-sub { color: var(--text-muted); font-size: .9rem; margin-bottom: 2rem; letter-spacing: .03em; }
.field-group { margin-bottom: 1rem; }
.field-group label { display: block; font-size: .85rem; font-weight: 600; color: var(--text-muted); margin-bottom: .35rem; text-align: left; }
.field-group input, .field-group select, .field-group textarea { width: 100%; padding: .75rem 1rem; border: 1.5px solid var(--warm-gray); border-radius: var(--radius); font-family: var(--font-body); font-size: 1rem; background: var(--cream); color: var(--text); transition: border-color .2s; }
.field-group input:focus, .field-group select:focus, .field-group textarea:focus { outline: none; border-color: var(--navy); background: var(--white); }
.login-footer { margin-top: 1.5rem; color: var(--text-muted); font-size: .8rem; }

/* NAV */
.site-nav { position: fixed; top: 0; left: 0; right: 0; height: var(--nav-h); background: var(--navy); display: flex; align-items: center; padding: 0 1.5rem; z-index: 1000; box-shadow: 0 2px 12px rgba(0,0,0,.25); }
.nav-brand { font-family: var(--font-head); color: var(--gold); font-size: 1.2rem; font-weight: 700; text-decoration: none; margin-right: 2rem; white-space: nowrap; }
.nav-links { display: flex; gap: .25rem; flex: 1; }
.nav-links a { color: rgba(255,255,255,.75); text-decoration: none; font-size: .9rem; font-weight: 600; padding: .4rem .85rem; border-radius: var(--radius); letter-spacing: .02em; transition: all .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--white); background: rgba(255,255,255,.12); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 1rem; }
.nav-logout { background: none; border: 1px solid rgba(255,255,255,.3); color: rgba(255,255,255,.8); padding: .3rem .85rem; border-radius: var(--radius); font-size: .85rem; cursor: pointer; font-family: var(--font-body); transition: all .2s; }
.nav-logout:hover { background: rgba(255,255,255,.1); color: var(--white); }
.admin-badge { background: var(--gold); color: var(--navy); font-size: .7rem; font-weight: 700; padding: .15rem .5rem; border-radius: 20px; letter-spacing: .05em; }
/* Version label in upper-right nav: muted so it doesn't compete with navigation */
.nav-version { font-size: .7rem; color: rgba(255,255,255,.4); letter-spacing: .04em; user-select: none; }
/* Admin-only: version becomes a clickable button that opens the changelog */
.nav-version-btn { font-size: .7rem; color: rgba(255,255,255,.4); letter-spacing: .04em; background: none; border: none; cursor: pointer; padding: 0; font-family: var(--font-body); transition: color .15s; }
.nav-version-btn:hover { color: rgba(255,255,255,.75); text-decoration: underline; }

/* Changelog modal */
.changelog-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 9000; display: flex; align-items: center; justify-content: center; }
.changelog-overlay.hidden { display: none; }
.changelog-modal { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-lg); width: min(580px, calc(100vw - 2rem)); max-height: 80vh; display: flex; flex-direction: column; overflow: hidden; }
.changelog-modal-header { background: var(--navy); color: var(--white); padding: 1rem 1.25rem; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.changelog-modal-header h2 { margin: 0; font-size: 1.05rem; font-family: var(--font-body); font-weight: 600; letter-spacing: .03em; }
.changelog-modal-close { background: none; border: none; color: rgba(255,255,255,.7); font-size: 1.2rem; cursor: pointer; padding: 0 .25rem; line-height: 1; }
.changelog-modal-close:hover { color: var(--white); }
.changelog-modal-body { overflow-y: auto; padding: 1.25rem; flex: 1; min-height: 0; }
.changelog-version { margin-bottom: 1.5rem; }
.changelog-version:last-child { margin-bottom: 0; }
.changelog-version-tag { display: inline-block; background: var(--navy); color: var(--white); font-size: .7rem; font-weight: 700; letter-spacing: .06em; padding: .15rem .55rem; border-radius: 20px; margin-bottom: .35rem; }
.changelog-version-tag.current { background: var(--gold); color: var(--navy); }
.changelog-version h3 { margin: 0 0 .5rem; font-size: .95rem; font-family: var(--font-body); font-weight: 600; color: var(--text); display: flex; align-items: center; gap: .5rem; }
.changelog-version ul { margin: 0; padding-left: 1.25rem; color: var(--text-muted); font-size: .88rem; line-height: 1.6; }
.changelog-version ul li { margin-bottom: .2rem; }

/* MAP */
#map { position: fixed; top: var(--nav-h); left: 0; right: 0; bottom: 0; }
.map-search-bar { position: fixed; top: calc(var(--nav-h) + 12px); left: 50%; transform: translateX(-50%); z-index: 900; background: var(--white); border-radius: 8px; box-shadow: var(--shadow); display: flex; align-items: center; padding: .4rem .75rem; gap: .5rem; width: min(460px, calc(100vw - 2rem)); border: 1.5px solid var(--warm-gray); }
.map-search-bar input { flex: 1; border: none; outline: none; font-family: var(--font-body); font-size: .95rem; background: transparent; color: var(--text); }
.map-count-badge { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 900; background: var(--navy); color: var(--white); font-size: .8rem; padding: .3rem .9rem; border-radius: 20px; letter-spacing: .03em; pointer-events: none; }
.leaflet-popup-content-wrapper { border-radius: 8px !important; box-shadow: var(--shadow-lg) !important; border-top: 3px solid var(--gold) !important; padding: 0 !important; overflow: hidden; }
.leaflet-popup-content { margin: 0 !important; width: 240px !important; }
.leaflet-popup-tip { background: var(--white) !important; }
.popup-photo-placeholder { width: 100%; height: 70px; background: linear-gradient(135deg, var(--navy) 0%, #253561 100%); display: flex; align-items: center; justify-content: center; color: var(--gold); font-size: 1.8rem; font-family: var(--font-head); }
.popup-photo { width: 100%; height: 100px; object-fit: cover; display: block; }
.popup-inner { padding: .85rem 1rem; }
.popup-name { font-family: var(--font-head); font-size: 1rem; color: var(--navy); margin-bottom: .15rem; }
.popup-nick { color: var(--text-muted); font-size: .78rem; font-style: italic; margin-bottom: .35rem; }
.popup-detail { font-size: .8rem; color: var(--text-muted); margin-bottom: .1rem; }
.popup-detail strong { color: var(--text); }
.popup-link { display: inline-block; margin-top: .5rem; color: var(--navy); font-size: .8rem; font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--gold); cursor: pointer; }

/* DIRECTORY */
.directory-header { background: var(--navy); padding: 2rem 2rem 1.5rem; color: var(--white); padding-top: calc(var(--nav-h) + 1.5rem); }
.directory-header h1 { font-family: var(--font-head); font-size: 1.8rem; color: var(--gold); margin-bottom: .25rem; }
.directory-header p { color: rgba(255,255,255,.6); font-size: .9rem; }
.directory-filters { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }
.directory-filters input, .directory-filters select { padding: .5rem .85rem; border: 1.5px solid rgba(255,255,255,.2); border-radius: var(--radius); background: rgba(255,255,255,.08); color: var(--white); font-family: var(--font-body); font-size: .9rem; }
.directory-filters input::placeholder { color: rgba(255,255,255,.5); }
.directory-filters select option { background: var(--navy); }
.directory-filters input:focus, .directory-filters select:focus { outline: none; border-color: var(--gold); }
/* 420px minimum gives 3 wide columns on typical desktops; drops to 2 on narrower screens */
.directory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 1.25rem; padding: 1.5rem 2rem; max-width: 1400px; margin: 0 auto; }
/* Fixed height keeps all cards identical. 270px (vs prior 250px) gives a touch more room
   in case a long name wraps to two lines now that ellipsis truncation is removed. */
.member-card { background: var(--white); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; transition: transform .2s, box-shadow .2s; cursor: pointer; border-left: 3px solid transparent; display: flex; flex-direction: column; height: 270px; }
.member-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-left-color: var(--gold); }
.member-card-photo { height: 90px; flex-shrink: 0; background: linear-gradient(135deg, var(--navy), #253561); display: flex; align-items: center; justify-content: center; color: var(--gold); font-family: var(--font-head); font-size: 2rem; position: relative; overflow: hidden; }
.member-card-photo img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
/* flex:1 + overflow:hidden ensures body fills remaining card height and clips any overflow */
.member-card-body { padding: .9rem 1rem; flex: 1; overflow: hidden; }
.member-card-name { font-family: var(--font-head); font-size: 1.05rem; color: var(--navy); }
.member-card-meta { font-size: .8rem; color: var(--text-muted); margin-top: .2rem; }
/* Each tags row is its own line; empty rows collapse to zero height so they don't add phantom spacing */
.member-card-tags { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .5rem; }
.member-card-tags:empty { margin-top: 0; }
.tag { background: var(--warm-gray); color: var(--text-muted); font-size: .72rem; padding: .15rem .5rem; border-radius: 20px; font-weight: 600; }
.tag.gold { background: var(--gold); color: var(--navy); }

/* MEMBER MODAL */
.modal-overlay { position: fixed; inset: 0; background: rgba(26,39,68,.55); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 1rem; backdrop-filter: blur(3px); }
.modal { background: var(--white); border-radius: 12px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; position: relative; }
.modal-header { background: var(--navy); padding: 1.5rem 1.5rem 1rem; display: flex; align-items: flex-start; gap: 1rem; position: relative; }
.modal-avatar { width: 72px; height: 72px; border-radius: 50%; border: 3px solid var(--gold); flex-shrink: 0; background: #253561; display: flex; align-items: center; justify-content: center; color: var(--gold); font-family: var(--font-head); font-size: 1.6rem; overflow: hidden; }
.modal-avatar img { width: 100%; height: 100%; object-fit: cover; }
.modal-title { flex: 1; }
.modal-title h2 { font-family: var(--font-head); color: var(--white); font-size: 1.35rem; }
.modal-title .modal-nick { color: var(--gold-lt); font-size: .88rem; font-style: italic; }
.modal-title .modal-class { color: rgba(255,255,255,.65); font-size: .82rem; margin-top: .2rem; }
.modal-close { position: absolute; top: .75rem; right: .75rem; background: rgba(255,255,255,.1); border: none; color: var(--white); width: 28px; height: 28px; border-radius: 50%; cursor: pointer; font-size: 1rem; display: flex; align-items: center; justify-content: center; transition: background .2s; }
.modal-close:hover { background: rgba(255,255,255,.25); }
.modal-body { padding: 1.5rem; }
.modal-section { margin-bottom: 1.25rem; }
.modal-section h3 { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); margin-bottom: .6rem; padding-bottom: .3rem; border-bottom: 1px solid var(--warm-gray); }
.modal-field { display: flex; gap: .5rem; margin-bottom: .35rem; font-size: .88rem; }
.modal-field .label { color: var(--text-muted); min-width: 120px; flex-shrink: 0; }
.modal-field .value { color: var(--text); word-break: break-word; }
.modal-field a { color: var(--navy); }
/* Address directions links: no underline at rest, underline on hover; icon stays vertically centered */
.modal-field .value a[href*="maps.google"] { text-decoration: none; display: inline-flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.modal-field .value a[href*="maps.google"]:hover { text-decoration: underline; }

/* IN MEMORIAM */
.memoriam-header { background: var(--navy); padding: 2.5rem 2rem 2rem; text-align: center; border-bottom: 3px solid var(--gold); padding-top: calc(var(--nav-h) + 2rem); }
.memoriam-header h1 { font-family: var(--font-head); font-size: 2rem; color: var(--gold); margin-bottom: .4rem; }
.memoriam-header p { color: rgba(255,255,255,.65); font-size: .95rem; max-width: 500px; margin: 0 auto; }
.memoriam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 2rem; padding: 2rem; max-width: 1200px; margin: 0 auto; }
.memoriam-card { background: var(--white); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; border-top: 3px solid var(--gold); }
.memoriam-card-header { background: linear-gradient(135deg, var(--navy), #253561); padding: 1.25rem; display: flex; align-items: center; gap: 1rem; }
.memoriam-avatar { width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--gold); background: #1a2744; display: flex; align-items: center; justify-content: center; color: var(--gold); font-family: var(--font-head); font-size: 1.3rem; overflow: hidden; flex-shrink: 0; }
.memoriam-avatar img { width: 100%; height: 100%; object-fit: cover; }
.memoriam-name { font-family: var(--font-head); color: var(--white); font-size: 1.1rem; }
.memoriam-years { color: rgba(255,255,255,.6); font-size: .82rem; margin-top: .15rem; }
.memoriam-card-body { padding: 1.25rem; }
.memoriam-tribute { background: var(--cream); border-radius: 6px; padding: .75rem; margin-bottom: .6rem; border-left: 2px solid var(--gold); }
.memoriam-tribute p { font-size: .88rem; color: var(--text); line-height: 1.5; }
.memoriam-tribute .tribute-author { font-size: .78rem; color: var(--text-muted); margin-top: .4rem; font-style: italic; }
.memoriam-add-btn { display: block; width: 100%; background: transparent; border: 1.5px dashed var(--warm-gray); color: var(--text-muted); padding: .6rem; border-radius: 6px; cursor: pointer; font-family: var(--font-body); font-size: .85rem; margin-top: .75rem; transition: all .2s; }
.memoriam-add-btn:hover { border-color: var(--gold); color: var(--navy); }
.tribute-form { background: var(--cream); border-radius: 8px; padding: 1rem; margin-top: .75rem; }
.tribute-form textarea { height: 80px; resize: vertical; font-size: .9rem; }
.tribute-form-actions { display: flex; gap: .5rem; margin-top: .6rem; justify-content: flex-end; }

/* ADMIN */
.admin-header { background: var(--navy); padding: 1.5rem 2rem; border-bottom: 3px solid var(--gold); padding-top: calc(var(--nav-h) + 1.5rem); }
.admin-header h1 { font-family: var(--font-head); color: var(--gold); font-size: 1.6rem; }
.admin-header p { color: rgba(255,255,255,.6); font-size: .88rem; margin-top: .2rem; }
.admin-tabs { display: flex; gap: 0; background: var(--white); border-bottom: 2px solid var(--warm-gray); padding: 0 2rem; overflow-x: auto; }
.admin-tab { padding: .85rem 1.25rem; font-family: var(--font-body); font-size: .9rem; font-weight: 600; color: var(--text-muted); background: none; border: none; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap; transition: all .2s; }
.admin-tab:hover { color: var(--navy); }
.admin-tab.active { color: var(--navy); border-bottom-color: var(--gold); }
.admin-content { padding: 2rem; max-width: 900px; }
.admin-panel { display: none; }
.admin-panel.active { display: block; }
.admin-card { background: var(--white); border-radius: 8px; box-shadow: var(--shadow); padding: 1.5rem; margin-bottom: 1.5rem; }
.admin-card h2 { font-family: var(--font-head); font-size: 1.2rem; color: var(--navy); margin-bottom: .35rem; }
.admin-card p { color: var(--text-muted); font-size: .88rem; margin-bottom: 1rem; line-height: 1.5; }

/* IMPORT */
.import-drop-zone { border: 2px dashed var(--warm-gray); border-radius: 8px; padding: 2.5rem; text-align: center; transition: all .2s; cursor: pointer; background: var(--cream); }
.import-drop-zone:hover, .import-drop-zone.drag-over { border-color: var(--gold); background: rgba(201,168,76,.05); }
.import-drop-zone .drop-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.import-drop-zone p { color: var(--text-muted); font-size: .9rem; }
.import-drop-zone strong { color: var(--navy); }
.import-preview { margin-top: 1.25rem; overflow-x: auto; }
.import-preview table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.import-preview th { background: var(--navy); color: var(--white); padding: .4rem .6rem; text-align: left; white-space: nowrap; }
.import-preview td { padding: .35rem .6rem; border-bottom: 1px solid var(--warm-gray); white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.import-preview tr:nth-child(even) td { background: var(--cream); }
.import-stats { display: flex; gap: 1rem; margin: 1rem 0; flex-wrap: wrap; }
.import-stat { background: var(--cream); border-radius: 6px; padding: .6rem 1rem; text-align: center; flex: 1; min-width: 100px; }
.import-stat .stat-num { font-size: 1.5rem; font-weight: 700; color: var(--navy); font-family: var(--font-head); }
.import-stat .stat-lbl { font-size: .75rem; color: var(--text-muted); }
.progress-bar-wrap { background: var(--warm-gray); border-radius: 20px; height: 10px; overflow: hidden; margin: .5rem 0; }
.progress-bar-fill { background: var(--gold); height: 100%; border-radius: 20px; transition: width .4s; }

/* SETTINGS */
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: .6rem 0; border-bottom: 1px solid var(--warm-gray); }
.toggle-row label { font-size: .9rem; color: var(--text); }
.toggle { position: relative; display: inline-block; width: 40px; height: 22px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: var(--warm-gray); border-radius: 22px; cursor: pointer; transition: .2s; }
.toggle-slider:before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: .2s; }
.toggle input:checked + .toggle-slider { background: var(--navy); }
.toggle input:checked + .toggle-slider:before { transform: translateX(18px); }

/* IMPORT LOG */
.import-log-row { display: flex; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--warm-gray); align-items: center; font-size: .82rem; }
.import-log-row .log-date { color: var(--text-muted); min-width: 140px; }
.import-log-row .log-count { font-weight: 700; color: var(--navy); }
.import-log-row .log-status { margin-left: auto; }
.badge-success { background: #d4edda; color: var(--success); font-size: .75rem; padding: .15rem .5rem; border-radius: 20px; font-weight: 700; }
.badge-warn { background: #fff3cd; color: #856404; font-size: .75rem; padding: .15rem .5rem; border-radius: 20px; font-weight: 700; }

/* ROLES */
.role-row { display: flex; gap: .75rem; align-items: center; padding: .5rem 0; border-bottom: 1px solid var(--warm-gray); font-size: .88rem; flex-wrap: wrap; }
.role-row .role-name { font-weight: 600; color: var(--navy); min-width: 160px; }
.role-row .role-term { color: var(--text-muted); }

/* MODERATION */
.mod-item { background: var(--cream); border-radius: 6px; padding: 1rem; margin-bottom: .75rem; border-left: 3px solid var(--warm-gray); }
.mod-item.pending { border-left-color: var(--gold); }
.mod-item-meta { font-size: .78rem; color: var(--text-muted); margin-bottom: .4rem; }
.mod-item-text { font-size: .9rem; color: var(--text); margin-bottom: .6rem; line-height: 1.5; }
.mod-item-actions { display: flex; gap: .5rem; }

/* HAMBURGER / MOBILE NAV */
.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: .4rem;
  margin-left: auto;
  flex-direction: column;
  gap: 5px;
}
.nav-hamburger span {
  display: block; width: 22px; height: 2px;
  background: rgba(255,255,255,.85); border-radius: 2px; transition: all .25s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-mobile-menu {
  display: none; position: fixed; top: var(--nav-h); left: 0; right: 0;
  background: var(--navy); border-top: 1px solid rgba(255,255,255,.1);
  z-index: 999; padding: .75rem 0 1rem; box-shadow: 0 8px 24px rgba(0,0,0,.3);
}
.nav-mobile-menu.open { display: block; }
.nav-mobile-menu a {
  display: block; color: rgba(255,255,255,.85); text-decoration: none;
  font-size: 1rem; font-weight: 600; padding: .75rem 1.5rem;
  border-left: 3px solid transparent; transition: all .15s;
}
.nav-mobile-menu a:hover,
.nav-mobile-menu a.active { color: var(--white); border-left-color: var(--gold); background: rgba(255,255,255,.06); }
.nav-mobile-menu .mobile-logout {
  display: block; margin: .75rem 1.5rem 0; background: none;
  border: 1px solid rgba(255,255,255,.25); color: rgba(255,255,255,.75);
  padding: .6rem 1rem; border-radius: var(--radius); font-family: var(--font-body);
  font-size: .9rem; cursor: pointer; width: calc(100% - 3rem); text-align: left;
}

/* RESPONSIVE */
@media (max-width: 700px) {
  .nav-links { display: none; }
  .nav-right { display: none; }
  .nav-hamburger { display: flex; }

  .directory-grid { grid-template-columns: 1fr 1fr; gap: .75rem; padding: 1rem; }
  .memoriam-grid { grid-template-columns: 1fr; padding: 1rem; }
  .admin-content { padding: 1rem; }
  .admin-tabs { padding: 0 .5rem; }
  .admin-tab { padding: .75rem .75rem; font-size: .82rem; }

  .map-search-bar { width: calc(100vw - 1rem); top: calc(var(--nav-h) + 8px); }
  .map-count-badge { bottom: 16px; font-size: .75rem; }

  .modal { max-height: 95vh; }
  .modal-header { padding: 1rem; }
  .modal-body { padding: 1rem; }

  .directory-header { padding: 1.25rem 1rem 1rem; padding-top: calc(var(--nav-h) + 1rem); }
  .memoriam-header { padding: 1.5rem 1rem 1rem; padding-top: calc(var(--nav-h) + 1rem); }
  .admin-header { padding: 1rem; padding-top: calc(var(--nav-h) + 1rem); }

  .import-stats { gap: .5rem; }
  .import-stat { min-width: 80px; }

  .tribute-form-actions { flex-direction: column; }
}
@media (max-width: 480px) {
  .directory-grid { grid-template-columns: 1fr; }
  .nav-brand { font-size: 1rem; margin-right: 0; }
  .modal-avatar { width: 56px; height: 56px; font-size: 1.3rem; }
}

/* ── MAP PIN LABELS ─────────────────────────────────────────── */
.pin-label {
  background: var(--white) !important;
  border: 1px solid var(--gold) !important;
  border-radius: 4px !important;
  color: var(--navy) !important;
  font-family: var(--font-body) !important;
  font-size: .75rem !important;
  font-weight: 600 !important;
  padding: 2px 6px !important;
  box-shadow: 0 2px 6px rgba(0,0,0,.15) !important;
  white-space: nowrap !important;
}
.pin-label::before { display: none !important; }
.custom-pin { background: transparent !important; border: none !important; }

/* ── DIRECTORY CARD STYLES ───────────────────────────────────── */

/* Style A: Portrait — tall card, photo fills top in 3:4 ratio.
   Updated from 180px to 260px so names have room without wrapping. */
.card-style-portrait .directory-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.card-style-portrait .member-card { display: flex; flex-direction: column; height: auto; }
.card-style-portrait .member-card-photo {
  height: 200px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--navy), #253561);
}
.card-style-portrait .member-card-body { padding: .75rem; flex: 1; }
.card-style-portrait .member-card-name { font-size: .95rem; }

/* Style B: Circle — centered circular avatar, details below.
   Updated from 160px to 200px. */
.card-style-circle .directory-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.card-style-circle .member-card { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 1.25rem 1rem 1rem; height: auto; }
.card-style-circle .member-card-photo {
  width: 80px; height: 80px; border-radius: 50%;
  flex-shrink: 0; margin-bottom: .75rem;
  border: 3px solid var(--gold);
  background: linear-gradient(135deg, var(--navy), #253561);
  font-size: 1.5rem;
}
.card-style-circle .member-card-body { padding: 0; width: 100%; }
.card-style-circle .member-card-name { font-size: .95rem; }
.card-style-circle .member-card-meta { font-size: .78rem; }
.card-style-circle .member-card-tags { justify-content: center; }
.card-style-circle .member-card-tags .tag { font-size: .7rem; }
.card-style-circle .member-card > div:first-child { display: flex; justify-content: center; }

/* Style C: Row — horizontal layout with square photo.
   Updated from 280px to 420px to match base grid width. */
.card-style-row .directory-grid {
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
}
.card-style-row .member-card { display: flex; flex-direction: row; align-items: stretch; height: auto; }
.card-style-row .member-card-photo {
  width: 90px; height: 90px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--navy), #253561);
}
.card-style-row .member-card-body { padding: .75rem .9rem; flex: 1; min-width: 0; }
.card-style-row .member-card-name { font-size: .95rem; }

/* Style D: Minimal — no photo, text-only, very dense.
   Updated from 200px to 320px. */
.card-style-minimal .directory-grid {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.card-style-minimal .member-card-photo { display: none; }
.card-style-minimal .member-card { border-left: 3px solid var(--gold); padding: .75rem 1rem; height: auto; }
.card-style-minimal .member-card:hover { border-left-color: var(--gold); }
.card-style-minimal .member-card-body { padding: 0; }
.card-style-minimal .member-card-name { font-size: .95rem; }

/* ── CARD STYLE MOBILE OVERRIDES ────────────────────────────────
   These MUST appear after the card style definitions above so they
   win the cascade at equal specificity. Forces 2-column layout on
   mobile for all card styles. */
@media (max-width: 700px) {
  .card-style-portrait .directory-grid,
  .card-style-circle .directory-grid,
  .card-style-row .directory-grid,
  .card-style-minimal .directory-grid { grid-template-columns: 1fr 1fr; gap: .75rem; padding: 1rem; }
}

/* ── PRIVACY SETTINGS (edit modal) ──────────────────────────── */
.privacy-toggle { position:relative; display:inline-block; width:44px; height:24px; flex-shrink:0; cursor:pointer; }
.privacy-toggle input { opacity:0; width:0; height:0; position:absolute; }
.privacy-slider { position:absolute; inset:0; background:#cbd5e1; border-radius:24px; transition:.2s; }
.privacy-slider::before { content:''; position:absolute; height:18px; width:18px; left:3px; bottom:3px; background:var(--white); border-radius:50%; transition:.2s; }
.privacy-toggle input:checked + .privacy-slider { background:var(--navy); }
.privacy-toggle input:checked + .privacy-slider::before { transform:translateX(20px); }

.privacy-pills { display:flex; gap:.4rem; flex-wrap:wrap; }
.privacy-pill { position:relative; display:inline-flex; align-items:center; gap:.35rem; padding:.35rem .8rem; border:1.5px solid var(--warm-gray); border-radius:20px; cursor:pointer; font-size:.82rem; font-weight:500; color:var(--text-muted); transition:.15s; user-select:none; }
.privacy-pill input { position:absolute; opacity:0; width:0; height:0; }
.privacy-pill:has(input:checked) { border-color:var(--navy); background:var(--navy); color:var(--white); }

/* ── IMPORT MATCH CARDS ──────────────────────────────────────── */
.import-match-card { border:1px solid var(--warm-gray); border-radius:6px; margin-bottom:.5rem; overflow:hidden; transition:opacity .2s; }
.import-match-header { display:flex; align-items:center; gap:.65rem; padding:.55rem .75rem; background:var(--cream); cursor:pointer; user-select:none; flex-wrap:wrap; }
.import-match-header:hover { background:var(--warm-gray); }
.import-match-badge { font-size:.72rem; font-weight:600; background:var(--gold); color:var(--navy); border-radius:10px; padding:.1rem .5rem; flex-shrink:0; }
.import-match-chevron { margin-left:auto; color:var(--text-muted); font-size:.8rem; }
.import-match-body { padding:.75rem; border-top:1px solid var(--warm-gray); background:var(--white); }
.import-diff-table { width:100%; border-collapse:collapse; font-size:.82rem; margin-bottom:.25rem; }
.import-diff-table th { background:var(--navy); color:var(--white); padding:.35rem .6rem; text-align:left; font-weight:600; }
.import-diff-table td { padding:.35rem .6rem; border-bottom:1px solid var(--warm-gray); vertical-align:top; }
.import-diff-table td:first-child { font-weight:500; white-space:nowrap; width:110px; }
.import-diff-table td:nth-child(2) { color:var(--text-muted); max-width:180px; }
.import-diff-table td:nth-child(3) { color:var(--navy); max-width:180px; }
.import-diff-table td:last-child { text-align:center; width:60px; }
.import-diff-table tr:last-child td { border-bottom:none; }
.import-match-fuzzy { border-color:#f0c040; }
.import-match-fuzzy .import-match-header { background:#fffbeb; }
.import-match-fuzzy .import-match-header:hover { background:#fef3c7; }
.import-match-badge-fuzzy { background:#92400e !important; color:white !important; }
