/* =====================================================================
 *  components.css — header, footer, buttons, cards, shared UI
 * ===================================================================== */

/* ---------------------------------------------------------------------
 * Header
 * ------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgb(255 255 255 / 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.brand img {
  height: 2.5rem;
  width: auto;
}

@media (min-width: 1024px) {
  .brand img { height: 3rem; }
}

.brand-text {
  display: block;
  line-height: 1.2;
}

.brand-text .name {
  display: block;
  white-space: nowrap;
  font-weight: 800;
  font-size: var(--fs-base);
  letter-spacing: -0.01em;
  color: var(--brand-700);
}

@media (min-width: 640px) {
  .brand-text .name { font-size: var(--fs-lg); }
}

@media (max-width: 379px) {
  .brand-text .name { font-size: var(--fs-sm); }
}

@media (min-width: 1200px) {
  .brand-text .name { font-size: var(--fs-xl); }
}

.brand-text .sub {
  display: block;
  white-space: nowrap;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-950);
  margin-top: 0.15rem;
}

.primary-nav {
  display: none;
  align-items: center;
  gap: 0.05rem;
}

@media (min-width: 1150px) {
  .primary-nav { display: flex; }
}

.primary-nav a {
  position: relative;
  padding: 0.55rem 0.7rem;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink-700);
  border-radius: var(--radius-1);
  transition: color var(--dur-fast) var(--ease-out);
}

.primary-nav a::after {
  content: "";
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  bottom: 0.3rem;
  height: 2px;
  background: var(--brand-700);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-base) var(--ease-out);
}

.primary-nav a:hover {
  color: var(--brand-700);
}

.primary-nav a:hover::after {
  transform: scaleX(1);
}

.primary-nav a[aria-current="page"] {
  color: var(--brand-700);
  font-weight: 600;
}

.primary-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.header-actions {
  display: none;
  align-items: center;
  gap: 0.5rem;
}

@media (min-width: 1150px) {
  .header-actions { display: flex; margin-left: 0.5rem; }
}

/* ---------------------------------------------------------------------
 * Buttons
 * ------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: var(--fs-sm);
  font-weight: 600;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-1);
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--brand-700);
  color: #fff;
}

.btn--primary:hover {
  background: var(--brand-600);
  box-shadow: var(--shadow-lift);
}

.btn--outline {
  border-color: var(--brand-700);
  color: var(--brand-700);
  background: transparent;
}

.btn--outline:hover {
  background: var(--brand-700);
  color: #fff;
  box-shadow: var(--shadow-lift);
}

.btn--ghost {
  color: var(--ink-700);
}

.btn--ghost:hover {
  color: var(--brand-700);
}

.btn--sm {
  padding: 0.5rem 1rem;
  font-size: var(--fs-xs);
}

.btn--icon {
  padding: 0;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--border-strong);
  color: var(--ink-700);
}

.btn--icon:hover {
  border-color: var(--brand-700);
  color: var(--brand-700);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--brand-700);
  border-bottom: 1px solid var(--brand-700);
  padding-bottom: 2px;
  transition: color var(--dur-fast) var(--ease-out), gap var(--dur-fast) var(--ease-out);
}

.text-link:hover {
  color: var(--brand-800);
  gap: 0.6rem;
}

.text-link--plain {
  border-bottom: none;
  padding-bottom: 0;
}

.text-link .icon {
  transition: transform var(--dur-fast) var(--ease-out);
}

.text-link:hover .icon {
  transform: translateX(2px);
}

/* ---------------------------------------------------------------------
 * Mobile navigation
 * ------------------------------------------------------------------- */
.mobile-nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: none;
  color: var(--brand-700);
  transition: color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.mobile-nav-toggle:hover {
  color: var(--brand-800);
}

.mobile-nav-toggle:active {
  transform: scale(0.92);
}

@media (min-width: 1150px) {
  .mobile-nav-toggle { display: none; }
}

.mobile-nav-panel {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  z-index: 45;
  background: #fff;
  overflow-y: auto;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 24px 48px rgb(2 8 20 / 0.14);
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}

@media (min-width: 1150px) {
  .mobile-nav-panel { display: none; }
}

.mobile-nav-panel.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-panel nav {
  padding: 0.85rem 1rem 0.5rem;
}

/* Nav links: icon + label + chevron, hover & active states */
.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.8rem 0.9rem;
  border-radius: var(--radius-1);
  font-size: var(--fs-base);
  font-weight: 500;
  color: var(--ink-700);
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.mobile-nav-link:hover {
  background: var(--brand-50);
  color: var(--brand-700);
}

.mobile-nav-link .mobile-nav-link-icon {
  display: flex;
  flex-shrink: 0;
  color: var(--brand-700);
}

.mobile-nav-link .mobile-nav-link-chevron {
  margin-left: auto;
  display: flex;
  flex-shrink: 0;
  color: var(--ink-300);
  transition: color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.mobile-nav-link:hover .mobile-nav-link-chevron {
  color: var(--brand-700);
  transform: translateX(2px);
}

.mobile-nav-link.is-active {
  background: var(--brand-50);
  color: var(--brand-700);
  font-weight: 700;
}

.mobile-nav-link.is-active .mobile-nav-link-chevron {
  color: var(--brand-700);
}

.mobile-nav-panel .mobile-nav-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding: 1.1rem 0.25rem 0.75rem;
  border-top: 1px solid var(--border);
}

.mobile-nav-panel .btn {
  width: 100%;
  justify-content: center;
}

/* ---------------------------------------------------------------------
 * Footer
 * ------------------------------------------------------------------- */
.site-footer {
  background: var(--surface-muted);
  color: var(--ink-500);
  border-top: 1px solid var(--border);
}

.footer-grid {
  display: grid;
  gap: var(--space-10);
  padding-block: var(--space-12);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .footer-grid { grid-template-columns: 1.3fr 1fr 1fr; padding-block: var(--space-12); }
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-brand img {
  height: 5.5rem;
  width: auto;
}

.footer-brand .name {
  font-weight: 800;
  font-size: var(--fs-md);
  color: var(--brand-700);
}

.footer-brand .sub {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-950);
}

.footer-tagline {
  margin-top: 1.25rem;
  max-width: 26rem;
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
  color: var(--ink-500);
}

.footer-heading {
  font-size: var(--fs-2xs);
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brand-700);
}

.footer-list {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: var(--fs-sm);
}

.footer-list li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.footer-list .icon {
  margin-top: 0.15rem;
  color: var(--brand-700);
}

.footer-list a {
  color: var(--ink-500);
  transition: color var(--dur-fast) var(--ease-out);
}

.footer-list a:hover {
  color: var(--brand-700);
}

.footer-coord-role {
  display: block;
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-500);
}

.footer-coord-name {
  display: block;
  margin-top: 0.2rem;
  font-weight: 600;
  color: var(--text);
}

.footer-coord-email {
  display: block;
  margin-top: 0.25rem;
  font-size: var(--fs-xs);
  font-weight: 500;
}

.footer-quicklinks a {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink-500);
  transition: color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.footer-quicklinks a:hover {
  color: var(--brand-700);
  transform: translateX(2px);
}

.footer-quicklinks .icon {
  color: var(--brand-700);
}

.footer-bottom {
  border-top: 1px solid var(--border);
}

.footer-bottom .container {
  padding-block: var(--space-5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-sm);
  color: var(--ink-500);
  text-align: center;
}

@media (min-width: 768px) {
  .footer-bottom .container { flex-direction: row; justify-content: center; }
}

/* ---------------------------------------------------------------------
 * Back to top
 * ------------------------------------------------------------------- */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.45rem;
  height: 2.45rem;
  background: var(--brand-700);
  color: #fff;
  border-radius: var(--radius-1);
  box-shadow: var(--shadow-lift);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), background-color var(--dur-fast);
}

.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--brand-600);
}

/* ---------------------------------------------------------------------
 * Section heading
 * ------------------------------------------------------------------- */
.section-heading {
  margin-bottom: var(--space-10);
}

@media (min-width: 768px) {
  .section-heading { margin-bottom: var(--space-14); }
}

.section-heading--center {
  text-align: center;
}

.section-heading .kicker {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brand-700);
}

.section-heading h2 {
  margin-top: 0.75rem;
  font-size: var(--fs-2xl);
}

@media (min-width: 768px) {
  .section-heading h2 { font-size: var(--fs-3xl); }
}

.section-heading--center h2 {
  margin-inline: auto;
  max-width: 42rem;
}

.section-heading .rule {
  margin-top: 1.25rem;
  width: 3rem;
  height: 4px;
  background: var(--brand-700);
}

.section-heading--center .rule {
  margin-inline: auto;
}

.section-heading p.desc {
  margin-top: 1.15rem;
  max-width: 42rem;
  font-size: var(--fs-md);
  line-height: var(--lh-normal);
  color: var(--text-muted);
}

.section-heading--center p.desc {
  margin-inline: auto;
}

/* ---------------------------------------------------------------------
 * Page banner
 * ------------------------------------------------------------------- */
.page-banner {
  position: relative;
  overflow: hidden;
  background: var(--brand-950);
  color: #fff;
  padding-block: var(--space-10);
}

@media (min-width: 768px) {
  .page-banner { padding-block: var(--space-14); }
}

.page-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgb(255 255 255 / 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(255 255 255 / 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 80% at 30% 20%, black 40%, transparent 90%);
}

.page-banner::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 4px;
  background: var(--brand-700);
}

.page-banner .container {
  position: relative;
}

.page-banner .breadcrumb {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--brand-300);
}

.page-banner h1 {
  margin-top: 0.6rem;
  font-size: 2.25rem;
  letter-spacing: -0.02em;
  color: #fff;
}

@media (min-width: 768px) {
  .page-banner h1 { font-size: 3rem; }
}

.page-banner .subtitle {
  margin-top: 0.85rem;
  max-width: 42rem;
  font-size: var(--fs-base);
  line-height: 1.65;
  color: #d1d5db;
}

/* ---------------------------------------------------------------------
 * Cards
 * ------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  border-radius: var(--radius-1);
}

.card--hover {
  transition: box-shadow var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}

.card--hover:hover {
  box-shadow: var(--shadow-lift);
  transform: translateY(-3px);
  border-color: var(--brand-200);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  font-size: var(--fs-2xs);
  font-weight: 600;
  color: var(--text);
  background: var(--surface-muted);
  border-radius: var(--radius-1);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.7rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--brand-700);
  border-radius: var(--radius-1);
}

/* ---------------------------------------------------------------------
 * Form controls (selects used in publications filter)
 * ------------------------------------------------------------------- */
.field-label {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
}

.select {
  appearance: none;
  height: 2.5rem;
  padding: 0 2.3rem 0 0.85rem;
  border: 1px solid var(--border-strong);
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23012f70' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 1.1rem;
  border-radius: var(--radius-1);
  font-size: var(--fs-sm);
  color: var(--text);
  transition: border-color var(--dur-fast) var(--ease-out);
}

.select:hover {
  border-color: var(--ink-300);
}

.select:focus-visible {
  border-color: var(--border-strong);
  outline: none;
}

/* ---------------------------------------------------------------------
 * Reveal-on-scroll animation (progressive enhancement)
 * ------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-group > * {
  transition-delay: calc(var(--reveal-index, 0) * 70ms);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
