@import url("https://fonts.googleapis.com/css2?family=Crimson+Pro:ital,wght@0,400;0,600;0,700;1,400;1,600&display=swap");

[data-page="changelog"] {
  --pg-cream: #f5f0e8;
  --pg-cream-dark: #ebe5d9;
  --pg-teal: #1a4645;
  --pg-teal-light: #2a6665;
  --pg-text: #4a4a4a;
  --pg-text-strong: #1a1a1a;
  --pg-text-muted: #888;
  --pg-border: #d4cfc7;
  --pg-white: #ffffff;
  --pg-radius: 12px;
  --font-serif: "Crimson Pro", Georgia, "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* legacy vars used by existing release/section styles */
  --color-background: var(--pg-cream);
  --color-background-weak: var(--pg-cream-dark);
  --color-background-weak-hover: #ddd8cc;
  --color-text: var(--pg-text);
  --color-text-weak: var(--pg-text-muted);
  --color-text-weaker: #bbb;
  --color-text-strong: var(--pg-text-strong);
  --color-border: var(--pg-border);
  --color-border-weak: #e0dbd3;

  background: var(--pg-cream);
  font-family: var(--font-sans);
  color: var(--pg-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;

  [data-component="footer"] {
    display: flex; justify-content: center; gap: 2rem;
    padding: 2rem; background: var(--pg-cream);
    border-top: 1px solid var(--pg-border); font-size: 0.85rem;
    margin-top: auto;
  }
  [data-component="footer"] a { color: var(--pg-text-muted); text-decoration: none; }
  [data-component="footer"] a:hover { color: var(--pg-text-strong); }

  [data-component="container"] {
    max-width: 67.5rem;
    margin: 0 auto;
  }

  [data-component="content"] {
    padding: 4rem 5rem;

    @media (max-width: 60rem) {
      padding: 3rem 1.5rem;
    }
  }

  [data-component="legal"] {
    color: var(--color-text-weak);
    text-align: center;
    padding: 2rem 5rem;
    display: flex;
    gap: 32px;
    justify-content: center;

    @media (max-width: 60rem) {
      padding: 2rem 1.5rem;
    }

    a {
      color: var(--color-text-weak);
      text-decoration: none;
    }

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

  /* Changelog Hero */
  [data-component="changelog-hero"] {
    margin-bottom: 4rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--color-border-weak);

    @media (max-width: 50rem) {
      margin-bottom: 2rem;
      padding-bottom: 1.5rem;
    }

    h1 {
      font-size: 1.5rem;
      font-weight: 700;
      color: var(--color-text-strong);
      margin-bottom: 8px;
    }

    p {
      color: var(--color-text);
    }
  }

  /* Releases */
  [data-component="releases"] {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  [data-component="release"] {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 3rem;
    padding: 2rem 0;
    border-bottom: 1px solid var(--color-border-weak);

    @media (max-width: 50rem) {
      grid-template-columns: 1fr;
      gap: 1rem;
    }

    &:first-child {
      padding-top: 0;
    }

    &:last-child {
      border-bottom: none;
    }

    header {
      display: flex;
      flex-direction: column;
      gap: 4px;
      position: sticky;
      top: 80px;
      align-self: start;
      background: var(--color-background);
      padding: 44px 0 8px;

      @media (max-width: 50rem) {
        position: static;
        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding: 0;
      }

      [data-slot="version"] {
        a {
          font-weight: 600;
          color: var(--color-text-strong);
          text-decoration: none;

          &:hover {
            text-decoration: underline;
            text-underline-offset: 2px;
            text-decoration-thickness: 1px;
          }
        }
      }

      time {
        color: var(--color-text-weak);
        font-size: 14px;
      }
    }

    [data-slot="content"] {
      display: flex;
      flex-direction: column;
      gap: 1.5rem;
    }

    [data-component="section"] {
      h3 {
        font-size: 13px;
        font-weight: 600;
        color: var(--color-text-strong);
        margin-bottom: 6px;
      }

      ul {
        list-style: none;
        padding: 0;
        margin: 0;
        padding-left: 16px;
        display: flex;
        flex-direction: column;
        gap: 4px;

        li {
          color: var(--color-text);
          font-size: 13px;
          line-height: 1.5;
          padding-left: 12px;
          position: relative;

          &::before {
            content: "-";
            position: absolute;
            left: 0;
            color: var(--color-text-weak);
          }

          [data-slot="author"] {
            color: var(--color-text-weak);
            font-size: 12px;
            margin-left: 4px;
            text-decoration: none;

            &:hover {
              text-decoration: underline;
              text-underline-offset: 2px;
              text-decoration-thickness: 1px;
            }
          }
        }
      }
    }

    [data-component="contributors"] {
      font-size: 13px;
      color: var(--color-text-weak);
      padding-top: 0.5rem;

      span {
        color: var(--color-text-weak);
      }

      a {
        color: var(--color-text);
        text-decoration: none;

        &:hover {
          text-decoration: underline;
          text-underline-offset: 2px;
          text-decoration-thickness: 1px;
        }
      }
    }

    [data-component="highlights"] {
      display: flex;
      flex-direction: column;
      gap: 3rem;
      margin-bottom: 0.75rem;
    }

    [data-component="collapsible-sections"] {
      display: flex;
      flex-direction: column;
      gap: 0;
    }

    [data-component="collapsible-section"] {
      [data-slot="toggle"] {
        display: flex;
        align-items: center;
        gap: 6px;
        background: none;
        border: none;
        padding: 6px 0;
        cursor: pointer;
        font-family: inherit;
        font-size: 13px;
        font-weight: 600;
        color: var(--color-text-weak);

        &:hover {
          color: var(--color-text);
        }

        [data-slot="icon"] {
          font-size: 10px;
        }
      }

      ul {
        list-style: none;
        padding: 0;
        margin: 0;
        padding-left: 16px;
        padding-bottom: 8px;

        li {
          color: var(--color-text);
          font-size: 13px;
          line-height: 1.5;
          padding-left: 12px;
          position: relative;

          &::before {
            content: "-";
            position: absolute;
            left: 0;
            color: var(--color-text-weak);
          }

          [data-slot="author"] {
            color: var(--color-text-weak);
            font-size: 12px;
            margin-left: 4px;
            text-decoration: none;

            &:hover {
              text-decoration: underline;
              text-underline-offset: 2px;
              text-decoration-thickness: 1px;
            }
          }
        }
      }
    }

    [data-component="highlight"] {
      h4 {
        font-size: 14px;
        font-weight: 600;
        color: var(--color-text-strong);
        margin-bottom: 8px;
      }

      hr {
        border: none;
        border-top: 1px solid var(--color-border-weak);
        margin-bottom: 16px;
      }

      [data-slot="highlight-item"] {
        margin-bottom: 48px;

        &:last-child {
          margin-bottom: 0;
        }

        p[data-slot="title"] {
          font-weight: 600;
          font-size: 16px;
          margin-bottom: 4px;
        }

        p {
          font-size: 14px;
          margin-bottom: 12px;
        }
      }

      img,
      video {
        max-width: 100%;
        height: auto;
        border-radius: 4px;
      }
    }
  }

  a {
    color: var(--pg-teal);
    text-decoration: none;

    &:hover {
      text-decoration: underline;
      text-underline-offset: 2px;
    }
  }

  [data-component="changelog-hero"] h1 {
    font-family: var(--font-serif);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 400;
    font-style: italic;
    color: var(--pg-teal);
    margin: 0 0 0.75rem;
  }

  [data-component="changelog-hero"] p {
    color: var(--pg-text-muted);
    font-size: 1rem;
  }

  [data-component="legal"] {
    color: var(--pg-text-muted);
    text-align: center;
    padding: 1.5rem 2rem;
    display: flex;
    gap: 2rem;
    justify-content: center;
    font-size: 0.8rem;
  }
  [data-component="legal"] a { color: var(--pg-text-muted); }
}
