/* =========================================================
   FoundryPress Public Site Stylesheet
   ---------------------------------------------------------
   © 2026 Kloos Enterprises. All rights reserved.

   Public-facing theme styles for FoundryPress sites, articles,
   demo banners, content cards, navigation, markup helpers, and
   brand switching.

   Drop-in safe:
   - Preserves existing public site class names.
   - Does not depend on Hub admin CSS.
   - Keeps demo mode, article pages, and brand switcher compatible.
   ========================================================= */


/* =========================================================
   01. Design Tokens
   ========================================================= */

:root {
    --site-bg: #f6f8fb;
    --site-surface: #ffffff;
    --site-text: #1d3243;
    --site-text-soft: #5f7283;
    --site-border: #dbe4ec;
    --site-accent: #2f6fed;
    --site-shadow: 0 14px 38px rgba(21, 52, 88, 0.08);
    --site-radius: 18px;
    --site-max: 1100px;
    --site-focus: 0 0 0 4px rgba(47, 111, 237, 0.16);
}


/* =========================================================
   02. Base / Reset
   ========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, Helvetica, sans-serif;
    background: var(--site-bg);
    color: var(--site-text);
    line-height: 1.7;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
    text-decoration: none;
}

img,
svg {
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: none;
    box-shadow: var(--site-focus);
}


/* =========================================================
   03. Layout Shell
   ========================================================= */

.site-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-header__inner,
.site-main,
.site-footer__inner {
    width: min(100% - 2rem, var(--site-max));
    margin: 0 auto;
}

.site-main {
    flex: 1;
    padding-block: 2rem 4rem;
}


/* =========================================================
   04. Header / Logo / Navigation
   ========================================================= */

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--site-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.site-header__inner {
    min-height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    flex-direction: column;
    gap: 0.1rem;
}

.site-logo__img {
    display: block;
    width: auto;
    height: 36px;
}

.site-logo__eyebrow {
    color: var(--site-accent);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.site-logo__title {
    font-size: 1.2rem;
    font-weight: 800;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.site-nav__link {
    padding: 0.65rem 0.9rem;
    border-radius: 999px;
    color: var(--site-text-soft);
    font-weight: 600;
    transition:
        background-color 0.16s ease,
        color 0.16s ease;
}

.site-nav__link:hover,
.site-nav__link.is-active {
    background: #eaf1ff;
    color: var(--site-accent);
}

/* Hub logo compatibility when the public logo class appears in Hub markup. */
.hub-topbar .site-logo__img {
    height: 64px;
}


/* =========================================================
   05. Brand Switcher
   ---------------------------------------------------------
   Used by Studio/Pro public multi-brand navigation.
   ========================================================= */

.nav-brand-switcher {
    margin-left: 0.5rem;
}

.nav-brand-switcher select {
    min-height: 42px;
    padding: 0.55rem 0.85rem;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 999px;
    background: #ffffff;
    color: var(--site-text);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}


/* =========================================================
   06. Hero / Demo Banner
   ========================================================= */

.site-hero,
.demo-banner__inner {
    border: 1px solid var(--site-border);
    border-radius: 28px;
    background: linear-gradient(135deg, #ffffff 0%, #edf4ff 100%);
    box-shadow: var(--site-shadow);
}

.site-hero {
    margin-bottom: 2rem;
    padding: 2.4rem;
}

.demo-banner {
    margin-bottom: 2rem;
}

.demo-banner__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
}

.demo-banner__intro {
    color: var(--site-text-soft);
}

.demo-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.site-kicker {
    display: inline-block;
    margin-bottom: 0.9rem;
    color: var(--site-accent);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.site-hero h1,
.demo-banner h1 {
    margin: 0 0 0.8rem;
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.site-hero p,
.demo-banner p {
    margin: 0;
    color: var(--site-text-soft);
}


/* =========================================================
   07. Sections / Empty States
   ========================================================= */

.site-section + .site-section {
    margin-top: 2rem;
}

.site-section__head {
    margin-bottom: 1rem;
}

.site-section__head h2 {
    margin: 0 0 0.8rem;
    line-height: 1.15;
}

.site-section__head p {
    margin: 0;
    color: var(--site-text-soft);
}

.site-empty {
    padding: 1.5rem;
    border: 1px solid var(--site-border);
    border-radius: var(--site-radius);
    background: var(--site-surface);
    color: var(--site-text-soft);
}


/* =========================================================
   08. Buttons / CTAs
   ========================================================= */

.site-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0.85rem 1.2rem;
    border-radius: 999px;
    font-weight: 700;
    text-decoration: none;
    transition:
        background-color 0.16s ease,
        border-color 0.16s ease,
        color 0.16s ease,
        transform 0.16s ease;
}

.site-btn:hover {
    transform: translateY(-1px);
}

.site-btn--primary {
    background: var(--site-accent);
    color: #ffffff;
}

.site-btn--secondary {
    border: 1px solid var(--site-border);
    background: #ffffff;
    color: var(--site-text);
}

.site-btn--secondary:hover {
    border-color: rgba(47, 111, 237, 0.35);
    background: #f8fbff;
}


/* =========================================================
   09. Article Cards / Archive
   ========================================================= */

.article-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1.2rem;
}

.article-card {
    grid-column: span 6;
    padding: 1.4rem;
    border: 1px solid var(--site-border);
    border-radius: var(--site-radius);
    background: var(--site-surface);
    box-shadow: var(--site-shadow);
}

.article-card h2 {
    margin: 0 0 0.8rem;
    line-height: 1.15;
}

.article-card p {
    margin: 0;
    color: var(--site-text-soft);
}

.article-card__content {
    color: var(--site-text-soft);
}

.article-card__meta {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
    color: var(--site-accent);
    font-size: 0.82rem;
    font-weight: 700;
}

.article-card__link {
    display: inline-flex;
    margin-top: 1rem;
    color: var(--site-accent);
    font-weight: 700;
}

.article-card__link:hover {
    text-decoration: underline;
    text-underline-offset: 0.18em;
}


/* =========================================================
   10. Article Read Page
   ========================================================= */

.article-page {
    padding: 48px 20px 72px;
}

.article-shell {
    max-width: 860px;
    margin: 0 auto;
}

.article-header {
    margin-bottom: 32px;
    text-align: center;
}

.article-back-link {
    display: inline-block;
    margin-bottom: 22px;
    color: var(--site-text-soft);
    font-weight: 600;
    text-decoration: none;
}

.article-back-link:hover {
    color: var(--site-accent);
}

.article-header h1,
.article-read h1 {
    margin: 12px auto 16px;
    max-width: 820px;
    font-size: clamp(2rem, 5vw, 3.6rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.article-lede {
    max-width: 700px;
    margin: 0 auto 18px;
    color: var(--site-text-soft);
    font-size: 1.1rem;
    line-height: 1.7;
}

.article-meta,
.article-read__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    color: var(--site-text-soft);
    font-size: 0.95rem;
}

.article-meta {
    justify-content: center;
}

.article-meta span:not(:last-child)::after {
    content: "•";
    margin-left: 18px;
    color: var(--site-border);
}

.article-read {
    padding: 2rem;
    border: 1px solid var(--site-border);
    border-radius: 28px;
    background: var(--site-surface);
    box-shadow: var(--site-shadow);
}

.article-read__meta {
    margin-bottom: 1.25rem;
}

.article-read__content {
    margin-top: 1.6rem;
}

.article-read__content p,
.article-content p {
    margin: 0 0 1.35em;
    color: var(--site-text-soft);
}

.article-read__content p + p {
    margin-top: 1rem;
}

.article-hero-image {
    margin: 34px 0 42px;
    overflow: hidden;
    border-radius: 24px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
}

.article-hero-image img {
    display: block;
    width: 100%;
    height: auto;
}

.article-content {
    max-width: 720px;
    margin: 0 auto;
    font-size: 1.05rem;
    line-height: 1.85;
}

.article-content ul,
.article-content ol {
    margin: 0 0 1.5em 1.25em;
    padding-left: 1.1em;
}

.article-content li {
    margin-bottom: 0.6em;
}

.article-content strong {
    color: var(--site-text);
}

.article-cta {
    max-width: 720px;
    margin: 48px auto 0;
    padding: 28px;
    border: 1px solid var(--site-border);
    border-radius: 22px;
    background: var(--site-surface);
    box-shadow: var(--site-shadow);
    text-align: center;
}

.article-cta h2 {
    margin-top: 0;
    margin-bottom: 10px;
}

.article-cta p {
    margin-bottom: 18px;
    color: var(--site-text-soft);
}


/* =========================================================
   11. Article Markup Helpers
   ---------------------------------------------------------
   Output from FoundryPress lightweight article markup parser.
   ========================================================= */

.fp-divider {
    margin: 2rem 0;
    border: 0;
    border-top: 1px solid rgba(15, 23, 42, 0.14);
}

.fp-callout {
    margin: 1.5rem 0;
    padding: 1rem 1.2rem;
    border-left: 4px solid #2f5d62;
    border-radius: 14px;
    background: #f3f6f6;
    color: #18212f;
}

.fp-list {
    margin: 1rem 0 1.5rem;
    padding-left: 1.4rem;
}

.fp-list li {
    margin: 0.45rem 0;
}

.article-code {
    margin: 1.5rem 0;
    padding: 1rem;
    overflow-x: auto;
    border-radius: 14px;
    background: #0f172a;
    color: #f9fafb;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 0.95rem;
    line-height: 1.5;
}

.article-code code {
    font-family: inherit;
    font-size: 0.9rem;
    white-space: pre;
}

.article-image {
    margin: 2rem 0;
}

.article-image img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
}

.article-image figcaption {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.75;
}


/* =========================================================
   12. Demo Mode Bar
   ========================================================= */

.fp-demo-bar {
    position: relative;
    z-index: 999;
    padding: 10px 16px;
    background: #111827;
    color: #ffffff;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.fp-demo-bar strong {
    color: #facc15;
}


/* =========================================================
   13. Footer
   ========================================================= */

.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--site-border);
    background: #ffffff;
}

.site-footer__inner {
    padding: 1.2rem 0 2rem;
    color: var(--site-text-soft);
    font-size: 0.95rem;
}


/* =========================================================
   14. Responsive
   ========================================================= */

@media (max-width: 900px) {
    .site-header__inner {
        flex-direction: column;
        align-items: flex-start;
        padding-block: 1rem;
    }

    .site-nav {
        width: 100%;
    }

    .nav-brand-switcher {
        width: 100%;
        margin-left: 0;
    }

    .nav-brand-switcher select {
        width: 100%;
    }

    .demo-banner__inner {
        grid-template-columns: 1fr;
    }

    .article-card {
        grid-column: span 12;
    }

    .site-hero,
    .demo-banner__inner,
    .article-read {
        padding: 1.5rem;
    }
}

@media (max-width: 700px) {
    .article-page {
        padding-top: 32px;
    }

    .article-meta,
    .article-read__meta {
        display: block;
    }

    .article-meta span,
    .article-read__meta span {
        display: block;
        margin-bottom: 4px;
    }

    .article-meta span::after {
        display: none;
    }

    .article-hero-image {
        border-radius: 18px;
    }
}

.site-brand-switcher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
}

.site-brand-switcher label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--site-text-soft);
    letter-spacing: 0.02em;
}

.site-brand-switcher select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    background:
        linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
    
    border: 1px solid var(--site-border);
    border-radius: 999px;

    padding:
        0.7rem
        2.75rem
        0.7rem
        1rem;

    font-size: 0.95rem;
    font-weight: 600;

    color: var(--site-text);

    cursor: pointer;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;

    box-shadow:
        0 4px 12px rgba(15, 23, 42, 0.06);

    background-image:
        linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%),
        url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7L10 12L15 7' stroke='%23607080' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\");

    background-repeat:
        no-repeat,
        no-repeat;

    background-position:
        center,
        right 0.9rem center;

    background-size:
        cover,
        14px;
}

.site-brand-switcher select:hover {
    border-color: var(--site-accent);
}

.site-brand-switcher select:focus {
    outline: none;

    border-color: var(--site-accent);

    box-shadow:
        0 0 0 4px rgba(47, 111, 237, 0.14);
}

.site-brand-switcher select:active {
    transform: translateY(1px);
}

/* =========================================================
   15. Reduced Motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
