/* =========================================================
   VARIABLES
========================================================= */

:root {
  --bg: #f6f8fb;
  --accent: #00878f;
  --muted: #00878f;
  --error: #c33;
  --border: #e6eef8;
  --card-bg: #ffffff;
  --oxford-blue: #002147;
  --shadow: rgba(10, 20, 40, 0.03);
  --max-width: 1000px;

  /* animations */
  --anim-fast: 0.15s ease;
  --anim-normal: 0.18s ease;

  /* elevation */
  --elev-hover: 0 6px 18px rgba(0,0,0,0.08);
  --elev-item: 0 1px 4px var(--shadow);
}

/* =========================================================
   BASE
========================================================= */

* { box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial;
  margin: 0;
  padding: 18px;
  background: var(--bg);
  color: var(--oxford-blue);
}

/* =========================================================
   HEADER
========================================================= */

.site-header {
  /* background: white; */
  background: var(--bg);
  padding: 14px 0;
}

.header-menu {
  /* background: var(--oxford-blue); */
  background: var(--accent);
  padding: 14px 0;
  margin-bottom: 20px;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.site-title {
  font-size: 2.5rem;
  font-weight: 400;
}

.site-logo {
  height: 150px; 
}

/* =========================================================
   VIEW SYSTEM
========================================================= */

.view { display: none; }
.view.active { display: block; }

/* =========================================================
   BUTTON SYSTEM (UNIFIED)
========================================================= */

button {
  cursor: pointer;
  border-radius: 10px;
  border: none;
  transition:
    transform var(--anim-fast),
    box-shadow var(--anim-fast),
    background var(--anim-fast),
    color var(--anim-fast);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--elev-hover);
}

button:active:not(:disabled) {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.5;
  cursor: default;
  box-shadow: none;
}

/* =========================================================
   MENU
========================================================= */

.menu-bar {
  display: flex;
  max-width: var(--max-width);
  margin: 0 auto;
  gap: 12px;
}

.menu-btn {
  flex: 1;
  padding: 10px;
  border-radius: 12px;
  border: 1.5px solid var(--accent);
  background: transparent;
  color: white;
  /* color: var(--oxford-blue); */
  font-size: 1rem;
  font-weight: 600;
}
.menu-btn.active {
  background: var(--accent);
  border: 1.5px solid white;
}
/* .menu-btn.active { background: var(--accent); } */

/* =========================================================
   SEARCH
========================================================= */

.search-layout {
  display: grid;
  grid-template-columns: 325px minmax(0, 1fr);
  gap: 0.2rem;
}

.searchbar {
  display: grid;
  width: 100%;
}

.search_row_freetext {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  width: 100%;
}

.search-sidebar {
  padding-right: 0.2rem;
}

.search_freetext {
  flex: 1;
  min-width: 0;
  padding: 0.5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 1rem;
  background: white;
}

.icon-btn {
  width: 2rem;
  height: 2rem;
  flex: 0 0 2rem;
  font-size: 1rem;
  background: white;
  color: var(--accent);
}

.icon-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--elev-hover);
}

.icon-btn:active:not(:disabled) {
  transform: translateY(0);
}

.filter-block {
  display: grid;
  gap: 0.25rem;
}

.search_section_title {
  padding: 0.1rem;
  margin-top: 1rem;
  font-weight: 600;
  color: var(--accent)
}

.year-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

/* Chrome, Safari, Edge */
.search-year::-webkit-outer-spin-button,
.search-year::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
.search-year {
  -moz-appearance: textfield;
}

.search-year,
.search-select {
  flex: 1;
  padding: 1rem;
  height: 2rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: white;
  font-size: 1rem;
  min-width: 0;
}

.search-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.search-select::-ms-expand {
  display: none;
}

.search-select {
  background-image: none;
}


/* =========================================================
   MULTI-SELECT
========================================================= */

.multi-select {
  position: relative;
  width: 100%;
}

.multi-select__trigger {
  width: 100%;
  min-height: 44px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: white;
  box-shadow: var(--elev-item);
}

.multi-select__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
  align-items: center;
}

.multi-select__placeholder {
  color: var(--muted);
}

.multi-select__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 8px;
  background: #e8edf5;
  color: var(--oxford-blue);
  font-size: 0.9rem;
  white-space: nowrap;
}

 .multi-select__caret {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--muted); 
}

.multi-select__trigger:hover .multi-select__caret {
  border-top-color: var(--accent);
}

.multi-select__panel {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: 240px;
  overflow: auto;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--elev-hover);
  padding: 8px;
}

.multi-select__option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.multi-select__option:hover {
  background: #f3f7fc;
}

.multi-select__option input {
  margin: 0;
}

.multi-select-row {
  display: flex;
  align-items: center;
  gap: 2px;
}

/* =========================================================
   CARDS
========================================================= */

.card-interactive {
  background: white;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--elev-item);
  cursor: pointer;
  transition: transform var(--anim-normal), box-shadow var(--anim-normal);
}

.card-interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--elev-hover);
}

.card {
  cursor: default;
  box-shadow: none;
  background: white;
}


.summary_title {
  font-size: 1.2rem;
  padding: 0 0 0.75rem 0;
  font-weight: 700;
}

.summary_section_title {
  font-size: 1.1rem;
  padding: 0.75rem 0 0.25rem 0;
  font-weight: 500;
}

.summary_info {
  display: grid;
  gap: 1rem;
}

.summary_row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1rem;
  align-items: start;
}

.summary_label {
  font-weight: 500;
  color: var(--accent)
}

.summary_value {
  font-weight: 500;
} 

.summary_value_missing {
  color: var(--muted);
  font-style: italic;
}

.details_title {
  font-size: 1.2rem;
  padding: 0 0 0.75rem 0;
  font-weight: 700;
}

.details_section_title {
  font-size: 1.1rem;
  padding: 0.75rem 0 0.25rem 0;
  font-weight: 500;
}

.details_info {
  display: grid;
  gap: 1rem;
}

.details_row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1rem;
  align-items: start;
}

.details_label {
  font-weight: 500;
  color: var(--accent)
}

.details_value {
  font-weight: 500;
} 




/* =========================================================
   DETAILS
========================================================= */

#view-details {
  max-width: var(--max-width);
  margin: 0 auto;
}

#details-content {
  background: white;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 18px;
  margin-top: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: white;
  color: var(--accent);
  cursor: pointer;
  font-weight: 600;
  box-shadow: var(--elev-item);

  transition:
    transform var(--anim-fast),
    box-shadow var(--anim-fast),
    background var(--anim-fast),
    color var(--anim-fast),
    border-color var(--anim-fast);
}

.btn:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);

  transform: translateY(-4px);
  box-shadow: var(--elev-hover);
}

.btn:active {
  transform: translateY(0);
  box-shadow: var(--elev-item);
}

/* =========================================================
   PAGINATION
========================================================= */

.pagination {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 12px;
  margin-bottom: 12px;
}

.page-btn {
  background: white;
  /* border: 1px solid var(--accent); */
  padding: 6px 10px;
  font-weight: 600;
}

.page-btn:hover:not(:disabled) {
  /* background: var(--accent); */
  /* color: white; */
  border-color: var(--accent);
}

.page-btn.active {
  background: var(--accent);
  color: white;
}

/* =========================================================
   PROFILE
========================================================= */
.about-grid {
  display: grid;
  gap: 1rem;
}

.profile-card {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1rem;
  align-items: start;
  background: white;
  border-radius: 12px;
  padding: 1rem;
}

.profile-photo {
  width: 140px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

.profile-body h3 {
  margin-top: 0;
}

/* =========================================================
   HOME / ABOUT / CONTACT
========================================================= */

.home-card,
.profile-card,
.contact-card {
  background: white;
  border-radius: 12px;
  padding: 1rem;
}

.about-grid,
.contact-grid {
  display: grid;
  gap: 1rem;
}

/* =========================================================
   FOOTER
========================================================= */

.site-footer {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--accent);
  /* background: var(--oxford-blue); */
}

.footer-logos {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-logo-link img {
  height: 70px;
  /* max-width: 140px; */
  object-fit: contain;
  width: auto;
}

.footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between; 
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-links-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;

  margin-left: auto;   
}

.footer-logos-row {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
}

.footer-link {
  color: white;
  text-decoration: none;
  font-weight: 500;
  display: inline-block;

  transition:
    transform var(--anim-fast),
    opacity var(--anim-fast);
}

.footer-link:hover {
  transform: translateY(-2px);   /* 👈 lift */
  opacity: 0.85;
}

.footer-link:active {
  transform: translateY(0);      /* 👈 press down */
  opacity: 0.7;
}

/* =========================================================
   SPACING & LAYOUT
========================================================= */

#home-content,
.results,
.about-grid,
.contact-grid {
  display: grid;
  gap: 1rem;
}

#details-content > * + * {
  margin-top: 0.9rem;
}

.main,
#view-details,
.header-inner,
.menu-bar,
.footer-logos {
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}

#view-details {
  width: 100%;
}

/* ========================================================
   POPUPS & MODALS
========================================================= */

.hidden { display: none; }

.info-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.info-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}

.info-modal__panel {
  position: relative;
  max-width: 700px;
  margin: 10vh auto;
  background: var(--bg);
  padding: 1.5rem;
  border-radius: 12px;
  z-index: 1;
}

.info-modal__body {
  white-space: pre-wrap;
}

.footer-link--button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.info-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--bg);
  color: var(--accent);
  font-size: 24px;
  font-weight: 700;
  line-height: 36px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 8px var(--shadow);
}

.info-modal__close:hover {
  background: var(--shadow);
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 1000px) {
  body { padding: 10px; }

  .menu-bar {
    flex-wrap: wrap;
    padding: 1rem;
  }

  .menu-btn {
    flex: 1 1 calc(50% - 4px);
  }

  .search-layout {
    grid-template-columns: 1fr;
  }

  .search-sidebar {
    position: static;
    padding-right: 0.2rem;
  }

  .profile-card {
    grid-template-columns: 1fr;
  }

  .profile-photo {
    width: 100%;
    max-width: 220px;
  }

  .page-btn {
    padding: 6px 8px;
  }

  .pagination {
    justify-content: center;
    gap: 8px;
  }

  .page-info {
    flex-basis: 100%;
    margin-left: 0 !important;
    margin-top: 8px;
    text-align: center;
    width: 100%;
  }

  .summary_row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .site-title {
    font-size: 1rem;
    font-weight: 400;
  }

}