/*
 * HospiEdge — global card + section polish.
 * Brings the homepage card style to every public page.
 * Loaded after site.css so it overrides the legacy card rules.
 */

/* ---------- Cards ---------- */
section .grid > .card,
section .grid > a.card,
section .product-map-grid > .product-map-card,
section .decision-matrix > .decision-card,
section .support-path-grid > .card,
.testimonial-grid > .testimonial-card {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 30px 28px;
  background: linear-gradient(180deg, rgba(255,255,255,.085), rgba(255,255,255,.025));
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 18px 60px rgba(0,0,0,.22);
  transition: transform .3s cubic-bezier(.22,.9,.4,1.2), border-color .3s ease, box-shadow .3s ease;
}

/* Gold gradient top accent that animates on hover */
section .grid > .card::before,
section .grid > a.card::before,
section .product-map-grid > .product-map-card::before,
section .decision-matrix > .decision-card::before,
section .support-path-grid > .card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #ffd77e, #ff9d6f, #ffd77e);
  background-size: 200% 100%;
  opacity: .55;
  transition: opacity .3s ease, background-position .8s ease;
  z-index: 1;
}

/* Gold radial halo on hover */
section .grid > .card::after,
section .grid > a.card::after,
section .product-map-grid > .product-map-card::after,
section .decision-matrix > .decision-card::after,
section .support-path-grid > .card::after {
  content: "";
  position: absolute;
  top: -40%; right: -30%;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(244,182,61,.14), transparent 65%);
  opacity: 0;
  transition: opacity .4s ease;
  pointer-events: none;
}

section .grid > .card:hover,
section .grid > a.card:hover,
section .product-map-grid > .product-map-card:hover,
section .decision-matrix > .decision-card:hover,
section .support-path-grid > .card:hover {
  transform: translateY(-6px) scale(1.012);
  border-color: rgba(244,182,61,.55);
  box-shadow: 0 30px 80px rgba(244,182,61,.18), 0 0 0 1px rgba(244,182,61,.3);
}

section .grid > .card:hover::before,
section .grid > a.card:hover::before,
section .product-map-grid > .product-map-card:hover::before,
section .decision-matrix > .decision-card:hover::before,
section .support-path-grid > .card:hover::before {
  opacity: 1;
  background-position: 100% 0;
}

section .grid > .card:hover::after,
section .grid > a.card:hover::after,
section .product-map-grid > .product-map-card:hover::after,
section .decision-matrix > .decision-card:hover::after,
section .support-path-grid > .card:hover::after {
  opacity: 1;
}

/* Card titles + arrow link animation */
section .grid > .card h3,
section .grid > a.card h3,
section .product-map-grid > .product-map-card h3,
section .decision-matrix > .decision-card h3,
section .support-path-grid > .card h3 {
  font-size: 1.25rem;
  letter-spacing: -.01em;
  margin-bottom: 6px;
  position: relative;
  z-index: 2;
}

section .card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: .9rem;
  position: relative;
  z-index: 2;
  transition: gap .25s ease;
}

section .card-link::after {
  content: "→";
  display: inline-block;
  transition: transform .25s ease;
}

section .grid > .card:hover .card-link::after,
section .grid > a.card:hover .card-link::after,
section .product-map-grid > .product-map-card:hover .card-link::after,
section .decision-matrix > .decision-card:hover .card-link::after,
section .support-path-grid > .card:hover .card-link::after {
  transform: translateX(4px);
}

/* ---------- Pricing cards ---------- */
.pricing-grid .price-card {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  padding: 32px 28px;
  border: 1px solid rgba(255,255,255,.12);
  background: linear-gradient(180deg, rgba(255,255,255,.085), rgba(255,255,255,.025));
  box-shadow: 0 18px 60px rgba(0,0,0,.22);
  transition: transform .3s cubic-bezier(.22,.9,.4,1.2), border-color .3s ease, box-shadow .3s ease;
}
.pricing-grid .price-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #ffd77e, #ff9d6f, #ffd77e);
  background-size: 200% 100%;
  opacity: .55;
  transition: opacity .3s ease, background-position .8s ease;
}
.pricing-grid .price-card.featured::before { opacity: 1; height: 4px; }
.pricing-grid .price-card:hover {
  transform: translateY(-6px);
  border-color: rgba(244,182,61,.55);
  box-shadow: 0 30px 80px rgba(244,182,61,.22), 0 0 0 1px rgba(244,182,61,.3);
}
.pricing-grid .price-card:hover::before { opacity: 1; background-position: 100% 0; }
.pricing-grid .price-card.featured {
  background: linear-gradient(180deg, rgba(244,182,61,.14), rgba(255,255,255,.04));
  border-color: rgba(244,182,61,.42);
  transform: scale(1.02);
}
.pricing-grid .price-card.featured:hover { transform: scale(1.02) translateY(-6px); }

/* ---------- Workflow ribbon (used on /products + /index) ---------- */
.workflow-ribbon {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
  counter-reset: ribbon;
}
.workflow-ribbon a {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 24px 22px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,.12);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  text-decoration: none;
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
  overflow: hidden;
}
.workflow-ribbon a::before {
  counter-increment: ribbon;
  content: counter(ribbon, decimal-leading-zero);
  position: absolute;
  top: 14px; right: 18px;
  font: 900 28px/1 system-ui, -apple-system, Segoe UI, sans-serif;
  color: rgba(244,182,61,.18);
  letter-spacing: -.03em;
}
.workflow-ribbon a:hover {
  transform: translateY(-4px);
  border-color: rgba(244,182,61,.5);
  box-shadow: 0 22px 60px rgba(244,182,61,.18);
}
.workflow-ribbon strong { font-size: 1.05rem; color: #fff; }
.workflow-ribbon span { color: var(--soft); font-size: .92rem; line-height: 1.5; }
@media (max-width: 980px) { .workflow-ribbon { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .workflow-ribbon { grid-template-columns: 1fr; } }

/* ---------- Section reveal on scroll (all pages) ---------- */
section[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s ease, transform .7s ease;
}
section[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  section[data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* ---------- Header CTAs ---------- */
.site-nav .header-cta-demo {
  background: linear-gradient(135deg, #ffd77e, #f4b63d);
  color: #1a1206;
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(244,182,61,.28);
}
.site-nav .header-cta-demo:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(244,182,61,.4);
}
.site-nav .header-cta-pricing {
  margin-left: auto;
}
@media (max-width: 980px) {
  .site-nav .header-cta-pricing,
  .site-nav .header-cta-demo {
    width: 100%;
    margin: 6px 0 0;
  }
}

/* ---------- Misc polish ---------- */
.callout {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  padding: 32px;
  background: linear-gradient(140deg, rgba(244,182,61,.16), rgba(255,255,255,.04));
  border: 1px solid rgba(244,182,61,.3);
  box-shadow: 0 24px 70px rgba(0,0,0,.25);
}
.callout::before {
  content: "";
  position: absolute;
  top: -50%; right: -30%;
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(244,182,61,.18), transparent 65%);
  pointer-events: none;
}

/* ---------- Homepage/index readability guard ----------
   Keeps every visible card label above glow layers and forces dark-page contrast.
   This is intentionally narrow to text visibility; it does not change app links or behavior.
 */
section .grid > .card > *,
section .grid > a.card > *,
section .product-map-grid > .product-map-card > *,
section .decision-matrix > .decision-card > *,
section .support-path-grid > .card > *,
.testimonial-grid > .testimonial-card > * {
  position: relative;
  z-index: 2;
  min-width: 0;
}

section .grid > .card h3,
section .grid > a.card h3,
section .product-map-grid > .product-map-card h3,
section .decision-matrix > .decision-card h3,
section .support-path-grid > .card h3,
.page-home .proof-home-card h2,
.page-home .proof-home-card h3,
.page-home .workflow-ribbon strong,
.page-home .counter-num {
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0,0,0,.26);
}

section .grid > .card p,
section .grid > a.card p,
section .product-map-grid > .product-map-card p,
section .decision-matrix > .decision-card p,
section .support-path-grid > .card p,
.testimonial-grid > .testimonial-card p,
.page-home .proof-home-card p,
.page-home .workflow-ribbon span,
.page-home .counter-label {
  color: #dbe5f5;
  opacity: 1;
}

section .grid > .card .eyebrow,
section .grid > a.card .eyebrow,
.page-home .proof-home-card .eyebrow {
  color: #ffe39d;
  background: rgba(244,182,61,.16);
  border-color: rgba(244,182,61,.34);
}

section .grid > .card .card-link,
section .grid > a.card .card-link,
section .support-path-grid > .card .card-link {
  color: #ffd77e;
}

.page-home .counter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.page-home .counter-tile {
  display: grid;
  gap: 8px;
  min-height: 150px;
  align-content: start;
  padding: 24px 22px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.03));
  box-shadow: 0 18px 60px rgba(0,0,0,.18);
}

.page-home .counter-num {
  display: block;
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  font-weight: 900;
  letter-spacing: -.035em;
  line-height: 1.05;
}

.page-home .counter-label {
  display: block;
  font-weight: 750;
  line-height: 1.48;
  overflow-wrap: anywhere;
}

@media (max-width: 980px) {
  .page-home .counter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .page-home .counter-grid { grid-template-columns: 1fr; }
  .page-home .counter-tile { min-height: auto; }
}
