/*
 * site.css — Apps Portal custom overlay
 *
 * Per-app theming works via CSS custom properties injected by the
 * app-theme.html partial. Since Bootstrap's .btn-primary color is
 * compiled from Sass, we re-declare it here using var(--app-primary).
 *
 * Custom property defaults (applied when outside an app section):
 */

:root {
  --app-primary:   #0d6efd;
  --app-secondary: #6c757d;
  --app-accent:    #0dcaf0;

  /* Derived shades used below */
  --app-primary-dark:  color-mix(in srgb, var(--app-primary) 80%, #000);
  --app-primary-light: color-mix(in srgb, var(--app-primary) 15%, #fff);
}

/* ── Global ────────────────────────────────────────────────────── */

body {
  font-family: system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

/* ── Navbar ────────────────────────────────────────────────────── */

.navbar-brand .brand-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

/* ── Per-app primary color wired onto Bootstrap components ─────── */
/* This is the critical section: override the compiled Sass values  */

.btn-app-primary {
  background-color: var(--app-primary);
  border-color: var(--app-primary);
  color: #fff;
}

.btn-app-primary:hover,
.btn-app-primary:focus {
  background-color: var(--app-primary-dark);
  border-color: var(--app-primary-dark);
  color: #fff;
}

.btn-app-secondary {
  background-color: transparent;
  border-color: var(--app-primary);
  color: var(--app-primary);
}

.btn-app-secondary:hover,
.btn-app-secondary:focus {
  background-color: var(--app-primary-light);
  border-color: var(--app-primary);
  color: var(--app-primary);
}

/* Links inside app sections */
.app-section a:not(.btn):not(.badge-link) {
  color: var(--app-primary);
}
.app-section a:not(.btn):not(.badge-link):hover {
  color: var(--app-primary-dark);
}

/* Section accent bar */
.section-accent {
  border-left: 4px solid var(--app-primary);
}

/* Active nav link accent */
.app-subnav .nav-link.active,
.app-subnav .nav-link:hover {
  color: var(--app-primary);
  border-bottom: 2px solid var(--app-primary);
}

/* ── Homepage ──────────────────────────────────────────────────── */

.portal-hero {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 5rem 0 4rem;
}

.app-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.app-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,.12) !important;
}

.app-card-icon {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 16px;
}

/* ── App landing ───────────────────────────────────────────────── */

.app-hero {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--app-primary) 8%, #fff),
    color-mix(in srgb, var(--app-primary) 3%, #f8f9fa)
  );
  padding: 4rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--app-primary) 20%, #e9ecef);
}

.app-icon {
  width: 120px;
  height: 120px;
  object-fit: contain;
  border-radius: 22%;
  box-shadow: 0 8px 28px rgba(0,0,0,.18);
}

/* Feature cards */
.feature-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--app-primary-light);
  color: var(--app-primary);
  font-size: 1.5rem;
  flex-shrink: 0;
}

/* Screenshots */
.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.screenshot-thumb {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  border: 1px solid #dee2e6;
  transition: box-shadow 0.15s ease;
}

.screenshot-thumb:hover {
  box-shadow: 0 8px 28px rgba(0,0,0,.18);
}

/* Store badges */
.store-badge {
  height: 48px;
  width: auto;
}

/* ── Sub-nav (per-app pages) ───────────────────────────────────── */

.app-subnav {
  border-bottom: 1px solid #dee2e6;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-subnav .nav-link {
  color: #495057;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  font-size: 0.9rem;
}

/* ── Legal / content pages ─────────────────────────────────────── */

.content-page {
  max-width: 820px;
}

.page-lead {
  font-size: 1.1rem;
  color: #6c757d;
}

/* ── Footer ────────────────────────────────────────────────────── */

.site-footer {
  background: #212529;
  color: #adb5bd;
  padding: 2.5rem 0;
  font-size: 0.875rem;
}

.site-footer a {
  color: #ced4da;
  text-decoration: none;
}

.site-footer a:hover {
  color: #fff;
}

/* ── Utilities ─────────────────────────────────────────────────── */

.prose > * + * {
  margin-top: 1em;
}

.prose > :first-child {
  margin-top: 0;
}

.eyebrow {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--app-primary);
  font-weight: 600;
}

@media (max-width: 576px) {
  .app-icon { width: 80px; height: 80px; }
  .portal-hero, .app-hero { padding: 3rem 0 2.5rem; }
}
