/* PantryRx 2026 visual refresh: Apple-like marketing + product shell */

/* Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  letter-spacing: -0.01em;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration-color: rgba(17, 17, 19, 0.25);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: rgba(17, 17, 19, 0.45);
}

/* Layout primitives */
.shell,
.container {
  max-width: var(--container);
}

.shell {
  margin: 0 auto;
  padding: 0 var(--sp-5);
}

@media (min-width: 1200px) {
  .shell {
    padding: 0 var(--sp-6);
  }
}

.section-pad {
  padding: clamp(56px, 7vw, 96px) 0;
}

.section-heading {
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: var(--lh-tight);
}

.lead-text {
  color: var(--ink-2);
  font-size: var(--text-lg);
  line-height: 1.6;
}

.section-subtext,
.muted {
  color: var(--ink-3);
}

.section-spacer {
  margin-top: var(--sp-7);
}

.divider {
  height: 1px;
  background: var(--border);
}

/* Icons */
.icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: -3px;
  color: currentColor;
}

.icon--sm {
  width: 16px;
  height: 16px;
  vertical-align: -2px;
}

.icon--lg {
  width: 22px;
  height: 22px;
  vertical-align: -4px;
}

/* Buttons (override bootstrap look without removing classes) */
.btn {
  border-radius: var(--r-pill) !important;
  padding: 10px 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  transition: transform 120ms ease, box-shadow 160ms ease, background-color 160ms ease,
    border-color 160ms ease, color 160ms ease, opacity 160ms ease;
}

.btn:focus-visible {
  outline: 3px solid rgba(0, 113, 227, 0.28);
  outline-offset: 2px;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.10);
}

.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-primary {
  background: var(--brand) !important;
  border-color: rgba(0, 0, 0, 0) !important;
}

.btn-primary:hover {
  background: #0a7cff !important;
}

.btn-outline-primary,
.btn-secondary {
  background: transparent !important;
  border-color: var(--border-2) !important;
  color: var(--ink) !important;
}

.btn-outline-primary:hover,
.btn-secondary:hover {
  background: rgba(0, 0, 0, 0.03) !important;
  border-color: rgba(0, 0, 0, 0.22) !important;
}

.btn-link {
  color: var(--ink-2) !important;
  text-decoration: none !important;
}

.btn-link:hover {
  color: var(--ink) !important;
  background: rgba(0, 0, 0, 0.03) !important;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, transform 120ms ease;
}

.ghost-btn:hover {
  background: rgba(0, 0, 0, 0.035);
  border-color: rgba(0, 0, 0, 0.06);
}

/* Cards / tiles */
.card,
.tile,
.feed-card {
  border-radius: var(--r-xl) !important;
  border: 1px solid var(--border) !important;
  background: var(--surface) !important;
  box-shadow: none;
}

.card-soft,
.card-quiet {
  background: var(--surface) !important;
}

.shadow-soft,
.nav-shadow {
  box-shadow: var(--shadow-1) !important;
}

.tile {
  padding: var(--sp-6);
}

.tile:hover {
  box-shadow: var(--shadow-1);
}

.card-title,
h1,
h2,
h3,
h4,
h5,
h6 {
  letter-spacing: -0.02em;
}

.card-title {
  font-weight: 650;
}

/* Chips / badges */
.chip,
.brand-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: var(--r-pill);
  background: rgba(0, 0, 0, 0.035);
  border: 1px solid rgba(0, 0, 0, 0.06);
  font-size: var(--text-sm);
  color: var(--ink-2);
  font-weight: 600;
}

.chip.secondary {
  background: rgba(0, 113, 227, 0.10);
  border-color: rgba(0, 113, 227, 0.16);
  color: var(--brand-ink);
}

.brand-chip {
  background: var(--brand-soft);
  border-color: rgba(0, 113, 227, 0.16);
  color: var(--brand-ink);
}

.badge {
  border-radius: var(--r-pill);
  padding: 6px 10px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.badge-soft {
  background: rgba(0, 0, 0, 0.04) !important;
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--ink-2) !important;
}

.badge-warning-soft {
  background: rgba(180, 83, 9, 0.12) !important;
  border: 1px solid rgba(180, 83, 9, 0.18);
  color: #7c2d12 !important;
}

.badge-danger-soft {
  background: rgba(180, 35, 24, 0.10) !important;
  border: 1px solid rgba(180, 35, 24, 0.16);
  color: #7f1d1d !important;
}

/* Inputs */
.form-control,
.form-select,
.input-group-text {
  border-radius: var(--r-lg) !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
}

.form-control,
.form-select {
  padding: 11px 12px;
  box-shadow: none !important;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(0, 113, 227, 0.35) !important;
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.14) !important;
}

.form-label {
  font-weight: 650;
  color: var(--ink-2);
  font-size: var(--text-sm);
  letter-spacing: -0.01em;
}

/* Alerts */
.alert {
  border-radius: var(--r-xl);
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
  padding: 12px 14px;
}

/* Marketing navbar: Apple-like */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.header-bar {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: 10px 0;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(0, 113, 227, 0.14), rgba(0, 0, 0, 0.02));
  border: 1px solid rgba(0, 0, 0, 0.10);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.brand-text strong {
  font-weight: 750;
  letter-spacing: -0.03em;
}

.brand-sub {
  display: block;
  font-size: var(--text-xs);
  color: var(--ink-3);
  margin-top: 1px;
}

.main-nav {
  display: none;
  align-items: center;
  gap: 18px;
}

.main-nav a {
  font-size: var(--text-sm);
  color: var(--ink-2);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: var(--r-pill);
}

.main-nav a:hover {
  background: rgba(0, 0, 0, 0.035);
  color: var(--ink);
}

@media (min-width: 992px) {
  .main-nav {
    display: flex;
  }
}

@media (max-width: 991px) {
  .main-nav.is-open {
    display: flex;
    position: absolute;
    top: 64px;
    left: 50%;
    transform: translateX(-50%);
    width: min(92vw, 560px);
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(0, 0, 0, 0.10);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-2);
  }
  .main-nav.is-open a {
    padding: 10px 12px;
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* App shell */
body.app-shell {
  background-image:
    url("/static/img/app-shell-accent.webp"),
    radial-gradient(1200px 500px at 20% -10%, rgba(0, 113, 227, 0.08), transparent 60%),
    radial-gradient(900px 520px at 90% 0%, rgba(0, 0, 0, 0.04), transparent 55%);
  background-color: var(--bg-subtle);
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-size: cover, auto, auto;
  background-position: center, center, center;
}

/* Marketing hero background */
.hero {
  position: relative;
  background-image: url("/static/img/marketing-hero-bg.webp");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1000px 520px at 15% 0%, rgba(255, 255, 255, 0.72), transparent 60%),
    radial-gradient(900px 520px at 85% 0%, rgba(255, 255, 255, 0.72), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0.86));
}

.hero > * {
  position: relative;
}

.app-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 320px;
  gap: var(--sp-6);
  align-items: start;
}

@media (max-width: 1199px) {
  .app-grid {
    grid-template-columns: 280px minmax(0, 1fr);
  }
  .rail-right {
    display: none;
  }
}

@media (max-width: 991px) {
  .app-grid {
    grid-template-columns: 1fr;
  }
  .rail-left {
    display: none;
  }
}

.rail-left .nav-card,
.rail-right .sidebar-card {
  position: sticky;
  top: 86px;
}

/* Mobile bottom tabs: keep markup but position like an app bar */
.app-tabs-bar {
  position: sticky;
  top: 56px;
  z-index: 999;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

@media (max-width: 991px) {
  .app-tabs-bar {
    position: fixed;
    bottom: 0;
    top: auto;
    left: 0;
    right: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.10);
    border-bottom: 0;
  }
  body.app-shell .container.pt-4.mt-5 {
    padding-bottom: 92px;
  }
}

.app-top-tabs {
  display: flex;
  justify-content: space-between;
  gap: 2px;
  padding: 6px 0;
}

.app-top-tabs .nav-link {
  border-radius: var(--r-lg) !important;
  color: var(--ink-2);
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
}

.app-top-tabs .nav-link.active {
  background: rgba(0, 0, 0, 0.05);
  color: var(--ink);
}

@media (max-width: 991px) {
  .app-top-tabs .nav-link span {
    display: none;
  }
  .app-top-tabs .nav-link {
    padding: 12px 10px;
    justify-content: center;
    width: 100%;
  }
}

/* Sidebar */
.nav-card.sidebar-card {
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  margin-bottom: 14px;
}

.sidebar-avatar {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.08);
  font-weight: 800;
}

.sidebar-name {
  font-weight: 750;
}

.sidebar-meta {
  font-size: var(--text-xs);
  color: var(--ink-3);
}

.sidebar-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  margin: 10px 0 8px;
}

.sidebar-card .nav-link {
  border-radius: var(--r-lg) !important;
  padding: 10px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-2);
  font-weight: 650;
}

.sidebar-card .nav-link.active {
  background: rgba(0, 0, 0, 0.05);
  color: var(--ink);
}

/* Page headers */
.feed-title {
  font-size: clamp(30px, 3.2vw, 42px);
  line-height: var(--lh-tight);
  letter-spacing: -0.04em;
  font-weight: 780;
}

.feed-subtitle {
  color: var(--ink-2);
  font-size: var(--text-lg);
  max-width: 70ch;
}

/* Tables */
.table-card {
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

.table {
  --bs-table-bg: transparent;
}

.table thead th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  background: rgba(0, 0, 0, 0.02) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.table tbody td {
  border-color: rgba(0, 0, 0, 0.06);
}

/* Blog cards (also used outside yahoo-feed) */
.blog-card__media img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-top-left-radius: var(--r-xl);
  border-top-right-radius: var(--r-xl);
  display: block;
}

/* Footer */
.site-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: var(--sp-7);
  padding: var(--sp-8) 0 var(--sp-6);
}

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

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

.footer-nav ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.footer-nav a {
  color: var(--ink-2);
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--ink);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-5) 0;
  color: var(--ink-3);
  font-size: var(--text-sm);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

@media (max-width: 767px) {
  .footer-bottom {
    flex-direction: column;
  }
}
