/* ==========================================================================
   Our Apps page (/our-apps)
   Reuses the themes-page shell (.zt-header / .zt-tabs / .zt-section / .zt-cta)
   and adds the app-card grid below. All spacing uses logical properties so the
   same rules work in both RTL (Arabic) and LTR (English).
   ========================================================================== */

.oa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  margin-top: 10px;
}

.oa-card {
  --oa-accent: #3b82f6;
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e8ecf3;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(15, 23, 42, .06);
  transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease;
}

.oa-card::before {
  content: '';
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  height: 4px;
  background: var(--oa-accent);
}

.oa-card:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--oa-accent) 40%, #e8ecf3);
  box-shadow: 0 18px 40px rgba(15, 23, 42, .12);
}

/* Sits inline next to the title, not pinned to the card corner — the corner is
   the logo's, and an absolute badge landed on top of it. */
.oa-card-titlerow {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.oa-card-badge {
  flex: 0 0 auto;
  background: var(--oa-accent);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
  padding: 5px 11px;
  border-radius: 999px;
  margin-block-end: 4px;
}

.oa-card-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #f4f6fb;
}

.oa-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}

.oa-card:hover .oa-card-cover img {
  transform: scale(1.04);
}

.oa-card-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px 22px;
  flex: 1;
}

.oa-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Logo, then the name + domain beside it — the whole group hugs the reading
   edge (right in Arabic, left in English). */
.oa-card-logo {
  flex: 0 0 auto;
  width: 58px;
  height: 58px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--oa-accent) 10%, #fff);
  border: 1px solid color-mix(in srgb, var(--oa-accent) 22%, #fff);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* App icons ship with their own background and rounded corners — let them fill
   the box instead of floating on a tinted plate meant for the letter fallback. */
.oa-card-logo.has-img {
  background: none;
  border-color: transparent;
}

.oa-card-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.oa-card-logo-fallback {
  font-size: 24px;
  font-weight: 800;
  color: var(--oa-accent);
  line-height: 1;
}

.oa-card-title {
  min-width: 0;
  flex: 1 1 auto;
}

.oa-card-title h3 {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #16213e;
  line-height: 1.35;
}

/* The box follows the page direction so the domain sits under the title on the
   same edge; the inner <bdi dir="ltr"> keeps the domain itself reading LTR. */
.oa-card-url {
  display: block;
  font-size: 12.5px;
  color: #8892a6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: start;
}

/* Reserve two lines so the rows underneath (platform chips, features, button)
   line up across cards even when one description is shorter than another. */
.oa-card-desc {
  margin: 0;
  color: #5a6478;
  font-size: 14.5px;
  line-height: 1.85;
  min-height: calc(2 * 1.85em);
}

.oa-card-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.oa-platform-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  background: #eef2f9;
  color: #46536b;
  border: 1px solid #dde4f0;
}

.oa-platform-chip i {
  font-size: 11px;
}

.oa-card-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
}

/* Every chip stays on exactly one line — a wrapped feature breaks the grid
   rhythm and reads as clutter. Overlong text is truncated, not wrapped. */
.oa-card-features li {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: #4b5567;
  min-width: 0;
}

.oa-card-features li i {
  color: var(--oa-accent);
  font-size: 12px;
  flex: 0 0 auto;
  width: 14px;
  text-align: center;
}

.oa-card-features li span {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.oa-card-actions {
  margin-block-start: auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.oa-card-cta {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--oa-accent);
  color: #fff !important;
  font-weight: 700;
  font-size: 14.5px;
  text-decoration: none;
  transition: filter .25s ease, transform .25s ease;
}

.oa-card-cta:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.oa-card-cta i {
  font-size: 12px;
}

/* Secondary action — a soft tint of the app's accent so it reads as a real
   button next to the solid primary, rather than a bare link. */
.oa-card-details {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--oa-accent) 22%, #fff);
  background: color-mix(in srgb, var(--oa-accent) 10%, #fff);
  color: var(--oa-accent) !important;
  font-weight: 700;
  font-size: 14.5px;
  text-decoration: none;
  transition: background .25s ease, border-color .25s ease, transform .25s ease;
}

.oa-card-details:hover {
  background: color-mix(in srgb, var(--oa-accent) 18%, #fff);
  border-color: color-mix(in srgb, var(--oa-accent) 45%, #fff);
  transform: translateY(-2px);
}

/* The card's only button: give it the full solid treatment. */
.oa-card-details.is-primary {
  background: var(--oa-accent);
  border-color: var(--oa-accent);
  color: #fff !important;
  box-shadow: 0 10px 24px -12px var(--oa-accent);
}

.oa-card-details.is-primary:hover {
  background: var(--oa-accent);
  filter: brightness(1.08);
}

@media (max-width: 640px) {
  .oa-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .oa-card-features {
    grid-template-columns: 1fr;
  }
}
