/* ================================================================
   shared.css — rules common to every new-HHS page
   ================================================================ */

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
body  { font-family: system-ui, -apple-system, sans-serif;
        margin: 0; background: #f3f4f6; color: #1f2937; line-height: 1.5; }
a     { color: inherit; }

/* ---- Page header ---- */
.page-header  { background: #1e3a5f; color: #fff; padding: 0.75rem 1.5rem;
                display: flex; align-items: center; gap: 1rem; }
.header-start { display: flex; align-items: center; gap: 0.75rem; flex: 1; min-width: 0; }
.header-end   { flex: 1; display: flex; justify-content: flex-end; align-items: center; gap: 0.5rem; }
.page-header h1 { margin: 0; font-size: 1.15rem; font-weight: 600; }
.page-header a  { color: #93c5fd; text-decoration: none; font-size: 0.9rem; }
.page-header a:hover { text-decoration: underline; }
.header-home-btn { font-size: 2.2rem !important; line-height: 1; color: #fff !important;
                   flex-shrink: 0; opacity: 0.75; }
.header-home-btn:hover { opacity: 1; text-decoration: none !important; }

/* ---- Sunday Roster badge (header) — hidden on narrow screens ---- */
.header-roster-badge { color: #fff; text-decoration: none; font-size: 0.9rem;
                       white-space: nowrap; margin-right: 1rem; flex-shrink: 0; }
.header-roster-badge:hover { text-decoration: underline; }

/* ---- Sunday Roster item inside hamburger — visible only on narrow screens ---- */
.nav-roster-item { display: none !important; }
@media (max-width: 750px) {
    .header-roster-badge { display: none; }
    .nav-roster-item { display: block !important; border-top: 1px solid #d1d5db;
                       margin-top: 0.3rem; padding-top: 0.1rem; }
    .header-user { max-width: 5rem; flex-shrink: 1; }
    .header-username { font-size: 0.65rem; line-height: 1.25; overflow-wrap: break-word; text-align: right; }
}

/* ---- Header user / login widget ---- */
.header-user { display: flex; flex-direction: column; align-items: flex-end; gap: 0.1rem; flex-shrink: 0; }
.header-user a { font-size: 0.8rem; }
.header-username { font-size: 0.78rem; color: #bfdbfe; }

/* ---- Hamburger nav ---- */
.header-nav  { position: relative; flex-shrink: 0; }
.hamburger-btn { background: none; border: none; cursor: pointer; padding: 6px 8px;
                 border-radius: 5px; color: #fff; line-height: 0; }
.hamburger-btn:hover { background: rgba(255,255,255,.15); }
.nav-menu { position: absolute; top: calc(100% + 10px); left: 50%;
            transform: translateX(-50%);
            background: #fff; border-radius: 8px; min-width: 220px;
            max-height: 90vh; overflow-y: auto;
            box-shadow: 0 4px 20px rgba(0,0,0,.25);
            list-style: none; padding: 0.2rem 0; margin: 0; z-index: 1000; }
.nav-menu::before { content: ''; position: absolute; top: -6px; left: 50%;
                    transform: translateX(-50%);
                    border: 6px solid transparent;
                    border-top: 0; border-bottom-color: #fff; }
.nav-menu li a { display: block; padding: 0.3rem 1.1rem; color: #1f2937;
                 text-decoration: none; font-size: 0.95rem; white-space: nowrap; }
.nav-menu li a:hover { background: #eff6ff; color: #1e3a5f; font-weight: 500; }

/* ---- Login form ---- */
.login-box   { background: #fff; border-radius: 10px; padding: 2rem;
               box-shadow: 0 1px 3px rgba(0,0,0,.08);
               max-width: 400px; margin: 0 auto; }
.login-box h2 { margin: 0 0 1.25rem; font-size: 1.25rem; }
.login-hint  { color: #6b7280; font-size: 0.9rem; margin: 0 0 1rem; }
.login-field { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 1rem; }
.login-field label { font-size: 0.875rem; font-weight: 500; color: #374151; }
.login-field input { padding: 0.5rem 0.75rem; border: 1px solid #d1d5db;
                     border-radius: 6px; font-size: 1rem; }
.login-field input:focus { outline: 2px solid #3b82f6; border-color: transparent; }
.pw-wrapper       { position: relative; }
.pw-wrapper input { width: 100%; box-sizing: border-box; padding-right: 2.5rem; }
.pw-toggle        { position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%);
                    background: none; border: none; cursor: pointer; padding: 0.2rem;
                    color: #9ca3af; line-height: 0; }
.pw-toggle:hover  { color: #374151; }
.login-btn   { width: 100%; padding: 0.6rem; background: #1e3a5f; color: #fff;
               border: none; border-radius: 6px; font-size: 1rem;
               cursor: pointer; margin-top: 0.25rem; }
.login-btn:hover { background: #2d5a8e; }
.login-error { color: #b91c1c; background: #fef2f2; border: 1px solid #fca5a5;
               border-radius: 6px; padding: 0.5rem 0.75rem; margin-bottom: 1rem;
               font-size: 0.9rem; }

/* ---- TOTP digit boxes ---- */
.totp-boxes { display: flex; gap: 0.4rem; justify-content: center; margin-bottom: 1.25rem; }
.totp-digit { width: 2.4rem; height: 2.8rem; text-align: center; font-size: 1.25rem;
              font-weight: 600; font-family: monospace;
              border: 2px solid #d1d5db; border-radius: 6px;
              caret-color: transparent; }
.totp-digit:focus { border-color: #3b82f6; outline: none; }

/* ---- Search bar ---- */
.search-bar { background: #fff; border-bottom: 1px solid #e5e7eb; padding: 0.6rem 1.5rem; }
.search-bar form { max-width: 800px; display: flex; flex-direction: column; gap: 0.45rem; }
.search-main-row { display: flex; gap: 0.5rem; }
.search-main-row input { flex: 1; padding: 0.5rem 0.75rem; border: 1px solid #d1d5db;
                          border-radius: 6px; font-size: 1rem; }
.search-main-row input:focus { outline: 2px solid #3b82f6; border-color: transparent; }
.search-main-row button { padding: 0.5rem 1.25rem; background: #1e3a5f; color: #fff;
                           border: none; border-radius: 6px; cursor: pointer; font-size: 0.9rem;
                           font-weight: 600; font-family: inherit; white-space: nowrap; }
.search-main-row button:hover { background: #2d5a8e; }
.add-record-btn       { display: inline-block; background: #1e3a5f; color: #fff;
                        font-size: 0.9rem; font-weight: 600; text-decoration: none;
                        padding: 0.4rem 1rem; border-radius: 4px; margin: 0.8rem 0.4rem 0 0; }
.add-record-btn:hover { background: #2d5a8e; }
.search-main-row .add-record-btn { margin: 0; }

/* ---- Layout ---- */
.container { max-width: 1100px; margin: 1.5rem auto; padding: 0 1rem; }
.welcome   { background: #fff; border-radius: 10px; padding: 1.5rem;
             box-shadow: 0 1px 3px rgba(0,0,0,.08); max-width: 640px; }
.welcome p { margin: 0.4rem 0; }
.search-hint { color: #6b7280; font-size: 0.9rem; margin-top: 0.75rem !important; }
.search-hint code { background: #f3f4f6; padding: 0 4px; border-radius: 3px; }
.no-results { color: #6b7280; }

/* ---- Message box ---- */
.message-box { background: #fff; border-radius: 10px; padding: 1.25rem 1.5rem;
               box-shadow: 0 1px 3px rgba(0,0,0,.08); margin-top: 1.5rem; margin-bottom: 1.5rem; }
.message-box > *:first-child { margin-top: 0; }
.message-box > *:last-child  { margin-bottom: 0; }
.message-box p { margin-top: 0.35rem; margin-bottom: 0.35rem; }

/* ---- Highlight ---- */
mark { background: #fef08a; color: inherit; padding: 0 2px; border-radius: 2px; }

/* ---- Browse / module button grid (used by hhs.php and collection pages) ---- */
.browse-section  { margin-top: 1.5rem; }
.browse-heading  { font-size: 1.1rem; font-weight: 600; color: #1f2937;
                   margin: 0 0 0.85rem; }
.module-buttons  { display: grid;
                   grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
                   gap: 0.6rem; }
.module-btn      { display: block; background: #f0f7ff; border: 2px solid #93c5fd;
                   border-radius: 8px; padding: 0.65rem 1rem;
                   text-decoration: none; color: #1e3a5f; font-size: 0.95rem;
                   font-weight: 500;
                   box-shadow: 0 2px 4px rgba(0,0,0,.08);
                   transition: box-shadow .15s, border-color .15s, background .15s; }
.module-btn:hover { background: #dbeafe; box-shadow: 0 4px 12px rgba(0,0,0,.15);
                    border-color: #3b82f6; color: #1e3a5f; }
.module-btn--nolink { background: #f9fafb; border-color: #d1d5db; color: #9ca3af;
                      font-weight: 400; cursor: default; }
.module-btn--nolink:hover { background: #f9fafb; box-shadow: 0 2px 4px rgba(0,0,0,.08);
                             border-color: #d1d5db; }
.module-btn-count { font-size: 0.8rem; color: #4b6a8f; }

/* ---- Site footer (back-to-home button + recent uploads) ---- */
.site-footer { text-align: center; padding: 1.5rem 1rem; margin-top: 2rem;
               display: flex; justify-content: center; align-items: center;
               gap: 0.75rem; flex-wrap: wrap; }
.site-footer-btn { display: inline-block; padding: 0.55rem 1.4rem;
                   background: #1e3a5f; color: #fff; border-radius: 6px;
                   text-decoration: none; font-size: 0.95rem; font-weight: 500; }
.site-footer-btn:hover { background: #2d5a8e; }
.site-footer-btn--outline { background: transparent; color: #1e3a5f;
                             border: 2px solid #1e3a5f; }
.site-footer-btn--outline:hover { background: #1e3a5f; color: #fff; }

/* ---- Admin sidebar (spanner icon + slide-out panel) ---- */
.admin-sidebar-btn { background: none; border: none; cursor: pointer; color: #fff;
                     font-size: 1.25rem; padding: 4px 6px; border-radius: 5px;
                     opacity: 0.8; flex-shrink: 0; line-height: 1; }
.admin-sidebar-btn:hover { opacity: 1; background: rgba(255,255,255,.15); }
.admin-sidebar { position: fixed; top: 0; right: -300px; width: 280px; height: 100%;
                 background: #fff; box-shadow: -4px 0 20px rgba(0,0,0,.2);
                 transition: right 0.25s ease; z-index: 2000;
                 display: flex; flex-direction: column; }
.admin-sidebar.open { right: 0; }
.admin-sidebar-hdr { display: flex; align-items: center; justify-content: space-between;
                     padding: 0.85rem 1.1rem; background: #1e3a5f; color: #fff;
                     font-weight: 600; font-size: 0.95rem; flex-shrink: 0; }
.admin-sidebar-close { background: none; border: none; cursor: pointer; color: #fff;
                       font-size: 1.1rem; padding: 0; line-height: 1; opacity: 0.8; }
.admin-sidebar-close:hover { opacity: 1; }
.admin-sidebar-nav { padding: 0.85rem; display: flex; flex-direction: column; gap: 0.4rem;
                     overflow-y: auto; }
.admin-sidebar-nav a { display: block; padding: 0.55rem 0.9rem; background: #f3f4f6;
                        border-radius: 6px; color: #1f2937; text-decoration: none;
                        font-size: 0.9rem; border: 1px solid #e5e7eb; }
.admin-sidebar-nav a:hover { background: #eff6ff; border-color: #93c5fd; color: #1e3a5f; }
.admin-sb-section { font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
                    letter-spacing: 0.08em; color: #6b7280; padding: 0.5rem 0 0.1rem;
                    border-top: 1px solid #e5e7eb; margin-top: 0.25rem; }
.admin-sb-section:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.admin-table-select { width: 100%; padding: 0.4rem 0.5rem; border: 1px solid #d1d5db;
                      border-radius: 5px; font-size: 0.875rem; background: #fff; }
.table-ac-wrap { position: relative; }
.table-ac-input { width: 100%; padding: 0.4rem 0.5rem; border: 1px solid #d1d5db;
                  border-radius: 5px; font-size: 0.875rem; background: #fff;
                  box-sizing: border-box; }
.table-ac-input:focus { outline: none; border-color: #93c5fd; box-shadow: 0 0 0 2px rgba(147,197,253,.35); }
.table-ac-list { position: absolute; top: 100%; left: 0; right: 0; z-index: 200;
                 margin: 2px 0 0; padding: 0; list-style: none;
                 background: #fff; border: 1px solid #d1d5db; border-radius: 5px;
                 max-height: 600px; overflow-y: auto;
                 box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.table-ac-list li { padding: 0.1rem 0.75rem; font-size: 0.875rem; cursor: pointer; }
.table-ac-list li:hover, .table-ac-list li.ac-active { background: #eff6ff; color: #1e3a5f; }

/* ---- Shared module utilities (used by collection, events, exhibition, quilt, etc.) ---- */
.back-link       { display: inline-block; color: #2980b9; text-decoration: none;
                   font-size: 0.9rem; margin-bottom: 1rem; }
.back-link:hover { text-decoration: underline; }

.edit-link       { display: inline-flex; align-items: center; gap: 0.3rem;
                   font-size: 0.85rem; color: #2980b9; text-decoration: none; }
.edit-link:hover { text-decoration: underline; }
.edit-link img   { width: 14px; height: 14px; }

.result-count    { color: #6b7280; margin-bottom: 0.75rem; font-size: 0.95rem; }

.image-nav       { display: flex; gap: 1.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.image-nav-prev,
.image-nav-next  { display: inline-block; color: #2980b9; text-decoration: none;
                   font-size: 0.95rem; font-weight: 600; }
.image-nav-prev:hover,
.image-nav-next:hover { text-decoration: underline; }