/* Xandriq - content-pages.css
 * Drop caps, pull quotes, mono-table, long-form intro.
 */

.content-intro {
  max-width: 740px;
  margin: 0 auto;
}

.content-intro__lead {
  font-family: var(--f-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--c-text-dim);
}

.long-form {
  max-width: 740px;
  font-family: var(--f-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--c-text);
}

.long-form--wide {
  max-width: 880px;
}

.long-form p {
  margin-bottom: var(--s-16);
}

.long-form p:first-child.drop-cap::first-letter {
  font-family: var(--f-heading);
  font-weight: 700;
  font-size: 3.75rem;
  float: left;
  line-height: 0.92;
  padding-right: 10px;
  padding-top: 6px;
  color: var(--c-text);
}

.long-form h2,
.long-form h3 {
  margin-top: var(--s-40);
}

.long-form h2:first-child,
.long-form h3:first-child {
  margin-top: 0;
}

.long-form ul,
.long-form ol {
  margin-bottom: var(--s-24);
  padding-left: var(--s-24);
}

.long-form ul li,
.long-form ol li {
  margin-bottom: var(--s-8);
}

.long-form strong {
  color: var(--c-text);
  font-weight: 600;
}

/* ===== Legal tables ===== */
.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--f-body);
  font-size: 0.9375rem;
  margin: var(--s-24) 0;
  border: 1px solid var(--c-border);
}

.legal-table th,
.legal-table td {
  text-align: left;
  padding: var(--s-12) var(--s-16);
  border-bottom: 1px solid var(--c-border);
  vertical-align: top;
}

.legal-table th {
  font-weight: 600;
  color: var(--c-text);
  background: var(--c-surface);
  font-family: var(--f-body);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.legal-table td {
  color: var(--c-text-dim);
}

.legal-table tr:last-child th,
.legal-table tr:last-child td {
  border-bottom: 0;
}

/* ===== Contact info cards ===== */
.contact-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-32);
}

.contact-card {
  padding: var(--s-32) var(--s-24);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface);
}

.contact-card__label {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: var(--s-8);
}

.contact-card__value {
  font-family: var(--f-body);
  font-size: 1.0625rem;
  color: var(--c-text);
  margin: 0;
  line-height: 1.4;
  word-break: break-word;
}

.contact-card__value a {
  color: var(--c-text);
  text-decoration: none;
  border-bottom: 1px solid var(--c-border);
}

.contact-card__value a:hover {
  color: var(--c-accent);
  border-bottom-color: var(--c-accent);
}

/* ===== Screenshot row ===== */
.screenshot-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-48);
  align-items: start;
}

.screenshot {
  width: 100%;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface);
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: cover;
}

/* ===== Download grid (badge cells) ===== */
.download-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface);
}

.download-cell {
  padding: var(--s-32) var(--s-24);
  border-right: 1px solid var(--c-border);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-16);
}

.download-cell:last-child {
  border-right: 0;
}

.download-cell__title {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin: 0;
}

.download-cell__desc {
  font-family: var(--f-body);
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--c-text-dim);
  margin: 0;
}

.download-cell .badge-link {
  min-height: 58px;
  align-items: center;
  justify-content: center;
}

/* ===== Screenshots caption layout ===== */
.screenshot-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-40);
  margin-bottom: var(--s-48);
  align-items: start;
}

.screenshot-block:last-child {
  margin-bottom: 0;
}

.screenshot-block__text h3 {
  font-family: var(--f-heading);
  font-weight: 600;
  margin-bottom: var(--s-12);
}

.screenshot-block__text p {
  color: var(--c-text-dim);
  margin: 0;
}

.screenshot-block figcaption {
  font-family: var(--f-heading);
  font-style: italic;
  font-size: 0.8125rem;
  color: var(--c-text-dim);
  margin-top: var(--s-8);
}

/* ===== Map embed (OpenStreetMap iframe) ===== */
.map-embed {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 520px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--c-surface);
  position: relative;
}

.map-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  filter: saturate(0.85) contrast(1.02);
}

.map-embed__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-16);
  padding: var(--s-24);
  text-align: center;
  background: var(--c-special);
  color: var(--c-text-dim);
}

.map-embed.is-loaded .map-embed__placeholder {
  display: none;
}

.map-embed__placeholder a {
  color: var(--c-accent);
}

@media (max-width: 767px) {
  .map-embed {
    aspect-ratio: 4 / 3;
  }
}

/* ===== Gallery (4-col Mindustry screenshot grid) ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-32);
}

.gallery-item {
  margin: 0;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.gallery-item--text-only {
  position: relative;
}

.gallery-item--text-only::before {
  content: "№ " counter(gallery-counter, decimal-leading-zero);
  counter-increment: gallery-counter;
  position: absolute;
  top: var(--s-16);
  right: var(--s-16);
  font-family: var(--f-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: var(--c-accent);
}

.gallery-grid:has(.gallery-item--text-only) {
  counter-reset: gallery-counter;
}

.gallery-item__img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--c-special);
  border-bottom: 1px solid var(--c-border);
}

.gallery-item__cap {
  padding: var(--s-20, 1.25rem);
  display: flex;
  flex-direction: column;
  gap: var(--s-8);
}

.gallery-item__title {
  font-family: var(--f-heading);
  font-weight: 600;
  font-size: 1.0625rem;
  color: var(--c-text);
}

.gallery-item__body {
  font-family: var(--f-body);
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--c-text-dim);
}

.gallery-item__attr {
  font-family: var(--f-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-text-dim);
  margin-top: var(--s-8);
  padding-top: var(--s-8);
  border-top: 1px solid var(--c-border);
}

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

/* ===== Community voices (3 pull quotes) ===== */
.voices-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-32);
}

.voices-grid .pull-quote {
  margin: 0;
}

/* ===== Thank-you page ===== */
.thankyou {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.thankyou__inner {
  max-width: 560px;
  padding: var(--s-48) var(--s-24);
}

.thankyou__check {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--s-24);
  color: var(--c-accent);
}

.thankyou__meta {
  font-family: var(--f-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  color: var(--c-text-dim);
  text-transform: uppercase;
  padding: var(--s-16) var(--s-24);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  display: inline-block;
  margin: var(--s-24) 0;
  background: var(--c-surface);
}

.thankyou__meta span {
  color: var(--c-accent);
}

/* ===== Responsive ===== */
@media (max-width: 1023px) {
  .contact-cards,
  .download-grid {
    grid-template-columns: 1fr 1fr;
  }
  .download-cell:nth-child(2) {
    border-right: 0;
  }
  .download-cell:nth-child(1),
  .download-cell:nth-child(2) {
    border-bottom: 1px solid var(--c-border);
  }
  .voices-grid {
    grid-template-columns: 1fr;
  }
  .screenshot-block,
  .screenshot-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .contact-cards,
  .download-grid {
    grid-template-columns: 1fr;
  }
  .download-cell {
    border-right: 0;
    border-bottom: 1px solid var(--c-border);
  }
  .download-cell:last-child {
    border-bottom: 0;
  }
  .legal-table,
  .legal-table thead,
  .legal-table tbody,
  .legal-table tr,
  .legal-table th,
  .legal-table td {
    display: block;
  }
  .legal-table th {
    background: var(--c-special);
  }
}
