/* Privacy policy pages, rod.ac/privacy/<slug>.
   Loaded after /styles.css, so colours, fonts, the header, footer and buttons come from there.
   This file only adds the policy layout.

   Contents
   1. Page
   2. Title and sticker
   3. At a glance box
   4. Contents list and policy text
   5. Empty, not found and error messages
   6. Printing
*/


/* ==========================================================================
   1. Page
   ========================================================================== */

.policy-page {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(32px, 6vw, 72px) var(--page-gutter) clamp(48px, 8vw, 96px);
}

/* styles.css gives every section big padding for the main page; policy sections don't want it */
.policy-page section {
  max-width: none;
  margin: 0;
  padding: 0;
}

.policy-message {
  color: var(--muted-text);
}

/* Shown on entries marked draft: true in policies.js */
.policy-draft {
  margin-bottom: 24px;
  padding: 12px 16px;
  border: 2px dashed var(--deep-blue);
  border-radius: var(--radius-small);
  background-color: var(--pale-blue);
  color: var(--navy);
  font-weight: 700;
}


/* ==========================================================================
   2. Title and sticker
   The app icon sits tilted like the project stickers on the home page.
   ========================================================================== */

.policy-head {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 28px);
}

.policy-sticker {
  display: flex;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
  width: clamp(72px, 10vw, 104px);
  aspect-ratio: 1;
  overflow: hidden;
  border: 6px solid #ffffff;
  border-radius: 24%;
  background-color: #ffffff;
  box-shadow: 0 0 0 1px var(--border), 0 12px 22px -10px rgba(11, 26, 43, 0.45);
  transform: rotate(-5deg);
}

.policy-sticker img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.policy-sticker-dark {
  background-color: var(--navy);
}

/* No icon set: the first letter of the app name, white on dodger blue at a large size (passes 3:1) */
.policy-sticker-letter {
  background-color: var(--blue);
  color: #ffffff;
  font-size: clamp(2.2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1;
}

.policy-title {
  min-width: 0;
}

.policy-head h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  overflow-wrap: anywhere;
}

.policy-meta {
  margin-top: 10px;
  color: var(--muted-text);
}

.policy-intro {
  max-width: 62ch;
  margin-top: 28px;
  font-size: 1.15rem;
}


/* ==========================================================================
   3. At a glance box
   Same white card with a blue top edge as the project card on the home page.
   ========================================================================== */

.policy-facts {
  margin-top: 32px;
  padding: 20px 22px 22px;
  border: 1px solid var(--border);
  border-top: 4px solid var(--blue);
  border-radius: var(--radius-medium);
  background-color: var(--card-background);
}

.policy-facts h2 {
  margin-bottom: 14px;
  font-size: 1.2rem;
  letter-spacing: 0;
}

.policy-facts dl {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  margin: 0;
}

.policy-fact {
  flex: 1 1 200px;
}

.policy-fact dt {
  color: var(--muted-text);
  font-size: 0.92rem;
}

.policy-fact dd {
  margin: 2px 0 0;
  font-size: 1.15rem;
  font-weight: 700;
}


/* ==========================================================================
   4. Contents list and policy text
   Contents on the left on wide screens, above the text on narrow ones.
   Section numbers match the 01, 02 numbering on the service cards.
   ========================================================================== */

.policy-layout {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-top: 40px;
}

.policy-contents h2 {
  margin-bottom: 8px;
  font-size: 1rem;
  letter-spacing: 0;
}

.policy-contents ol {
  margin: 0;
  padding-left: 22px;
}

.policy-contents a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--navy);
  text-decoration: none;
}

.policy-contents a:hover {
  color: var(--deep-blue);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.policy-body {
  flex: 1 1 0;
  min-width: 0;
  max-width: 68ch;
  counter-reset: policy-section;
}

.policy-section + .policy-section {
  margin-top: 36px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.policy-section h2 {
  margin-bottom: 12px;
  font-size: clamp(1.4rem, 2.6vw, 1.75rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  counter-increment: policy-section;
}

.policy-section h2::before {
  content: counter(policy-section, decimal-leading-zero);
  display: block;
  margin-bottom: 6px;
  color: var(--deep-blue);
  font-size: 1rem;
  letter-spacing: 0;
}

.policy-section p + p,
.policy-section p + ul,
.policy-section ul + p {
  margin-top: 12px;
}

.policy-section ul {
  margin-bottom: 0;
  padding-left: 22px;
}

.policy-section li + li {
  margin-top: 6px;
}

.policy-section a {
  overflow-wrap: anywhere;
}

.policy-actions {
  margin-top: 40px;
}

@media (min-width: 900px) {
  .policy-layout {
    flex-direction: row;
    align-items: flex-start;
    gap: 56px;
  }

  .policy-contents {
    position: sticky;
    top: 92px; /* Clears the sticky header */
    flex: 0 0 220px;
  }
}


/* ==========================================================================
   5. Empty, not found and error messages
   ========================================================================== */

.policy-state {
  max-width: 52ch;
}

.policy-state h1 {
  font-size: clamp(2rem, 5vw, 3rem);
}

.policy-state p {
  margin-top: 16px;
  color: var(--muted-text);
  font-size: 1.1rem;
}

.policy-state .button {
  margin-top: 24px;
}


/* ==========================================================================
   6. Printing
   Just the policy, in black on white.
   ========================================================================== */

@media print {
  .site-header,
  .site-footer,
  .skip-link,
  .policy-contents,
  .policy-actions {
    display: none;
  }

  body {
    background-color: #ffffff;
    color: #000000;
  }

  .policy-page {
    padding: 0;
  }

  .policy-sticker {
    box-shadow: none;
    transform: none;
  }

  .policy-body {
    max-width: none;
  }

  .policy-section {
    break-inside: avoid;
  }
}
