/* =========================================================================
   Осмех на дар — BigHearts child theme overrides
   Loaded after the parent theme + Elementor CSS.
   The page-title bar (bg.jpg) is intentionally NOT styled here.
   ========================================================================= */

/* ---------- 1. Design tokens ------------------------------------------- */
:root {
    --osmeh-primary: #F74F22;        /* brand orange (unchanged) */
    --osmeh-secondary: #FFAC00;      /* brand yellow (unchanged) */
    --osmeh-primary-dark: #C73A12;   /* 5.2:1 on white — buttons & small text */
    --osmeh-ink: #222328;            /* 8.3:1 on --osmeh-secondary */
    --osmeh-text: #616161;
    --osmeh-soft: #FFF4EC;           /* light orange tint for panels */
    --osmeh-radius: 14px;
    --osmeh-radius-sm: 8px;
    --osmeh-shadow: 0 6px 24px rgba(34, 35, 40, .08);
    --osmeh-shadow-hover: 0 14px 36px rgba(34, 35, 40, .14);
    --osmeh-ease: cubic-bezier(.2, .7, .2, 1);
    --osmeh-font: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    /* Feed the parent theme's variables, in case a value is still missing/invalid. */
    --bighearts-content-color: var(--osmeh-text);
    --bighearts-header-font-color: #232323;
}

/* ---------- 2. Typography ---------------------------------------------- */
body,
button, input, select, textarea {
    font-family: var(--osmeh-font);
}

h1, h2, h3, h4, h5, h6,
.primary-nav, .wgl-button, .elementor-heading-title {
    font-family: var(--osmeh-font);
}

/* Fluid sizes for single-post headings (Elementor widgets keep their own sizes). */
.single_meta h1.blog-post_title   { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3rem); line-height: 1.2; }
.single_meta .blog-post_text h2   { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.25rem); line-height: 1.25; }
.single_meta .blog-post_text h3   { font-size: clamp(1.25rem, 1.05rem + .8vw, 1.75rem); line-height: 1.3; }

h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

/* ---------- 3. Buttons (readable contrast) ----------------------------- */
.wgl-button,
.elementor-button,
.osmeh-donate,
input[type="submit"],
button[type="submit"] {
    background-color: var(--osmeh-primary-dark);
    border-color: var(--osmeh-primary-dark);
    color: #fff;
    border-radius: 999px;
    transition: background-color .2s var(--osmeh-ease), color .2s var(--osmeh-ease),
                transform .2s var(--osmeh-ease), box-shadow .2s var(--osmeh-ease);
}

.wgl-button:hover, .wgl-button:focus-visible,
.elementor-button:hover, .elementor-button:focus-visible,
.osmeh-donate:hover, .osmeh-donate:focus-visible,
input[type="submit"]:hover, button[type="submit"]:hover {
    background-color: var(--osmeh-secondary);
    border-color: var(--osmeh-secondary);
    color: var(--osmeh-ink);
    transform: translateY(-2px);
    box-shadow: var(--osmeh-shadow);
}

/* ---------- 4. Header & menu ------------------------------------------- */
/* Carried over from Customizer → Additional CSS (header template 8591 column widths, lavalamp). */
.elementor-8591 .elementor-element.elementor-element-0067ca4 { width: 60% !important; }
.elementor-8591 .elementor-element.elementor-element-fb8b7a6 { width: 10% !important; }
.primary-nav .lavalamp-object { left: -6px; bottom: 25px; }

/* Submenu as a soft card */
.primary-nav ul li ul.sub-menu {
    border-radius: var(--osmeh-radius);
    box-shadow: var(--osmeh-shadow-hover);
    padding: 10px 0;
    overflow: hidden;
}
.primary-nav ul li ul.sub-menu li a:hover .item_text,
.primary-nav ul li ul.sub-menu li.current-menu-item > a .item_text {
    color: var(--osmeh-primary-dark);
}

/* Keyboard focus that is actually visible */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid var(--osmeh-secondary);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ---------- 5. News cards (BigHearts "Blog" widget) -------------------- */
.blog-posts .blog-post {
    height: 100%;
}
.blog-posts .blog-post_wrapper {
    background: #fff;
    border-radius: var(--osmeh-radius);
    box-shadow: var(--osmeh-shadow);
    overflow: hidden;
    height: 100%;
    transition: transform .3s var(--osmeh-ease), box-shadow .3s var(--osmeh-ease);
}
.blog-posts .blog-post_wrapper:hover {
    transform: translateY(-4px);
    box-shadow: var(--osmeh-shadow-hover);
}
.blog-posts .blog-post_media_part img.blog-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform .6s var(--osmeh-ease);
}
.blog-posts .blog-post_wrapper:hover img.blog-img {
    transform: scale(1.04);
}
.blog-posts .blog-post_content,
.blog-posts .blog-post_meta-wrap {
    padding-left: clamp(18px, 3vw, 30px);
    padding-right: clamp(18px, 3vw, 30px);
}
.blog-posts .blog-post_content { padding-top: 22px; }
.blog-posts .blog-post_meta-wrap { padding-bottom: 22px; }
.blog-posts .blog-post_title a { color: var(--osmeh-ink); }
.blog-posts .blog-post_title a:hover { color: var(--osmeh-primary-dark); }
.blog-posts .post_categories a {
    border-radius: 999px;
}

/* ---------- 6. Donate button, floating mobile button, bank info -------- */
.osmeh-donate {
    display: inline-flex;
    align-items: center;
    gap: .5em;
    padding: .7em 1.5em;
    font-weight: 800;
    font-size: 15px;
    line-height: 1.2;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: .03em;
    white-space: nowrap;
}
.osmeh-donate__heart { font-size: 1.1em; line-height: 1; }

.osmeh-donate--floating {
    position: fixed;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    z-index: 999;
    box-shadow: var(--osmeh-shadow-hover);
}
@media (min-width: 1200px) {
    .osmeh-donate--floating { display: none; }
}
/* Keep the theme's "back to top" button clear of the floating button on mobile */
@media (max-width: 1199px) {
    #scroll_up { bottom: 84px !important; }
}

.osmeh-bank {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px 40px;
    padding: clamp(20px, 4vw, 36px);
    background: var(--osmeh-soft);
    border-radius: var(--osmeh-radius);
}
.osmeh-bank__details { margin: 0; flex: 1 1 280px; }
.osmeh-bank__details dt {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--osmeh-text);
    margin-top: 12px;
}
.osmeh-bank__details dt:first-child { margin-top: 0; }
.osmeh-bank__details dd { margin: 2px 0 0; font-weight: 700; color: var(--osmeh-ink); font-size: 18px; }
.osmeh-bank__account { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.osmeh-copy {
    margin-left: 10px;
    padding: 2px 12px;
    font-size: 13px;
    border-radius: 999px;
    border: 1px solid var(--osmeh-primary-dark);
    background: transparent;
    color: var(--osmeh-primary-dark);
    cursor: pointer;
}
.osmeh-copy:hover { background: var(--osmeh-primary-dark); color: #fff; }
.osmeh-bank__qr { margin: 0; text-align: center; }
.osmeh-bank__qr img { width: 180px; height: auto; border-radius: var(--osmeh-radius-sm); background: #fff; padding: 8px; }
.osmeh-bank__qr figcaption { font-size: 13px; margin-top: 6px; }

/* ---------- 7. Opt-in classes (Elementor → Advanced → CSS Classes) ----- */

/* Hero section: add class "osmeh-hero" to the top section */
.osmeh-hero .elementor-heading-title {
    font-weight: 800;
    letter-spacing: -.01em;
}
.osmeh-hero .elementor-widget-text-editor {
    font-size: clamp(1.05rem, 1rem + .4vw, 1.3rem);
}

/* Impact counters: add class "osmeh-counters" to the section with Counter widgets */
.osmeh-counters .elementor-counter-number-wrapper {
    color: var(--osmeh-primary-dark);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.osmeh-counters .elementor-counter-title {
    color: var(--osmeh-ink);
    font-weight: 700;
}

/* Donor logos: grayscale, color on hover — class "osmeh-donors" */
.osmeh-donors img {
    filter: grayscale(1);
    opacity: .75;
    transition: filter .3s var(--osmeh-ease), opacity .3s var(--osmeh-ease);
}
.osmeh-donors img:hover,
.osmeh-donors a:focus-visible img {
    filter: none;
    opacity: 1;
}

/* Volunteer photos: round — class "osmeh-volunteers" */
.osmeh-volunteers img {
    border-radius: 50%;
    aspect-ratio: 1;
    object-fit: cover;
    box-shadow: var(--osmeh-shadow);
}

/* Gentle fade-in — class "osmeh-reveal" (news cards get it automatically) */
.osmeh-js .osmeh-reveal,
.osmeh-js .blog-posts .blog-post_wrapper {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .6s var(--osmeh-ease), transform .6s var(--osmeh-ease);
}
.osmeh-js .osmeh-reveal.is-visible,
.osmeh-js .blog-posts .blog-post_wrapper.is-visible {
    opacity: 1;
    transform: none;
}

/* ---------- 8. Misc polish --------------------------------------------- */
#scroll_up {
    border-radius: 50%;
    box-shadow: var(--osmeh-shadow);
}
::selection {
    background: var(--osmeh-secondary);
    color: var(--osmeh-ink);
}
img { height: auto; }

/* ---------- 9. Reduced motion: no movement at all ---------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
    .osmeh-js .osmeh-reveal,
    .osmeh-js .blog-posts .blog-post_wrapper {
        opacity: 1;
        transform: none;
    }
    .blog-posts .blog-post_wrapper:hover,
    .blog-posts .blog-post_wrapper:hover img.blog-img { transform: none; }
}
