/* Council 12050 – site styles (Bootstrap 5.3 base) */
:root {
    --kofc-blue: #1f4e8c;
    --kofc-blue-dark: #163a69;
    --kofc-gold: #c9a227;
    --bs-primary: var(--kofc-blue);
    --bs-primary-rgb: 31, 78, 140;
    --bs-link-color: var(--kofc-blue);
    --bs-link-color-rgb: 31, 78, 140;
    --bs-link-hover-color: var(--kofc-blue-dark);
}

html, body { height: 100%; }
body { display: flex; flex-direction: column; min-height: 100vh; background: #f6f7f9; }

.btn-primary {
    --bs-btn-bg: var(--kofc-blue); --bs-btn-border-color: var(--kofc-blue);
    --bs-btn-hover-bg: var(--kofc-blue-dark); --bs-btn-hover-border-color: var(--kofc-blue-dark);
    --bs-btn-active-bg: var(--kofc-blue-dark); --bs-btn-active-border-color: var(--kofc-blue-dark);
    --bs-btn-disabled-bg: var(--kofc-blue); --bs-btn-disabled-border-color: var(--kofc-blue);
}
.btn-outline-primary {
    --bs-btn-color: var(--kofc-blue); --bs-btn-border-color: var(--kofc-blue);
    --bs-btn-hover-bg: var(--kofc-blue); --bs-btn-hover-border-color: var(--kofc-blue);
    --bs-btn-active-bg: var(--kofc-blue-dark);
}
.bg-primary { background-color: var(--kofc-blue) !important; }
.text-primary { color: var(--kofc-blue) !important; }
.border-primary { border-color: var(--kofc-blue) !important; }
.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: #7f9fca; box-shadow: 0 0 0 .2rem rgba(31, 78, 140, .2);
}
.form-check-input:checked { background-color: var(--kofc-blue); border-color: var(--kofc-blue); }

.skip-link { position: absolute; left: 1rem; top: .5rem; z-index: 2000; background: #fff; padding: .5rem 1rem; }

/* Navbar */
.navbar { border-bottom: 3px solid var(--kofc-gold); }
.navbar-brand .brand-text { font-weight: 600; letter-spacing: .02em; }
.navbar .nav-link.active { font-weight: 600; text-decoration: underline; text-decoration-color: var(--kofc-gold); text-underline-offset: .4rem; }
.admin-menu { max-height: 80vh; overflow-y: auto; }
.admin-menu .bi { width: 1.25rem; display: inline-block; }

/* Page headings */
.page-title { font-size: 1.75rem; font-weight: 600; color: var(--kofc-blue-dark); margin-bottom: 1rem; }
.page-title small { font-size: 1rem; color: #6c757d; font-weight: 400; }

/* Cards */
.card { border: 1px solid #e3e6eb; box-shadow: 0 1px 3px rgba(16, 24, 40, .05); }
.card-header.bg-primary { color: #fff; }

/* Page messages */
.page-message { border-left: 4px solid var(--kofc-blue); }
.page-message.style-Highlight { border-left-color: var(--kofc-gold); background: #fffbea; }
.page-message.style-Alert { border-left-color: #b42318; background: #fff4f2; }
.page-message img.message-image { max-width: 100%; max-height: 260px; object-fit: contain; }
.page-message p:last-child { margin-bottom: 0; }

/* Home */
.events-list .event-item { padding: .6rem 0; border-bottom: 1px solid #eef0f3; display: flex; gap: .75rem; }
.events-list .event-item:last-child { border-bottom: 0; }
.event-date-badge {
    flex: 0 0 3.25rem; text-align: center; border-radius: .5rem; background: #eef3fa; color: var(--kofc-blue-dark);
    line-height: 1.1; padding: .35rem 0;
}
.event-date-badge .m { font-size: .7rem; text-transform: uppercase; font-weight: 600; }
.event-date-badge .d { font-size: 1.35rem; font-weight: 700; }
.event-icon { width: 2.25rem; height: 2.25rem; object-fit: contain; }
.carousel-item img { width: 100%; height: clamp(220px, 45vw, 460px); object-fit: cover; border-radius: .5rem .5rem 0 0; background: #222; }
.carousel-caption-below { background: var(--kofc-blue-dark); color: #fff; padding: .75rem 1rem; border-radius: 0 0 .5rem .5rem; min-height: 4.25rem; }
.carousel-caption-below h5 { margin: 0; font-size: 1.05rem; }
.carousel-caption-below p { margin: 0; font-size: .9rem; opacity: .9; }

/* Calendar */
#calendar { background: #fff; padding: .75rem; border-radius: .5rem; border: 1px solid #e3e6eb; }
.fc .fc-toolbar-title { font-size: 1.25rem; }
.fc .fc-button-primary { background: var(--kofc-blue); border-color: var(--kofc-blue); }
.fc .fc-button-primary:hover, .fc .fc-button-primary:not(:disabled).fc-button-active { background: var(--kofc-blue-dark); border-color: var(--kofc-blue-dark); }
.fc-event { cursor: pointer; }
.fc a { text-decoration: none; color: inherit; }
.fc .fc-event-title { white-space: normal; }
.fc .fc-daygrid-event-dot { display: none; }
.fc .fc-daygrid-dot-event { display: block; padding: 1px 3px; background: #eef3fa; border-radius: 3px; margin-bottom: 2px; }
.fc .fc-event-time { font-weight: 600; margin-right: 2px; }
.fc .fc-daygrid-event { white-space: normal; }
@media (max-width: 575.98px) {
    .fc .fc-toolbar { flex-wrap: wrap; gap: .5rem; }
    .fc .fc-toolbar-title { font-size: 1.05rem; }
}

/* Council */
.officer-table td:first-child { width: 45%; color: #475467; }
.council-photo { max-height: 420px; object-fit: cover; width: 100%; }
.gk-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #e9ecef; }
.gk-card .placeholder-photo { aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; background: #e9ecef; color: #98a2b3; font-size: 3rem; }

/* Gallery */
.album-card img, .album-card .no-cover { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #e9ecef; }
.album-card .no-cover { display: flex; align-items: center; justify-content: center; font-size: 2.5rem; color: #98a2b3; }
.album-card a { text-decoration: none; color: inherit; }
.album-card:hover { box-shadow: 0 4px 14px rgba(16, 24, 40, .12); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; }
.photo-grid button { border: 0; padding: 0; background: #e9ecef; border-radius: .375rem; overflow: hidden; aspect-ratio: 1 / 1; }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.photo-grid button:hover img, .photo-grid button:focus img { transform: scale(1.04); }
#photoModal .modal-content { background: #111; }
#photoModal img { max-height: 82vh; width: auto; max-width: 100%; margin: 0 auto; display: block; }
#photoModal .modal-footer { color: #ddd; justify-content: space-between; border-top-color: #333; }
@media (max-width: 575.98px) { .photo-grid { grid-template-columns: repeat(3, 1fr); gap: .25rem; } }

/* Links */
.publication-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; background: #fff; padding: .5rem; }

/* Forms */
.form-section { background: #fff; border: 1px solid #e3e6eb; border-radius: .5rem; padding: 1.25rem; }
.field-validation-error { color: #b42318; font-size: .875rem; }
.input-validation-error { border-color: #b42318 !important; }
.validation-summary-errors ul { margin-bottom: 0; }
label.required::after { content: " *"; color: #b42318; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Admin */
.admin-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.table-admin td, .table-admin th { vertical-align: middle; }
.table-admin .actions { white-space: nowrap; text-align: right; }
.thumb-sm { width: 64px; height: 48px; object-fit: cover; border-radius: .25rem; background: #e9ecef; }
.icon-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: .5rem; max-height: 260px; overflow-y: auto; }
.icon-picker label { border: 2px solid transparent; border-radius: .375rem; padding: .25rem; cursor: pointer; text-align: center; background: #fff; }
.icon-picker input { position: absolute; opacity: 0; }
.icon-picker input:checked + label { border-color: var(--kofc-blue); background: #eef3fa; }
.icon-picker img { width: 48px; height: 48px; object-fit: contain; }
.stat-card .num { font-size: 1.75rem; font-weight: 700; color: var(--kofc-blue-dark); }
.admin-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .75rem; }
.admin-photo-grid .card img { aspect-ratio: 4 / 3; object-fit: cover; }
.photo-select { position: absolute; top: .4rem; left: .4rem; background: rgba(255,255,255,.9); border-radius: .3rem; padding: .15rem .3rem; line-height: 1; cursor: pointer; }
.photo-select .form-check-input { margin: 0; width: 1.25rem; height: 1.25rem; cursor: pointer; }
.admin-photo-grid .card.photo-selected { outline: 3px solid var(--kofc-gold); }
.move-bar { background: #fff; border: 1px solid #e3e6eb; border-radius: .5rem; padding: .5rem .75rem; position: sticky; top: 70px; z-index: 10; }

/* Responsive tables become stacked cards on phones */
@media (max-width: 767.98px) {
    table.table-stack thead { display: none; }
    table.table-stack, table.table-stack tbody, table.table-stack tr, table.table-stack td { display: block; width: 100%; }
    table.table-stack tr { border: 1px solid #e3e6eb; border-radius: .5rem; margin-bottom: .75rem; background: #fff; padding: .25rem .5rem; }
    table.table-stack td { border: 0; padding: .3rem .25rem; }
    table.table-stack td[data-label]::before { content: attr(data-label) ": "; font-weight: 600; color: #475467; }
    table.table-stack td.actions { text-align: left; }
}

/* Footer */
.site-footer { background: #1d2433; color: #d0d5dd; font-size: .95rem; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--kofc-gold); }

@media print {
    .navbar, .site-footer, .admin-toolbar, .btn { display: none !important; }
}

/* Document search */
.search-results mark { background: #fff1b8; padding: 0 .1em; border-radius: .15em; }
.search-results .snippet { color: #475467; }

/* Treasury */
.treasury-nav { flex-wrap: wrap; }
.treasury-summary .stat-card { background: #fff; border: 1px solid #e3e6eb; border-radius: .5rem; padding: .75rem 1rem; height: 100%; }
.treasury-summary .stat-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: #667085; }
.treasury-summary .stat-value { font-size: 1.5rem; font-weight: 700; color: var(--kofc-blue-dark); }
.treasury-summary .stat-note { font-size: .85rem; color: #667085; }
.split-table td { vertical-align: top; }
.split-total.mismatch { color: #b42318; font-weight: 600; }
.receipt-preview { max-width: 100%; max-height: 70vh; border: 1px solid #e3e6eb; border-radius: .375rem; background: #fff; }
.report-table td.sub { padding-left: 2rem; color: #475467; }
@media print {
    .treasury-nav, .no-print { display: none !important; }
    .print-only { display: block !important; }
    main.container-xl { max-width: 100%; padding: 0; }
}
.print-only { display: none; }

/* Agendas */
.agenda-section { margin-bottom: 1rem; scroll-margin-top: 80px; }
.agenda-heading { font-weight: 700; margin-bottom: .25rem; }
.agenda-box { background: #fff; border: 1px solid #c9ced6; border-radius: .25rem; padding: .6rem .8rem; }
.agenda-standing { color: #475467; }
.agenda-auto { color: #1F5FA8; font-style: italic; border-left: 3px solid #9ec5fe; padding-left: .6rem; margin: .25rem 0; }
.agenda-item { border-top: 1px dashed #e3e6eb; padding: .4rem 0; scroll-margin-top: 80px; }
.agenda-item:first-child { border-top: 0; }
.agenda-item-off .item-text { text-decoration: line-through; color: #98a2b3; }
.agenda-note { background: #fff8e1; border-radius: .25rem; padding: .1rem .4rem; margin-top: .2rem; display: inline-block; }
.item-actions form { display: inline; }
.agenda-add { position: sticky; top: 64px; z-index: 5; }
@media (max-width: 767.98px) { .agenda-add { position: static; } }

/* Newsletter */
.photo-rules { background: #f1f6ff; border: 1px solid #cfe0ff; border-radius: .375rem; padding: .5rem .8rem; }
.photo-checklist { background: #fff8e1; border: 1px solid #f5dfa0; border-radius: .375rem; padding: .5rem .8rem; }
.newsletter-issue { max-width: 860px; margin: 0 auto; }
.newsletter-mast { border-bottom: 3px solid var(--kofc-blue-dark, #1f3a68); margin-bottom: 1.25rem; padding-bottom: .75rem; }
.newsletter-issue h2 { color: var(--kofc-blue-dark, #1f3a68); font-size: 1.35rem; margin-top: 1.75rem; }
.newsletter-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .75rem; margin: .75rem 0; }
.newsletter-photos figure { margin: 0; }
.newsletter-photos img { width: 100%; height: 220px; object-fit: cover; border-radius: .375rem; }
.newsletter-photos figcaption { font-size: .85rem; color: #475467; font-style: italic; margin-top: .25rem; }
.newsletter-gk-photo { float: right; width: 140px; margin: 0 0 .5rem 1rem; border-radius: .375rem; }
.newsletter-card img { height: 160px; object-fit: cover; }

/* Volunteer schedules */
.volunteer-job { border-top: 1px solid #e3e6eb; padding: .55rem 0; scroll-margin-top: 80px; }
.volunteer-job:first-of-type { border-top: 0; }
.volunteer-job-mine { background: #eef6ee; margin: 0 -.5rem; padding-left: .5rem; padding-right: .5rem; border-radius: .25rem; }
.schedule-job { scroll-margin-top: 80px; }
@media print { .schedule-print td, .schedule-print th { font-size: 11pt; } }

/* Volunteer badges in event lists (home page, calendar) */
.volunteer-badge { font-weight: 600; font-size: .75rem; }
.volunteer-badge.needed { background: #ffc107; color: #3d2e00; }
.volunteer-badge.mine { background: #d1e7dd; color: #0f5132; }

/* Classes: attendance checklist */
.attendance-grid { column-width: 16rem; column-gap: 1.5rem; }
.attendance-grid .form-check { break-inside: avoid; padding-top: .15rem; padding-bottom: .15rem; }
.signin-table td { height: 2.1rem; }
