/* =============================================
   DocEngine — Subpage Styles
   ============================================= */

/* --- Page Hero --- */
.page-hero {
  background: var(--gradient-hero);
  padding: clamp(6rem, 10vw, 8rem) 0 clamp(3rem, 5vw, 4rem);
  text-align: center;
}

.page-hero__title {
  font-size: var(--text-4xl);
  font-weight: 800;
  color: var(--white);
  margin-bottom: 0.5rem;
}

.page-hero__subtitle {
  font-size: var(--text-lg);
  color: var(--gray-300);
  max-width: 600px;
  margin: 0 auto;
}

/* --- Page Content --- */
.page-content {
  padding: var(--section-py) 0;
}

.page-content__inner {
  max-width: 900px;
  margin: 0 auto;
}

/* --- Legal Document Styles --- */
.legal-doc h2 {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--gray-900);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.legal-doc h2:first-child {
  margin-top: 0;
}

.legal-doc h3 {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--gray-700);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.legal-doc p {
  color: var(--gray-500);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.legal-doc ul {
  list-style: disc;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.legal-doc ul li {
  color: var(--gray-500);
  line-height: 1.8;
  margin-bottom: 0.5rem;
}

.legal-doc a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-color: rgba(65, 116, 185, 0.3);
  transition: text-decoration-color var(--transition);
}

.legal-doc a:hover {
  text-decoration-color: var(--blue);
}

/* --- Security Grid --- */
.security-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.security-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.security-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--blue);
}

.security-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--blue-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: var(--blue);
}

.security-card h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.security-card p {
  color: var(--gray-500);
  line-height: 1.7;
  font-size: var(--text-sm);
}

/* --- Documentation Grid --- */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 1.5rem;
}

.docs-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.docs-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--blue);
}

.docs-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.docs-card__icon--blue { background: var(--blue-pale); color: var(--blue); }
.docs-card__icon--green { background: #D1FAE5; color: var(--green); }
.docs-card__icon--purple { background: #EDE9FE; color: var(--purple); }
.docs-card__icon--orange { background: #FFF3E0; color: var(--orange); }
.docs-card__icon--cyan { background: #E0F7FA; color: var(--cyan); }
.docs-card__icon--red { background: #FEE2E2; color: var(--red); }

.docs-card h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.docs-card p {
  color: var(--gray-500);
  line-height: 1.7;
  font-size: var(--text-sm);
  margin-bottom: 1rem;
}

.docs-card ol,
.docs-card ul {
  padding-left: 1.25rem;
}

.docs-card ol { list-style: decimal; }
.docs-card ul { list-style: disc; }

.docs-card li {
  color: var(--gray-500);
  font-size: var(--text-sm);
  line-height: 1.7;
  margin-bottom: 0.35rem;
}

.docs-card li strong {
  color: var(--gray-700);
}

.docs-card a {
  color: var(--blue);
}

/* --- API Reference --- */
.api-overview {
  margin-bottom: 3rem;
}

.api-info h2 {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--gray-900);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.api-info h2:first-child {
  margin-top: 0;
}

.api-info p {
  color: var(--gray-500);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.api-info code {
  background: var(--gray-100);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: var(--text-sm);
  color: var(--blue);
}

.api-code-block {
  display: block;
  background: var(--navy);
  color: #A5D6FF;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  font-size: var(--text-sm);
  overflow-x: auto;
  margin-bottom: 1rem;
}

.api-section {
  margin-bottom: 2.5rem;
}

.api-section__title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--gray-200);
}

.api-section__title i {
  width: 20px;
  height: 20px;
  color: var(--blue);
}

.api-endpoint {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  transition: border-color var(--transition);
}

.api-endpoint:hover {
  border-color: var(--blue);
}

.api-endpoint__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.api-endpoint__header code {
  font-size: var(--text-sm);
  color: var(--gray-900);
  font-weight: 500;
}

.api-endpoint p {
  color: var(--gray-500);
  font-size: var(--text-sm);
  margin: 0;
}

.api-method {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.api-method--get { background: #D1FAE5; color: #065F46; }
.api-method--post { background: #DBEAFE; color: #1E40AF; }
.api-method--put { background: #FEF3C7; color: #92400E; }
.api-method--delete { background: #FEE2E2; color: #991B1B; }

/* --- Changelog --- */
.changelog-timeline {
  position: relative;
  padding-left: 2rem;
}

.changelog-timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gray-200);
}

.changelog-entry {
  position: relative;
  margin-bottom: 3rem;
  padding-left: 1.5rem;
}

.changelog-entry::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 0.35rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--blue);
  border: 3px solid var(--white);
  box-shadow: 0 0 0 2px var(--blue);
}

.changelog-entry__date {
  font-size: var(--text-sm);
  color: var(--gray-400);
  margin-bottom: 0.25rem;
}

.changelog-entry__version {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.changelog-entry__tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.changelog-tag {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.changelog-tag--feature { background: #DBEAFE; color: #1E40AF; }
.changelog-tag--improvement { background: #D1FAE5; color: #065F46; }
.changelog-tag--fix { background: #FEF3C7; color: #92400E; }

.changelog-entry ul {
  list-style: disc;
  padding-left: 1.25rem;
}

.changelog-entry li {
  color: var(--gray-500);
  line-height: 1.8;
  margin-bottom: 0.5rem;
}

.changelog-entry li strong {
  color: var(--gray-700);
}

/* --- Help Center --- */
.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.help-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.help-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--blue-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: var(--blue);
}

.help-card h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 1rem;
}

.help-faq {
  border-bottom: 1px solid var(--gray-100);
  margin-bottom: 0;
}

.help-faq:last-child {
  border-bottom: none;
}

.help-faq summary {
  padding: 0.75rem 0;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.help-faq summary::after {
  content: '+';
  font-size: 1.25rem;
  color: var(--gray-400);
  transition: transform var(--transition);
}

.help-faq[open] summary::after {
  content: '-';
}

.help-faq p {
  color: var(--gray-500);
  font-size: var(--text-sm);
  line-height: 1.7;
  padding-bottom: 0.75rem;
}

.help-faq a {
  color: var(--blue);
}

/* Help Contact */
.help-contact {
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  padding: 3rem;
  text-align: center;
}

.help-contact h2 {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.help-contact > p {
  color: var(--gray-500);
  margin-bottom: 2rem;
}

.help-contact__methods {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  text-align: center;
}

.help-contact__method {
  padding: 1.5rem;
}

.help-contact__method i {
  width: 32px;
  height: 32px;
  color: var(--blue);
  margin-bottom: 0.75rem;
}

.help-contact__method h4 {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
}

.help-contact__method p {
  font-size: var(--text-sm);
  color: var(--gray-500);
  line-height: 1.6;
}

.help-contact__method a {
  color: var(--blue);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .page-content__inner {
    max-width: 100%;
  }

  .docs-grid,
  .help-grid {
    grid-template-columns: 1fr;
  }

  .security-grid {
    grid-template-columns: 1fr;
  }

  .changelog-timeline {
    padding-left: 1.5rem;
  }

  .changelog-entry {
    padding-left: 1rem;
  }

  .help-contact {
    padding: 2rem 1.5rem;
  }

  .help-contact__methods {
    grid-template-columns: 1fr;
  }
}
