/* ============================================================
   FLORIN+ Blog Stylesheet
   Shared across all 40+ blog articles
   Mobile-first, fully responsive
   ============================================================ */

/* === RESET & BOX MODEL === */
*, *::before, *::after {
  box-sizing: border-box;
}

/* === GLOBAL OVERFLOW FIX === */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

img, video, iframe, svg {
  max-width: 100%;
  height: auto;
}

/* === BLOG LAYOUT GRID === */
.blog-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  align-items: start;
  max-width: 100%;
}

/* KEY FIX: min-width:0 prevents CSS Grid items from overflowing their column */
.blog-body {
  min-width: 0;
  max-width: 760px;
  overflow-wrap: break-word;
  word-break: break-word;
}

.blog-sidebar {
  position: sticky;
  top: 100px;
  min-width: 0;
}

/* === BLOG HERO === */
.blog-hero {
  background: linear-gradient(135deg, #0f2d8a 0%, #155EEF 60%, #1BBDE0 100%);
  padding: 80px 0 60px;
  color: white;
  overflow: hidden;
}

.blog-hero h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 16px;
}

.blog-hero .meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  opacity: .85;
  font-size: .92rem;
}

/* === SUMMARY & TOC === */
.blog-summary {
  background: #EFF5F5;
  border-radius: 16px;
  padding: 28px 32px;
  margin: 40px 0;
  overflow-wrap: break-word;
}

.blog-summary h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--blue-primary);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.blog-summary ul, .blog-summary li {
  padding-left: 20px;
  margin-bottom: 8px;
  line-height: 1.6;
}

.blog-toc {
  background: white;
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 24px 28px;
  margin: 0 0 40px;
  overflow-wrap: break-word;
}

.blog-toc h3 {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.blog-toc ol { padding-left: 20px; }
.blog-toc li { margin-bottom: 6px; }
.blog-toc a { color: var(--blue-primary); }

/* === BODY TEXT === */
.blog-body p {
  margin-bottom: 18px;
  line-height: 1.75;
  font-size: 1.03rem;
  overflow-wrap: break-word;
}

.blog-body ul {
  padding-left: 22px;
  margin: 16px 0;
}

.blog-body li {
  margin-bottom: 8px;
  line-height: 1.7;
  overflow-wrap: break-word;
}

.blog-body h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 18px;
  padding-top: 8px;
}

.blog-body h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--dark);
  margin: 24px 0 12px;
}

/* === INFO / WARNING / SUCCESS BOXES === */
.info-box, .warning-box, .success-box, .disclaimer-box {
  border-radius: 0 12px 12px 0;
  padding: 18px 20px;
  margin: 24px 0;
  overflow-wrap: break-word;
  word-break: break-word;
  overflow: hidden;
}

.info-box {
  background: #EFF5F5;
  border-left: 4px solid #155EEF;
}

.warning-box {
  background: #FFF8E1;
  border-left: 4px solid #F59E0B;
}

.success-box {
  background: #F0FDF4;
  border-left: 4px solid #22C55E;
}

.disclaimer-box {
  background: #FFF8E1;
  border-left: 4px solid #F59E0B;
  font-size: .85rem;
}

.disclaimer-box strong {
  display: block;
  margin-bottom: 6px;
  color: #92400E;
  overflow-wrap: break-word;
}

.info-box ul, .warning-box ul, .success-box ul, .disclaimer-box ul {
  padding-left: 16px;
  margin: 0;
}

.info-box li, .warning-box li, .success-box li, .disclaimer-box li {
  margin-bottom: 4px;
  overflow-wrap: break-word;
  word-break: break-word;
}

.disclaimer-box li { color: #78350F; }

/* === CTA BOX === */
.cta-box {
  background: linear-gradient(135deg, #155EEF, #1440C4);
  border-radius: 16px;
  padding: 28px 32px;
  margin: 32px 0;
  color: white;
  text-align: center;
  overflow-wrap: break-word;
}

.cta-box h3 { color: white; margin-bottom: 10px; }
.cta-box p { color: rgba(255,255,255,0.88); margin-bottom: 20px; }

.cta-box a.cta-btn {
  display: inline-block;
  background: white;
  color: #155EEF;
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.cta-box a.cta-btn2 {
  display: inline-block;
  background: rgba(255,255,255,0.18);
  color: white;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  margin-left: 12px;
  margin-top: 8px;
  white-space: nowrap;
}

/* === FAQ === */
.faq-item { border-bottom: 1px solid var(--border); padding: 4px 0; }

.faq-item__q {
  padding: 18px 0;
  cursor: pointer;
  font-weight: 600;
  color: var(--dark);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-item__q::after {
  content: "＋";
  font-size: 1.2rem;
  color: var(--blue-primary);
  transition: .2s;
  flex-shrink: 0;
  margin-left: 12px;
}

.faq-item.open .faq-item__q::after { content: "－"; }

.faq-item__a {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease, padding .35s ease;
  line-height: 1.7;
  padding: 0;
}

.faq-item.open .faq-item__a { max-height: 600px; padding: 0 0 18px; }

/* === SOURCES === */
.sources-box {
  background: #f8fafc;
  border-radius: 12px;
  padding: 24px 28px;
  margin: 40px 0;
  overflow-wrap: break-word;
}

.sources-box h3 {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
}

.sources-box li { margin-bottom: 6px; font-size: .9rem; }
.sources-box a { color: var(--blue-primary); text-decoration: underline; }

/* === TABLES === */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  table-layout: fixed; /* KEY: prevents table from overflowing */
}

th {
  padding: 12px 14px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  text-align: left;
  font-weight: 700;
  font-size: .93rem;
  overflow-wrap: break-word;
  word-break: break-word;
}

td {
  padding: 11px 14px;
  border: 1px solid var(--border);
  line-height: 1.5;
  font-size: .93rem;
  overflow-wrap: break-word;
  word-break: break-word;
}

tr:nth-child(even) td { background: #fafbfc; }

/* Table scroll wrapper (for tables that need it) */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* === STEP LIST === */
.step-list {
  counter-reset: step;
  padding-left: 0;
  list-style: none;
}

.step-list li {
  counter-increment: step;
  padding: 14px 14px 14px 56px;
  position: relative;
  border-bottom: 1px solid var(--border);
  line-height: 1.65;
  overflow-wrap: break-word;
}

.step-list li::before {
  content: counter(step);
  position: absolute;
  left: 12px;
  top: 12px;
  width: 30px;
  height: 30px;
  background: var(--blue-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
}

/* === PRE / CODE === */
pre, code {
  white-space: pre-wrap;
  word-break: break-all;
  max-width: 100%;
  overflow-x: auto;
}

/* === FOOTER LOGO === */
.footer .nav__logo img { filter: brightness(0) invert(1); }

/* === SIDEBAR CTA === */
.sidebar-cta {
  background: linear-gradient(135deg, #155EEF, #1440C4);
  border-radius: 16px;
  padding: 28px 24px;
  color: white;
  text-align: center;
}

.sidebar-cta h3 { color: white; font-size: 1.1rem; margin-bottom: 10px; }
.sidebar-cta p { color: rgba(255,255,255,.85); font-size: .9rem; margin-bottom: 18px; }

.sidebar-cta a {
  display: block;
  background: white;
  color: #155EEF;
  padding: 11px 20px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  margin-bottom: 10px;
}

/* === COOKIE BANNER === */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #0D1B4E;
  color: white;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.3);
  font-family: 'Inter', sans-serif;
  font-size: .93rem;
}

#cookie-banner a { color: #18C8E6; text-decoration: underline; }

.cookie-btn {
  padding: 10px 22px;
  border-radius: 8px;
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

.cookie-btn--accept { background: #18C8E6; color: #0D1B4E; }
.cookie-btn--decline { background: rgba(255,255,255,0.12); color: white; }
#cookie-banner.hidden { display: none; }

/* === NAV: MOBILE OPEN STATE === */
/* position: fixed – iOS Safari safe, always relative to viewport */
.nav__links.open {
  display: flex !important;
  flex-direction: column;
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  background: white;
  padding: 8px 20px 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
  z-index: 9998;
  border-top: 1px solid #E2E8F0;
  gap: 0;
}

.nav__links.open a {
  display: block;
  padding: 14px 0;
  border-bottom: 1px solid #F1F5F9;
  font-weight: 500;
  color: #1E293B;
  font-size: 1rem;
}

.nav__links.open a:last-child { border-bottom: none; }

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* 900px: sidebar hides, single column */
@media (max-width: 900px) {
  .blog-layout {
    grid-template-columns: 1fr;
  }
  .blog-sidebar {
    display: none;
  }
}

/* 768px: mobile nav + compact layout */
@media (max-width: 768px) {

  /* Nav */
  .nav__links { display: none !important; }
  .nav__mobile-toggle { display: flex !important; }
  .nav__cta .btn:first-child { display: none; }
  .nav__cta .btn--primary { padding: 9px 14px; font-size: .86rem; }

  /* Hero */
  .blog-hero { padding: 48px 0 36px; }
  .blog-hero h1 { font-size: clamp(1.4rem, 5vw, 2rem); }
  .blog-hero .meta { gap: 10px; font-size: .85rem; }

  /* Summary / TOC */
  .blog-summary { padding: 20px 18px; margin: 28px 0; }
  .blog-toc { padding: 18px 20px; }

  /* Body text */
  .blog-body { padding: 0 2px; }
  .blog-body p { font-size: .97rem; }
  .blog-body h2 { font-size: 1.25rem; }
  .blog-body h3 { font-size: 1.05rem; }

  /* Boxes */
  .cta-box { padding: 22px 18px; }
  .cta-box a.cta-btn, .cta-box a.cta-btn2 {
    display: block !important;
    margin: 8px 0 !important;
    margin-left: 0 !important;
    text-align: center !important;
    white-space: normal;
  }
  .info-box, .warning-box, .success-box, .disclaimer-box {
    padding: 14px 16px;
    margin: 16px 0;
  }

  /* Step list */
  .step-list li { padding: 12px 12px 12px 50px; }

  /* Cookie banner */
  #cookie-banner { flex-direction: column; gap: 14px; padding: 16px; }
  #cookie-banner p { margin: 0; }
  .cookie-btn { width: 100%; text-align: center; }

  /* Tables */
  table { font-size: .82rem; }
  th, td { padding: 8px 9px; }
}

/* 480px: small phones */
@media (max-width: 480px) {

  /* Hero */
  .blog-hero { padding: 36px 0 28px; }
  .blog-hero h1 { font-size: 1.35rem; }

  /* Summary */
  .blog-summary { padding: 16px 14px; }

  /* CTA */
  .cta-box h3 { font-size: 1rem; }
  .cta-box a.cta-btn, .cta-box a.cta-btn2 {
    display: block !important;
    width: 100% !important;
    margin: 6px 0 !important;
    margin-left: 0 !important;
    text-align: center !important;
    padding: 12px 16px !important;
  }

  /* Tables */
  table { font-size: .78rem; }
  th, td { padding: 7px 8px; }

  /* Step list */
  .step-list li { padding: 10px 10px 10px 44px; }
  .step-list li::before { left: 8px; top: 10px; width: 26px; height: 26px; font-size: .8rem; }

  /* Boxes */
  .info-box, .warning-box, .success-box, .disclaimer-box {
    padding: 12px 14px;
  }
}
