/* ============================================
   Amora & Co. — Legal Document Components
   Built on top of the site's own design tokens (styles.css)
   ============================================ */

body.legal-doc { background: var(--color-bg-alt); }

/* ---------- Page shell ---------- */
.doc-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md) var(--space-xl);
}
.doc-page {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

/* ---------- Cover / header banner ---------- */
.doc-cover {
  position: relative;
  padding: 3.2rem var(--space-xl) 2.6rem;
  background:
    radial-gradient(circle at 15% 20%, color-mix(in srgb, var(--blush) 35%, transparent), transparent 55%),
    radial-gradient(circle at 85% 0%, color-mix(in srgb, var(--sky) 35%, transparent), transparent 50%),
    linear-gradient(160deg, var(--cream) 0%, var(--cream-alt) 100%);
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.doc-cover .logo-mark {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-sm);
  object-fit: contain;
}
.doc-brand {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--fs-xs);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--rose-ink);
  margin-bottom: 0.75rem;
}
.doc-cover h1 {
  font-size: clamp(2rem, 1.7rem + 1.5vw, var(--fs-3xl));
  margin-bottom: 0.6rem;
}
.doc-cover .doc-subtitle {
  color: var(--color-text-soft);
  font-size: var(--fs-lg);
  max-width: 46ch;
  margin: 0 auto;
}
.doc-meta {
  margin-top: var(--space-md);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: center;
  font-size: var(--fs-xs);
  color: var(--color-text-soft);
}
.doc-meta strong { color: var(--ink); }

/* ---------- Body content ---------- */
.doc-body {
  padding: var(--space-xl) var(--space-xl) var(--space-lg);
}
@media (max-width: 640px) {
  .doc-body, .doc-cover { padding-left: var(--space-md); padding-right: var(--space-md); }
}

.doc-intro {
  font-size: var(--fs-lg);
  color: var(--color-text-soft);
  border-left: 3px solid var(--gold);
  padding-left: 1.1rem;
  margin-bottom: var(--space-lg);
}

section.doc-section {
  padding-top: var(--space-lg);
  padding-bottom: var(--space-lg);
  border-top: 1px solid var(--border);
}
section.doc-section:first-of-type { border-top: none; padding-top: 0; }

.section-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: var(--color-primary-text);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  margin-right: 0.7rem;
  flex: none;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin-bottom: 0.9rem;
}
.section-title h2 { font-size: var(--fs-xl); }
.section-icon {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: var(--radius-full);
  background: var(--color-bg-alt);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.7rem;
  flex: none;
}
.section-icon svg { width: 1.15rem; height: 1.15rem; }

.doc-section h3 {
  font-size: 1.1rem;
  margin: 1.1rem 0 0.4rem;
  color: var(--rose-ink);
}
.doc-section p { margin-bottom: 0.75rem; }
.doc-section p:last-child { margin-bottom: 0; }

/* ---------- Callout boxes ---------- */
.callout {
  border-radius: var(--radius-md);
  padding: 1.1rem 1.3rem;
  margin: 1rem 0;
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
  font-size: var(--fs-sm);
}
.callout .callout-icon {
  width: 1.6rem;
  height: 1.6rem;
  flex: none;
  margin-top: 0.1rem;
}
.callout-title { font-weight: 700; margin-bottom: 0.2rem; font-family: var(--font-body); }
.callout-info { background: color-mix(in srgb, var(--sky) 22%, white); color: var(--ink); }
.callout-info .callout-title { color: var(--sky-deep); }
.callout-warn { background: color-mix(in srgb, var(--gold) 25%, white); color: var(--ink); }
.callout-warn .callout-title { color: var(--gold-deep); }
.callout-good { background: color-mix(in srgb, var(--sage) 25%, white); color: var(--ink); }
.callout-good .callout-title { color: var(--sage-deep); }
.callout-note { background: color-mix(in srgb, var(--blush) 25%, white); color: var(--ink); }
.callout-note .callout-title { color: var(--rose-ink); }

/* ---------- Tables ---------- */
table.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.4rem;
  font-size: var(--fs-sm);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}
table.doc-table th {
  background: var(--color-bg-alt);
  color: var(--rose-ink);
  text-align: left;
  padding: 0.7rem 1rem;
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--border);
}
table.doc-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table.doc-table tr:last-child td { border-bottom: none; }
table.doc-table tr:nth-child(even) td { background: color-mix(in srgb, var(--cream-alt) 55%, white); }

/* ---------- Placeholders ---------- */
.ph {
  background: color-mix(in srgb, var(--gold) 30%, white);
  color: var(--gold-deep);
  padding: 0.05em 0.5em;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.94em;
  white-space: nowrap;
}

/* ---------- Signature blocks ---------- */
.sig-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin-top: var(--space-md);
}
@media (max-width: 640px) { .sig-grid { grid-template-columns: 1fr; } }
.sig-block { display: flex; flex-direction: column; }
.sig-line {
  border-bottom: 1.5px solid var(--ink-soft);
  height: 2.6rem;
  margin-bottom: 0.4rem;
}
.sig-label { font-size: var(--fs-xs); color: var(--color-text-soft); text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------- Divider ---------- */
.doc-divider {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: var(--space-lg) 0;
}

/* ---------- Footer ---------- */
.doc-footer {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--border);
  padding: 1.5rem var(--space-xl);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: var(--fs-xs);
  color: var(--color-text-soft);
}
.doc-footer .foot-brand { display: flex; align-items: center; gap: 0.6rem; }
.doc-footer .foot-brand img { width: 22px; height: 22px; object-fit: contain; }
.doc-footer .foot-brand strong { font-family: var(--font-heading); color: var(--ink); font-size: 1rem; }

/* ---------- Nav between documents (screen only) ---------- */
.doc-nav {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.2rem var(--space-md) 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--fs-xs);
}
.doc-nav a {
  text-decoration: none;
  color: var(--rose-ink);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.doc-nav a:hover { text-decoration: underline; }

/* ---------- Index hub cards ---------- */
.index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: var(--space-lg);
}
.doc-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.doc-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.doc-card .card-icon {
  width: 2.6rem; height: 2.6rem;
  border-radius: var(--radius-full);
  background: var(--color-bg-alt);
  display: flex; align-items: center; justify-content: center;
}
.doc-card .card-icon svg { width: 1.4rem; height: 1.4rem; color: var(--rose-ink); }
.doc-card h3 { font-family: var(--font-heading); font-size: 1.3rem; color: var(--ink); text-decoration: none; }
.doc-card p { font-size: var(--fs-sm); color: var(--color-text-soft); text-decoration: none; margin: 0; }

/* ---------- Print ---------- */
@media print {
  .doc-nav { display: none; }
  .doc-wrap { padding: 0; max-width: 100%; }
  .doc-page { box-shadow: none; border-radius: 0; border: none; }
  section.doc-section { break-inside: avoid; }
  @page { margin: 1.6cm; }
}
