/* ============================================================
   FONTS
   ============================================================ */
@font-face {
  font-family: "Fredoka";
  src: url("../font/Fredoka-Regular.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fredoka";
  src: url("../font/Fredoka-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --laffari-blue: #178be7;
  --laffari-deep: #0f6fc0;
  --laffari-bg: #f6f8fb;
  --laffari-dark: #0b1220;
  --radius: 18px;
  --reveal-dur: .6s;
  --reveal-ease: cubic-bezier(.2, .6, .2, 1);
}

/* ============================================================
   BASE TYPOGRAPHY  — readability first
   ============================================================ */
html {
  font-family: "Fredoka", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body, html {
  font-family: "Fredoka", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

body {
  background: var(--laffari-bg);
  color: #1a1a2e;          /* slightly softer than pure black */
  line-height: 1.65;       /* comfortable reading line-height */
  font-size: 1rem;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  color: #003053 !important;
  line-height: 1.2;
  font-weight: 700;
}

/* Body text improvements */
p {
  line-height: 1.7;
  margin-bottom: 1rem;
}

.lead {
  font-size: 1.15rem;
  line-height: 1.65;
  color: #333;
}

.text-muted {
  color: #5a6272 !important;   /* higher contrast than Bootstrap default */
  line-height: 1.6;
}

small, .small {
  font-size: 0.875rem;
  line-height: 1.55;
}

/* Links */
a { text-decoration: none; }
.footer a { text-decoration: none; }

/* ============================================================
   LAYOUT HELPERS
   ============================================================ */
.max-600 { max-width: 600px; }
.container-narrow { max-width: 800px; margin-inline: auto; }

.border-radius-xl  { border-radius: 30px; }
.border-radius-l   { border-radius: 16px; }
.border-radius-x   { border-radius: 15px; }
.rounded-2xl       { border-radius: var(--radius); }
.shadow-soft       { box-shadow: 0 8px 20px rgba(16,24,40,.08); }
.text-title        { font-weight: 700; letter-spacing: .2px; }
.float-right       { float: right; }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  top: 54px;
  transition: top .35s, box-shadow .25s;
  z-index: 1030;
  box-shadow: 0 12px 0 0 #d9d9d9;
}
.navbar.is-fixed {
  top: 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
.dropdown-menu[data-bs-popper] { left: auto; right: 0; }

/* Nav pills / links */
.nav-link {
  border-radius: 16px;
  color: #003053 !important;
  font-size: 0.95rem;
}
.nav-link:hover { background: #f0f0f0; border-radius: 16px !important; }
.nav-pills .nav-link { border-radius: 16px !important; }
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link { color: #fff !important; background-color: #1f92e5; }

/* ============================================================
   ACCORDION  — two variants:
   1. FAQ pages: accordion-flush (landing page / blog page style)
   2. Legacy bordered: only on original blue sections (kept via .accordion-bordered helper)
   ============================================================ */

/* Default accordion: flush style (landing page look) */
.accordion { --bs-accordion-bg: transparent !important; border-radius: 16px !important; }

/* Accordion items – flush style */
.accordion-flush .accordion-item {
  border: 1px solid rgba(0,48,83,.08) !important;
  background: #fff !important;
  border-radius: 12px !important;
  margin-bottom: 12px !important;
  padding: 0 1rem;
}
.accordion-flush .accordion-button {
  color: #003053 !important;
  font-size: 1.05rem;
  font-weight: 600;
  background: transparent !important;
  padding: 1rem 0;
  box-shadow: none !important;
}
.accordion-flush .accordion-button:not(.collapsed) {
  color: #1f92e5 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.accordion-flush .accordion-button::after {
  filter: none;
}
.accordion-flush .accordion-body {
  color: #44546a;
  font-size: 0.97rem;
  line-height: 1.7;
  padding: 0 0 1rem 0;
}
.accordion-flush .accordion-button:hover {
  background: transparent !important;
  color: #1f92e5 !important;
  border-radius: 0 !important;
}

/* Non-flush (pill/bordered) accordion – for legacy blue style */
.accordion-item {
  border: 8px solid #1F92E5 !important;
  background: #1F92E5;
  border-radius: 16px !important;
}
.accordion-button, .accordion-button:not(.collapsed), .accordion-item { color: #fff; }
.accordion-button:not(.collapsed) {
  background-color: transparent;
  box-shadow: 0 2px 0 0 #057DD3;
}
.accordion-button:hover {
  background: #057DD3;
  border-top-left-radius: 9px;
  border-top-right-radius: 9px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-store {
  padding: 14px 19px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  border-radius: 20px;
  border: 2px solid #d9d9d9;
  background: #fff;
  box-shadow: 0 6px 0 0 #d9d9d9;
  text-decoration: none !important;
  color: #003053 !important;
  font-weight: 600;
  transition: box-shadow .15s, transform .15s;
}
.btn-store:hover {
  box-shadow: 0 2px 0 0 #d9d9d9;
  background: #f0f0f0;
  transform: translateY(2px);
}
.btn-store i { font-size: 1.2rem; margin-right: .5rem; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  background: url(../img/HeroSection.webp) center/cover no-repeat;
  color: #fff;
  height: 90vh;
}
.hero-blog {
  height: 60vh;
}
.hero h1, .hero h2, .hero h3 { color: #fff !important; }

/* ============================================================
   CARDS  — blog cards with consistent image ratio
   ============================================================ */
.card { border: none; }
.card-img, .card-img-top {
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  /* Consistent 16:9 ratio for all blog card images */
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
  display: block;
}

.card:hover { background: #f0f0f0; }

/* Coloured shadow card styles */
.article-orange-shadow { border: 8px solid #f90 !important; background: #fff; box-shadow: 0 18px 0 0 #f90; }
.article-green-shadow  { border: 8px solid #59b715 !important; background: #fff; box-shadow: 0 18px 0 0 #59b715; }
.article-purple-shadow { border: 8px solid #9b65ff !important; background: #fff; box-shadow: 0 18px 0 0 #9b65ff; }
.article-blue-shadow   { border: 8px solid #1f92e5 !important; background: #fff; box-shadow: 0 18px 0 0 #1f92e5; }

/* Ensure card body text is readable */
.card-body .h5, .card-body h2.h5 {
  font-size: 1rem;
  line-height: 1.35;
  font-weight: 700;
  color: #003053 !important;
  margin-bottom: .5rem;
}
.card-body .meta { color: #7a8594; font-size: 0.8rem; }

/* ============================================================
   BENTO / TILES
   ============================================================ */
.bento { background: #1f92e5; display: grid; gap: 1rem; }
@media (min-width: 768px) {
  .bento { grid-template-columns: repeat(12,1fr); }
  .bento .tile-12 { grid-column: span 12; }
  .bento .tile-8  { grid-column: span 8; }
  .bento .tile-6  { grid-column: span 6; }
  .bento .tile-4  { grid-column: span 4; }
}

.tile {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(16,24,40,.08);
  position: relative;
}
.tile-cover {
  min-height: 320px;
  background: center/cover no-repeat #cfe3ff;
  background-position: bottom;
  background-size: cover;
  background-repeat: no-repeat;
  transition: transform .4s, opacity .3s;
}
.tile:hover .tile-cover { transform: scale(1.03); opacity: .95; }
.tile-body {
  padding: 1rem;
  position: absolute;
  bottom: 0;
  background: rgba(255,255,255,.88);
  margin: 15px;
  border-radius: 9px;
  width: -webkit-fill-available;
}
.tile-wide  .tile-cover { min-height: 220px; }
.tile-short .tile-cover { min-height: 140px; }
.avatar-penguin, .tile-tall .tile-cover { min-height: 360px; }

.tile-glass {
  backdrop-filter: blur(6px);
  background: rgba(255,255,255,.6);
  border: 1px solid rgba(16,24,40,.08);
}

/* ============================================================
   CTA / FOOTER
   ============================================================ */
.cta { background: url(../img/cta-bgr.webp) center/cover no-repeat #1f92e5; }
.cta h2, .cta h3, .cta p { color: #fff; }
.footer { background: #1f92e5; color: #eaf4ff; }
.footer a { color: #eaf4ff; }

/* CTA button – same pill style as landing page btn-store */
.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 20px;
  border: 2px solid #d9d9d9;
  background: #fff;
  box-shadow: 0 6px 0 0 #d9d9d9;
  color: #003053 !important;
  font-weight: 600;
  text-decoration: none !important;
  transition: box-shadow .15s, transform .15s;
}
.btn-cta:hover {
  box-shadow: 0 2px 0 0 #d9d9d9;
  background: #f0f0f0;
  transform: translateY(2px);
}

.text-white-80 { color: rgba(255,255,255,.8) !important; }
a.text-white-80:hover { text-decoration: underline; }

/* ============================================================
   TAGS
   ============================================================ */
.tag {
  border: 1px solid #ccc;
  border-radius: 20px;
  padding: 5px 12px;
  display: inline-block;
  margin-bottom: 5px;
  font-size: .85rem;
  color: #444;
}
.tag::before { content: "#"; margin-right: 2px; color: #999; }
.white-tag {
  border: 1px solid #fff;
  padding: 9px 19px;
  background: rgba(255,255,255,.85);
  color: #000;
}
.white-tag::before { content: ""; }

/* ============================================================
   REVEAL ANIMATIONS
   ============================================================ */
[data-animate] {
  opacity: 0;
  will-change: transform, opacity;
  transition: transform var(--reveal-dur) var(--reveal-ease),
              opacity var(--reveal-dur) var(--reveal-ease);
}
[data-animate=up]    { transform: translateY(20px); }
[data-animate=down]  { transform: translateY(-20px); }
[data-animate=left]  { transform: translateX(24px); }
[data-animate=right] { transform: translateX(-24px); }
[data-animate=fade]  { transform: none; }
[data-animate=zoom]  { transform: scale(.98); }
.is-visible { opacity: 1; transform: none; }
[data-animate][style*="--delay"] { transition-delay: var(--delay,0s); }
[data-category] { transition: opacity .2s; }

@media (prefers-reduced-motion: reduce) {
  [data-animate], [data-category] { transition: none !important; }
  [data-animate] { opacity: 1 !important; transform: none !important; }
}

/* ============================================================
   STORY GROUPS (tabs)
   ============================================================ */
.story-group { display: none; }
.story-group.is-active { display: block; }

/* ============================================================
   BRAND STRIP (logo scroll)
   ============================================================ */
.brand-strip-wrapper {
  overflow: hidden;
  position: relative;
  white-space: nowrap;
}
.brand-strip-wrapper::before,
.brand-strip-wrapper::after {
  content: "";
  position: absolute;
  top: 0;
  width: 100px;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}
.brand-strip-wrapper::before { left: 0; background: linear-gradient(to right, #f6f8fb 0%, transparent 100%); }
.brand-strip-wrapper::after  { right: 0; background: linear-gradient(to left,  #f6f8fb 0%, transparent 100%); }
.brand-strip { display: flex; width: max-content; gap: 3rem; }
.brand-track {
  display: flex;
  gap: 3rem;
  animation: scroll-logos 40s linear infinite;
}
.brand-track img { transition: transform .3s ease; }
.brand-track img:hover { transform: scale(1.1); }
@keyframes scroll-logos {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============================================================
   MISC COMPONENTS
   ============================================================ */
.placeholder-card { background: #e9eef6; border-radius: 16px; }
.ratio-16x9 { aspect-ratio: 16/9; }
.brand-strip .logo-pill {
  background: #fff;
  border-radius: 12px;
  padding: .5rem 1rem;
  border: 1px solid rgba(16,24,40,.06);
}
.avatar-penguin {
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="640" height="640"><rect width="100%" height="100%" rx="28" ry="28" fill="%23ffffff"/><text x="50%" y="50%" fill="%230b1220" dominant-baseline="middle" text-anchor="middle" font-size="28" font-family="Arial">Penguin Illustration Placeholder</text></svg>') center/contain no-repeat #fff;
  border-radius: 28px;
}
.story-cover {
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="800" height="450"><rect width="100%" height="100%" fill="%23cfe3ff"/><text x="50%" y="50%" fill="%230b1220" dominant-baseline="middle" text-anchor="middle" font-size="28" font-family="Arial">Story Cover</text></svg>') center/cover no-repeat;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  min-height: 160px;
}
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: static;
  width: auto;
  height: auto;
  background: #fff;
  padding: .5rem 1rem;
  z-index: 1000;
}

/* Bedtime sky */
.bedtime-sky {
  background: radial-gradient(120% 80% at 70% 20%, #1a2b4a 0, #0d172b 65%, #091021 100%);
}
.bedtime-stars {
  background-image: radial-gradient(#fff 1px,transparent 1px), radial-gradient(#fff 1px,transparent 1px);
  background-size: 24px 24px, 32px 32px;
  background-position: 0 0, 12px 12px;
  opacity: .18;
}

/* Pagination */
.active > .page-link, .page-link.active { background-color: #1f92e5 !important; border-color: #1f92e5 !important; }
.page-link { color: #1f92e5; }

/* Display override */
.display-1 { line-height: 1 !important; }

/* ============================================================
   BLOG ARTICLE — PROSE STYLES
   ============================================================ */
.prose {
  font-size: 1.05rem;
  line-height: 1.75;
  color: #1a1a2e;
}
.prose h2 {
  font-size: 1.45rem;
  margin-top: 2.25rem;
  margin-bottom: .75rem;
  line-height: 1.25;
}
.prose h3 {
  font-size: 1.15rem;
  margin-top: 0.75rem;
  margin-bottom: .5rem;
  line-height: 1.3;
}
.prose p, .prose li {
  line-height: 1.75;
  color: #2c3347;
}
.prose ul, .prose ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}
.prose li { margin-bottom: .4rem; }
.prose a {
  color: #1f92e5;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.prose a:hover { color: #0f6fc0; }
.prose strong { color: #003053; }

/* Table of contents */
.toc {
  background: #f0f5fc;
  font-size: 0.95rem;
}
.toc a { color: #1f92e5; }
.toc a:hover { color: #0f6fc0; text-decoration: underline; }

/* In-article images */
.post-hero img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 18px;
  display: block;
}

/* ============================================================
   RESPONSIVE — Mobile
   ============================================================ */
@media (max-width: 768px) {
  .w-50 { width: 100% !important; }
  .navbar { top: 0; }
  .border-radius-l, .nav-link { padding: 12px 16px; }
}

@media (max-width: 576px) {
  .navbar { border-radius: 0; }
  .tile-body { position: static; padding: 0; }
  .hero, .hero-blog {
    background: #1F92E5 !important;
    padding-top: 100px;
    height: auto;
  }
  .white-tag { width: 100%; display: block; text-align: center; }
  .navbar-collapse .dropdown-menu {
    position: static;
    float: none;
    width: auto;
    margin-top: 0;
    background-color: transparent;
    border: 0;
    box-shadow: none !important;
    padding-left: 0;
    padding-right: 0;
  }
  .navbar-collapse .dropdown-menu .dropdown-item { white-space: normal; }

  /* Blog card images stay 16:9 on mobile */
  .card-img, .card-img-top {
    aspect-ratio: 16 / 9;
    object-fit: cover;
  }

  /* Better prose on small screens */
  .prose { font-size: 1rem; }
  .prose h2 { font-size: 1.25rem; }
  .prose h3 { font-size: 1.05rem; }
}