
/* === Fundacja Razem Tworzymy — design tokens === */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,700;1,9..144,400;1,9..144,600&display=swap');

:root{
  --background:#fbf7ee;
  --foreground:#1f2a4a;
  --card:#ffffff;
  --muted:#f1ebde;
  --muted-foreground:#6b7390;
  --border:#e6dfcd;
  --primary:#2f5fb0;
  --primary-foreground:#ffffff;
  --accent:#f3b6c7;
  --accent-foreground:#5a2a3a;
  --leaf:#5a8a4f;
  --heart:#e26b8a;
  --foreground-90:rgba(31,42,74,.9);
  --foreground-80:rgba(31,42,74,.8);
  --foreground-70:rgba(31,42,74,.7);
  --foreground-60:rgba(31,42,74,.6);
  --foreground-15:rgba(31,42,74,.15);
  --background-90:rgba(251,247,238,.9);
  --background-70:rgba(251,247,238,.7);
}

/* Full-page background for WP theme */
body{ background:var(--background); }

/* Wrapper — wszystkie style działają tylko w obrębie .rt */
.rt, .rt *{ box-sizing:border-box; }
.rt{
  font-family:ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
  color:var(--foreground);
  background:var(--background);
  line-height:1.55;
}
.rt h1,.rt h2,.rt h3,.rt .font-display{
  font-family:"Fraunces",Georgia,serif;
  font-weight:600;
  letter-spacing:-0.02em;
  line-height:1.05;
  margin:0;
}
.rt p{ margin:0; }
.rt img{ max-width:100%; height:auto; display:block; }
.rt a{ text-decoration:none; color:inherit; }
.rt button{ font:inherit; cursor:pointer; border:0; background:none; color:inherit; }
/* Przyciski — wyższa specyficzność (0,2,0) niż .rt a (0,1,1), działa lokalnie i w WP */
.rt .rt-btn-primary{ background:var(--foreground); color:var(--background); }
.rt .rt-btn-outline{ border:2px solid var(--foreground); color:var(--foreground); }
.rt .rt-btn-outline:hover{ background:var(--foreground); color:var(--background); }
.rt .rt-btn-fb{ background:#1877F2; color:#fff; }
.rt .rt-btn-leaf{ background:var(--leaf); color:#fff; }
.rt .rt-btn-card{ background:var(--card); border:1px solid var(--border); color:var(--foreground); }
.rt .rt-btn-card:hover{ background:var(--muted); }

/* Layout helpers */
.rt-wrap{ max-width:1200px; margin:0 auto; padding:0 1.5rem; }
.rt-section{ padding:4rem 0; border-bottom:1px solid var(--foreground-15); }
.rt-section.dark{ background:var(--foreground); color:var(--background); }
.rt-section.cream{ background:var(--muted); }
.rt-grid{ display:grid; gap:2rem; }
.rt-grid.cols-2{ grid-template-columns:1fr; }
.rt-grid.cols-3{ grid-template-columns:1fr; }
.rt-grid.cols-4{ grid-template-columns:1fr 1fr; }
/* Mobile: przyciski w rzędzie idą jeden pod drugim */
@media(max-width:767px){
  .rt .rt-flex.rt-flex-wrap .rt-btn{ width:100%; justify-content:center; }
  .rt-grid{ grid-template-columns:1fr !important; }
}
@media(min-width:768px){
  .rt-section{ padding:6rem 0; }
  .rt-grid.cols-2{ grid-template-columns:1fr 1fr; }
  .rt-grid.cols-3{ grid-template-columns:repeat(3,1fr); }
  .rt-grid.cols-4{ grid-template-columns:repeat(4,1fr); }
}

/* Typografia */
.rt-eyebrow{
  display:inline-flex; align-items:center; gap:.75rem;
  font-size:.7rem; text-transform:uppercase; letter-spacing:.25em;
  color:var(--leaf); font-weight:500;
}
.rt-eyebrow::before{ content:""; width:2.25rem; height:1px; background:var(--leaf); }
.rt-h1{ font-size:clamp(2.6rem,7.2vw,5.5rem); font-weight:600; line-height:1.02; }
.rt-h2{ font-size:clamp(1.8rem,4.2vw,3rem); font-weight:600; }
.rt-h3{ font-size:1.4rem; font-weight:600; }
.rt-italic{
  font-style:italic; color:var(--primary); font-weight:400;
  position:relative; display:inline-block;
}
.rt-italic::after{
  content:"";
  position:absolute; left:0; bottom:-0.3em;
  width:100%; height:0.25em;
  background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 300 12' preserveAspectRatio='none' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 10C50 3 180 -1 298 10' stroke='%23f3b6c7' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-size:100% 100%;
  background-repeat:no-repeat;
  pointer-events:none;
}
.rt-lead{ font-size:1.1rem; color:var(--foreground-70); max-width:34rem; }
.rt-muted{ color:var(--muted-foreground); font-size:.9rem; }

/* Buttons */
.rt-btn{
  display:inline-flex; align-items:center; gap:.75rem;
  padding:1rem 2rem;
  font-size:.7rem; font-weight:600; letter-spacing:.2em; text-transform:uppercase;
  transition:all .25s ease;
}
.rt-btn-primary{
  background:var(--foreground); color:var(--background);
  box-shadow:8px 8px 0 0 rgba(90,138,79,.45);
}
.rt-btn-primary:hover{
  transform:translate(2px,2px);
  box-shadow:4px 4px 0 0 rgba(90,138,79,.45);
}
.rt-btn-outline{
  border:2px solid var(--foreground); color:var(--foreground);
}
.rt-btn-outline:hover{ background:var(--foreground); color:var(--background); }
.rt-btn-fb{ background:#1877F2; color:#fff; box-shadow:6px 6px 0 0 rgba(90,138,79,.45); }
.rt-btn-leaf{ background:var(--leaf); color:#fff; }
.rt-btn-card{ background:var(--card); border:1px solid var(--border); color:var(--foreground); }
.rt-btn-card:hover{ background:var(--muted); }

/* Karty */
.rt-card{ background:var(--card); border:1px solid var(--border); padding:1.75rem; transition:all .3s ease; }
.rt-card:hover{ transform:translateY(-3px); box-shadow:0 12px 32px -10px rgba(0,0,0,.12); }
.rt-tag{
  display:inline-flex; align-items:center; gap:.4rem;
  padding:.3rem .7rem; font-size:.7rem; font-weight:500;
  background:var(--muted); color:var(--muted-foreground);
}
.rt-num{ font-family:"Fraunces",serif; font-size:2.2rem; color:var(--primary); }

/* Hero */
.rt-hero{ position:relative; overflow:hidden; padding:4rem 0 3rem; }
.rt-hero-grid{ display:grid; gap:3rem; align-items:center; }
@media(min-width:768px){ .rt-hero-deco-svg{ display:block !important; } }
@media(min-width:992px){
  .rt-hero{ padding:6rem 0 5rem; }
  .rt-hero-grid{ grid-template-columns:7fr 5fr; gap:5rem; }
}
.rt-hero-frame{
  position:relative; z-index:10;
  border:14px solid var(--card);
  box-shadow:0 25px 50px -12px rgba(0,0,0,.25);
  background:var(--muted); overflow:visible;
}
.rt-hero-img{ position:relative; aspect-ratio:4/5; overflow:hidden; background:var(--muted); }
.rt-hero-frame img{ width:100%; height:100%; object-fit:cover; animation:rt-kenburns 14s ease-in-out infinite alternate; }
.rt-hero-badge{
  position:absolute; top:-1rem; right:-1rem; z-index:3;
  background:var(--accent); color:var(--accent-foreground);
  padding:.6rem 1.4rem; font-family:"Fraunces",serif;
  font-size:.85rem; font-weight:600; letter-spacing:.2em; text-transform:uppercase;
  box-shadow:0 10px 25px -10px rgba(0,0,0,.3);
}
.rt-hero-caption{
  position:absolute; bottom:-2rem; left:-2rem; z-index:3;
  background:var(--foreground); color:var(--background);
  padding:1.25rem 1.5rem; max-width:18rem;
}
@media(max-width:991px){ .rt-hero-caption{ position:static; margin-top:1.25rem; } }

/* Marquee */
.rt-marquee{ overflow:hidden; background:rgba(241,235,222,.6); border-top:1px solid var(--foreground-15); padding:1rem 0; }
.rt-marquee-track{
  display:flex; gap:3rem; width:max-content;
  font-family:"Fraunces",serif; font-size:1.4rem; color:var(--foreground-70);
  animation:rt-marquee 40s linear infinite;
  white-space:nowrap; align-items:center;
}
.rt-marquee-track .star{ color:var(--primary); }

/* Quote */
.rt-quote{ font-family:"Fraunces",serif; font-size:clamp(1.6rem,3.4vw,2.6rem); line-height:1.2; }

/* Stats */
.rt-stats{ display:grid; grid-template-columns:repeat(3,1fr); border-top:1px solid var(--foreground-15); border-bottom:1px solid var(--foreground-15); }
.rt-stat{ padding:1.5rem .75rem; text-align:center; border-right:1px solid var(--foreground-15); }
.rt-stat:last-child{ border-right:0; }
.rt-stat-v{ font-family:"Fraunces",serif; font-size:2rem; color:var(--primary); }
.rt-stat-l{ margin-top:.25rem; font-size:.65rem; text-transform:uppercase; letter-spacing:.18em; color:var(--muted-foreground); }

/* Animacje */
@keyframes rt-kenburns{ 0%{transform:scale(1)} 100%{transform:scale(1.08) translate(-1%,-1%)} }
@keyframes rt-marquee{ 0%{transform:translateX(0)} 100%{transform:translateX(-50%)} }
@keyframes rt-fadeup{ from{opacity:0; transform:translateY(20px)} to{opacity:1; transform:translateY(0)} }
.rt [data-reveal]{ opacity:0; transform:translateY(20px); transition:opacity .9s ease, transform .9s ease; }
.rt [data-reveal].is-visible{ opacity:1; transform:translateY(0); }

/* Forms */
.rt-input, .rt-textarea{
  width:100%; padding:.75rem 1rem; font:inherit;
  background:var(--card); border:1px solid var(--border); outline:0;
  transition:border-color .2s;
}
.rt-input:focus, .rt-textarea:focus{ border-color:var(--primary); box-shadow:0 0 0 3px rgba(47,95,176,.15); }
.rt-label{ display:block; font-size:.85rem; font-weight:500; margin-bottom:.4rem; }

/* Listing cards */
.rt-listing{ display:flex; flex-direction:column; background:var(--card); border:1px solid var(--border); transition:all .3s; }
.rt-listing:hover{ transform:translateY(-3px); box-shadow:0 16px 40px -12px rgba(0,0,0,.15); }
.rt-listing-img{ position:relative; aspect-ratio:4/3; overflow:hidden; background:var(--muted); }
.rt-listing-img img{ width:100%; height:100%; object-fit:cover; transition:transform .7s; }
.rt-listing:hover .rt-listing-img img{ transform:scale(1.05); }
.rt-listing-src{ position:absolute; left:.75rem; top:.75rem; background:rgba(31,42,74,.9); color:#fff; padding:.3rem .6rem; font-size:.65rem; text-transform:uppercase; letter-spacing:.1em; }
.rt-listing-body{ padding:1.25rem; display:flex; flex-direction:column; flex:1; }
.rt-pill{ display:inline-block; padding:.2rem .6rem; font-size:.7rem; font-weight:500; }
.rt-pill-leaf{ background:rgba(90,138,79,.15); color:var(--leaf); }
.rt-pill-primary{ background:rgba(47,95,176,.15); color:var(--primary); }
.rt-pill-accent{ background:rgba(243,182,199,.4); color:var(--accent-foreground); }

/* Helpers */
.rt-flex{ display:flex; }
.rt-flex-wrap{ flex-wrap:wrap; }
.rt-gap-2{ gap:.5rem; } .rt-gap-3{ gap:.75rem; } .rt-gap-4{ gap:1rem; } .rt-gap-6{ gap:1.5rem; }
.rt-mt-2{ margin-top:.5rem; } .rt-mt-4{ margin-top:1rem; } .rt-mt-6{ margin-top:1.5rem; } .rt-mt-8{ margin-top:2rem; } .rt-mt-10{ margin-top:2.5rem; }
.rt-mb-4{ margin-bottom:1rem; }
.rt-text-center{ text-align:center; }
.rt-divider{ height:1px; background:var(--foreground-15); border:0; }

/* === Kadence WP compatibility === */
.entry-content .rt p,
.wp-block-html .rt p{ margin-top:0; margin-bottom:0; }

.entry-content .rt h1,.entry-content .rt h2,.entry-content .rt h3,
.wp-block-html .rt h1,.wp-block-html .rt h2,.wp-block-html .rt h3{
  font-family:"Fraunces",Georgia,serif;
  letter-spacing:-0.02em; line-height:1.05;
  margin-top:0; margin-bottom:0;
}
.entry-content .rt h1,.wp-block-html .rt h1{ font-weight:700; }
.entry-content .rt h2,.wp-block-html .rt h2{ font-weight:600; }
.entry-content .rt h3,.wp-block-html .rt h3{ font-weight:600; }
.wp-block-html{ margin-bottom:0 !important; }
.entry-content .rt a,.wp-block-html .rt a{ color:inherit; text-decoration:none; }
/* Button text colours — must beat the color:inherit rule above (specificity 0,2,1 → 0,3,1) */
.wp-block-html .rt a.rt-btn-primary,
.entry-content .rt a.rt-btn-primary{ color:var(--background); }
.wp-block-html .rt a.rt-btn-outline,
.entry-content .rt a.rt-btn-outline{ color:var(--foreground); }
.wp-block-html .rt a.rt-btn-outline:hover,
.entry-content .rt a.rt-btn-outline:hover{ background:var(--foreground); color:var(--background); }
.wp-block-html .rt a.rt-btn-fb,.wp-block-html .rt a.rt-btn-leaf,
.entry-content .rt a.rt-btn-fb,.entry-content .rt a.rt-btn-leaf{ color:#fff; }
.wp-block-html .rt a.rt-btn-card,
.entry-content .rt a.rt-btn-card{ color:var(--foreground); }
.entry-content .rt img,.wp-block-html .rt img{ display:block; max-width:100%; height:auto; }
.entry-content .rt ul,.wp-block-html .rt ul{ list-style:none; padding-left:0; margin:0; }
/* pre elements — Kadence may apply white background to pre */
.rt .rt-template{ background:var(--card); color:var(--foreground); }
/* Listing save button — ensure SVG icon renders inside button */
.rt-listing-img button svg{ display:block; }

/* === Dark mode === */
html.dark{
  --background:#1b1f2e;
  --foreground:#f0ece0;
  --card:#242840;
  --muted:#2a2f4a;
  --muted-foreground:#9aa0bc;
  --border:#333857;
  --primary:#6b9fe8;
  --primary-foreground:#0a0f1e;
  --accent:#8b3a52;
  --accent-foreground:#f3b6c7;
  --leaf:#7ab86b;
  --heart:#e26b8a;
  --foreground-90:rgba(240,236,224,.9);
  --foreground-80:rgba(240,236,224,.8);
  --foreground-70:rgba(240,236,224,.7);
  --foreground-60:rgba(240,236,224,.6);
  --foreground-15:rgba(240,236,224,.12);
  --background-90:rgba(27,31,46,.9);
  --background-70:rgba(27,31,46,.7);
}
html.dark body{ background:var(--background); }
html.dark .rt{ background:var(--background); color:var(--foreground); }
html.dark .rt-section.cream{ background:var(--muted); }
html.dark .rt-marquee{ background:rgba(36,40,64,.6); }
/* Dark mode heading colors — beats Kadence theme heading color rules */
html.dark .rt h1,
html.dark .rt h2,
html.dark .rt h3{ color:var(--foreground); }
html.dark .wp-block-html .rt h1,html.dark .wp-block-html .rt h2,html.dark .wp-block-html .rt h3,
html.dark .entry-content .rt h1,html.dark .entry-content .rt h2,html.dark .entry-content .rt h3{ color:var(--foreground); }
/* Dark mode pre/template fix */
html.dark .rt .rt-template{ background:var(--card); color:var(--foreground); }
/* Dark mode listing save button — override hardcoded cream background */
html.dark .rt-listing-img button{ background:rgba(27,31,46,.85) !important; color:var(--foreground); }
/* Dark mode button overrides — specificity 0,3,0 definitively beats html.dark .rt (0,2,1) */
html.dark .rt .rt-btn-primary{ background:var(--foreground); color:var(--background); }
html.dark .rt .rt-btn-outline{ border-color:var(--foreground); color:var(--foreground); }
html.dark .rt .rt-btn-outline:hover{ background:var(--foreground); color:var(--background); }
html.dark .rt .rt-btn-fb{ background:#1877F2; color:#fff; }
html.dark .rt .rt-btn-leaf{ background:var(--leaf); color:#fff; }
html.dark .rt .rt-btn-card{ background:var(--card); color:var(--foreground); }
html.dark .rt .rt-btn-card:hover{ background:var(--muted); }
/* WP block + dark mode — specificity 0,4,1 — highest priority */
html.dark .wp-block-html .rt a.rt-btn-primary,
html.dark .entry-content .rt a.rt-btn-primary{ color:var(--background); }
html.dark .wp-block-html .rt a.rt-btn-outline,
html.dark .entry-content .rt a.rt-btn-outline{ color:var(--foreground); }
html.dark .wp-block-html .rt a.rt-btn-outline:hover,
html.dark .entry-content .rt a.rt-btn-outline:hover{ background:var(--foreground); color:var(--background); }
html.dark .wp-block-html .rt a.rt-btn-fb,html.dark .wp-block-html .rt a.rt-btn-leaf,
html.dark .entry-content .rt a.rt-btn-fb,html.dark .entry-content .rt a.rt-btn-leaf{ color:#fff; }
html.dark .wp-block-html .rt a.rt-btn-card,
html.dark .entry-content .rt a.rt-btn-card{ color:var(--foreground); }

/* === Header === */
.rt-header{
  position:sticky; top:0; z-index:40;
  border-bottom:1px solid var(--border);
  background:var(--background-90);
  backdrop-filter:blur(12px);
}
.rt-header-inner{
  max-width:1200px; margin:0 auto;
  display:flex; align-items:center; justify-content:space-between; gap:1rem;
  padding:.75rem 1.5rem;
}
.rt-header-logo{ display:flex; align-items:center; gap:.75rem; text-decoration:none; color:inherit; }
.rt-header-logo img{ width:3rem; height:3rem; display:block; }
.rt-nav-desktop{ display:none; align-items:center; gap:.25rem; }
@media(min-width:992px){ .rt-nav-desktop{ display:flex; } }
.rt-nav-link{
  padding:.5rem 1rem; font-size:.85rem; font-weight:500;
  color:var(--foreground-80); text-decoration:none; transition:background .2s;
}
.rt-nav-link:hover,.rt-nav-link.rt-active{ background:var(--muted); color:var(--foreground); }
.rt-header-actions{ display:flex; align-items:center; gap:.5rem; }
.rt-theme-btn,.rt-hamburger{
  display:inline-flex; align-items:center; justify-content:center;
  width:3rem; height:3rem;
  border:1px solid var(--border); background:var(--card); color:var(--foreground);
  cursor:pointer; transition:background .2s;
}
.rt-theme-btn:hover,.rt-hamburger:hover{ background:var(--muted); }
@media(min-width:992px){ .rt-hamburger{ display:none; } }
.rt-nav-mobile{ display:none; flex-direction:column; border-top:1px solid var(--border); background:var(--background); }
.rt-nav-mobile.rt-open{ display:flex; }
.rt-nav-mobile .rt-nav-link{ border-bottom:1px solid var(--border); padding:.75rem 1.5rem; font-size:1rem; }

/* Theme toggle icons — controlled by html.dark, no JS needed */
.rt-icon-sun{ display:none; }
html.dark .rt-icon-sun{ display:inline; }
html.dark .rt-icon-moon{ display:none; }

/* Hamburger icons — controlled by aria-expanded attribute */
.rt-icon-x{ display:none; }
.rt-hamburger[aria-expanded="true"] .rt-icon-x{ display:inline; }
.rt-hamburger[aria-expanded="true"] .rt-icon-menu{ display:none; }

/* === Footer === */
.rt-footer{ border-top:1px solid var(--border); background:rgba(241,235,222,.4); }
html.dark .rt-footer{ background:rgba(36,40,64,.4); }
.rt-footer-inner{
  max-width:1200px; margin:0 auto;
  display:grid; gap:2.5rem; grid-template-columns:1fr;
  padding:3rem 1.5rem;
}
@media(min-width:768px){ .rt-footer-inner{ grid-template-columns:2fr 1fr 1fr; } }
.rt-footer-link{ color:var(--muted-foreground); font-size:.9rem; text-decoration:none; }
.rt-footer-link:hover{ color:var(--foreground); }
.rt-footer-copy{ border-top:1px solid var(--border); padding:1.25rem 1.5rem; text-align:center; font-size:.75rem; color:var(--muted-foreground); }

/* === Responsive aside grid (2fr 1fr na desktop, 1fr na mobile) === */
@media(min-width:768px){ .rt-grid.cols-2.rt-grid-aside{ grid-template-columns:2fr 1fr; } }

/* === Icon boxes === */
.rt-icon-box{
  display:inline-flex; align-items:center; justify-content:center;
  width:3rem; height:3rem; background:var(--muted); color:var(--foreground);
  flex-shrink:0;
}

/* === Post template (portal) === */
.rt-template{
  white-space:pre-wrap; font-family:inherit; font-size:.9rem;
  line-height:1.6; color:var(--foreground); margin:0;
}

/* === Treść wpisu (single.php) === */
.rt-post-content h2{ font-family:"Fraunces",serif; font-size:1.6rem; font-weight:600; margin:2rem 0 .75rem; color:var(--foreground); }
.rt-post-content h3{ font-family:"Fraunces",serif; font-size:1.25rem; font-weight:600; margin:1.75rem 0 .5rem; color:var(--foreground); }
.rt-post-content p{ margin:0 0 1.25rem; }
.rt-post-content ul,.rt-post-content ol{ padding-left:1.5rem; margin:0 0 1.25rem; display:flex; flex-direction:column; gap:.4rem; }
.rt-post-content ul{ list-style:disc; }
.rt-post-content ol{ list-style:decimal; }
.rt-post-content a{ color:var(--primary); text-decoration:underline; }
.rt-post-content blockquote{ border-left:3px solid var(--primary); margin:1.5rem 0; padding:.75rem 1.25rem; background:var(--muted); color:var(--foreground-80); font-style:italic; }
.rt-post-content img{ max-width:100%; height:auto; display:block; margin:1.5rem 0; }
.rt-post-content strong{ font-weight:600; color:var(--foreground); }
