/* ============================================================
   jthieren.be — global styles
   Design tokens live here; component-specific styles live in
   each component's .razor.css file (scoped automatically).
   ============================================================ */

:root {
    /* Colour tokens — light theme (CS_Suite "Crisp White") */
    --bg:            #fcfcfc;   /* Crisp ContainerBackColor */
    --bg-elevated:   #ffffff;   /* Crisp panels / cards       */
    --border:        #dee2e6;   /* Crisp BorderColor          */
    --text:          #212121;   /* Crisp ForegroundColor      */
    --text-muted:    #646464;   /* Crisp SecondaryColor       */
    --accent:        #2980b9;   /* Crisp AccentColor          */
    --accent-hover:  #1f6391;   /* darker accent for hover    */
    --accent-soft:   #e8f4fd;   /* Crisp StateInitiation (soft blue) */

    /* Subtle CS_Suite state tints (soft background + readable text) */
    --soft-info:         #e8f4fd;  --soft-info-text:    #0b5a8a;
    --soft-success:      #d4edda;  --soft-success-text: #1b5e2a;
    --soft-warning:      #fff3cd;  --soft-warning-text: #7a5c00;
    --soft-error:        #f8d7da;  --soft-error-text:   #8a1f27;

    /* Typography & rhythm */
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: "Cascadia Code", "Consolas", "SF Mono", ui-monospace, monospace;
    --maxw: 900px;
    --radius: 10px;
}

/* Dark theme */
@media (prefers-color-scheme: dark) {
    :root {
        /* Aligned to CS_Suite "Dark" theme */
        --bg:          #2d2d30;   /* Dark BackgroundColor */
        --bg-elevated: #37373a;   /* Dark PanelBackColor  */
        --border:      #505050;   /* Dark BorderColor     */
        --text:        #f1f1f1;   /* Dark ForegroundColor */
        --text-muted:  #aaaaaa;   /* Dark SecondaryColor  */
        --accent:      #4da3e3;   /* Dark PrimaryColor, lightened for contrast */
        --accent-hover:#79bdec;
        --accent-soft: #24384a;

        --soft-info:    #1e3a52;  --soft-info-text:    #9fcdf0;
        --soft-success: #1d3a28;  --soft-success-text: #a7d8b4;
        --soft-warning: #3d3413;  --soft-warning-text: #e3c766;
        --soft-error:   #4a2427;  --soft-error-text:   #f0a8ad;
    }
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    line-height: 1.2;
    font-weight: 650;
    letter-spacing: -0.01em;
}

h1 { font-size: 2.1rem; margin: 0 0 0.6rem; }
h2 { font-size: 1.45rem; margin: 2.2rem 0 0.8rem; }
h3 { font-size: 1.15rem; margin: 1.6rem 0 0.5rem; }

p { margin: 0 0 1rem; }

a {
    color: var(--accent);
    text-decoration: none;
}
a:hover { color: var(--accent-hover); text-decoration: underline; }

code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--accent-soft);
    padding: 0.1em 0.35em;
    border-radius: 5px;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

/* ---- Reusable layout helpers ---- */
.container {
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 1rem;
}

.lead {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 40ch;
}

.muted { color: var(--text-muted); }

.text-danger { color: #b32121; }

/* ---- Hero (home page) ---- */
.hero {
    padding: 3.5rem 0 2.5rem;
}
.hero h1 { font-size: 2.6rem; }

/* ---- "Three doors" cards ---- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.1rem;
    margin: 1.5rem 0;
}

.card {
    display: block;
    padding: 1.4rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-elevated);
    color: inherit;
    transition: border-color .15s ease, transform .15s ease;
}
.card:hover {
    text-decoration: none;
    border-color: var(--accent);
    transform: translateY(-2px);
}
.card h3 { margin: 0 0 0.35rem; color: var(--accent); }
.card p  { margin: 0; color: var(--text-muted); font-size: 0.98rem; }

/* ---- Software / tool cards ---- */
.tool {
    display: flex;
    gap: 1.1rem;
    align-items: flex-start;
    padding: 1.3rem 1.4rem;
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);   /* subtle CS_Suite accent edge */
    border-radius: var(--radius);
    background: var(--bg-elevated);
    margin-bottom: 1rem;
}
.tool h3 { margin-top: 0; }
.tool-body { flex: 1; min-width: 0; }

/* White tile keeps every icon legible in light AND dark mode */
.tool-icon {
    flex: none;
    width: 64px;
    height: 64px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.tool-icon img {
    max-width: 82%;
    max-height: 82%;
    display: block;
}

/* Clickable tool cards on the Software list */
.tool-link {
    color: inherit;
    transition: border-color .15s ease, transform .15s ease;
}
.tool-link:hover {
    text-decoration: none;
    border-color: var(--accent);
    border-left-color: var(--accent);
    transform: translateY(-2px);
}
.tool-arrow {
    align-self: center;
    flex: none;
    font-size: 1.3rem;
    color: var(--text-muted);
}
.tool-link:hover .tool-arrow { color: var(--accent); }

/* Tool detail page */
.tool-hero {
    display: flex;
    gap: 1.1rem;
    align-items: center;
    margin-top: 0.5rem;
}
.tool-hero h1 { margin: 0 0 0.2rem; }

.feature-list { padding-left: 1.2rem; }
.feature-list li { margin: 0.35rem 0; }

/* Pull-quote (About) */
.pull {
    margin: 1.6rem 0;
    padding: 0.4rem 0 0.4rem 1.1rem;
    border-left: 3px solid var(--accent);
    font-size: 1.2rem;
    font-style: italic;
    color: var(--text-muted);
}

/* "The story so far" note on a tool page */
.origin {
    padding: 0.9rem 1.1rem;
    background: var(--accent-soft);
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 0.95rem;
}

.badges { margin-top: 0.6rem; }
.badge {
    display: inline-block;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    border-radius: 999px;
    padding: 0.15em 0.7em;
    margin: 0 0.35em 0.35em 0;
    /* default: soft-blue "info" tint from the CS_Suite state palette */
    background: var(--soft-info);
    color: var(--soft-info-text);
}
.badge-success { background: var(--soft-success); color: var(--soft-success-text); }
.badge-warning { background: var(--soft-warning); color: var(--soft-warning-text); }
.badge-error   { background: var(--soft-error);   color: var(--soft-error-text);   }

/* ---- Buttons ---- */
.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 0.6em 1.2em;
    border-radius: var(--radius);
    font-weight: 550;
    border: none;
    cursor: pointer;
}
.btn:hover { background: var(--accent-hover); color: #fff; text-decoration: none; }

/* ---- Responsive: tidy up on phones ---- */
@media (max-width: 560px) {
    .hero { padding: 2.2rem 0 1.8rem; }
    .hero h1 { font-size: 2rem; }
    h1 { font-size: 1.8rem; }

    /* Stack the tool icon above its text so the description gets full width */
    .tool {
        flex-direction: column;
        gap: 0.8rem;
    }
}

/* Blazor's built-in error banner (leave as-is) */
.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}
.blazor-error-boundary::after { content: "An error has occurred."; }

#blazor-error-ui {
    color-scheme: light;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}
