/* Explain: Base reset, typography defaults, and print styles for the application. */
* {
    box-sizing: border-box;
}

html {
    background: var(--background-color);
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

body {
    margin: 0;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    position: relative;
    background:
        radial-gradient(circle at top left, color-mix(in srgb, var(--sage-color) 28%, transparent), transparent 34rem),
        linear-gradient(180deg, var(--cream-color), color-mix(in srgb, var(--sage-color) 14%, var(--cream-color)) 100%);
}

::selection {
    background: var(--sage-color);
    color: var(--charcoal-color);
}

button,
a {
    cursor: pointer;
}

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

:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--clay-color) 72%, transparent);
    outline-offset: 3px;
}

@media print {
    body:not(.is-printing-diary) header,
    body:not(.is-printing-diary) footer,
    body:not(.is-printing-diary) #a11y-widget,
    body:not(.is-printing-diary) #ai-chat-toggle,
    body:not(.is-printing-diary) .mobile-form-float,
    body:not(.is-printing-diary) .floating-contact-open,
    body:not(.is-printing-diary) a[href^="https://wa.me"] {
        display: none !important;
    }

    body.is-printing-diary > *:not(.print-only-container) {
        display: none !important;
    }
    
    /* הרמת הכפתורים הצפים כשיש סרגל תחתון דביק, כדי שלא יסתירו טקסטים */
    body:has(.sticky-bottom-bar) #global-floating-actions,
    body:has(.sticky-bottom-bar) #a11y-widget {
        bottom: 6rem !important;
    }
    body:has(.sticky-bottom-bar) #ai-chat-toggle {
        bottom: 14.5rem !important;
    }
    body:has(.sticky-bottom-bar) #ai-chat-window {
        bottom: 19rem !important;
    }

    .print-only-container {
        display: block !important;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        background: white;
        color: black;
    }
    
    /* Ensure colors and borders print correctly */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}
