/*
 * geo-styles.css — Osenpa GEO/SEO Content Styles
 * Dark space theme: bg #050814 / #070b1f · accent purple #8b5cf6
 * Applied to: index, product pages, donate
 */

/* ─── 1. Link colors in content areas ──────────────────────────────── */
.product-description a,
.geo-about a,
.geo-glance a,
.support-page a {
  color: #8ab4f8;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.15s ease;
}
.product-description a:hover,
.geo-about a:hover,
.geo-glance a:hover,
.support-page a:hover {
  color: #c0d4fd;
  text-decoration: none;
}

/* ─── 2. Homepage section spacing ─────────────────────────────────── */
section[aria-labelledby="about-heading"] {
  margin-top: 3.5rem;
}
section[aria-labelledby="comparison-heading"] {
  margin-top: 3rem;
}
section[aria-labelledby="projects-heading"] {
  margin-top: 3rem;
}

/* ─── 3. Homepage – About Osenpa card ─────────────────────────────── */
.geo-about {
  position: relative;
  padding: 2rem 2.25rem;
  background: linear-gradient(135deg, rgba(99,79,220,.07) 0%, rgba(56,189,248,.04) 100%);
  border: 1px solid rgba(139,92,246,.18);
  border-left: 3px solid rgba(139,92,246,.55);
  border-radius: 14px;
}
.geo-about h2 {
  margin-bottom: .75rem;
}
.geo-about p {
  line-height: 1.8;
  color: #b8c9de;
}

/* ─── 4. Homepage – Software at a Glance ──────────────────────────── */
.geo-glance h2 {
  margin-bottom: .5rem;
}

/* ─── 5. Product pages – Definition (What is X?) ──────────────────── */
section[aria-labelledby="definition-heading"] {
  border-left: 2px solid rgba(139,92,246,.38);
  padding-left: 1.6rem;
}
section[aria-labelledby="definition-heading"] p {
  line-height: 1.8;
  color: #b2c6de;
}

/* ─── 1b. Coffee button text color ────────────────────────────────── */
.coffee-button {
  color: #fff !important;
}

/* ─── 6. Table wrapper ─────────────────────────────────────────────── */
.table-wrapper {
  margin-top: 1.4rem;
  border-radius: 12px;
  border: 1px solid rgba(139,92,246,.22);
  box-shadow: 0 4px 32px rgba(0,0,0,.45);
  overflow: hidden; /* table-layout:fixed pins width — no scroll needed */
}

/* ─── 7. Table base ────────────────────────────────────────────────── */
.table-wrapper table {
  width: 100%;
  table-layout: fixed;   /* forces table to stay within container width */
  border-collapse: collapse;
  font-size: .84rem;
  line-height: 1.45;
  color: #c0cfe6;
  background: rgba(5,8,22,.65);
}

/* ─── 8. Table header ──────────────────────────────────────────────── */
.table-wrapper thead tr {
  background: linear-gradient(90deg, rgba(99,79,220,.22) 0%, rgba(56,189,248,.07) 100%);
  border-bottom: 2px solid rgba(139,92,246,.35);
}
.table-wrapper thead th {
  padding: .85rem 1.1rem;
  text-align: left;
  font-weight: 700;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: #a78bfa;
  word-break: break-word; /* wrap long product names instead of overflowing */
}
/* First column (Feature) gets a slightly larger share */
.table-wrapper thead th:first-child {
  width: 24%;
}

/* Highlight "our product" column header (2nd col) in all feature-row tables */
section[aria-labelledby="ac-comparison-heading"] thead th:nth-child(2),
section[aria-labelledby="vc-comparison-heading"] thead th:nth-child(2),
section[aria-labelledby="jc-comparison-heading"] thead th:nth-child(2) {
  color: #c4b5fd;
  background: rgba(139,92,246,.12);
  border-left: 2px solid rgba(139,92,246,.4);
  border-right: 2px solid rgba(139,92,246,.4);
}

/* ─── 9. Table body rows ───────────────────────────────────────────── */
.table-wrapper tbody tr {
  border-bottom: 1px solid rgba(255,255,255,.04);
  transition: background .12s ease;
}
.table-wrapper tbody tr:last-child {
  border-bottom: none;
}
.table-wrapper tbody tr:nth-child(even) {
  background: rgba(255,255,255,.02);
}
.table-wrapper tbody tr:hover {
  background: rgba(139,92,246,.07);
}

/* ─── 10. Table cells ──────────────────────────────────────────────── */
.table-wrapper tbody td {
  padding: .68rem 1.1rem;
  vertical-align: top;
  border-right: 1px solid rgba(255,255,255,.035);
  word-break: break-word; /* wrap cell text to fit fixed column width */
}
.table-wrapper tbody td:last-child {
  border-right: none;
}
.table-wrapper tbody td:first-child {
  font-weight: 600;
  color: #d8e5f5;
}

/* Highlight "our product" column cells (2nd col) in all feature-row tables */
section[aria-labelledby="ac-comparison-heading"] tbody td:nth-child(2),
section[aria-labelledby="vc-comparison-heading"] tbody td:nth-child(2),
section[aria-labelledby="jc-comparison-heading"] tbody td:nth-child(2) {
  color: #d4c8ff;
  background: rgba(139,92,246,.05);
  border-left: 2px solid rgba(139,92,246,.28);
  border-right: 2px solid rgba(139,92,246,.28);
  font-weight: 500;
}

/* ─── 11a. Product card — align "Open Details" CTA to bottom ──────── */
.card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.card-cta {
  margin-top: auto;
}

/* ─── 11. Responsive — stacked card layout ─────────────────────────── */
@media (max-width: 700px) {
  .table-wrapper {
    border-radius: 10px;
    overflow: visible; /* allow cards to breathe */
    border: none;
    box-shadow: none;
    background: transparent;
  }

  .table-wrapper table,
  .table-wrapper tbody {
    display: block;
    width: 100%;
  }

  /* Hide column header row — labels come from data-label */
  .table-wrapper thead {
    display: none;
  }

  /* Each row becomes a card */
  .table-wrapper tbody tr {
    display: block;
    border: 1px solid rgba(139,92,246,.2);
    border-radius: 10px;
    margin-bottom: .75rem;
    padding: .6rem .75rem;
    background: rgba(8,12,30,.7);
  }
  .table-wrapper tbody tr:nth-child(even) {
    background: rgba(8,12,30,.7);
  }
  .table-wrapper tbody tr:hover {
    background: rgba(12,18,40,.8);
  }
  /* No special row highlight on mobile (product = column, not row) */

  /* Each cell becomes a labelled row within the card */
  .table-wrapper tbody td {
    display: flex;
    align-items: baseline;
    gap: .6rem;
    padding: .38rem .25rem;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,.04);
    font-size: .82rem;
    white-space: normal;
    color: #c0cfe6;
  }
  .table-wrapper tbody td:last-child {
    border-bottom: none;
  }
  .table-wrapper tbody td:first-child {
    font-weight: 700;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #a78bfa;
    border-bottom: 1px solid rgba(139,92,246,.15);
    white-space: normal;
  }

  /* Label prefix from data-label attribute */
  .table-wrapper tbody td[data-label]::before {
    content: attr(data-label);
    flex-shrink: 0;
    width: 7.5rem;
    min-width: 7.5rem;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: #6e84a3;
  }
  /* Don't show label prefix for first cell (it's the row title) */
  .table-wrapper tbody td:first-child[data-label]::before {
    display: none;
  }

  /* Highlight our product's cell within each feature card on mobile */
  section[aria-labelledby="ac-comparison-heading"] tbody td:nth-child(2),
  section[aria-labelledby="vc-comparison-heading"] tbody td:nth-child(2),
  section[aria-labelledby="jc-comparison-heading"] tbody td:nth-child(2) {
    background: rgba(139,92,246,.1);
    border-left: none;
    border-right: none;
    border-radius: 5px;
    color: #c4b5fd;
    font-weight: 600;
  }
  section[aria-labelledby="ac-comparison-heading"] tbody td:nth-child(2)::before,
  section[aria-labelledby="vc-comparison-heading"] tbody td:nth-child(2)::before,
  section[aria-labelledby="jc-comparison-heading"] tbody td:nth-child(2)::before {
    color: #8b6fd4;
  }
}

@media (max-width: 768px) {
  .geo-about {
    padding: 1.4rem 1.1rem;
    background: none;
    border: none;
    border-left: 2px solid rgba(139,92,246,.28);
    border-radius: 0;
    box-shadow: none;
  }
  section[aria-labelledby="definition-heading"] {
    padding-left: 1rem;
  }
}
