/* =========================================================================
   Roam2Go — Blog (index + article)
   Adaptat de blog-v1/ (Claude Design) al theme roam2go-d1.
   100% SCOPED sota .r2g-blog (index) i .r2g-article (single) amb variables
   locals --rb-* → ZERO col·lisió amb theme.css / brand.css global.
   ========================================================================= */

.r2g-blog, .r2g-article {
  --rb-ink: #0F1B14; --rb-ink-2: #41504A; --rb-ink-3: #7A8580; --rb-ink-4: #B4BAB6;
  --rb-line: #ECE7DC; --rb-paper: #FBFAF6; --rb-card: #FFFFFF;
  --rb-green: #0FB37A; --rb-green-d: #08905E; --rb-green-soft: #E6F7EF;
  --rb-blue: #11A0C4; --rb-blue-soft: #E3F5F9; --rb-amber: #FFD23F;
  --rb-grad: linear-gradient(118deg, #0FB37A 0%, #11A0C4 100%);
}

/* Contenidors propis (no depenen del .wrap global) */
.r2g-blog .rb-wrap,
.r2g-article .rb-wrap { max-width: 1160px; margin: 0 auto; padding: 0 28px; }
.r2g-article .rb-narrow { max-width: 760px; margin: 0 auto; padding: 0 28px; }

/* Pills de categoria (compartides) */
.r2g-blog .cat, .r2g-article .cat {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 800;
  letter-spacing: .04em; text-transform: uppercase; padding: 5px 11px; border-radius: 999px;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif; text-decoration: none;
}
.r2g-blog .cat-dest, .r2g-article .cat-dest         { background: var(--rb-green-soft); color: var(--rb-green-d); }
.r2g-blog .cat-guies, .r2g-article .cat-guies       { background: var(--rb-blue-soft);  color: #086A85; }
.r2g-blog .cat-consells, .r2g-article .cat-consells { background: #FFF4D6; color: #8B6B00; }
.r2g-blog .cat-novetats, .r2g-article .cat-novetats { background: #F1ECFF; color: #6B4FBB; }

/* =========================== INDEX (/blog/) =========================== */
.r2g-blog .blog-hero { padding: 56px 0 36px; }
.r2g-blog .blog-hero .eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--rb-green-d); margin-bottom: 14px; }
.r2g-blog .blog-hero .eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--rb-green); box-shadow: 0 0 0 4px rgba(15,179,122,.18); }
.r2g-blog .blog-hero h1 { font-size: clamp(38px, 5vw, 58px); font-weight: 800; letter-spacing: -.025em; margin: 0 0 12px; line-height: 1.04; font-family: 'Plus Jakarta Sans', system-ui, sans-serif; }
.r2g-blog .blog-hero h1 em { font-family: 'Fraunces', serif; font-style: italic; font-weight: 500; background: var(--rb-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.r2g-blog .blog-hero p { font-size: 18px; color: var(--rb-ink-2); max-width: 560px; margin: 0; }

.r2g-blog .blog-filters { display: flex; gap: 8px; flex-wrap: wrap; padding: 28px 0 32px; position: static; background: none; border: 0; border-radius: 0; top: auto; }
.r2g-blog .fchip { padding: 9px 16px; border-radius: 999px; border: 1px solid var(--rb-line); background: #fff; font-family: 'Plus Jakarta Sans', system-ui, sans-serif; font-size: 13.5px; font-weight: 700; color: var(--rb-ink-2); cursor: pointer; text-decoration: none; transition: all .15s; }
.r2g-blog .fchip:hover { border-color: var(--rb-ink-3); }
.r2g-blog .fchip.active { background: var(--rb-ink); color: #fff; border-color: var(--rb-ink); }

.r2g-blog .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; padding-bottom: 12px; }
.r2g-blog .post { background: var(--rb-card); border: 1px solid var(--rb-line); border-radius: 20px; overflow: hidden; text-decoration: none; color: inherit; transition: transform .2s, box-shadow .2s; display: flex; flex-direction: column; }
.r2g-blog .post:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -16px rgba(15,27,20,.18); }
.r2g-blog .post .img { aspect-ratio: 16/9; position: relative; overflow: hidden; }
.r2g-blog .post .img img { width: 100%; height: 100%; object-fit: cover; }
.r2g-blog .post .img .cat { position: absolute; top: 12px; left: 12px; z-index: 2; }
.r2g-blog .post .body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.r2g-blog .post h2 { font-size: 19px; font-weight: 800; letter-spacing: -.015em; line-height: 1.25; margin: 0 0 8px; font-family: 'Plus Jakarta Sans', system-ui, sans-serif; }
.r2g-blog .post .excerpt { font-size: 14px; color: var(--rb-ink-2); margin: 0 0 16px; flex: 1; }
.r2g-blog .post .meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--rb-ink-3); font-weight: 600; padding-top: 14px; border-top: 1px solid var(--rb-line); }
.r2g-blog .post .meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--rb-ink-4); }

.r2g-blog .featured { grid-column: 1 / -1; display: grid; grid-template-columns: 1.1fr 1fr; }
.r2g-blog .featured .img { aspect-ratio: auto; min-height: 260px; }
.r2g-blog .featured .body { padding: 32px 36px; justify-content: center; }
.r2g-blog .featured h2 { font-size: 30px; line-height: 1.1; margin-bottom: 12px; }
.r2g-blog .featured .excerpt { font-size: 16px; }

/* Placeholders de portada (quan no hi ha featured image) */
.r2g-blog .ph, .r2g-article .ph-cover { position: absolute; inset: 0; }
.r2g-blog .ph-dest, .r2g-article .ph-dest         { background: linear-gradient(135deg,#0FB37A,#11A0C4); }
.r2g-blog .ph-guies, .r2g-article .ph-guies       { background: linear-gradient(135deg,#11A0C4,#0A4A7A); }
.r2g-blog .ph-consells, .r2g-article .ph-consells { background: linear-gradient(135deg,#FFD23F,#E8930A); }
.r2g-blog .ph-novetats, .r2g-article .ph-novetats { background: linear-gradient(135deg,#6B4FBB,#3A2A6B); }
.r2g-blog .ph-emoji { position: absolute; right: -10px; bottom: -16px; font-size: 120px; opacity: .25; }

/* Estat buit */
.r2g-blog .empty { text-align: center; padding: 70px 24px; background: var(--rb-card); border: 1px dashed var(--rb-line); border-radius: 24px; margin: 8px 0 24px; }
.r2g-blog .empty .ic { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 18px; background: var(--rb-green-soft); display: flex; align-items: center; justify-content: center; color: var(--rb-green-d); }
.r2g-blog .empty h3 { font-size: 22px; font-weight: 800; margin: 0 0 8px; }
.r2g-blog .empty p { color: var(--rb-ink-2); margin: 0 0 22px; }
.r2g-blog .empty a { display: inline-flex; align-items: center; gap: 8px; background: var(--rb-grad); color: #fff; padding: 13px 24px; border-radius: 999px; font-weight: 800; font-size: 14px; text-decoration: none; }

.r2g-blog .blog-pagination { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; padding: 12px 0 64px; }
.r2g-blog .blog-pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--rb-line); background: #fff; color: var(--rb-ink-2); font-weight: 700; font-size: 14px; text-decoration: none; }
.r2g-blog .blog-pagination .page-numbers.current { background: var(--rb-ink); color: #fff; border-color: var(--rb-ink); }

/* =========================== ARTICLE (single) =========================== */
.r2g-article .crumbs { font-size: 13px; color: var(--rb-ink-3); padding: 24px 0 0; display: flex; gap: 8px; flex-wrap: wrap; }
.r2g-article .crumbs a { color: var(--rb-ink-3); text-decoration: none; }
.r2g-article .crumbs a:hover { color: var(--rb-ink); }
.r2g-article .crumbs .sep { color: var(--rb-ink-4); }
.r2g-article .crumbs b { color: var(--rb-ink); font-weight: 700; }

.r2g-article .art-head { padding: 22px 0 26px; }
.r2g-article .art-head h1 { font-size: clamp(32px, 4.4vw, 50px); font-weight: 800; letter-spacing: -.025em; line-height: 1.06; margin: 14px 0 18px; max-width: 18ch; font-family: 'Plus Jakarta Sans', system-ui, sans-serif; }
.r2g-article .art-meta { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--rb-ink-2); flex-wrap: wrap; }
.r2g-article .art-meta .author { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--rb-ink); }
.r2g-article .art-meta .av { width: 28px; height: 28px; border-radius: 50%; background: var(--rb-grad); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 800; }
.r2g-article .art-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--rb-ink-4); }

.r2g-article .cover { aspect-ratio: 16/9; border-radius: 22px; overflow: hidden; position: relative; margin: 0 0 8px; background: linear-gradient(135deg,#0FB37A,#11A0C4); }
.r2g-article .cover img { width: 100%; height: 100%; object-fit: cover; }
.r2g-article .cover .ph-emoji { position: absolute; right: 6%; bottom: -10px; font-size: 140px; opacity: .28; }

/* Tipografia del cos */
.r2g-article .prose { font-family: 'Source Serif 4', Georgia, serif; font-size: 18px; line-height: 1.75; color: var(--rb-ink); padding: 14px 0 0; }
.r2g-article .prose h2 { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 27px; font-weight: 800; letter-spacing: -.018em; margin: 38px 0 14px; line-height: 1.2; }
.r2g-article .prose h3 { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 20px; font-weight: 700; margin: 28px 0 10px; }
.r2g-article .prose p { margin: 0 0 18px; }
.r2g-article .prose ul, .r2g-article .prose ol { margin: 0 0 18px; padding-left: 24px; }
.r2g-article .prose li { margin-bottom: 8px; }
.r2g-article .prose strong { font-weight: 700; }
.r2g-article .prose a { color: var(--rb-green-d); text-decoration: underline; text-underline-offset: 3px; }
.r2g-article .prose img { border-radius: 16px; margin: 22px 0; }

.r2g-article .prose table { width: 100%; border-collapse: collapse; margin: 24px 0; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 14.5px; border-radius: 14px; overflow: hidden; border: 1px solid var(--rb-line); }
.r2g-article .prose th { background: var(--rb-ink); color: #fff; text-align: left; padding: 14px 16px; font-weight: 700; font-size: 12.5px; letter-spacing: .03em; }
.r2g-article .prose td { padding: 13px 16px; border-top: 1px solid var(--rb-line); }
.r2g-article .prose tr:nth-child(even) td { background: var(--rb-paper); }

.r2g-article .prose blockquote { margin: 28px 0; padding: 22px 28px; background: var(--rb-card); border-left: 4px solid var(--rb-green); border-radius: 0 16px 16px 0; font-family: 'Fraunces', serif; font-style: italic; font-weight: 500; font-size: 22px; line-height: 1.4; color: var(--rb-ink); }

/* Quadre clau accionable */
.r2g-article .r2g-key-box { background: var(--rb-green-soft); border: 1px solid #C9EBDE; border-radius: 18px; padding: 24px 26px; margin: 30px 0; font-family: 'Plus Jakarta Sans', sans-serif; }
.r2g-article .r2g-key-box .lab { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--rb-green-d); margin-bottom: 12px; }
.r2g-article .r2g-key-box .lab svg { width: 16px; height: 16px; }
.r2g-article .r2g-key-box p { font-size: 16px; line-height: 1.6; color: var(--rb-ink); margin: 0 0 8px; }
.r2g-article .r2g-key-box ul { margin: 8px 0 0; padding-left: 22px; }
.r2g-article .r2g-key-box li { font-size: 15.5px; margin-bottom: 6px; }

/* Banda CTA */
.r2g-article .cta-band { background: var(--rb-ink); border-radius: 22px; padding: 32px 34px; margin: 36px 0; color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; position: relative; overflow: hidden; }
.r2g-article .cta-band::before { content: ""; position: absolute; right: -60px; top: -40px; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(circle, rgba(15,179,122,.4), transparent 65%); }
.r2g-article .cta-band .t { position: relative; z-index: 2; }
.r2g-article .cta-band h3 { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 22px; font-weight: 800; margin: 0 0 4px; letter-spacing: -.015em; }
.r2g-article .cta-band p { font-family: 'Plus Jakarta Sans', sans-serif; margin: 0; color: rgba(255,255,255,.7); font-size: 14.5px; }
.r2g-article .cta-band a { position: relative; z-index: 2; background: var(--rb-amber); color: var(--rb-ink); padding: 14px 24px; border-radius: 999px; font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 14.5px; text-decoration: none; white-space: nowrap; }

/* FAQ */
.r2g-article .faq { padding: 12px 0 0; }
.r2g-article .faq h2 { font-size: 27px; font-weight: 800; letter-spacing: -.018em; margin: 0 0 18px; font-family: 'Plus Jakarta Sans', sans-serif; }
.r2g-article .faq-item { background: var(--rb-card); border: 1px solid var(--rb-line); border-radius: 14px; margin-bottom: 10px; overflow: hidden; }
.r2g-article .faq-q { padding: 18px 22px; font-weight: 700; font-size: 16px; cursor: pointer; display: flex; justify-content: space-between; gap: 16px; align-items: center; list-style: none; font-family: 'Plus Jakarta Sans', sans-serif; }
.r2g-article .faq-q::-webkit-details-marker { display: none; }
.r2g-article .faq-q .plus { width: 26px; height: 26px; border-radius: 50%; background: var(--rb-green-soft); color: var(--rb-green-d); display: flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0; transition: transform .2s; }
.r2g-article details[open] .faq-q .plus { transform: rotate(45deg); }
.r2g-article .faq-a { padding: 0 22px 20px; color: var(--rb-ink-2); font-size: 15px; line-height: 1.65; }

/* Articles relacionats */
.r2g-article .related { padding: 20px 0 64px; }
.r2g-article .related h2 { font-size: 24px; font-weight: 800; letter-spacing: -.018em; margin: 0 0 18px; font-family: 'Plus Jakarta Sans', sans-serif; }
.r2g-article .related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.r2g-article .rel { background: var(--rb-card); border: 1px solid var(--rb-line); border-radius: 16px; overflow: hidden; text-decoration: none; color: inherit; transition: transform .2s; }
.r2g-article .rel:hover { transform: translateY(-3px); }
.r2g-article .rel .img { aspect-ratio: 16/9; position: relative; overflow: hidden; }
.r2g-article .rel .img img { width: 100%; height: 100%; object-fit: cover; }
.r2g-article .rel .b { padding: 14px 16px; }
.r2g-article .rel h3 { font-size: 15px; font-weight: 700; margin: 0 0 6px; line-height: 1.3; font-family: 'Plus Jakarta Sans', sans-serif; }
.r2g-article .rel .m { font-size: 12px; color: var(--rb-ink-3); font-weight: 600; }

/* =========================== RESPONSIVE =========================== */
@media (max-width: 860px) {
  .r2g-blog .grid { grid-template-columns: 1fr 1fr; }
  .r2g-blog .featured { grid-template-columns: 1fr; }
  .r2g-blog .featured .img { aspect-ratio: 16/9; min-height: 0; }
}
@media (max-width: 720px) {
  .r2g-article .related-grid { grid-template-columns: 1fr; }
  .r2g-article .cta-band { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) {
  .r2g-blog .grid { grid-template-columns: 1fr; }
}
