/* Styles for the real, server-rendered Page Builder marketing components (Site Header, Hero,
   Media-Text Split, Feature Grid, Plan Card Grid, Site Footer, Button/CTA, Container, Card) on
   the public render path (see PublicSite::render_public_path / component_renderer.rs). Always
   loaded, independent of `used_dynamic` -- these are static components with no client JS. */

/* Indirection layer over ThemeEngine's real per-tenant tokens (theme_tokens_to_css emits
   --color-primary/--color-secondary/--color-accent/--color-background as <style> in <head>,
   ahead of this stylesheet, whenever the tenant has set them -- see Branding Console). Every
   rule below references --mc-* only, so a tenant with no branding configured yet still gets a
   sane default, and one that has still gets it applied with zero changes to this file. */
:root {
    --mc-primary: var(--color-primary, #1e40af);
    --mc-primary-dark: var(--color-secondary, #1e3a8a);
    --mc-ink: #1a2233;
    --mc-muted: #5b6472;
    --mc-border: #e5e7eb;
    --mc-bg-alt: var(--color-background, #f7f8fb);
    --mc-radius: var(--radius-md, 10px);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    color: var(--mc-ink);
    margin: 0;
}

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---- Site Header ---- */
/* --site-header-height is set inline per instance (component_renderer.rs's `heightPx` prop,
   default 64px) -- the fallback here only covers a header rendered with no inline style at all. */
.site-header {
    --site-header-height: 64px;
    height: var(--site-header-height);
    border-bottom: 1px solid var(--mc-border);
    background: #fff;
}
.site-header .container,
.site-header .header-content {
    height: 100%;
}
.site-header .header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.site-header .logo img {
    /* Logo is capped at 70% of the header's own height, not a fixed pixel size, so it scales
       with heightPx instead of overflowing or looking tiny relative to a custom header height. */
    max-height: calc(var(--site-header-height) * 0.7);
    width: auto;
    display: block;
}
.site-header .main-nav {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}
.site-header .main-nav a {
    color: var(--mc-ink);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}
.site-header .main-nav a:hover {
    color: var(--mc-primary);
}

/* ---- Buttons / CTA ---- */
.btn,
.cta-button {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 6px;
    background: var(--mc-primary);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
}
.btn:hover,
.cta-button:hover {
    background: var(--mc-primary-dark);
}

/* ---- Hero ---- */
.hero-block {
    text-align: center;
    padding: 72px 24px;
    background: var(--mc-bg-alt);
    background-size: cover;
    background-position: center;
}
.hero-block h1 {
    font-size: 2.4rem;
    margin: 0 0 16px;
    line-height: 1.2;
}
.hero-block p {
    font-size: 1.1rem;
    color: var(--mc-muted);
    max-width: 640px;
    margin: 0 auto 28px;
}

/* ---- Feature Grid ---- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(var(--feature-grid-columns, 3), 1fr);
    gap: 32px;
    max-width: 1120px;
    margin: 0 auto;
    padding: 56px 24px;
}
.feature-grid-item {
    text-align: center;
}
.feature-grid-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}
.feature-grid-item h3 {
    margin: 0 0 8px;
    font-size: 1.1rem;
}
.feature-grid-item p {
    margin: 0;
    color: var(--mc-muted);
    font-size: 0.95rem;
}
@media (max-width: 720px) {
    .feature-grid {
        grid-template-columns: 1fr;
    }
}

/* ---- Media-Text Split ---- */
.media-text-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
    max-width: 1120px;
    margin: 0 auto;
    padding: 56px 24px;
}
.media-text-split.reversed {
    direction: rtl;
}
.media-text-split.reversed > * {
    direction: ltr;
}
.media-text-split-copy h2 {
    margin-top: 0;
    font-size: 1.6rem;
}
.media-text-split-copy p {
    color: var(--mc-muted);
}
.media-text-split-copy ul {
    padding-left: 20px;
    color: var(--mc-muted);
}
.media-text-split-media img {
    width: 100%;
    min-height: 220px;
    border-radius: var(--mc-radius);
    display: block;
    /* Graceful placeholder look (not a broken-image icon) when mediaImageUrl is intentionally
       empty -- e.g. a "screenshot coming soon" section -- since alt text is the only content
       a real image src="" leaves to show. */
    background: linear-gradient(135deg, rgba(30,64,175,0.08), rgba(118,75,162,0.08));
    border: 1px dashed rgba(30,64,175,0.3);
    color: var(--mc-muted);
    font-size: 0.85rem;
    text-align: center;
}
@media (max-width: 720px) {
    .media-text-split,
    .media-text-split.reversed {
        grid-template-columns: 1fr;
        direction: ltr;
    }
}

/* ---- Plan Card Grid ---- */
.plan-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    max-width: 1120px;
    margin: 0 auto;
    padding: 56px 24px;
}
.plan-card {
    border: 1px solid var(--mc-border);
    border-radius: var(--mc-radius);
    padding: 28px 24px;
    text-align: center;
    background: #fff;
}
.plan-card .tier-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--mc-bg-alt);
    color: var(--mc-primary);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 12px;
}
.plan-card h3 {
    margin: 0 0 8px;
}
.plan-card p {
    color: var(--mc-muted);
    margin: 0 0 20px;
}

/* ---- Site Footer ---- */
.site-footer {
    border-top: 1px solid var(--mc-border);
    padding: 32px 0;
    margin-top: 48px;
    color: var(--mc-muted);
    font-size: 13px;
}
.site-footer .footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
}
.site-footer p {
    margin: 0;
}

/* ---- Card / Container (generic Page Builder primitives) ---- */
.component-container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 40px 24px;
}
.component-container h2 {
    font-size: 1.6rem;
    margin-top: 0;
}
.component-container p {
    color: var(--mc-muted);
}
.card {
    border: 1px solid var(--mc-border);
    border-radius: var(--mc-radius);
    overflow: hidden;
    margin: 12px 0;
}
.card-header {
    padding: 12px 16px;
    font-weight: 600;
    background: var(--mc-bg-alt);
    border-bottom: 1px solid var(--mc-border);
}
.card-body {
    padding: 16px;
}
