/*
Theme Name:   Thesla Cloud Child
Template:     astra
Description:  theslacloud.com — the static site ported to WordPress, plus the product landing pages.
Author:       Thesla Cloud Services
Version:      1.0.0
Text Domain:  thesla-child
*/

/* =====================================================================
   Tokens. Every template references these, never a raw hex.
   The first block is the original site's palette, unchanged, because
   assets/css/site.css (the ported stylesheet) uses these names.
   ===================================================================== */
:root {
    --primary-color: #2563eb;   /* action: buttons, CTA bands */
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --secondary-color: #64748b; /* secondary text */
    --secondary-dark: #475569;
    --secondary-light: #94a3b8;
    --accent-color: #06b6d4;    /* gradient end only. Fails AA with white text, never a text background on its own */
    --accent-dark: #0891b2;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --dark: #0f172a;            /* ink: text and dark panels */
    --dark-gray: #1e293b;
    --medium-gray: #334155;
    --light-gray: #cbd5e1;      /* lines and borders */
    --lighter-gray: #e2e8f0;
    --lightest-gray: #f1f5f9;   /* paper: alternate sections */
    --white: #ffffff;
    --gradient-primary: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
    --gradient-secondary: linear-gradient(135deg, #64748b 0%, #94a3b8 100%);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* WhatsApp. The original used the bright brand green (#25d366) behind white
       text, which fails contrast (about 2:1). The deep green passes AA. The bright
       green survives only as --tc-wa-glow, for the glyph on dark backgrounds. */
    --tc-wa: #0a7d5a;
    --tc-wa-dark: #08664a;
    --tc-wa-glow: #25d366;
    --whatsapp-green: var(--tc-wa);
    --whatsapp-green-dark: var(--tc-wa-dark);

    /* House aliases, used by the new product-page templates. */
    --tc-primary: var(--primary-color);
    --tc-primary-dark: var(--primary-dark);
    --tc-ink: var(--dark);
    --tc-slate: var(--secondary-dark);
    --tc-line: var(--lighter-gray);
    --tc-paper: var(--lightest-gray);
    --tc-white: var(--white);
    --tc-mist: var(--light-gray);
    --tc-scrim: rgba(15, 23, 42, 0.6);

    /* Type */
    --tc-head: 'Poppins', sans-serif;
    --tc-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Layout */
    --tc-max: 1200px;
    --tc-gutter: 20px;
    --tc-radius: 16px;
    --tc-callbar-h: 64px;
}

/* =====================================================================
   Shared rules added in the port. Page CSS lives in assets/css/site.css
   (the original stylesheet) and, for new templates, in a scoped <style>
   block inside the template file.
   ===================================================================== */

/* The fixed navbar must clear the WordPress admin bar when logged in. */
.admin-bar .navbar { top: 32px; }
@media (max-width: 782px) {
    .admin-bar .navbar { top: 46px; }
}

/* Skip link, hidden until focused. */
.skip-link.screen-reader-text:focus {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 10001;
    width: auto;
    height: auto;
    clip: auto;
    padding: 12px 16px;
    background: var(--white);
    color: var(--dark);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
}

/* Visible keyboard focus everywhere. */
:where(a, button, input, select, textarea, summary):focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Respect reduced motion: the original animates on load and on scroll. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .fade-in-up { opacity: 1 !important; transform: none !important; }
}

/* The WhatsApp button used by every new template.
   Always the glyph plus the word "WhatsApp". */
.btn-wa {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 48px;
    background: var(--tc-wa);
    color: var(--white);
    border: 2px solid transparent;
}
.btn-wa:hover,
.btn-wa:focus-visible {
    background: var(--tc-wa-dark);
    color: var(--white);
}
.btn-wa svg { width: 1.25em; height: 1.25em; flex: none; }
.btn-wa--on-dark { background: var(--white); color: var(--tc-wa-dark); }
.btn-wa--on-dark:hover,
.btn-wa--on-dark:focus-visible { background: var(--lightest-gray); color: var(--tc-wa-dark); }

/* Sticky action bar on product pages, phones only. */
.tc-callbar { display: none; }
@media (max-width: 768px) {
    body.tc-has-callbar { padding-bottom: calc(var(--tc-callbar-h) + env(safe-area-inset-bottom)); }
    .tc-callbar {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9998;
        gap: 8px;
        padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
        background: var(--white);
        border-top: 1px solid var(--lighter-gray);
        box-shadow: 0 -4px 12px rgba(15, 23, 42, 0.08);
    }
    .tc-callbar a {
        flex: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        min-height: 48px;
        border-radius: 10px;
        font-weight: 600;
        text-decoration: none;
    }
    .tc-callbar .tc-callbar__wa { background: var(--tc-wa); color: var(--white); }
    .tc-callbar .tc-callbar__alt { border: 2px solid var(--primary-color); color: var(--primary-color); }
    .tc-callbar svg { width: 1.2em; height: 1.2em; }
}

/* Header link that becomes "Products" once a product page is published.
   Eight items need a slightly tighter menu between the tablet and wide desktop widths. */
@media (min-width: 769px) and (max-width: 1280px) {
    .nav-menu.has-products { gap: 1.1rem; }
    .nav-menu.has-products .nav-link { font-size: 0.95rem; }
}

/* Text-only footer line for the registered identity. */
.footer-identity {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--secondary-light);
}

/* Inline SVG icon sizes inside the ported components. */
.footer-contact .tc-icon { width: 16px; height: 16px; }
.social-link .tc-icon { width: 20px; height: 20px; }
.fab-icon .tc-icon { width: 24px; height: 24px; }
.footer-identity { text-align: center; }

/* Breadcrumb clearance. On the static site the first section sat directly after
   the breadcrumb, and site.css pulls its top padding back with sibling rules
   (.breadcrumb-nav + .page-hero). In WordPress that section sits inside <main>,
   so the same pull-back is repeated here for the first section of <main>. */
.breadcrumb-nav + main > .page-hero:first-child { padding-top: 1.5rem; }
.breadcrumb-nav + main > .audit-hero:first-child { padding-top: 0; }
@media (max-width: 768px) {
    .breadcrumb-nav + main > .page-hero:first-child { padding-top: 3.75rem; }
    .breadcrumb-nav + main > .audit-hero:first-child { padding-top: 0.5rem; }
}

/* The homepage has no breadcrumb, so its hero keeps its own navbar clearance. */

/* Form validation and error states. The old main.js injected these at runtime. */
.error,
.error:focus { border-color: var(--error-color) !important; }
.form-error-msg {
    color: var(--error-color);
    font-size: 14px;
    margin-top: 8px;
    text-align: center;
}

/* The mobile menu panel is fixed under the navbar; drop it below the admin bar too. */
@media (max-width: 768px) {
    .admin-bar .nav-menu { top: 136px; height: calc(100vh - 136px); }
}
