/* ============================================================
   Francodesa Theme — CSS custom properties + base styles
   ============================================================ */

:root {
    --fd-green:       #2E7D32;
    --fd-green-dark:  #1B5E20;
    --fd-green-light: #66BB6A;
    --fd-ink:         #1a1a1a;
    --fd-white:       #ffffff;
    --fd-soft-green:  #eaf5ea;
    --fd-soft-cream:  #f7f7f2;
    --fd-muted:       #5c6b60;
    --fd-border:      rgba(27, 94, 32, 0.14);
    --fd-shadow:      0 24px 60px rgba(20, 20, 20, 0.10);
    --fd-radius-xl:   32px;
    --fd-radius-lg:   24px;
    --fd-radius-md:   18px;
}

html { scroll-behavior: smooth; }

body.public-site {
    margin: 0;
    font-family: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: var(--fd-ink);
    background: #ffffff;
}

body.public-site h1,
body.public-site h2,
body.public-site h3,
body.public-site h4,
body.public-site h5,
body.public-site h6 {
    font-family: "Inter", "Segoe UI", sans-serif;
    color: var(--fd-green-dark);
    font-weight: 700;
}

img { max-width: 100%; display: block; }

/* ── Navbar ──────────────────────────────────────────── */
.site-header,
.navbar {
    background: #ffffff;
    border-bottom: 1px solid rgba(20,20,20,0.06);
}

.nav-link {
    color: rgba(20, 20, 20, 0.85) !important;
    font-weight: 600;
    padding: 0.6rem 0.85rem !important;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--fd-green-dark) !important;
}

.dropdown-menu {
    border: 1px solid var(--fd-border);
    border-radius: var(--fd-radius-md);
    box-shadow: var(--fd-shadow);
    padding: 0.4rem 0;
    min-width: 200px;
}

.dropdown-item {
    font-weight: 600;
    color: rgba(20, 20, 20, 0.85);
    padding: 0.55rem 1rem;
    font-size: 0.92rem;
    border-radius: 6px;
    margin: 0 0.25rem;
}

.dropdown-item:hover, .dropdown-item:focus {
    background: var(--fd-soft-green);
    color: var(--fd-green-dark);
}

/* ── Buttons ─────────────────────────────────────────── */
.btn { border-radius: 30px; font-weight: 700; }

.btn-primary {
    background-color: var(--fd-green);
    border-color: var(--fd-green);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--fd-green-dark);
    border-color: var(--fd-green-dark);
}

.btn-outline-primary {
    color: var(--fd-green);
    border-color: rgba(27, 94, 32, 0.32);
}

.btn-outline-primary:hover, .btn-outline-primary:focus {
    background-color: var(--fd-green);
    border-color: var(--fd-green);
}

.badge.bg-primary { background-color: var(--fd-green) !important; }
.text-primary     { color: var(--fd-green) !important; }

/* ── Form controls ───────────────────────────────────── */
.form-control, .form-control:focus {
    border-radius: 18px;
    border-color: rgba(27, 94, 32, 0.12);
    box-shadow: none;
}

.form-control:focus { border-color: var(--fd-green-dark); }

/* ── Hero / page hero ────────────────────────────────── */
.hero-section, .page-hero {
    position: relative;
    padding: 4.5rem 0 3rem;
    background: linear-gradient(135deg, var(--fd-green-dark), var(--fd-green) 65%, var(--fd-green-light));
    color: #fff;
}

.page-hero--centered {
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* ── Section utilities ───────────────────────────────── */
.section-space { padding: 5.5rem 0; }
.bg-soft-blue  { background: var(--fd-soft-green); }
.bg-soft-gold  { background: var(--fd-soft-cream); }

.section-heading {
    font-size: clamp(2rem, 2.5vw, 2.8rem);
    font-weight: 800;
    color: var(--fd-green-dark);
    line-height: 1.15;
}

.section-lead {
    color: var(--fd-muted);
    font-size: 1.05rem;
    line-height: 1.9;
}

/* ── Cards / content panels ──────────────────────────── */
.content-card, .info-panel, .value-card {
    border-radius: var(--fd-radius-xl);
    overflow: hidden;
    box-shadow: var(--fd-shadow);
}

.content-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--fd-white);
    border: 1px solid var(--fd-border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.content-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 28px 64px rgba(27, 94, 32, 0.16);
}

/* ── CTA section (also used for the "en construcción" notice) ────── */
.cta-section {
    background: linear-gradient(135deg, #0d0d0d, #171717 55%, #12210f);
}

/* ── Footer ──────────────────────────────────────────── */
.site-footer { background: var(--fd-green-dark); }

.footer-title  { font-size: 1.05rem; margin-bottom: 1rem; color: var(--fd-white); }
.footer-muted,
.footer-links a,
.footer-contact a,
.footer-bottom { color: rgba(255, 255, 255, 0.9); }

/* ── Gallery ─────────────────────────────────────────── */
.gallery-tile {
    border-radius: var(--fd-radius-lg);
    overflow: hidden;
    box-shadow: var(--fd-shadow);
}

/* ── Back to top ─────────────────────────────────────── */
.back-to-top {
    position: fixed;
    display: none;
    right: 30px;
    bottom: 30px;
    z-index: 1100;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    background: var(--fd-green-dark);
    color: #fff;
    box-shadow: 0 8px 20px rgba(27,94,32,0.18);
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 767.98px) {
    .section-space { padding: 4.25rem 0; }
}

/* ============================================================
   Blog Shared — hero parallax, article cards, sidebar
   ============================================================ */

.blog-hero-parallax,
.article-hero-parallax {
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.blog-hero-bg-parallax,
.article-hero-bg-parallax {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    transform: scale(1.04);
    transition: transform 0.4s ease;
}

.blog-hero-overlay,
.article-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(27, 94, 32, 0.72) 0%,
        rgba(20, 20, 20, 0.88) 100%);
}

.blog-hero-content,
.article-hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 4rem 1rem;
    color: #fff;
}

.blog-hero-title,
.article-hero-title {
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 700;
    color: var(--fd-white);
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 16px rgba(0,0,0,0.3);
}

.blog-hero-description,
.article-hero-description {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.88);
    max-width: 640px;
    margin: 0 auto 1.5rem;
}

.article-hero-meta {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.article-hero-meta-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: rgba(255,255,255,0.85);
    font-size: 0.92rem;
}

/* ── Article card (blog index grid) ──────────────────────── */
.blog-article-card {
    border-radius: var(--fd-radius-lg);
    overflow: hidden;
    background: var(--fd-white);
    box-shadow: var(--fd-shadow);
    border: 1px solid var(--fd-border);
    height: 100%;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.blog-article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 32px 72px rgba(27, 94, 32, 0.18);
}

.blog-article-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.blog-article-card-image {
    flex: 0 0 220px;
    min-height: 220px;
    background-size: cover;
    background-position: center;
    background-color: var(--fd-soft-green);
}

.blog-article-card-content {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.blog-article-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--fd-green-dark);
    margin: 0;
    line-height: 1.3;
}

.blog-article-description {
    font-size: 0.93rem;
    color: var(--fd-muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.blog-article-meta {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--fd-border);
}

.blog-article-date {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--fd-muted);
    font-size: 0.85rem;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-section {
    background: var(--fd-white);
    border: 1px solid var(--fd-border);
    border-radius: var(--fd-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--fd-shadow);
}

.sidebar-section-title {
    font-size: 1.1rem;
    color: var(--fd-green-dark);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.blog-info-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 0.85rem;
}

.blog-info-icon  { color: var(--fd-green); margin-top: 0.15rem; flex-shrink: 0; }
.blog-info-content { flex: 1; }

.blog-info-label {
    font-size: 0.78rem;
    color: var(--fd-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.blog-info-value { font-size: 0.95rem; color: var(--fd-ink); }

/* ── Latest articles sidebar list ────────────────────────── */
.latest-articles-grid { display: flex; flex-direction: column; gap: 1rem; }

.latest-article-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s;
}

.latest-article-item:hover { opacity: 0.8; }

.latest-article-thumbnail {
    flex: 0 0 64px;
    height: 64px;
    border-radius: 0.5rem;
    background-size: cover;
    background-position: center;
    background-color: var(--fd-soft-green);
}

.latest-article-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--fd-green-dark);
    margin: 0 0 0.25rem;
    line-height: 1.3;
}

.latest-article-date {
    font-size: 0.78rem;
    color: var(--fd-muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* ============================================================
   Blog Index Page — articles section, search
   ============================================================ */

.blog-articles-section {
    background: var(--fd-soft-green);
    min-height: 40vh;
}

.articles-count { font-size: 0.95rem; }

@media (max-width: 767.98px) {
    .blog-hero-parallax  { min-height: 300px; }
    .blog-hero-bg-parallax { background-attachment: scroll; }
}

/* ============================================================
   Blog Article Page — article content, typography
   ============================================================ */

.article-content-section { background: var(--fd-white); }

.article-main-content {
    background: var(--fd-white);
    border-radius: var(--fd-radius-xl);
    border: 1px solid var(--fd-border);
    box-shadow: var(--fd-shadow);
    padding: 2.5rem;
}

.article-content {
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--fd-ink);
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
    color: var(--fd-green-dark);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.article-content p { margin-bottom: 1.25rem; }

.article-content img {
    border-radius: 0.75rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    margin: 1.5rem auto;
    max-width: 100%;
    display: block;
}

.article-content a {
    color: var(--fd-green);
    text-decoration: underline;
}

.article-content blockquote {
    border-left: 4px solid var(--fd-green);
    margin: 1.5rem 0;
    padding: 0.75rem 1.25rem;
    background: var(--fd-soft-green);
    border-radius: 0 0.5rem 0.5rem 0;
    color: var(--fd-muted);
    font-style: italic;
}

.article-content pre,
.article-content code {
    background: var(--fd-soft-green);
    border-radius: 8px;
    font-size: 0.9rem;
}

/* ── x402 paywall gate ───────────────────────────────────── */
.article-paywall {
    text-align: center;
    padding: 3rem 1.5rem;
    background: var(--fd-soft-green);
    border: 1px solid var(--fd-border);
    border-radius: var(--fd-radius-lg);
    margin-top: 1.5rem;
}

@media (max-width: 767.98px) {
    .article-hero-parallax    { min-height: 280px; }
    .article-hero-bg-parallax { background-attachment: scroll; }
    .article-main-content     { padding: 1.5rem; }
}

/* ============================================================
   CMS block contract — Layer 0/1 hooks.
   Sections emit stable data-* tokens (data-bg / data-layout /
   data-grid / data-cta); a theme may override any selector below.
   ============================================================ */

.cms-section { position: relative; }

/* Grid: masonry (CSS multi-column) */
.cms-masonry { column-gap: 1.5rem; column-count: 1; }
@media (min-width: 576px) { .cms-masonry { column-count: 2; } }
@media (min-width: 992px) { .cms-masonry { column-count: 3; } }
.cms-masonry__item { break-inside: avoid; margin-bottom: 1.5rem; }

/* Grid: carousel (horizontal scroll-snap) */
.cms-carousel-track {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.75rem;
}
.cms-carousel-track__item {
    flex: 0 0 auto;
    width: min(320px, 80%);
    scroll-snap-align: start;
}

/* Dark-surface card variant used when a section background is dark */
.cms-card--dark {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
}
.cms-card--dark .card-title,
.cms-card--dark h5 { color: #fff; }

/* ── Global light/dark opt-in (visitor toggle sets data-bs-theme) ── */
html[data-bs-theme="dark"] body.public-site { background: #0d120d; color: #e7efe7; }
html[data-bs-theme="dark"] body.public-site h1,
html[data-bs-theme="dark"] body.public-site h2,
html[data-bs-theme="dark"] body.public-site h3,
html[data-bs-theme="dark"] body.public-site h4,
html[data-bs-theme="dark"] body.public-site h5,
html[data-bs-theme="dark"] body.public-site h6,
html[data-bs-theme="dark"] .section-heading,
html[data-bs-theme="dark"] .card-title { color: #eaf5ea; }
html[data-bs-theme="dark"] .site-header,
html[data-bs-theme="dark"] .navbar { background: #0d120d; border-bottom-color: rgba(255,255,255,0.08); }
/* Header text/links must stay legible on the dark header (override the light nav-link color). */
html[data-bs-theme="dark"] .navbar .nav-link,
html[data-bs-theme="dark"] .navbar .navbar-brand,
html[data-bs-theme="dark"] .navbar .btn-link { color: #e7efe7 !important; }
html[data-bs-theme="dark"] .navbar .nav-link:hover,
html[data-bs-theme="dark"] .navbar .nav-link.active { color: #ffffff !important; }
html[data-bs-theme="dark"] .dropdown-menu { background: #141b14; border-color: rgba(255,255,255,0.1); }
html[data-bs-theme="dark"] .dropdown-item { color: #e7efe7; }
html[data-bs-theme="dark"] .dropdown-item:hover,
html[data-bs-theme="dark"] .dropdown-item:focus { background: #1a241a; color: #ffffff; }
html[data-bs-theme="dark"] .cms-section.bg-white,
html[data-bs-theme="dark"] .cms-section.bg-light { background: #0d120d !important; }
html[data-bs-theme="dark"] .cms-section.bg-soft-blue { background: #16231a !important; }
/* Inner fixed-white surfaces (e.g. value cards) must darken so muted text/headings stay legible. */
html[data-bs-theme="dark"] .cms-section .bg-white { background-color: #141b14 !important; color: #e7efe7; }
html[data-bs-theme="dark"] .content-card,
html[data-bs-theme="dark"] .card { background: #141b14; color: #e7efe7; border-color: rgba(255,255,255,0.08); }