/* Shared styles for all pages */
:root {
  --purple: #4B2E83;
  --gold: #F5AA1C;
  --ink: #333;
  --muted: #555;
  --card-border: #ccc;
  --overlay: rgba(0,0,0,.55);
}

/* Base styles */
body {
  font-family: 'Roboto', sans-serif;
  margin: 0;
  background-color: #ffffff;
  color: var(--ink);
}

/* Header styles */
header {
  background: var(--purple);
  padding: 1rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

header .brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 auto;
}

header img {
  height: 60px;
}

header h1 {
  font-family: 'Montserrat', sans-serif;
  color: var(--gold);
  font-size: 1.5rem;
  margin: 0;
  text-align: center;
}

/* Navigation styles */
.top-nav {
  width: 100%;
  background: #fff;
  padding: 12px 0;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

.menu {
  display: inline-flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.pill-link {
  font-family: 'Montserrat', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #fff;
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: 8px 16px;
  text-decoration: none;
  transition: all .2s ease-in-out;
  background: transparent;
  display: inline-block;
}

.tab-nav .pill-link:not(.active) {
  color: var(--purple);
}

.pill-link:hover {
  background: var(--gold);
  color: var(--purple);
}

.pill-link.active {
  background: var(--purple);
  color: white;
  border: none;
}

.tab-nav {
  padding: 1rem;
  text-align: center;
}

/* Modal overlay styles (shared by index and search_articles) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.show {
  display: flex;
}

.modal-card {
  background: #fff;
  width: min(1000px, 95vw);
  height: min(85vh, 900px);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  border: 3px solid var(--gold);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  background: var(--purple);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
}

.modal-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.05rem;
  margin: 0;
  line-height: 1.2;
}

.modal-close {
  appearance: none;
  background: var(--gold);
  color: var(--purple);
  border: none;
  border-radius: 8px;
  font-weight: 700;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-close:hover {
  background: #ffbd48;
}

.modal-body {
  flex: 1;
  background: #fff;
}

.modal-body iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* Mobile responsive */
@media (max-width: 600px) {
  header {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  header h1 {
    text-align: left;
  }

  .top-nav {
    width: 100%;
    text-align: left;
  }

  .menu {
    justify-content: flex-start;
  }

  .modal-overlay {
    padding: 0;
  }

  .modal-overlay.show {
    display: block;
  }

  .modal-card {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    margin: 0;
    border: none;
  }
}
header .header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Article header styles */
.article-header {
  background: #fff;
}
