/* Master Policy — shared UI
   Cool slate/teal editorial look. Keeps multi-tenant logos; cleans chrome. */

@import url('https://fonts.googleapis.com/css2?family=Literata:opsz,wght@7..72,500;7..72,650;7..72,700&family=Manrope:wght@400;500;600;700&display=swap');

:root {
  --ink: #0d3b4c;
  --ink-soft: #1a5566;
  --accent: #1f7a8c;
  --accent-hover: #186474;
  --paper: #f5f7f9;
  --paper-2: #eef2f5;
  --surface: #ffffff;
  --line: #d7e0e6;
  --text: #1c2a32;
  --muted: #5b6b75;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(13, 59, 76, 0.04), 0 8px 24px rgba(13, 59, 76, 0.06);
  --font-ui: 'Manrope', system-ui, sans-serif;
  --font-display: 'Literata', Georgia, serif;
  --header-h: 72px;
  --toc-w: 280px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  height: 100%;
}

body.policy-body {
  margin: 0;
  min-height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-ui);
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(31, 122, 140, 0.10), transparent 55%),
    radial-gradient(900px 400px at 100% 0%, rgba(13, 59, 76, 0.06), transparent 50%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
  background-attachment: fixed;
}

/* Full-height frame keeps footer pinned on short pages */
.site-frame {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.site-shell {
  flex: 1 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.site-shell > .site-main,
.site-shell > .doc-layout,
.site-shell > .contact-shell {
  flex: 1 0 auto;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

/* ——— Site header ——— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(215, 224, 230, 0.9);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.site-header__inner {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  text-decoration: none !important;
  min-width: 0;
}

.site-brand img {
  height: 40px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
}

.site-brand__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.site-brand__name {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 1.05rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-brand__tag {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none !important;
  transition: background 0.15s ease, color 0.15s ease;
}

.site-nav a:hover,
.site-nav a.is-active {
  background: rgba(31, 122, 140, 0.1);
  color: var(--ink);
}

.site-nav__cta {
  margin-left: 0.35rem;
  background: var(--ink) !important;
  color: #fff !important;
}

.site-nav__cta:hover {
  background: var(--ink-soft) !important;
  color: #fff !important;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ——— Page shell ——— */
.site-main {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.site-footer {
  margin-top: auto;
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2rem;
  color: var(--muted);
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.72);
}

.site-footer__inner {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ——— Landing ——— */
.hero-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: 2rem 2.25rem;
  margin-bottom: 1.5rem;
}

.hero-panel h1,
.hero-panel h4 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0 0 0.75rem;
  font-weight: 650;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
}

.hero-panel .block-content,
.hero-panel p {
  color: var(--muted);
  line-height: 1.7;
  font-size: 1.02rem;
  margin: 0;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.overview-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.overview-card:hover {
  transform: translateY(-2px);
  border-color: rgba(31, 122, 140, 0.35);
}

.overview-card h4 {
  font-family: var(--font-display);
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 650;
  margin: 0 0 0.65rem;
}

.overview-card p,
.overview-card .block-content {
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
  font-size: 0.95rem;
}

/* ——— Document pages (privacy / terms / others) ——— */
.doc-layout {
  display: grid;
  grid-template-columns: var(--toc-w) minmax(0, 1fr);
  grid-template-areas: "toc panel";
  gap: 1.5rem;
  align-items: start;
  width: min(1180px, calc(100% - 2rem));
  margin: 1.25rem auto 3rem;
}

/* Backdrop must not participate in the grid (it was stealing the first column). */
.doc-toc-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(13, 59, 76, 0.35);
  z-index: 150;
}

.doc-toc {
  grid-area: toc;
  position: sticky;
  top: calc(var(--header-h) + 1rem);
  max-height: calc(100vh - var(--header-h) - 2rem);
  overflow: auto;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  padding: 1.25rem 1rem 1.5rem;
  box-shadow: var(--shadow);
}

.doc-toc__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff !important;
  text-decoration: none !important;
}

.doc-toc__brand img {
  height: 56px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
}

.doc-toc__brand span {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.8;
}

.doc-toc__label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  margin: 1.1rem 0 0.55rem;
  list-style: none;
}

.doc-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.doc-toc li { margin: 0 0 0.35rem; }

.doc-toc a {
  display: block;
  color: rgba(255, 255, 255, 0.88) !important;
  text-decoration: none !important;
  font-size: 0.86rem;
  line-height: 1.4;
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.doc-toc a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff !important;
}

.doc-panel {
  grid-area: panel;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow);
  padding: 2rem 2.25rem 2.5rem;
  min-width: 0;
}

.doc-panel h1 {
  font-family: var(--font-display);
  color: var(--ink);
  font-size: clamp(1.6rem, 2.5vw, 2.1rem);
  font-weight: 700;
  margin: 0 0 1rem;
  line-height: 1.25;
}

.doc-panel h2 {
  font-family: var(--font-display);
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 650;
  margin: 2rem 0 0.75rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--line);
}

.doc-panel h2:first-of-type { border-top: 0; padding-top: 0; }

.doc-panel h3 {
  color: var(--ink-soft);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 1.35rem 0 0.5rem;
}

.doc-panel p,
.doc-panel li {
  line-height: 1.7;
  color: var(--text);
}

.doc-panel img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0.75rem 0 1rem;
}

.doc-panel table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.95rem;
}

.doc-panel th,
.doc-panel td {
  border: 1px solid var(--line);
  padding: 0.65rem 0.75rem;
  vertical-align: top;
}

.doc-panel th {
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
}

.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.doc-empty {
  text-align: center;
  color: var(--muted);
  padding: 3rem 1rem;
  font-size: 1.05rem;
  line-height: 1.6;
}

.doc-mobile-toc-btn {
  display: none;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
  font-weight: 600;
  font-family: var(--font-ui);
  cursor: pointer;
}

/* ——— Contact form ——— */
.contact-shell {
  width: min(640px, calc(100% - 2rem));
  margin: 2rem auto 3rem;
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow);
  padding: 2rem;
}

.contact-card h1 {
  font-family: var(--font-display);
  color: var(--ink);
  font-size: 1.75rem;
  margin: 0 0 1.25rem;
  text-transform: capitalize;
}

.contact-card label {
  display: block;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.contact-card .form-control {
  border: 1px solid var(--line);
  border-radius: 8px !important;
  padding: 0.65rem 0.8rem;
  font-family: var(--font-ui);
}

.contact-card .form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 122, 140, 0.15);
  outline: none;
}

.contact-card .btn-primary,
.contact-card button[type="submit"] {
  background: var(--ink);
  border: 0;
  border-radius: 8px;
  padding: 0.7rem 1.25rem;
  font-weight: 600;
  color: #fff;
}

.contact-card .btn-primary:hover,
.contact-card button[type="submit"]:hover {
  background: var(--ink-soft);
}

/* Back-to-top */
#myBtn {
  display: none;
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 99;
  border: 0;
  background: var(--ink);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow);
}

#myBtn:hover { background: var(--accent); }

/* Legacy Codebase blocks on landing — neutralize heavy chrome */
.policy-body .block {
  background: transparent;
  box-shadow: none;
  margin: 0;
}
.policy-body .block-header {
  background: transparent;
  border: 0;
  padding: 0;
}
.policy-body .block-content {
  padding: 0;
}

@media (max-width: 960px) {
  .overview-grid { grid-template-columns: 1fr; }

  .doc-layout {
    grid-template-columns: 1fr;
    grid-template-areas: "panel";
  }

  .doc-toc {
    grid-area: unset;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(86vw, 300px);
    max-height: none;
    z-index: 200;
    border-radius: 0;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
  }

  .doc-layout.is-toc-open .doc-toc {
    transform: translateX(0);
  }

  .doc-layout.is-toc-open .doc-toc-backdrop { display: block; }

  .doc-mobile-toc-btn { display: inline-flex; align-items: center; gap: 0.4rem; }

  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 0.75rem;
    gap: 0.25rem;
  }

  .site-header.is-nav-open .site-nav { display: flex; }

  .nav-toggle { display: inline-flex; }

  .hero-panel,
  .doc-panel { padding: 1.35rem 1.15rem; }
}
