/* Shared appearance contract: html[data-theme=light|dark|system].
   Brand accents and Elementor instance colours remain owned by their controls. */
:root {
  --bef-ink: #14263c;
  --bef-muted: #526176;
  --bef-paper: #ffffff;
  --bef-page: #f3f5f8;
  --bef-soft: #edf1f6;
  --bef-line: #cbd4e0;
  --bef-field-bg: #ffffff;
  --bef-field-border: #7b8ba0;
  --bef-danger: #b42339;
  --bef-danger-bg: #fff0f2;
  --bef-warning: #754710;
  --bef-warning-bg: #fff7e5;
  --bef-success: #16603e;
  --bef-success-bg: #eaf7ef;
  --bef-accent-text-mix: 25%;
  --bef-surface: var(--bef-paper);
  --bef-primary: var(--bef-accent);
  --bef-on-inverse: #ffffff;
  --bef-media-bg: #102236;
  --bef-media-panel: #152c43;
  --bef-media-text: #f2f6fb;
  --bef-media-muted: #c3d0e0;
  --bef-media-line: #56718d;
  --bef-shadow: 0 6px 25px #14263c0b;
  color-scheme: light;
  scrollbar-gutter: stable;
}

html[data-theme=dark] {
  --bef-ink: #edf3fb;
  --bef-muted: #b5c3d5;
  --bef-paper: #142336;
  --bef-page: #0c1827;
  --bef-soft: #1d3047;
  --bef-line: #3d536b;
  --bef-field-bg: #102033;
  --bef-field-border: #7d91aa;
  --bef-danger: #ffb4be;
  --bef-danger-bg: #401d2c;
  --bef-warning: #ffd596;
  --bef-warning-bg: #3a2b16;
  --bef-success: #98e4b5;
  --bef-success-bg: #153828;
  --bef-accent-text-mix: 30%;
  --bef-on-inverse: #14263c;
  --bef-shadow: 0 6px 25px #00000024;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  html[data-theme=system] {
    --bef-ink: #edf3fb;
    --bef-muted: #b5c3d5;
    --bef-paper: #142336;
    --bef-page: #0c1827;
    --bef-soft: #1d3047;
    --bef-line: #3d536b;
    --bef-field-bg: #102033;
    --bef-field-border: #7d91aa;
    --bef-danger: #ffb4be;
    --bef-danger-bg: #401d2c;
    --bef-warning: #ffd596;
    --bef-warning-bg: #3a2b16;
    --bef-success: #98e4b5;
    --bef-success-bg: #153828;
    --bef-accent-text-mix: 30%;
    --bef-on-inverse: #14263c;
    --bef-shadow: 0 6px 25px #00000024;
    color-scheme: dark;
  }
}

/* Recompute aliases within locally coloured Elementor widgets and media surfaces. */
:root, .bef-widget, .bef-module, .bef-site-footer {
  --bef-accent-text: color-mix(in srgb, var(--bef-accent) var(--bef-accent-text-mix), var(--bef-ink));
}
.bef-widget { --bef-surface: var(--bef-paper); }
body.bef-live-news { background-color: var(--bef-page); }

/* Small editorial text needs more contrast than the unchanged brand backgrounds. */
.bef-ticker-item strong,
.bef-list-item time,
.bef-list-number,
.bef-category,
.bef-text-link,
.bef-content a,
.bef-source-box a,
.bef-listing-details a,
.bef-gallery-message.is-error,
.bef-widget .bef-widget-more a {
  color: var(--bef-accent-text, var(--bef-ink));
}
.bef-ticker-track { padding-block: 8px; }
.bef-ticker-item { min-width: 0; }
.bef-ticker-item time { flex-shrink: 0; }
.bef-ticker-item strong { min-width: 0; }
.bef-card-title a:hover,
.bef-list-item a:hover,
.bef-feed-meta a:hover { text-decoration: underline; text-underline-offset: .18em; }
.bef-feed-meta a:focus-visible { outline-color: var(--bef-ink); }
body :is(.bef-site-header,.bef-home,.bef-page-main,.bef-site-footer,.bef-community,.bef-preferences-dialog) :focus-visible {
  outline-color: var(--bef-accent-text, var(--bef-ink));
}

/* Editorial overlays keep their contrasting white captions. */
.bef-slide-labels .bef-category,
.bef-grid-overlay .bef-category,
.bef-grid-overlay .bef-card-meta,
.bef-grid-overlay .bef-card-excerpt { color: var(--bef-media-text); }
.bef-slide-content .bef-feed-meta,
.bef-slide-content .bef-feed-meta a { color: var(--bef-media-text); }
.bef-slide-content .bef-feed-meta a:hover { color: var(--bef-media-text); }
.bef-grid-overlay .bef-card-title a:hover { color: var(--bef-media-text); }
.bef-thumb-caption b { background: var(--bef-ink); color: var(--bef-paper); }
.bef-number-only .bef-thumb-caption b { color: var(--bef-muted); background: var(--bef-paper); }
.bef-number-only .is-active .bef-thumb-caption b { color: #fff; background: var(--bef-accent); }

/* The native header already has an important colour rule; limit its correction here. */
.bef-site-header .bef-header-follow { color: var(--bef-on-inverse) !important; }
.bef-site-header .bef-search-form input::placeholder { color: var(--bef-muted); opacity: 1; }
.bef-site-header .bef-search-form:focus-within { border-color: var(--bef-field-border); }
.bef-site-header .bef-nav-list > li { min-width: 0; }
.bef-nav-list .sub-menu { max-width: min(320px, calc(100vw - 32px)); }
.bef-nav-list .sub-menu a { overflow-wrap: anywhere; }

/* Form controls share one surface in pages, comments, newsletter and service filters. */
body :is(.bef-community,.bef-comments,.bef-archive-filters,.bef-pharmacy-filter,.bef-content,.bef-preferences-dialog)
:is(input[type=text],input[type=email],input[type=password],input[type=search],input[type=url],input[type=tel],input[type=number],input[type=date],textarea,select) {
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  background-color: var(--bef-field-bg);
  border-color: var(--bef-field-border);
  color: var(--bef-ink);
  border-radius: 6px;
  line-height: 1.5;
  padding: 10px 12px;
  box-sizing: border-box;
}
body :is(.bef-community,.bef-comments,.bef-content,.bef-archive-filters,.bef-pharmacy-filter)
:is(input,textarea)::placeholder { color: var(--bef-muted); opacity: 1; }
body :is(.bef-community,.bef-comments,.bef-content) textarea { resize: vertical; min-height: 130px; }
body :is(.bef-community,.bef-comments,.bef-content,.bef-preferences-dialog) :is(input[type=checkbox],input[type=radio]) {
  accent-color: var(--bef-accent);
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 2px;
}
.bef-community :is(.bef-consent,.bef-poll-choice) { min-width: 0; overflow-wrap: anywhere; }
.bef-community :is(label,legend,summary) { white-space: normal; overflow-wrap: anywhere; }
.bef-community .bef-form-status { color: var(--bef-ink); overflow-wrap: anywhere; }
body .bef-community [role=alert] { color: var(--bef-danger); }
.bef-community .bef-form-status[role=alert]:not(:empty) { background: var(--bef-danger-bg); padding: 10px 12px; border-radius: 5px; }
.bef-community .bef-poll-result { align-items: baseline; }
.bef-community .bef-poll-result :is(span,strong,small) { min-width: 0; overflow-wrap: anywhere; }
.bef-community .bef-poll-result progress { border: 0; border-radius: 6px; overflow: hidden; background: var(--bef-soft); }
.bef-community .bef-poll-result progress::-webkit-progress-bar { background: var(--bef-soft); }
.bef-community .bef-poll-result progress::-webkit-progress-value { background: var(--bef-community-accent); }
.bef-community .bef-poll-result progress::-moz-progress-bar { background: var(--bef-community-accent); }
.bef-community.bef-account { display: block; white-space: normal; border: 0; padding: 0; font-size: inherit; }
.bef-community.bef-account span { display: revert; }
.bef-community.bef-bookmarks article,
.bef-community .bef-bookmarks article,
.bef-widget .bef-audio-episode,
.bef-widget .bef-tabs-nav button { border-color: var(--bef-line); }
.bef-community.bef-bookmarks article { align-items: flex-start; flex-wrap: wrap; }
.bef-community.bef-bookmarks [data-bef-saved-item] a { flex: 1 1 180px; }
.bef-community.bef-bookmarks [data-bef-bookmark] { flex: 0 1 auto; }
.bef-article-tools > .bef-community { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bef-community small { opacity: 1; color: var(--bef-muted); }
.bef-community button:disabled { opacity: .75; }

/* Footer is an intentional dark surface even when the publication uses light mode. */
.bef-site-footer {
  --bef-ink: #f2f6fb;
  --bef-muted: #c3d0e0;
  --bef-paper: #14283d;
  --bef-soft: #1d334c;
  --bef-line: #506881;
  --bef-field-bg: #102033;
  --bef-field-border: #8296af;
  --bef-danger: #ffb4be;
  --bef-danger-bg: #401d2c;
  --bef-surface: var(--bef-paper);
  --bef-accent-text-mix: 30%;
  background: var(--bef-paper);
  color: var(--bef-ink);
  color-scheme: dark;
}
.bef-site-footer :is(.bef-footer-brand p,.bef-footer-links a,.bef-footer-links button,.bef-logo-tagline),
.bef-site-footer .bef-newsletter p { color: var(--bef-muted); }
.bef-site-footer .bef-newsletter label { color: var(--bef-ink); }
.bef-site-footer .bef-newsletter :is(input,button) { max-width: 100%; }
.bef-site-footer .bef-footer-bottom { background: var(--bef-field-bg); color: var(--bef-muted); border-color: var(--bef-line); }
.bef-footer-bottom > .bef-container { flex-wrap: wrap; }
.bef-footer-links :is(a,button) { overflow-wrap: anywhere; }

/* Service cards use semantic state colours instead of a fixed light/pink surface. */
.bef-pharmacy-icon { background: var(--bef-danger-bg); color: var(--bef-danger); border-color: color-mix(in srgb,var(--bef-danger) 40%,var(--bef-paper)); flex-shrink: 0; }
.bef-ribbon-weather > svg { color: var(--bef-warning); }
.bef-local-shortcuts > a > svg:first-child { color: var(--bef-accent-text); }
.bef-service-symbol { flex-shrink: 0; }
.bef-service-heading > div,
.bef-pharmacy-top > div,
.bef-service-event,
.bef-service-values :is(dt,dd),
.bef-weather-forecast > div { min-width: 0; overflow-wrap: anywhere; }
.bef-service-values > div { align-items: baseline; flex-wrap: wrap; gap: 5px 12px; }
.bef-service-values dt { flex: 1 1 90px; }
.bef-service-values dd { flex: 0 1 auto; max-width: 100%; }
.bef-weather-forecast { flex-wrap: wrap; row-gap: 14px; }
.bef-weather-forecast > div { flex: 1 1 48px; }
.bef-service-card .bef-service-status { overflow-wrap: anywhere; }
.bef-pharmacy-links a { min-height: 32px; display: inline-flex; align-items: center; }
.bef-data-ribbon strong { overflow-wrap: anywhere; }

/* Preserve table semantics: block tables scroll inside their own figure. */
.bef-content .wp-block-table { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
.bef-content table { table-layout: auto; background: var(--bef-paper); color: var(--bef-ink); }
.bef-content :is(th,td) { overflow-wrap: anywhere; min-width: 0; }
.bef-content table:not(.has-background) th { background: var(--bef-soft); }
.bef-content .wp-block-table.is-style-stripes tbody tr:nth-child(odd) { background-color: var(--bef-soft); }
.bef-content :is(pre,code,kbd) { overflow-wrap: normal; }
.bef-content pre { max-width: 100%; }
.bef-content > table { display: block; max-width: 100%; overflow-x: auto; }

/* Avoid intrinsic flex/grid widths expanding the page on long Turkish headlines. */
:is(.bef-home,.bef-page-main,.bef-widget,.bef-site-footer)
:is(.bef-section-head,.bef-section-title,.bef-card-body,.bef-list-item > div,.bef-article-header,.bef-article-meta-author,.bef-author-box > div,.bef-author-profile > div,.bef-player-bottom > span,.bef-player-bottom > a,.bef-source-label,.bef-newsletter) {
  min-width: 0;
  overflow-wrap: anywhere;
}
.bef-section-head { flex-wrap: wrap; align-items: baseline; }
.bef-section-title { max-width: 100%; }
.bef-section-head .bef-more { max-width: 100%; white-space: normal; }
.bef-article-header h1,.bef-page-heading h1 { overflow-wrap: anywhere; }
.bef-player-bottom { flex-wrap: wrap; }
.bef-slide-content { max-height: calc(100% - 72px); overflow-y: auto; scrollbar-width: thin; padding-bottom: 2px; }
.bef-slide-content h3,.bef-slide-content .bef-card-title { overflow-wrap: anywhere; }
.bef-slider-status { max-width: calc(100% - 26px); }
.bef-slider-thumbs { min-width: 0; max-width: 100%; }
.bef-gallery figcaption > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.bef-gallery-controls { flex-wrap: wrap; }
.bef-gallery-nav a { min-width: 40px; min-height: 40px; }
.bef-lightbox { color-scheme: dark; }
.bef-lightbox-caption { overflow-wrap: anywhere; overscroll-behavior: contain; }
.bef-lightbox-stage { min-height: 120px; }
.bef-lightbox :is(.bef-lightbox-prev,.bef-lightbox-next,.bef-icon-button) { min-width: 44px; min-height: 44px; }
.bef-media-consent { overflow: auto; overscroll-behavior: contain; }
.bef-media-consent > div { flex-wrap: wrap; justify-content: center; }
.bef-media-consent p { color: var(--bef-media-text); overflow-wrap: anywhere; }
.bef-module-video,.bef-module-video_playlist,.bef-shorts-viewer,.bef-player { color-scheme: dark; }
body :is(.bef-module-video,.bef-module-video_playlist,.bef-shorts-viewer,.bef-lightbox,.bef-floating-bulletin) :focus-visible { outline-color: var(--bef-media-text); }
.bef-player-caption { max-height: calc(100% - 88px); overflow: hidden; }
.bef-player-caption h3 { overflow-wrap: anywhere; }
.bef-shorts-intro { flex-wrap: wrap; }

/* Compact player: the label stays in the accessibility tree without covering headlines. */
.bef-floating-bulletin {
  left: auto;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  max-width: calc(100vw - 32px);
  color-scheme: dark;
}
.bef-floating-launch {
  width: 48px;
  height: 48px;
  min-height: 48px;
  padding: 8px;
  justify-content: center;
  gap: 0;
  border-radius: 50%;
  background: var(--bef-media-panel);
  border-color: var(--bef-media-line);
}
.bef-floating-launch > span {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.bef-floating-panel { width: 355px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 96px); overflow-y: auto; overscroll-behavior: contain; background: var(--bef-media-panel); border-color: var(--bef-media-line); }
.bef-floating-title { color: var(--bef-media-text); overflow-wrap: anywhere; }
.bef-floating-heading > span,.bef-floating-time { color: var(--bef-media-muted); }
.bef-floating-heading button { min-width: 40px; width: 40px; min-height: 40px; height: 40px; }
@supports selector(body:has(.bef-floating-bulletin)) {
  @media (max-width: 767px) {
    body:has(.bef-floating-bulletin) { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  }
  body:has(.bef-primary-nav.is-open) .bef-floating-bulletin { visibility: hidden; pointer-events: none; }
}

@media (min-width: 701px) {
  .bef-nav-list { flex-wrap: wrap; }
  .bef-navigation-inner { align-items: flex-start; }
  .bef-nav-local { padding-block: 17px; }
}
@media (max-width: 950px) and (min-width: 701px) {
  .bef-nav-list { overflow: visible; }
  .bef-nav-list .sub-menu { position: absolute; }
}
@media (max-width: 700px) {
  .bef-primary-nav { max-height: min(65svh, calc(100svh - 150px)); overscroll-behavior-y: contain; }
  .bef-primary-nav .bef-nav-list > li > a { white-space: normal; overflow-wrap: anywhere; min-height: 44px; display: flex; align-items: center; }
  .bef-primary-nav .sub-menu a { min-height: 40px; display: flex; align-items: center; }
  .bef-utility-left { flex-wrap: wrap; gap: 3px 10px; min-width: 0; }
  .bef-utility-left a { min-width: 0; overflow-wrap: anywhere; }
  .bef-utility-right { flex-shrink: 0; }
  .bef-masthead :is(.bef-logo,.custom-logo-link) { min-width: 0; max-width: calc(100% - 96px); }
  .bef-logo-image img,.bef-masthead .custom-logo { max-width: 100%; object-fit: contain; }
  .bef-article-meta-author { min-width: 0; flex: 1 1 130px; }
  .bef-article-tools button { min-height: 40px; }
  .bef-archive-filters label { min-width: min(120px,100%); }
  .bef-bulletin-panels [role=tabpanel] { flex-wrap: wrap; }
  .bef-bulletin-panels a { white-space: normal; overflow-wrap: anywhere; }
  .bef-player-caption { max-height: calc(100% - 68px); }
  .bef-media-consent { justify-content: flex-start; padding-top: 18px; }
  .bef-media-consent :is(button,a) { min-height: 40px; }
  .bef-shorts-track,.bef-short-slide { min-height: min(440px,70svh); }
  .bef-floating-bulletin { left: auto; right: max(12px,env(safe-area-inset-right)); bottom: max(12px,env(safe-area-inset-bottom)); }
  .bef-floating-launch { width: 48px; height: 48px; min-height: 48px; padding: 8px; }
  .bef-floating-launch > .bef-icon { width: 28px; height: 28px; }
  .bef-floating-panel { width: 330px; }
}
@media (max-width: 480px) {
  .bef-home-sidebar > .bef-module-service,.bef-article-sidebar > .bef-module-service { grid-column: 1 / -1; }
  .bef-services-grid { grid-template-columns: minmax(0,1fr); }
  .bef-service-card .bef-service-values dd { font-size: 1rem; }
  .bef-content table { font-size: 13px; }
  .bef-content :is(th,td) { padding: 8px; }
  .bef-lightbox { padding: 12px 8px; }
  .bef-footer-bottom .bef-back-top { min-height: 40px; display: inline-flex; align-items: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bef-card-image,.bef-play-button,.bef-button { transition: none; }
  .bef-grid-carousel,.bef-slider-thumbs,.bef-stories,.bef-shorts-track { scroll-behavior: auto; scroll-snap-type: none; }
}
@media (forced-colors: active) {
  .bef-floating-launch,.bef-pharmacy-icon,.bef-service-card,.bef-card { border: 1px solid CanvasText; }
  .bef-community .bef-poll-result progress { border: 1px solid CanvasText; }
}
@media print {
  :root,html[data-theme] { color-scheme: light; --bef-paper: #fff; --bef-page: #fff; --bef-soft: #fff; --bef-ink: #111; --bef-muted: #333; }
  body:has(.bef-floating-bulletin) { padding-bottom: 0; }
}

/* Keep slider geometry independent from Elementor's generic image sizing. */
.bef-slider,
.bef-slider > .bef-slides,
.bef-slider > .bef-slides > .bef-slide { box-sizing: border-box; min-width: 0; width: 100%; max-width: 100%; }
.bef-slider .bef-slide-image > img { display: block; width: 100%; height: 100%; max-height: none; object-fit: cover; aspect-ratio: auto; }
/* Elementor writes its responsive height on .bef-slides. Its per-widget selector
   overrides this fallback; the visible slide must fill the selected height. */
.bef-widget .bef-slider > .bef-slides { height: 500px; min-height: 0; }
.bef-widget .bef-slider > .bef-slides > .bef-slide { height: 100%; min-height: 0; aspect-ratio: auto; }
@media (max-width: 767px) {
  .bef-widget .bef-slider > .bef-slides { height: 360px; }
  .bef-slider > .bef-slides > .bef-slider-arrow { top: 48px; bottom: auto; width: 40px; height: 40px; transform: none; }
  .bef-slider > .bef-slides > .bef-prev { left: 12px; right: auto; }
  .bef-slider > .bef-slides > .bef-next { right: 12px; left: auto; }
  .bef-slider > .bef-slides:has(> .bef-slider-arrow) .bef-slide-content { max-height: calc(100% - 126px); }
}
