/* EvueMe Policy Portal — Brand-compliant stylesheet
   Applies Section 3 color system, Section 4 typography, Section 7 touchpoint rules
   from the EvueMe Brand Identity Manual v1.0 */

:root {
  /* Primary palette */
  --indigo: #47143D;
  --golden: #B99750;
  --mauve: #7C6D7C;

  /* Extended */
  --white: #FFFFFF;
  --off-white: #FAF7F2;
  --wash: #F5EEF3;
  --tint-10: #EDE8EC;
  --near-black: #1A1A2E;
  --border: #E5E0E4;

  /* Semantic */
  --teal: #1A7A6D;
  --coral: #B94A33;
  --amber: #D4882A;

  /* Spacing */
  --container-width: 1200px;
  --content-width: 820px;
  --gap: 24px;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--near-black);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============ TYPOGRAPHY ============ */

h1, h2, h3, h4 {
  color: var(--indigo);
  font-weight: 700;
  line-height: 1.25;
}

p { margin-bottom: 1rem; }

a {
  color: var(--indigo);
  text-decoration: underline;
  text-decoration-color: var(--golden);
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--golden);
}

strong { font-weight: 700; color: var(--indigo); }
em { font-style: italic; }

/* ============ TOP NAV BAR (every page) ============ */

.topbar {
  background: var(--indigo);
  height: 72px;
  display: flex;
  align-items: center;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.topbar__inner {
  max-width: var(--container-width);
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
}

.topbar__logo {
  height: 36px;
  width: auto;
  display: block;
}

.topbar__descriptor {
  color: var(--golden);
  font-size: 12px;
  letter-spacing: 0.08em;
  font-weight: 600;
  text-transform: uppercase;
}

.topbar__meta {
  color: var(--white);
  font-size: 13px;
  opacity: 0.85;
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar__meta strong { color: var(--golden); font-weight: 600; }

/* Golden accent line below topbar */
.topbar-rule {
  height: 3px;
  background: var(--golden);
}

/* ============ COVER PAGE — HERO ============ */

.hero {
  background: var(--indigo);
  color: var(--white);
  padding: 80px 32px 100px;
  position: relative;
  overflow: hidden;
}

.hero__inner {
  max-width: var(--container-width);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero__overline {
  color: var(--golden);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.hero__title {
  font-size: clamp(36px, 5vw, 52px);
  line-height: 1.1;
  margin-bottom: 20px;
  color: var(--white);
  max-width: 900px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.hero__tagline {
  font-size: 20px;
  color: var(--golden);
  font-style: italic;
  margin-bottom: 24px;
  max-width: 720px;
}

.hero__blurb {
  font-size: 17px;
  color: rgba(255, 255, 255, 0.88);
  max-width: 720px;
  line-height: 1.6;
}

/* ============ TRUST SIGNALS BAR (right under hero) ============ */

.trust {
  background: var(--off-white);
  padding: 36px 32px;
  border-bottom: 1px solid var(--border);
}

.trust__inner {
  max-width: var(--container-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  align-items: start;
}

.trust__item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.trust__label {
  font-size: 11px;
  font-weight: 700;
  color: var(--mauve);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.trust__value {
  font-size: 15px;
  color: var(--near-black);
  line-height: 1.4;
  font-weight: 600;
}

.trust__value a {
  color: var(--indigo);
}

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

.search-section {
  background: var(--white);
  padding: 48px 32px 24px;
}

.search-section__inner {
  max-width: var(--container-width);
  margin: 0 auto;
}

.search-section__title {
  font-size: 28px;
  color: var(--indigo);
  margin-bottom: 6px;
  font-weight: 700;
}

.search-section__caption {
  color: var(--mauve);
  font-size: 14px;
  margin-bottom: 24px;
}

.search-box {
  position: relative;
  max-width: 520px;
}

.search-box input {
  width: 100%;
  padding: 14px 18px 14px 48px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px;
  color: var(--near-black);
  background: var(--white);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-box input:focus {
  outline: none;
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px rgba(71, 20, 61, 0.1);
}

.search-box input::placeholder {
  color: var(--mauve);
}

.search-box__icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--mauve);
  pointer-events: none;
}

.search-count {
  color: var(--mauve);
  font-size: 13px;
  margin-top: 12px;
}

/* ============ POLICY GRID (cover) ============ */

.policy-grid-section {
  padding: 16px 32px 80px;
  background: var(--white);
}

.policy-grid-section__inner {
  max-width: var(--container-width);
  margin: 0 auto;
}

.policy-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.policy-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 4px solid var(--golden);
  border-radius: 8px;
  padding: 24px 28px;
  text-decoration: none;
  color: var(--near-black);
  transition: all 0.2s ease;
  display: block;
}

.policy-card:hover {
  border-color: var(--indigo);
  border-left-color: var(--indigo);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(71, 20, 61, 0.08);
  color: var(--near-black);
}

.policy-card__code {
  color: var(--golden);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.policy-card__title {
  color: var(--indigo);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 10px;
  text-decoration: none;
}

.policy-card__purpose {
  color: var(--near-black);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 14px;
  opacity: 0.8;
}

.policy-card__meta {
  display: flex;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--mauve);
}

.policy-card__meta strong {
  color: var(--indigo);
  font-weight: 600;
}

.policy-card--hidden {
  display: none;
}

.no-results {
  padding: 48px 0;
  color: var(--mauve);
  text-align: center;
  font-style: italic;
  display: none;
}

.no-results--visible { display: block; }

/* ============ POLICY PAGE LAYOUT ============ */

.policy-page {
  background: var(--white);
}

.policy-hero {
  background: var(--indigo);
  color: var(--white);
  padding: 48px 32px 56px;
  position: relative;
}

.policy-hero__inner {
  max-width: var(--container-width);
  margin: 0 auto;
  position: relative;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--golden);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 28px;
  transition: opacity 0.15s ease;
}

.back-link:hover {
  color: var(--golden);
  opacity: 0.8;
}

.policy-hero__code {
  color: var(--golden);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.policy-hero__title {
  font-size: clamp(30px, 4vw, 42px);
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 14px;
  font-weight: 700;
}

.policy-hero__meta {
  color: var(--golden);
  font-size: 15px;
}

.policy-hero__rule {
  height: 3px;
  background: var(--golden);
}

/* ============ POLICY BODY + STICKY TOC ============ */

.policy-body {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 48px 32px 80px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
  align-items: start;
}

.toc {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 128px);
  overflow-y: auto;
  padding-right: 12px;
}

.toc__header {
  font-size: 11px;
  font-weight: 700;
  color: var(--mauve);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.toc__list {
  list-style: none;
  padding: 0;
}

.toc__item { margin-bottom: 2px; }

.toc__link {
  display: block;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--near-black);
  text-decoration: none;
  border-radius: 4px;
  border-left: 2px solid transparent;
  transition: all 0.15s ease;
  line-height: 1.4;
}

.toc__link:hover {
  background: var(--wash);
  color: var(--indigo);
  border-left-color: var(--golden);
}

.toc__link--active {
  background: var(--wash);
  color: var(--indigo);
  font-weight: 600;
  border-left-color: var(--indigo);
}

.toc__link--h2 {
  padding-left: 20px;
  font-size: 12px;
  color: var(--mauve);
}

.toc__link--h3 {
  padding-left: 30px;
  font-size: 12px;
  color: var(--mauve);
}

/* ============ POLICY CONTENT ============ */

.policy-content {
  min-width: 0;
  max-width: 760px;
}

.control-box {
  background: var(--wash);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px 28px;
  margin-bottom: 32px;
}

.control-box__table {
  width: 100%;
  border-collapse: collapse;
}

.control-box__table td {
  padding: 7px 0;
  font-size: 14px;
  vertical-align: top;
}

.control-box__table td:first-child {
  width: 200px;
  color: var(--indigo);
  font-weight: 600;
}

.version-history {
  margin-bottom: 48px;
}

.version-history h2 {
  font-size: 22px;
  margin-bottom: 8px;
}

.version-history__blurb {
  color: var(--mauve);
  font-size: 14px;
  margin-bottom: 16px;
}

.version-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  font-size: 13px;
}

.version-table th {
  background: var(--indigo);
  color: var(--white);
  text-align: left;
  padding: 12px 14px;
  font-weight: 600;
  font-size: 13px;
}

.version-table td {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  color: var(--near-black);
}

.version-table tbody tr:nth-child(odd) { background: var(--off-white); }

.policy-content h1 {
  font-size: 28px;
  color: var(--indigo);
  margin: 48px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--golden);
  font-weight: 700;
  line-height: 1.2;
}

.policy-content h1:first-child { margin-top: 0; }

.policy-content h2 {
  font-size: 20px;
  color: var(--indigo);
  margin: 32px 0 10px;
  font-weight: 700;
}

.policy-content h3 {
  font-size: 17px;
  color: var(--indigo);
  margin: 24px 0 8px;
  font-weight: 600;
}

.policy-content p {
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 14px;
  color: var(--near-black);
}

.policy-content ul {
  list-style: none;
  padding-left: 0;
  margin: 0 0 16px;
}

.policy-content ul li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--near-black);
}

.policy-content ul li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 10px;
  width: 6px;
  height: 6px;
  background: var(--golden);
  border-radius: 50%;
}

.policy-content .cross-link {
  color: var(--indigo);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--golden);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.policy-content .cross-link:hover {
  color: var(--golden);
  text-decoration-color: var(--indigo);
}

/* Section anchors — offset so scroll lands below sticky header */
.policy-content [id] { scroll-margin-top: 100px; }

/* Table inside content (e.g. the policy suite table in 2.1) */
.content-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  margin: 20px 0 28px;
  font-size: 14px;
}

.content-table th {
  background: var(--indigo);
  color: var(--white);
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
}

.content-table th strong {
  color: var(--white);
  font-weight: 700;
}

.content-table td {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  vertical-align: top;
}

.content-table tbody tr:nth-child(odd) { background: var(--off-white); }

.content-table td:first-child {
  font-weight: 600;
  color: var(--indigo);
}

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

.site-footer {
  background: var(--indigo);
  color: var(--white);
  padding: 40px 32px 32px;
  margin-top: 48px;
}

.site-footer__inner {
  max-width: var(--container-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: space-between;
  align-items: flex-start;
}

.site-footer__brand {
  max-width: 360px;
}

.site-footer__brand img {
  height: 32px;
  width: auto;
  margin-bottom: 12px;
}

.site-footer__tagline {
  color: var(--golden);
  font-style: italic;
  font-size: 14px;
  margin-bottom: 8px;
}

.site-footer__meta {
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  line-height: 1.6;
}

.site-footer__meta a {
  color: var(--golden);
  text-decoration: none;
}

.site-footer__legal {
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  width: 100%;
}

/* ============ RESPONSIVE ============ */

@media (max-width: 960px) {
  .trust__inner { grid-template-columns: repeat(2, 1fr); }
  .policy-grid { grid-template-columns: 1fr; }
  .policy-body {
    grid-template-columns: 1fr;
    padding: 32px 20px 64px;
  }
  .toc {
    position: static;
    max-height: none;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--off-white);
    border-radius: 8px;
  }
  .toc__header { margin-bottom: 8px; }
  .toc details summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--indigo);
    list-style: none;
  }
  .toc details summary::-webkit-details-marker { display: none; }
  .toc details summary::after {
    content: "▾";
    float: right;
    transition: transform 0.2s;
  }
  .toc details[open] summary::after { transform: rotate(180deg); }
}

@media (max-width: 640px) {
  .topbar { padding: 0 16px; height: 60px; }
  .topbar__logo { height: 28px; }
  .topbar__meta { font-size: 11px; gap: 8px; }
  .topbar__meta > :first-child { display: none; }  /* Hide "Confidential" on very narrow screens */
  .topbar__descriptor { display: none; }
  .hero { padding: 48px 20px 64px; }
  .hero__title { font-size: 32px; line-height: 1.1; }
  .hero__tagline { font-size: 16px; }
  .hero__blurb { font-size: 15px; }
  .trust { padding: 28px 20px; }
  .trust__inner { grid-template-columns: 1fr; gap: 20px; }
  .search-section,
  .policy-grid-section { padding-left: 20px; padding-right: 20px; }
  .search-section__title { font-size: 22px; }
  .policy-hero { padding: 32px 20px 40px; }
  .site-footer { padding: 32px 20px 24px; }
  .site-footer__inner { flex-direction: column; gap: 20px; }
  .policy-content h1 { font-size: 22px; }
  .policy-content h2 { font-size: 17px; }
  .policy-content h3 { font-size: 16px; }
}

/* Print — clean PDF output if a reviewer uses the browser's print */
@media print {
  .topbar,
  .back-link,
  .toc,
  .site-footer,
  .search-section { display: none; }
  .policy-body {
    grid-template-columns: 1fr;
    padding: 0;
  }
  .policy-hero {
    background: var(--white);
    color: var(--indigo);
    padding: 0 0 20px;
    border-bottom: 2px solid var(--golden);
  }
  .policy-hero__title { color: var(--indigo); }
  .policy-hero__code,
  .policy-hero__meta,
  .back-link { color: var(--mauve); }
  body { font-size: 11pt; }
}
