/**
 * View 3: Modern Document Library — Styles
 *
 * All styles scoped under .bam-view-3 to prevent collisions
 * with existing plugin styles or theme styles.
 *
 * @package ArchiveAgendaMinutes
 */

/* =========================================================================
   CSS Custom Properties
   ========================================================================= */

.bam-view-3 {
  --bam-v3-primary: #008bb8;
  --bam-v3-primary-hover: #007199;
  --bam-v3-accent: #c1d82f;
  --bam-v3-accent-hover: #a8bd1e;
  --bam-v3-accent-text: #2d3a00;
  --bam-v3-accent-blue: #009ad0;
  --bam-v3-heading-blue: #002d72;
  --bam-v3-body-text: #3c3c3c;
  --bam-v3-border: #e2e2e2;
  --bam-v3-download-bg: #d0dd28;
  --bam-v3-download-text: #2b3c73;
  --bam-v3-black: #000;
  --bam-v3-white: #fff;
  --bam-v3-card-border: #e2e8ed;
  --bam-v3-sidebar-bg: #f5f7f9;
  --bam-v3-text: #1a2b3c;
  --bam-v3-text-muted: #6b7c8d;
  --bam-v3-radius: 8px;
  --bam-v3-radius-lg: 12px;
  --bam-v3-transition: 0.25s ease;
  --bam-v3-font:
    "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  font-family: var(--bam-v3-font);
  color: var(--bam-v3-text);
  line-height: 1.6;
}

.bam-v3-wrapper {
  display: grid;
  grid-template-columns: 0.33fr 1.5fr;
  gap: clamp(28px, 3.02vw, 58px);
}

/* =========================================================================
   Sidebar
   ========================================================================= */

.bam-view-3 .bam-v3-sidebar-inner {
  border-radius: clamp(18px, 1.3vw, 20px);
  background: var(--bam-v3-white);
  padding: clamp(18px, 1.3vw, 20px) clamp(16px, 1.2vw, 23px)
    clamp(22px, 1.9vw, 30px) clamp(22px, 1.9vw, 30px);
}

@media (min-width: 768px) {
  .bam-view-3 #bam-v3-sidebar {
    /* Sticky positioning is applied dynamically by JS based on viewport fit. */
    align-self: flex-start;
    z-index: 10;
  }
}

.bam-v3-sidebar-header {
  margin-bottom: clamp(18px, 1.3vw, 20px);
}

.bam-view-3 .bam-v3-sidebar-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--bam-v3-heading-blue);
  font-size: clamp(18px, 1.3vw, 20px);
  font-weight: 600;
}

/* Clear All button */
.bam-view-3 .bam-v3-clear-all {
  color: var(--bam-v3-black) !important;
  font-size: 14px;
  font-weight: 400;
  padding: 0;
  transition: opacity var(--bam-v3-transition);
}

.bam-view-3 .bam-v3-clear-all:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  color: var(--bam-v3-text-muted);
}

.bam-view-3 .bam-v3-clear-all:is(:focus-visible, :active) {
  box-shadow: none !important;
  outline: solid 2px #2b3c73;
}

/* .bam-view-3 .bam-v3-clear-all:not(:disabled):hover {
    color: var(--bam-v3-accent-blue);
    text-decoration: underline;
} */

.bam-v3-filter-group {
  padding: 0;
}

.bam-v3-filter-group:not(:last-child) {
  border-bottom: solid 1px var(--bam-v3-border);
  padding-bottom: clamp(16px, 1.25vw, 24px);
  margin-bottom: clamp(16px, 1.25vw, 24px);
}

/* Filter headings */
.bam-view-3 .bam-v3-filter-heading {
  color: var(--bam-v3-body-text);
  font-size: 16px;
  margin-bottom: 1rem;
  font-weight: 700;
  line-height: normal;
}

/* Checkbox styling */
.bam-v3-filter-options {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 5px;
}

.bam-v3-filter-options::-webkit-scrollbar {
  width: 6px;
}

.bam-v3-filter-options::-webkit-scrollbar-track {
  background: transparent;
}

.bam-v3-filter-options::-webkit-scrollbar-thumb {
  background-color: #d1d1d1;
  border-radius: 10px;
}

.bam-view-3 .form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
}

.bam-v3-filter-options .form-check-input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-block: auto;
  cursor: pointer;
}

.bam-view-3 .form-check-input:checked {
  background-color: var(--bam-v3-download-text);
  border-color: var(--bam-v3-download-text);
}

.bam-view-3 .form-check-input:focus {
  box-shadow: 0 0 0 0.2rem #2b3c7333;
  border-color: var(--bam-v3-download-text);
}

.bam-view-3 .form-check-label {
  cursor: pointer;
  color: var(--bam-v3-body-text);
  font-size: 16px;
  line-height: 22px;
}

/* =========================================================================
   Main Content Header
   ========================================================================= */

.bam-v3-header {
  margin-bottom: clamp(24px, 2.08vw, 40px);
  scroll-margin-top: 100px;
  /* Fallback; JS overrides dynamically. */
}

.bam-view-3 .bam-v3-title {
  font-size: clamp(18px, 1.35vw, 26px);
  font-family: var(--bam-v3-font);
  font-weight: 700;
  color: var(--bam-v3-black);
  line-height: normal;
}

.bam-v3-search .input-group {
  align-items: center;
  border-radius: 10px;
  border: 1px solid #bfbfbf;
  background: var(--bam-v3-white);
  gap: clamp(28px, 3.02vw, 58px);
  padding: clamp(12px, 0.68vw, 13px) clamp(13px, 0.78vw, 15px);
}

.bam-view-3 .bam-v3-search .input-group-text {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
}

.bam-v3-search .form-control {
  color: var(--bam-v3-body-text);
  font-size: clamp(14px, 0.83vw, 16px);
  padding: 0;
  border: none;
  line-height: normal;
}

.bam-view-3 .bam-v3-search .form-control:focus {
  box-shadow: 0 0 0 0.2rem #2b3c7333;
  border-color: var(--bam-v3-download-text);
}

.bam-view-3 .bam-v3-search .form-control:focus + .input-group-text,
.bam-view-3 .bam-v3-search .form-control:focus ~ .input-group-text {
  border-color: var(--bam-v3-primary);
}

/* Hide native browser clear button on search inputs */
.bam-view-3 .bam-v3-search input[type="search"]::-webkit-search-cancel-button,
.bam-view-3 .bam-v3-search input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

/* Custom search clear button */
.bam-view-3 .bam-v3-search-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 0 2px;
  margin: 0;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
  transition: color var(--bam-v3-transition);
}

.bam-view-3 .bam-v3-search-clear[hidden] {
  display: none;
}

/* .bam-view-3 .bam-v3-search-clear:hover,
.bam-view-3 .bam-v3-search-clear:focus-visible {
    color: var(--bam-v3-black);
} */

.bam-view-3 .bam-v3-search-clear:focus-visible {
  outline: 2px solid var(--bam-v3-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Results info */
.bam-view-3 .bam-v3-results-count {
  font-size: 0.8125rem;
  color: var(--bam-v3-text-muted);
  font-weight: 500;
}

/* =========================================================================
   Year Headings
   ========================================================================= */

.bam-view-3 .bam-v3-year-heading {
  font-size: clamp(18px, 1.3vw, 20px);
  font-family: var(--bam-v3-font);
  font-weight: 700;
  color: var(--bam-v3-black);
  margin-bottom: clamp(18px, 1.3vw, 20px);
}

/* =========================================================================
   Accordion (Month)
   ========================================================================= */

.bam-view-3 .bam-v3-accordion .accordion-item {
  border: none;
  margin-bottom: clamp(22px, 1.9vw, 30px);
  background: var(--bam-v3-white);
  border-radius: clamp(18px, 1.3vw, 20px);
  padding: 10px;
}

.bam-v3-year-section:last-of-type
  .bam-v3-accordion
  .accordion-item:last-of-type {
  margin-bottom: 0;
}

.bam-view-3 .bam-v3-accordion-btn {
  border-radius: clamp(18px, 1.3vw, 20px) !important;
  font-size: clamp(18px, 1.3vw, 20px);
  font-family: var(--bam-v3-font);
  padding: 9px 4px 9px 28px;
  color: var(--bam-v3-white);
  background: var(--bam-v3-accent-blue);
  font-weight: 600;
  border: none;
  transition: background-color var(--bam-v3-transition);
}

.bam-view-3 .bam-v3-accordion-btn:focus {
  box-shadow: 0 0 0 0.2rem rgba(0, 139, 184, 0.4);
}

/* Custom toggle icon: + / − */
.bam-view-3 .bam-v3-accordion-btn::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 30 30" fill="none"><rect width="30" height="30" rx="15" fill="white"/><mask id="mask0_40001276_21937" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="4" y="4" width="22" height="22"><rect x="4" y="4" width="22" height="22" fill="%23D9D9D9"/></mask><g mask="url(%23mask0_40001276_21937)"><path d="M14.084 15.9193H8.58398V14.0859H14.084V8.58594H15.9173V14.0859H21.4173V15.9193H15.9173V21.4193H14.084V15.9193Z" fill="%23009AD0"/></g></svg>');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 50%;
}

.bam-view-3 .bam-v3-accordion-btn:not(.collapsed)::after {
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 30 30" fill="none"><rect width="30" height="30" rx="15" fill="white"/><mask id="mask0_40001229_25294" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="4" y="4" width="22" height="22"><rect x="4" y="4" width="22" height="22" fill="%23D9D9D9"/></mask><g mask="url(%23mask0_40001229_25294)"><path d="M8.58398 15.9154V14.082H21.4173V15.9154H8.58398Z" fill="%23009AD0"/></g></svg>');
}

/* Accordion body */
.bam-view-3 .bam-v3-accordion .accordion-body {
  padding-block: clamp(16px, 1.15vw, 22px) 14px;
  padding-inline: clamp(16px, 1.1vw, 18px);
}

.bam-view-3 .bam-v3-accordion .accordion-collapse {
  border: none;
}

/* =========================================================================
   Document Card
   ========================================================================= */

.bam-view-3 .bam-v3-card {
  display: flex;
  height: 100%;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(16px, 1.1vw, 18px) 16px;
  border-radius: clamp(18px, 1.3vw, 20px);
  border: 1px solid var(--bam-v3-border);
}

.bam-view-3 .bam-v3-card-date {
  font-size: 14px;
  color: var(--bam-v3-black);
  font-weight: 400;
  margin-bottom: 6px;
  line-height: normal;
}

.bam-view-3 .bam-v3-card-title {
  color: var(--bam-v3-black);
  display: flex;
  align-items: flex-start;
  gap: 0.375rem;
  font-size: 16px;
  font-weight: 600;
  line-height: normal;
  gap: 6px;
}

.bam-view-3 .bam-v3-card-title svg {
  flex-shrink: 0;
  margin-top: 2px;
}

/* Category tags / pills */
.bam-view-3 .bam-v3-card-tags {
  display: flex;
  margin-block: clamp(28px, 3.07vw, 59px) clamp(18px, 1.3vw, 20px);
  flex-wrap: wrap;
  gap: 0.375rem;
}

.bam-view-3 .bam-v3-tag {
  display: inline-block;
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
  color: var(--bam-v3-black);
  font-size: 13px;
  line-height: 15px;
  padding: 2px 7px;
  border-radius: 3px;
}

/* Download button */
.bam-view-3 .bam-v3-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 6px clamp(18px, 1.3vw, 20px);
  gap: 0.625rem;
  border-radius: 18px;
  background: var(--bam-v3-download-bg);
  color: var(--bam-v3-download-text);
  font-size: clamp(14px, 0.83vw, 16px);
  font-weight: 500;
  line-height: 24px;
}

.bam-v3-download-btn-text {
  flex-shrink: 0;
}

.bam-view-3 .bam-v3-no-pdf {
  font-size: 0.8125rem;
  margin-top: auto;
}

/* =========================================================================
   No Results Message
   ========================================================================= */

.bam-view-3 .bam-v3-no-results h4 {
  color: var(--bam-v3-text);
  font-weight: 700;
}

.bam-v3-no-results h3 {
  color: var(--bam-v3-black);
  font-size: clamp(20px, 1.6vw, 26px);
  font-weight: 900;
  text-transform: uppercase;
  margin-block: 16px 10px;
}

/* =========================================================================
   Mobile Filter UI (Slide-up panels)
   ========================================================================= */

body.bam-modal-open {
  overflow: hidden;
}

.bam-v3-mobile-bar {
  display: none;
}

.bam-v3-mobile-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.bam-v3-mobile-panel[hidden] {
  display: none;
}

.bam-v3-mobile-panel__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.bam-v3-mobile-panel.bam-panel--open .bam-v3-mobile-panel__overlay {
  opacity: 1;
}

.bam-v3-mobile-panel__sheet {
  position: relative;
  background: var(--bam-v3-white);
  width: 100%;
  height: 85vh;
  border-radius: 10px 10px 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -10px 25px rgba(0, 0, 0, 0.1);
}

.bam-v3-mobile-panel.bam-panel--open .bam-v3-mobile-panel__sheet {
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .bam-v3-mobile-panel__overlay,
  .bam-v3-mobile-panel__sheet {
    transition: none;
  }
}

.bam-v3-mobile-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 16px;
  border-bottom: 1px solid var(--bam-v3-border);
}

.bam-v3-mobile-panel__title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--bam-v3-black);
}

.bam-v3-mobile-panel__clear-all {
  background: none;
  border: none;
  color: var(--bam-v3-black);
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  font-family: var(--bam-v3-font);
}

.bam-v3-mobile-panel__clear-all:disabled,
.bam-v3-mobile-panel__clear-all[disabled] {
  opacity: 0.5;
  text-decoration: none;
  cursor: not-allowed;
}

.bam-v3-mobile-panel__body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: row;
  background: var(--bam-v3-white);
  padding: 20px 16px 0 16px;
}

/* Two-column layout */
.bam-v3-mobile-tabs {
  width: 37%;
  display: flex;
  flex-direction: column;
  row-gap: 8px;
  overflow-y: auto;
  border-right: solid 1px var(--bam-v3-border);
}

.bam-v3-mobile-tab {
  border: none;
  text-align: left;
  font-family: var(--bam-v3-font);
  cursor: pointer;
  transition: background 0.2s;
  background: transparent;
  color: #4e4e4e;
  font-size: 14px;
  line-height: 21px;
  padding-block: 11px;
  padding-inline: 12px 8px;
  border-radius: 4px 0 0 4px;
}

.bam-v3-mobile-tab.active {
  background: #fff3de;
  font-weight: 600;
  color: var(--bam-v3-black);
}

.bam-v3-mobile-tab-content {
  width: 63%;
  overflow-y: auto;
  padding-inline: 20px 9px;
}

.bam-v3-mobile-tab-pane {
  display: none;
}

.bam-v3-mobile-tab-pane.active {
  display: block;
}

.bam-v3-mobile-tab-pane .bam-v3-filter-heading {
  display: none;
}

.bam-v3-mobile-tab-pane .bam-v3-filter-group {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.bam-v3-mobile-panel__footer {
  padding: 9px 16px 16px 16px;
  display: flex;
  gap: 10px;
  background: var(--bam-v3-white);
}

.bam-v3-mobile-panel__btn {
  flex: 1;
  padding: 14px;
  border-radius: 30px;
  font-family: var(--bam-v3-font);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: opacity 0.2s;

  color: var(--bam-v3-download-text);
  font-weight: 600;
  line-height: 20px;
  padding: 10px 18px;
  border: none;
}

.bam-v3-mobile-panel__btn:hover {
  opacity: 0.9;
}

.bam-v3-mobile-panel__btn--outline {
  background: #e2e2e2;
  max-width: 37%;
}

.bam-v3-mobile-panel__btn--fill {
  background: var(--bam-v3-accent);
  max-width: 63%;
  position: relative;
}

/* =========================================================================
   Pagination
   ========================================================================= */

.bam-v3-pagination-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 30px;
}

#bam-v3-pagination-container button {
  width: fit-content;
  border-color: var(--bam-v3-download-text);
  color: var(--bam-v3-white);
  background: var(--bam-v3-download-text);
  border-radius: 25px;
  padding: 10px 20px;
}

#bam-v3-pagination-container button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.bam-v3-next {
  margin-left: auto;
}

.bam-v3-page-dropdown {
  justify-content: center;
}

#bam-v3-page-select {
  border-radius: 25px;
  padding: 10px 30px 10px 20px;
  cursor: pointer;
}

/* =========================================================================
   Animations
   ========================================================================= */

/* Smooth card show/hide for filtering */
.bam-view-3 .bam-v3-card-col {
  margin: 0;
}

.bam-view-3 .bam-v3-card-col.d-none {
  opacity: 0;
  transform: scale(0.95);
}

.bam-view-3 .bam-v3-year-section {
  transition: opacity 0.2s ease;
  margin-bottom: clamp(32px, 3.65vw, 70px);
}

.bam-view-3 .bam-v3-year-section:last-of-type {
  margin-bottom: 0;
}

.bam-view-3 .bam-v3-month-item {
  transition: opacity 0.2s ease;
}

/* =========================================================================
   Responsive
   ========================================================================= */

@media (max-width: 1200px) {
  .bam-v3-wrapper {
    grid-template-columns: 0.6fr 1.5fr;
  }

  .bam-view-3 #bam-v3-sidebar {
    top: 7rem;
  }
}

@media (max-width: 991.98px) {
  .bam-view-3 .bam-v3-search {
    min-width: 100%;
    max-width: 100%;
  }

  /* .bam-view-3 .bam-v3-title {
        font-size: 1.25rem;
    } */
}

@media (max-width: 768px) {
  .bam-view-3 {
    padding-bottom: 80px;
  }

  .bam-v3-wrapper {
    grid-template-columns: 1fr;
  }

  .bam-view-3 #bam-v3-sidebar {
    display: none;
  }

  .bam-v3-mobile-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 9998;
    background: var(--bam-v3-heading-blue);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 4px 0 rgba(0, 0, 0, 0.06);
  }

  .bam-v3-mobile-bar__btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--bam-v3-white);
    padding: 17.5px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: var(--bam-v3-font);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
  }

  .bam-v3-mobile-bar__text-wrap {
    position: relative;
    display: flex;
  }

  .bam-v3-mobile-bar__icon-wrap svg {
    width: 18px;
    height: 18px;
  }

  .bam-v3-mobile-bar__badge {
    position: absolute;
    top: 0;
    right: -15px;
    width: 5px;
    height: 5px;
    background: #f9ac1b;
    border-radius: 50%;
  }

  .bam-v3-mobile-bar__badge[hidden] {
    display: none;
  }

  .bam-view-3 .bam-v3-header {
    flex-direction: column;
    align-items: stretch;
  }

  .bam-view-3 .bam-v3-title {
    text-align: center;
  }

  .bam-v3-mobile-tab-pane :is(.form-check-label) {
    font-size: 14px;
  }
}

@media (max-width: 480.98px) {
  .bam-v3-page-dropdown {
    order: -1;
    grid-column: 1 / span 3;
  }

  .bam-v3-next {
    grid-column-start: 3;
  }
}

/* =========================================================================
   Print
   ========================================================================= */

@media print {
  .bam-view-3 #bam-v3-sidebar {
    display: none;
  }

  .bam-view-3 .bam-v3-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }

  .bam-view-3 .accordion-collapse {
    display: block !important;
    height: auto !important;
  }
}
