/* static/css/docs.css
   Docs section card grid + page styles. Loaded only on /docs/* pages
   via the conditional in layouts/partials/head.html. */

.docs-page .page-title {
  margin-bottom: 1.5rem;
}

.docs-lead {
  margin-bottom: 2.5rem;
  color: var(--color-text-muted);
  line-height: 1.75;
}

.docs-lead h1:first-child {
  /* Body sometimes contains its own H1 (legacy Grav content);
     suppress it since page-title already shows the section title. */
  display: none;
}

.docs-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.docs-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.docs-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.docs-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  height: 100%;
}

.docs-card-image {
  background: #f7fafc;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.docs-card-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.docs-card-body {
  padding: 1rem 1.25rem 1.25rem;
}

.docs-card-title {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  line-height: 1.4;
  color: var(--color-text);
}

.docs-card-summary {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--color-text-muted);
}

@media (max-width: 480px) {
  .docs-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* Single-doc body images: cap height so portrait shots in install manuals
   don't blow up the page. */
.docs-page .content-body img {
  display: block;
  max-height: 480px;
  width: auto;
  margin: 16px auto;
}

/* Side-by-side figure rows in install manuals (figure-row shortcode).
   Each figure is a fixed-aspect tile so rows align cleanly even when the
   source photos mix portrait/landscape orientations. Photos are letter-
   boxed via object-fit: contain on a subtle background. */
.docs-page .content-body .figure-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: stretch;
  margin: 16px 0;
}
.docs-page .content-body .figure-row figure {
  flex: 1 1 220px;
  max-width: 300px;
  margin: 0;
  display: flex;
  flex-direction: column;
}
.docs-page .content-body .figure-row figure > .img-wrap,
.docs-page .content-body .figure-row figure > img {
  flex: 1 1 auto;
}
.docs-page .content-body .figure-row figure img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #f7fafc;
  border-radius: 6px;
  max-height: none;
  margin: 0;
}
.docs-page .content-body .figure-row figure figcaption {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 0.4rem;
  text-align: center;
}
@media (max-width: 600px) {
  .docs-page .content-body .figure-row { flex-direction: column; align-items: center; }
  .docs-page .content-body .figure-row figure { max-width: 100%; width: 100%; }
}
