/* Styles for /best-ibs-app/ and /low-fodmap-scanner-app/. Builds on style.css tokens and discover.css. */

/* ---------- Page rhythm ---------- */
.ap-section { padding: 72px 0; }
.ap-section + .ap-section { border-top: 1px solid var(--border); }
.ap-alt { background: var(--paper); }
.ap-section h2, .ap-compare h2 { font-family: var(--font-display); color: var(--ink); font-size: clamp(26px, 3.6vw, 34px); line-height: 1.15; margin: 0 0 10px; text-wrap: balance; }
.ap-section h3 { font-family: var(--font-display); color: var(--ink); font-size: 18px; line-height: 1.25; margin: 0 0 6px; }
.ap-section p { line-height: 1.65; color: var(--text-main); max-width: 760px; }
.ap-sub { color: var(--text-muted); margin: 0 0 28px; font-size: 17px; }
.ap-section a, .ap-hero a:not(.btn) { color: var(--ink-soft); text-underline-offset: 3px; }
.ap-section :focus-visible, .ap-hero :focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* ---------- Hero ---------- */
.ap-hero { padding: 116px 0 52px; background: linear-gradient(180deg, #d9f5ee, var(--mint)); }
.ap-hero h1 { font-family: var(--font-display); color: var(--ink); font-size: clamp(32px, 5.2vw, 52px); line-height: 1.08; margin: 0 0 14px; text-wrap: balance; }
.ap-lead { font-size: clamp(17px, 2.2vw, 20px); line-height: 1.55; color: var(--text-main); max-width: 640px; margin: 0 0 26px; }
.ap-btn-lg { display: inline-flex; align-items: center; justify-content: center; padding: 17px 38px; font-size: 18px; font-weight: 700; border-radius: var(--radius-pill); background: var(--ink); color: #fff !important; text-decoration: none !important; box-shadow: 0 10px 24px rgba(13, 59, 55, 0.22); transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease; }
.ap-btn-lg:hover { background: var(--ink-soft); transform: translateY(-2px); box-shadow: 0 14px 28px rgba(13, 59, 55, 0.26); }

/* ---------- Cards (one consistent card style) ---------- */
.ap-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.ap-feature { background: var(--paper); border: 1px solid var(--border); border-radius: 18px; padding: 24px; box-shadow: var(--shadow-card); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.ap-feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.ap-icon { display: block; width: 26px; height: 26px; }
.ap-feature .ap-icon { box-sizing: content-box; padding: 11px; border-radius: 14px; background: var(--primary-soft); color: var(--ink); margin-bottom: 14px; }
.ap-feature p { font-size: 15px; margin: 0; color: var(--text-muted); }
.ap-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 18px; }
.ap-card { background: var(--paper); border: 1px solid var(--border); border-radius: 18px; padding: 24px; box-shadow: var(--shadow-card); }
.ap-card p { font-size: 15px; margin: 0 0 10px; }
.ap-tagline { color: var(--text-muted); }

/* ---------- "What makes IBS Pal different" ---------- */
.ap-confirmed { list-style: none; padding: 0; margin: 0 0 22px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ap-confirmed li { display: flex; gap: 14px; align-items: flex-start; background: var(--mint); border: 1px solid var(--border); border-radius: 16px; padding: 18px; }
.ap-confirmed .ap-icon { flex: none; box-sizing: content-box; padding: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: #fff; }
.ap-confirmed strong { display: block; color: var(--ink); font-size: 16px; margin-bottom: 2px; }
.ap-confirmed span { display: block; font-size: 14px; line-height: 1.5; color: var(--text-muted); }
.ap-more { color: var(--text-muted); font-size: 15px; }

/* ---------- Comparison table (scoped to this page) ---------- */
.ap-compare { padding: 72px 0; background: #f3faf8; border-top: 1px solid var(--border); }
.ap-compare .container { max-width: 1060px; }
.ap-compare .section-header { margin-bottom: 22px; }
.ap-compare .section-description { max-width: 720px; font-size: 16px; }
.ap-compare .comparison-key { gap: 18px; flex-wrap: wrap; justify-content: center; margin-bottom: 14px; }
.ap-compare .home-comparison-scroll { border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 12px 36px rgba(13, 59, 55, 0.07); background: #fff; }
.ap-compare table { min-width: 780px; }
.ap-compare th, .ap-compare td { padding: 13px 10px; border-bottom-color: #eef4f2; }
.ap-compare thead th { height: 64px; font-size: 13px; background: #fff; }
.ap-compare thead .comparison-pal { background: #e3f5ee; }
.ap-compare tbody tr:nth-child(even) > * { background: #fafdfc; }
.ap-compare tbody tr:nth-child(even) > .comparison-pal { background: #dff3ea; }
.ap-compare tbody tr:hover > * { background: #f1faf6; }
.ap-compare th:first-child { box-shadow: 8px 0 10px -8px rgba(13, 59, 55, 0.22); }
.ap-compare tbody th { font-size: 14px; }
.ap-compare .comparison-indicator { width: 30px; height: 30px; font-size: 17px; }
.ap-compare .comparison-note { text-align: center; margin-top: 14px; }
.ap-compare .comparison-scroll-help { text-align: center; font-weight: 600; color: var(--ink-soft); margin: 0 0 8px; }

/* ---------- Sources accordion ---------- */
.ap-sources { background: var(--mint); padding: 40px 0; }
.ap-accordion { max-width: 820px; background: var(--paper); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-card); }
.ap-accordion summary { cursor: pointer; list-style: none; padding: 18px 22px; font-weight: 700; color: var(--ink); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ap-accordion summary::-webkit-details-marker { display: none; }
.ap-accordion summary::after { content: "+"; font-size: 24px; line-height: 1; font-weight: 400; color: var(--ink-soft); transition: transform 0.25s ease; }
.ap-accordion[open] summary::after { transform: rotate(45deg); }
.ap-accordion-body { padding: 0 22px 20px; font-size: 14px; }
.ap-accordion-body p { font-size: 14px; max-width: none; }

/* ---------- Final CTA ---------- */
.ap-cta { background: linear-gradient(135deg, var(--ink), #0a2e2b); text-align: center; padding: 80px 0; border-top: 0; }
.ap-cta h2 { color: #fff; }
.ap-cta p { color: rgba(255, 255, 255, 0.85); margin-left: auto; margin-right: auto; }
.ap-cta p a { color: var(--primary); }
.ap-cta-buttons { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: center; margin: 22px 0 10px; }
.ap-cta-buttons .btn { display: inline-flex; align-items: center; justify-content: center; padding: 15px 32px; border-radius: var(--radius-pill); font-weight: 700; text-decoration: none; }
.ap-cta-buttons .btn-primary { background: var(--primary); color: var(--ink); }
.ap-cta-buttons .btn-primary:hover { background: #7fe0d9; }
.ap-hero .ap-cta-buttons { justify-content: flex-start; }
.ap-hero .ap-cta-buttons .btn-primary { background: var(--ink); color: #fff; }
.ap-fine { font-size: 13px !important; color: var(--text-muted); margin: 0; }
.ap-cta .ap-fine { color: rgba(255, 255, 255, 0.75); }
.ap-cta :focus-visible { outline-color: var(--primary); }


/* ---------- /best-ibs-app/ hero (scoped; the scanner page keeps .ap-hero as is) ---------- */
.ap-hero-best { padding: 104px 0 20px; overflow: hidden; background: radial-gradient(760px 420px at 88% 38%, rgba(78, 205, 196, 0.32), transparent 68%), linear-gradient(180deg, #d9f5ee 0%, var(--mint) 100%); }
.ap-hero-best .container { max-width: 1100px; }
.ap-hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 20px 44px; align-items: center; }
.ap-hero-best h1 { font-size: clamp(36px, 5.6vw, 60px); line-height: 1.04; letter-spacing: -0.02em; margin: 0 0 16px; }
.ap-hero-best .ap-lead { max-width: 500px; margin: 0 0 28px; }
.ap-hero-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.ap-hero-best .ap-btn-lg { padding: 18px 46px; font-size: 18px; }
.ap-hero-stores .dz-badges { gap: 8px; }
.ap-hero-stores .dz-badges .store-btn img { height: 36px; }
.ap-hero-best .ap-fine { margin: 0; }
.ap-hero-visual { margin: 0; align-self: end; }
.ap-hero-visual img { display: block; width: 100%; max-width: 520px; height: auto; margin-left: auto; filter: drop-shadow(0 26px 28px rgba(13, 59, 55, 0.22)); -webkit-mask-image: linear-gradient(to bottom, #000 86%, transparent); mask-image: linear-gradient(to bottom, #000 86%, transparent); }
.ap-hero-best + main > .ap-section:first-child { padding-top: 40px; border-top: 0; }
.ap-publisher { margin: 14px auto 0; max-width: 640px; text-align: center; font-size: 12.5px !important; color: var(--text-muted) !important; }
@media (max-width: 820px) {
  .ap-hero-best { padding: 92px 0 0; }
  .ap-hero-grid { grid-template-columns: 1fr; gap: 6px; }
  .ap-hero-best .ap-lead { margin-bottom: 22px; }
  .ap-hero-actions { align-items: stretch; }
  .ap-hero-best .ap-btn-lg { width: 100%; }
  .ap-hero-stores { display: flex; justify-content: center; }
  .ap-hero-best .ap-fine { text-align: center; }
  .ap-hero-visual { max-width: 430px; margin: 8px auto 0; }
  .ap-hero-visual img { margin: 0 auto; }
  .ap-hero-best + main > .ap-section:first-child { padding-top: 28px; }
}

/* ---------- Mobile ---------- */
@media (max-width: 820px) {
    .ap-section { padding: 52px 0; }
  .ap-compare { padding: 52px 0; }
  .ap-cta { padding: 60px 0; }
}
@media (max-width: 600px) {
  .ap-hero { padding: 100px 0 40px; }
    .ap-btn-lg { width: 100%; padding: 17px 24px; }
        .ap-section { padding: 44px 0; }
  .ap-sub { font-size: 16px; margin-bottom: 22px; }
  .ap-features { grid-template-columns: 1fr 1fr; gap: 12px; }
  .ap-feature { padding: 18px 16px; border-radius: 16px; }
  .ap-feature h3 { font-size: 16px; }
  .ap-feature p { font-size: 14px; }
  .ap-feature .ap-icon { padding: 9px; margin-bottom: 10px; }
  .ap-confirmed { grid-template-columns: 1fr; gap: 10px; }
  .ap-compare { padding: 44px 0; }
  .ap-compare table { min-width: 700px; }
  .ap-compare th:first-child { width: 142px; min-width: 142px; padding-left: 12px; }
  .ap-compare .comparison-key { justify-content: flex-start; font-size: 12px; gap: 12px; }
  .ap-accordion summary { padding: 16px 18px; }
  .ap-accordion-body { padding: 0 18px 18px; }
  .ap-cta-buttons { flex-direction: column; }
  .ap-cta-buttons .btn { width: 100%; }
}
@media (max-width: 380px) {
  .ap-features { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .ap-btn-lg, .ap-feature, .ap-accordion summary::after { transition: none; }
  .ap-btn-lg:hover, .ap-feature:hover { transform: none; }
}

/* ============================================================
   /low-fodmap-scanner-app/  (mobile-first; classes prefixed sc-)
   ============================================================ */
.sc-hero { position: relative; overflow: hidden; color: #fff; padding: 92px 0 0; background: radial-gradient(520px 340px at 85% 62%, rgba(78, 205, 196, 0.30), transparent 70%), radial-gradient(420px 260px at 0% 0%, rgba(78, 205, 196, 0.12), transparent 70%), var(--ink); }
.sc-hero .container { max-width: 1100px; }
.sc-hero-grid { display: grid; grid-template-columns: 1fr; gap: 28px; align-items: end; }
.sc-hero-copy { padding-bottom: 0; }
.sc-eyebrow { display: inline-block; margin: 0 0 14px; padding: 6px 14px; border-radius: var(--radius-pill); background: rgba(78, 205, 196, 0.16); color: var(--primary); font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.sc-hero h1 { font-family: var(--font-display); font-size: clamp(36px, 9.4vw, 62px); line-height: 1.04; letter-spacing: -0.02em; margin: 0 0 14px; color: #fff; text-wrap: balance; }
.sc-accent { color: var(--primary); }
.sc-lead { font-size: 17px; line-height: 1.55; color: rgba(255, 255, 255, 0.82); max-width: 480px; margin: 0 0 24px; }
.sc-btn { display: flex; align-items: center; justify-content: center; width: 100%; padding: 17px 28px; border-radius: var(--radius-pill); background: var(--primary); color: var(--ink) !important; font-size: 18px; font-weight: 700; text-decoration: none !important; box-shadow: 0 12px 28px rgba(78, 205, 196, 0.28); transition: transform 0.2s ease, background 0.2s ease; }
.sc-btn:hover { background: #7fe0d9; transform: translateY(-2px); }
.sc-fine { margin: 12px 0 0; font-size: 13px; color: rgba(255, 255, 255, 0.66); text-align: center; }
.sc-btn:focus-visible, .sc-hero a:focus-visible, .sc-cta a:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

/* Two genuine app screens, overlapping, cropped by the section edge. */
.sc-phones { position: relative; width: 100%; max-width: 420px; aspect-ratio: 1 / 0.9; margin: 0 auto; }
.sc-phone-back, .sc-phone-front { position: absolute; width: 49%; }
.sc-phone-back { left: 4%; top: 2%; transform: rotate(-5deg); transform-origin: 50% 100%; }
.sc-phone-front { right: 4%; top: 9%; transform: rotate(4deg); transform-origin: 50% 100%; z-index: 2; }
.sc-why-device { display: block; width: 100%; max-width: 224px; margin: 32px auto 0; }

.sc-section { padding: 56px 0; background: var(--paper); }
.sc-soft { background: #f3faf8; }
.sc-section h2, .sc-cta h2 { font-family: var(--font-display); color: var(--ink); font-size: clamp(26px, 6.4vw, 34px); line-height: 1.15; margin: 0 0 24px; text-wrap: balance; }

/* How it works: compact steps (rows on mobile, a row of three on desktop). */
.sc-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.sc-step { display: flex; align-items: flex-start; gap: 16px; }
.sc-step .ap-icon, .sc-benefit .ap-icon { flex: none; box-sizing: content-box; padding: 12px; border-radius: 16px; background: var(--primary-soft); color: var(--ink); }
.sc-step h3 { font-family: var(--font-display); font-size: 19px; color: var(--ink); margin: 2px 0 2px; }
.sc-step p, .sc-benefit p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--text-muted); max-width: 34ch; }

/* More than a food scanner */
.sc-why { display: grid; grid-template-columns: 1fr; gap: 0; align-items: center; }
.sc-benefits { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.sc-benefit { display: grid; grid-template-columns: auto 1fr; column-gap: 16px; align-items: center; padding: 16px 0; border-top: 1px solid rgba(13, 59, 55, 0.1); }
.sc-benefit:first-child { border-top: 0; padding-top: 0; }
.sc-benefit .ap-icon { grid-row: 1 / span 2; }
.sc-benefit h3 { font-family: var(--font-display); font-size: 18px; color: var(--ink); margin: 0; align-self: end; }
.sc-benefit p { align-self: start; }

/* Final CTA */
.sc-cta { background: linear-gradient(135deg, var(--ink), #0a2e2b); text-align: center; padding: 60px 0; }
.sc-cta h2 { color: #fff; margin-bottom: 22px; }
.sc-stores { display: flex; justify-content: center; }
.sc-stores .dz-badges { justify-content: center; gap: 12px; }
.sc-stores .dz-badges .store-btn img { height: 48px; }
.sc-cta .sc-fine { margin-top: 14px; text-align: center; }

/* FAQ: one compact accordion */
.sc-faq { max-width: 760px; }
.sc-faq h2 { font-size: clamp(22px, 5.6vw, 28px); margin-bottom: 14px; }
.sc-faq-item { border-bottom: 1px solid var(--border); }
.sc-faq-item summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; font-weight: 600; color: var(--ink); font-size: 16px; }
.sc-faq-item summary::-webkit-details-marker { display: none; }
.sc-faq-item summary::after { content: "+"; font-size: 22px; font-weight: 400; color: var(--ink-soft); transition: transform 0.25s ease; flex: none; }
.sc-faq-item[open] summary::after { transform: rotate(45deg); }
.sc-faq-item p { margin: 0 0 16px; font-size: 15px; line-height: 1.6; color: var(--text-muted); }
.sc-section :focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* Subtle related links */
.sc-links { background: var(--mint); padding: 22px 0; }
.sc-links .container { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; }
.sc-links a { font-size: 14px; color: var(--ink-soft); text-underline-offset: 3px; }

@media (min-width: 821px) {
  .sc-hero { padding-top: 112px; }
  .sc-hero-grid { grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr); gap: 40px; }
  .sc-hero-copy { padding-bottom: 72px; align-self: center; }
  .sc-btn { display: inline-flex; width: auto; padding: 18px 46px; }
  .sc-hero .sc-fine { text-align: left; }
  .sc-phones { max-width: 500px; margin-right: 0; aspect-ratio: 1 / 0.98; }
  .sc-section { padding: 80px 0; }
  .sc-steps { grid-template-columns: repeat(3, 1fr); gap: 36px; }
  .sc-step { position: relative; }
  .sc-step + .sc-step::before { content: ""; position: absolute; left: -22px; top: 26px; width: 8px; height: 8px; border-top: 2px solid var(--primary-dark); border-right: 2px solid var(--primary-dark); transform: rotate(45deg); }
  .sc-why { grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr); gap: 56px; }
  .sc-why-device { max-width: 232px; margin: 0 auto; }
  .sc-cta { padding: 80px 0; }
  .sc-faq h2 { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .sc-btn, .sc-faq-item summary::after { transition: none; }
  .sc-btn:hover { transform: none; }
}
