/* Layout corrections that preserve the theme's original desktop appearance. */
/* Allocate real space to the brand before laying out navigation and actions. */
#header { --carei-header-bar-height: 107px; --carei-header-logo-width: 285px; }
#header .header-middle.is-sticky { --carei-header-bar-height: 90px; --carei-header-logo-width: 232px; }
#header .header-top { height: 28px; min-height: 0; padding: 0; }
#header .header-top__content { height: 28px; min-height: 0; flex-direction: row; flex-wrap: nowrap; gap: 12px; }
#header .header-top__content-left { min-width: 0; }
#header .header-top__content-left-item-box-text { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: 28px; font-size: 12px; }
#header .header-top__content-right-item-box { flex-wrap: nowrap; gap: 8px; }
#header .header-top-btn { padding: 3px 6px; font-size: 11px; line-height: 20px; white-space: nowrap; }
#header .header-middle { height: var(--carei-header-bar-height); padding: 0; box-sizing: border-box; }
#header .header-layout {
    display: grid;
    grid-template-columns: var(--carei-header-logo-width) minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    margin: 0;
    height: calc(var(--carei-header-bar-height) - 1px);
    padding: 8px 0;
    box-sizing: border-box;
}
#header .header-layout > div { width: auto; max-width: none; min-width: 0; padding: 0 !important; }
#header .header-toggle-column { display: none !important; }
#header .header-middle__logo a { display: flex; align-items: center; width: 100%; }
#header .header-middle__logo img { display: block; width: auto; max-width: 100%; height: auto; max-height: calc(var(--carei-header-bar-height) - 17px); object-fit: contain; padding: 0 !important; }
#header .header-navigation { gap: 16px; }
#header .header-navigation .menu-holder { width: auto !important; flex: 1 1 auto; min-width: 0; }
#header .header-navigation .header_button_holder { margin: 0 !important; flex: 0 0 auto; }
#header .header-navigation .menu-lang { flex: 0 0 auto; }
#header .main-nav > .nav-level-1 > .nav-item { flex: 0 0 auto; padding-block: 0 !important; }
#header .main-nav > .nav-level-1 > .nav-item > .nav-link { white-space: nowrap !important; }
@media (min-width: 1200px) and (max-width: 1599.98px) {
    #header .header-navigation { gap: 12px; }
    #header .main-nav > .nav-level-1 > .nav-item { padding: 0 !important; }
    #header .main-nav > .nav-level-1 > .nav-item > .nav-link { padding: 10px !important; }
    #header .main-nav > .nav-level-1 > .nav-item > .nav-link .txt { font-size: 14px; letter-spacing: .25px; }
    #header .main-nav > .nav-level-1 > .has-children > .nav-link { padding-right: 34px !important; }
    #header .main-nav > .nav-level-1 > .has-children > .nav-disclosure { right: 4px; }
    #header .header_button { font-size: 13px; padding: 12px; }
    #header .menu-lang .menu-link { padding: 10px; }
}
@media (max-width: 1199.98px) {
    #header .header-middle { padding: 0; }
    #header .header-layout { grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 8px 0; }
    #header .header-toggle-column { display: flex !important; }
    #header .header-layout > .header-logo-column { justify-self: center; width: min(100%, 300px); }
    #header .header-middle__logo a { justify-content: center; }
    #header .header-navigation { display: none !important; }
    .carei-dropdown-layer { display: none; }
}
/* Grow for long content without replacing the image, frame, colors or typography. */
.hero-section { max-height: none; }
.hero-actions .hero-btn-primary { max-width: 100%; white-space: normal; }
.hero-actions .btn-text { min-width: 0; overflow-wrap: anywhere; }
.hero-scroll-indicator { bottom: 8px; left: 50%; transform: translateX(-50%); pointer-events: none; }
.hero-bg-elements { inset: 0; pointer-events: none; }

.location-header, .location-info-card,
.news-card-title, .programari-content, .content_title__title { overflow-wrap: anywhere; }
.location-contact-section .row > [class*="col-"] { min-width: 0; }
.location-contact-section .row + .row { row-gap: 24px; }
.location-info-card .detail-item { flex-direction: row; gap: 8px; margin-bottom: 8px; }
.location-info-card .detail-item i { flex: 0 0 20px; }
.location-map-wrapper iframe { display: block; }

/* CMS headings and service names must also fit narrow phones. */
.title_h1, .section-title, .service-card__title, .service-card__description,
.post__desc, .post__intro, .post_content, .post_title { overflow-wrap: anywhere; }
.service-card__fallback:not([hidden]) {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--general-theme-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.post-image-fallback { display: none; }
.news-image-fallback { display: none; }
.news-card-image.image-unavailable picture { display: none !important; }
.news-card-image.image-unavailable > img { display: none; }
.news-card-image.image-unavailable .news-image-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #edf4f6;
    color: #5c7c89;
    font-size: 48px;
}
.post_image.image-unavailable figure { display: none; }
.post_image.image-unavailable .post-image-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    border-radius: 12px;
    background: #edf4f6;
    color: #5c7c89;
    font-size: 48px;
}
.studies_box .box_overlay { max-height: 100%; pointer-events: none; }
.section_category_hireink .content_title_title { font-size: clamp(1.5rem, 4vw, 2.5rem); overflow-wrap: anywhere; }

/* Cookie preferences must remain usable on small and landscape screens. */
body #gdpr-cookie-message {
    box-sizing: border-box;
    width: min(425px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    right: 16px;
    bottom: 16px;
    margin-left: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}
body #gdpr-cookie-message .btns_holder { display: flex; }
body #gdpr-cookie-message .btns_holder button { min-height: 44px; white-space: normal; letter-spacing: 0; }
body #gdpr-cookie-message .cookie_title { max-width: calc(100% - 90px); }
body #gdpr-cookie-message .background_img { width: 120px; pointer-events: none; }

@media (max-width: 991.98px) {
    /* Long slide copy belongs below the image when an overlay cannot fit. */
    .section_category_hireink .items_box_holder { background: var(--general-theme-color); }
    .section_category_hireink .items_box_holder > .container { padding: 0; max-width: none; }
    .section_category_hireink .banner_overlay { display: none; }
    .section_category_hireink .post_banner_box_holder { position: static !important; padding: 20px !important; }
    .section_category_hireink .post_banner_box_holder > .container { padding: 0; }
    .section_category_hireink .post_banner_content { margin-bottom: 20px !important; overflow-wrap: anywhere; }
    .section_category_hireink .post_banner_title { overflow-wrap: anywhere; }
    .section_category_hireink .post_banner_button { background: #fff !important; color: var(--general-theme-color) !important; min-height: 44px; }
}
@media (max-width: 767.98px) {
    .page-header .title_h1 { font-size: clamp(1.75rem, 6vw, 2.5rem) !important; }
    .page-subheader .title_h1, .category_pages .section-title { font-size: clamp(1.4rem, 5vw, 2rem) !important; }
    .hero-section { min-height: 0; padding: 40px 0; }
    .hero-section-overlay { padding: 0 !important; }
    .hero-section .text-white { padding-top: 0 !important; }
    .hero-section .container, .hero-section .col-lg-10 { padding-left: 0; padding-right: 0; }
    .hero-section .row { margin: 0; }
    .hero-content { font-size: 1rem; line-height: 1.65; }
    .hero-content.mb-5 { margin-bottom: 24px !important; }
    .hero-scroll-indicator { display: none; }
    .hero-actions { width: 100%; max-width: 420px; margin: 24px auto 0; gap: 16px !important; }
    .hero-actions .hero-btn-primary { width: 100%; justify-content: center; min-height: 48px; margin: 0 !important; }
    .location-info-card { padding: 24px; }
    .location-map-card, .location-map-wrapper, .location-map-wrapper iframe { min-height: 280px; }
    .location-map-placeholder { height: 280px; }
    .post_content p, .post__desc p, .post__intro p { text-align: left !important; line-height: 1.7; }
    .section_doctors .post_title { font-size: 1.5rem; line-height: 1.4; }
}
@media (prefers-reduced-motion: reduce) {
    .hero-circle, .scroll-arrow, .animate-fade-in, .animate-fade-in-delay,
    .animate-fade-in-delay-2, .counter-number.animate { animation: none; }
    .header .is-sticky { animation: none; }
}
