/* News list + article (Figma 295:7412, 295:9313). Tokens only (samf-tokens.css); logical properties only (RTL safe). */
.samf-news, .samf-news-detail {
  --_glass: rgba(0, 0, 0, .5);
  --_hairline: rgba(255, 255, 255, .35);
  --_ink: rgb(1, 1, 1);                        /* Figma "black" 010101: field text on the white inputs */
  --_black: var(--samf-figma-black);
  --_outline: rgb(64, 243, 148);                    /* Figma outline badge stroke (40F394, one step off Light Green) */
  --_field-bg: var(--samf-color-on-dark);
  --_field-text: var(--_ink);
  --_hero-top: 155px;
  /* Figma family name first (TOKEN REQUEST: --samf-font-figma), then our self-hosted chain until the licensed files arrive */
  --_f: var(--samf-font-display);
  color: var(--samf-color-text);
  font-family: var(--_f);
  font-size: var(--samf-fs-body);
}
.samf-news a:focus-visible, .samf-news input:focus-visible, .samf-news button:focus-visible,
.samf-news-detail a:focus-visible, .samf-news-detail button:focus-visible {
  outline: 3px solid var(--samf-color-focus);
  outline-offset: 2px;
}
.samf-news, .samf-news-detail { position: relative; }
.samf-news__crumb, .samf-galleries__crumb { position: absolute; inset-block-start: 0; inset-inline: 0; z-index: 2; }
.samf-news__wrap { max-inline-size: 1500px; margin-inline: auto; padding-inline: 40px; }

/* Page header (370px, title bottom-aligned, dark gradient) */
.samf-news__hero, .samf-news-detail__hero-band {
  box-sizing: border-box; display: flex; align-items: flex-end;
  min-block-size: 370px;
  padding-block: var(--_hero-top) 80px;
  background: linear-gradient(to top, rgba(3, 3, 3, .8), rgba(27, 30, 4, 0));
}
.samf-news__hero > .samf-news__wrap, .samf-news-detail__hero-band > .samf-news__wrap { inline-size: 100%; }
.samf-news__title, .samf-news-detail__section-label {
  font-family: var(--_f);
  font-weight: 500;
  font-size: 64px;
  line-height: 68px;
  letter-spacing: -.02em;
  margin: 0;
  color: var(--samf-color-text);
}
:lang(ar) .samf-news__title, :lang(ar) .samf-news-detail__title, :lang(ar) .samf-news-detail__section-label { letter-spacing: 0; }
.samf-news__main { padding-block: 80px; }

/* Search / date filter panel */
.samf-news__panel {
  display: grid; gap: 24px;
  background: var(--_glass);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-radius: 32px;
  padding: 32px;
  margin-block-end: 40px;
}
.samf-news__filters { display: flex; align-items: center; gap: 16px; }
.samf-news__filters, .samf-news__input, .samf-news__btn, .samf-news__tag, .samf-news__page { font-family: var(--_f); }
.samf-news__field { display: flex; flex-direction: column; gap: .375rem; min-width: 0; }
.samf-news__field--q { flex: 1 1 auto; }
.samf-news__label { font-size: var(--samf-fs-body); font-weight: 600; color: var(--samf-color-text); }
.samf-news__input {
  min-inline-size: 0;
  min-height: 48px;
  background: var(--_field-bg);
  color: var(--_field-text);
  border: 0;
  border-radius: 8px;
  padding-inline: 12px;
  font: inherit;
  color-scheme: light;
}
.samf-news__input::placeholder { color: var(--_field-text); opacity: .65; }
/* keyword label is replaced by the placeholder visually; stays for assistive tech */
.samf-news__field--q .samf-news__label {
  position: absolute; inline-size: 1px; block-size: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.samf-news__dates {
  display: flex; align-items: center; gap: 16px;
  background: var(--_field-bg); color: var(--_field-text);
  border-radius: 8px; padding: 12px; min-block-size: 48px; box-sizing: border-box;
}
.samf-news__field--date { flex-direction: row; align-items: center; gap: 8px; }
.samf-news__field--date + .samf-news__field--date { border-inline-start: 1px solid var(--samf-color-border-strong); padding-inline-start: 16px; margin-inline-start: 0; }
.samf-news__dates { gap: 16px; }
.samf-news__field--date .samf-news__label { color: var(--_field-text); font-weight: 300; font-size: 14px; line-height: 20px; }
.samf-news__field--date .samf-news__input { min-height: 24px; block-size: 24px; padding: 0 4px; background: transparent; font-size: 14px; line-height: 20px; }
.samf-news__icon { flex: none; color: var(--_field-text); }
.samf-news__actions { display: flex; flex-wrap: wrap; gap: .75rem; flex: none; }
.samf-news__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 2.75rem; min-width: 2.75rem;
  padding: 15px 20px;
  border-radius: 8px;
  font-size: 14px; line-height: 20px;
  font-weight: 600; text-decoration: none; cursor: pointer;
  border: 0;
  box-shadow: inset 0 0 0 1px var(--samf-color-primary);
}
.samf-news__btn--primary { background: var(--samf-color-primary); color: var(--samf-palette-charcoal); box-shadow: none; }
.samf-news__btn--primary:hover { background: var(--samf-color-primary-hover); }
.samf-news__btn--ghost { background: transparent; color: var(--samf-color-primary); }
@media (forced-colors: active) { .samf-news__btn { border: 1px solid ButtonText; } }
.samf-news__btn--ghost:hover { background: var(--samf-color-surface); }
.samf-news__arrow, .samf-news__chev { flex: none; }
[dir="rtl"] .samf-news__arrow, [dir="rtl"] .samf-news__chev { transform: scaleX(-1); }
.samf-news__count { color: var(--samf-color-muted); margin-block-end: 1rem; }

/* Category tags */
.samf-news__tags { display: flex; flex-wrap: wrap; gap: 12px; }
.samf-news__tag {
  display: inline-flex; align-items: center; min-height: 2.75rem;
  padding: 6px 10px;
  border-radius: 20px;
  border: 0;
  box-shadow: inset 0 0 0 1px var(--_outline);
  color: var(--samf-color-primary); text-decoration: none; font-weight: 400; font-size: var(--samf-fs-small); line-height: 16px;
}
@media (min-width: 1025px) { .samf-news__tag { min-height: 0; } }   /* Figma badge is 28px; 44px hit area stays on touch widths */
@media (forced-colors: active) { .samf-news__tag { border: 1px solid ButtonText; } }
.samf-news__tag:hover { background: var(--samf-color-surface); }
.samf-news__tag--active, .samf-news__tag--active:hover { background: var(--samf-color-primary); color: var(--_black); box-shadow: none; }

/* Cards */
.samf-news__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; list-style: none; padding: 0; margin: 0; }
.samf-news__card {
  position: relative; display: flex; flex-direction: column; height: 100%;
  background: rgba(255, 255, 255, .01);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-radius: 8px;
  overflow: hidden;
}
.samf-news__media { position: relative; aspect-ratio: 376 / 251; border-radius: 8px; overflow: hidden; }
.samf-news__image { inline-size: 100%; block-size: 100%; object-fit: cover; display: block; }
.samf-news__image--placeholder { background: var(--samf-color-services); }
.samf-news__card:hover .samf-news__image { transform: scale(1.03); }
.samf-news__image { transition: transform .3s ease; }
.samf-news__body { display: flex; flex-direction: column; gap: 4px; padding: 16px; flex: 1; }
.samf-news__badge {
  position: absolute; inset-block-start: 16px; inset-inline-start: 16px;
  padding: 6px 10px; border-radius: 20px;
  background: var(--samf-color-on-dark); color: var(--_black);
  font-size: var(--samf-fs-small); font-weight: 400; line-height: 16px; text-decoration: none;
}
.samf-news__card-title { font-family: var(--_f); font-weight: 300; font-size: var(--samf-fs-body); line-height: 20px; margin: 0; }
.samf-news__card-title a { color: inherit; text-decoration: none; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.samf-news__card-title a::after { content: ""; position: absolute; inset: 0; }
.samf-news__excerpt { display: none; }
.samf-news__meta { order: -1; color: var(--samf-color-performance); font-size: var(--samf-fs-small); line-height: 16px; margin: 0; unicode-bidi: isolate; }

/* Empty / no-results state (own design) */
.samf-news__empty {
  text-align: center;
  background: var(--_glass);
  border: 1px dashed var(--samf-color-border-strong);
  border-radius: 32px;
  padding: clamp(2rem, 6vw, 4rem) 1.5rem;
}
.samf-news__empty-title { font-family: var(--samf-font-display); font-size: var(--samf-fs-h5); margin-block-end: 1.5rem; }

/* Pagination: 32px circles */
.samf-news__pages { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; list-style: none; padding: 0; margin-block: 40px 0; }
.samf-news__page {
  display: inline-flex; align-items: center; justify-content: center;
  min-inline-size: 32px; min-block-size: 32px; padding: 4px;
  border-radius: 40px;
  border: 1px solid var(--samf-color-text);
  color: var(--samf-color-text); text-decoration: none; font-weight: 400; font-size: var(--samf-fs-small); line-height: 16px;
}
.samf-news__page:hover { border-color: var(--samf-color-primary); color: var(--samf-color-primary); }
.samf-news__page[aria-current="page"] { border-color: var(--samf-color-primary); color: var(--samf-color-primary); }
.samf-news__page[aria-disabled="true"] { opacity: .3; pointer-events: none; }
@media (pointer: coarse) { .samf-news__page { min-inline-size: 44px; min-block-size: 44px; } }

/* ---------- Article ---------- */
.samf-news-detail { padding-block-end: 0; }
.samf-news-detail__wrap { max-inline-size: 1180px; margin-inline: auto; padding-inline: 40px; display: grid; gap: 40px; padding-block: 80px; box-sizing: border-box; }
.samf-news-detail__back { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--samf-color-primary); text-decoration: none; font-weight: 600; justify-self: start; }
.samf-news-detail__header { display: grid; gap: 24px; justify-items: start; }
.samf-news-detail__title {
  font-family: var(--_f); font-weight: 600; font-size: 46px; line-height: 50px; letter-spacing: 0; margin: 0;
  color: var(--samf-color-text); min-inline-size: 100%;
}
.samf-news-detail__meta {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 16px;
  background: var(--_glass); border-radius: 8px; padding: 8px;
  color: var(--samf-color-text); font-size: var(--samf-fs-small); font-weight: 400; line-height: 16px; margin: 0; unicode-bidi: isolate;
}
.samf-news-detail__meta-item { display: inline-flex; align-items: center; gap: 8px; }
.samf-news-detail__meta-item svg { flex: none; }
.samf-news-detail__meta a { color: inherit; text-decoration: none; }
.samf-news-detail__hero { margin: 0; }
.samf-news-detail__image { inline-size: 100%; aspect-ratio: 1180 / 664; object-fit: cover; border-radius: 16px; display: block; }
.samf-news-detail__quote {
  border-inline-start: 3px solid var(--samf-color-performance);
  padding-inline-start: 40px; margin: 0;
  font-size: 1rem; line-height: 26px; font-weight: 400; color: var(--samf-color-text);
}
.samf-news-detail__quote p { margin: 0; }
.samf-news-detail__body { font-size: var(--samf-fs-body); font-weight: 300; line-height: 20px; }
.samf-news-detail__body > :first-child { font-weight: 600; }
.samf-news-detail__body p { margin-block: 0 20px; }
.samf-news-detail__body h2, .samf-news-detail__body h3, .samf-news-detail__body h4 { font-family: var(--_f); font-size: var(--samf-fs-body); line-height: 20px; font-weight: 600; color: var(--samf-color-performance); margin-block: 0 4px; }
.samf-news-detail__body img { max-inline-size: 100%; height: auto; border-radius: 16px; }
.samf-news-detail__body a { color: var(--samf-color-primary); }
.samf-news-detail__share {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  border-block-start: 1px solid var(--_hairline); padding-block-start: 24px;
}
.samf-news-detail__share-title { font-family: var(--_f); font-size: 1rem; line-height: 22px; font-weight: 700; margin: 0; }
.samf-news-detail__share-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.samf-news-detail__share-row { justify-content: flex-end; }
.samf-news-detail__icon {
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
  inline-size: 35px; block-size: 35px; padding: 10px; border-radius: 20px; flex: none;
  border: 1.5px solid var(--samf-color-text); color: var(--samf-color-text); background: rgba(0, 0, 0, .01);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); text-decoration: none; cursor: pointer;
}
.samf-news-detail__icon svg { inline-size: 100%; block-size: 100%; display: block; }
.samf-news-detail__icon:hover { border-color: var(--samf-color-primary); color: var(--samf-color-primary); }
.samf-news-detail__icon[hidden] { display: none; }
@media (max-width: 1024px) { .samf-news-detail__icon { inline-size: 44px; block-size: 44px; padding: 14px; } }

/* Related news: light band, 4-up */
.samf-news-detail__related { background: var(--samf-color-on-dark); color: var(--samf-color-surface); padding-block: 80px; }
.samf-news-detail__related-inner { max-inline-size: 1500px; margin-inline: auto; padding-inline: 40px; display: grid; gap: 40px; }
.samf-news-detail__related-title {
  font-family: var(--samf-font-display); font-size: clamp(1.75rem, 1.2rem + 2vw, 2.875rem); line-height: 1.09; margin: 0;
  display: flex; flex-wrap: wrap; gap: 4px 12px; font-weight: 300; color: var(--samf-color-surface);
}
.samf-news-detail__related-title strong { font-weight: 600; color: var(--samf-color-performance); }
html:not(:lang(ar)) .samf-news-detail__related-title { text-transform: uppercase; }
.samf-news-detail__related .samf-news__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.samf-news-detail__related .samf-news__card-title { color: var(--samf-color-surface); }
.samf-news-detail__related .samf-news__meta { color: var(--samf-color-performance); }

/* Tablet 1024 */
@media (max-width: 1024px) {
  .samf-news__field--date .samf-news__input { min-height: 44px; block-size: 44px; }
  .samf-news__grid, .samf-news-detail__related .samf-news__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .samf-news__filters { flex-wrap: wrap; }
  .samf-news__field--q { flex: 1 1 100%; }
  .samf-news__wrap, .samf-news-detail__wrap, .samf-news-detail__related-inner { padding-inline: 24px; }
  .samf-news__title { font-size: 48px; line-height: 52px; }
}
/* Mobile 375 */
@media (max-width: 640px) {
  .samf-news, .samf-news-detail { --_hero-top: 110px; }
  .samf-news__hero { min-block-size: 240px; padding-block-end: 40px; }
  .samf-news__title { font-size: 36px; line-height: 40px; }
  .samf-news__grid, .samf-news-detail__related .samf-news__grid { grid-template-columns: minmax(0, 1fr); }
  .samf-news__panel { padding: 16px; border-radius: 24px; }
  .samf-news__main { padding-block-start: 40px; }
  .samf-news__page { min-inline-size: 44px; min-block-size: 44px; }
  .samf-news__filters { flex-direction: column; align-items: stretch; }
  .samf-news__dates { flex-direction: column; align-items: stretch; gap: 0; padding-inline: 12px; }
  .samf-news__field--date { inline-size: 100%; }
  .samf-news__field--date + .samf-news__field--date { border-inline-start: 0; padding-inline-start: 0; border-block-start: 1px solid var(--samf-color-border-strong); }
  .samf-news__field--date .samf-news__input { flex: 1 1 0; inline-size: 0; min-inline-size: 0; }
  .samf-news__filters > *, .samf-news__panel { min-inline-size: 0; max-inline-size: 100%; }
  .samf-news__actions .samf-news__btn { flex: 1; }
  .samf-news__wrap, .samf-news-detail__wrap, .samf-news-detail__related-inner { padding-inline: 16px; }
  .samf-news-detail__quote { padding-inline-start: 20px; }
  .samf-news-detail__related { padding-block: 48px; }
}
@media (prefers-reduced-motion: reduce) { .samf-news *, .samf-news-detail * { transition: none !important; } }
@media (max-width: 375px) {
  .samf-news__panel { padding: 12px; }
  .samf-news img, .samf-news-detail img { max-inline-size: 100%; block-size: auto; }
  .samf-news__image { block-size: 100%; }
}

/* 1105: mobile filter panel stacks (search, dates, button); the 1024 flex-basis:100% made the search field tall in a column */
@media (max-width: 640px) {
  .samf-news__filters { display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
  .samf-news__filters > .samf-news__field--q, .samf-news__filters > .samf-news__dates, .samf-news__filters > .samf-news__actions { flex: 0 0 auto; inline-size: 100%; box-sizing: border-box; }
  .samf-news__field--q .samf-news__input { inline-size: 100%; }
}

/* 1105: article breadcrumb sits inside .samf-news-detail (positioned below the header) and long titles are truncated */
.samf-news__crumb .samf-breadcrumb__list { flex-wrap: nowrap; min-inline-size: 0; }
.samf-news__crumb .samf-breadcrumb__item:last-child { min-inline-size: 0; }
.samf-news__crumb .samf-breadcrumb__current { display: block; max-inline-size: min(60ch, 60vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 1105: article title scales down (Figma mobile 24/28, 46 would wrap to 9 lines in Arabic at 375) */
@media (max-width: 1024px) { .samf-news-detail__title { font-size: 34px; line-height: 40px; } }
@media (max-width: 640px) { .samf-news-detail__title { font-size: 26px; line-height: 32px; overflow-wrap: anywhere; } }

/* 1105: native date mask kept visible (hiding it by [value=""] also hid picked dates; a11y review) */

/* 1105: hide the native calendar glyph on desktop too (it duplicated the custom icon); the whole field stays clickable */
.samf-news__field--date { position: relative; }
.samf-news__field--date .samf-news__input::-webkit-calendar-picker-indicator { opacity: 0; position: absolute; inset: 0; inline-size: 100%; block-size: 100%; margin: 0; cursor: pointer; }

/* 1105: mobile matches Figma 789:27673 - search full row, From|To and the Search button share one row, tags scroll in a single row */
@media (max-width: 640px) {
  .samf-news__filters { flex-direction: row; flex-wrap: wrap; align-items: stretch; gap: 12px; }
  .samf-news__filters > .samf-news__field--q { flex: 1 1 100%; inline-size: 100%; }
  .samf-news__filters > .samf-news__dates { flex: 1 1 0; inline-size: auto; min-inline-size: 0; flex-direction: row; align-items: center; gap: 8px; padding-inline: 8px; }
  .samf-news__filters > .samf-news__actions { flex: 0 0 auto; inline-size: auto; }
  .samf-news__field--date { inline-size: auto; flex: 1 1 0; min-inline-size: 0; gap: 4px; }
  .samf-news__field--date + .samf-news__field--date { border-block-start: 0; border-inline-start: 1px solid var(--samf-color-border-strong); padding-inline-start: 8px; }
  .samf-news__field--date .samf-news__input { flex: 1 1 0; inline-size: 0; min-inline-size: 0; padding: 0; }
  .samf-news__field--date .samf-news__input::-webkit-calendar-picker-indicator { opacity: 0; position: absolute; inset: 0; inline-size: 100%; block-size: 100%; margin: 0; }
  .samf-news__field--date { position: relative; }
  .samf-news__actions .samf-news__btn { flex: none; }
  .samf-news__tags { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .samf-news__tag { flex: none; white-space: nowrap; }
}

/* 1105: article mobile - label and title sit close together under the header (Figma 797:33595) */
@media (max-width: 640px) {
  .samf-news-detail__hero-band { min-block-size: 180px; padding-block-end: 24px; }
  .samf-news-detail__wrap { padding-block-start: 32px; gap: 24px; }
}

/* ---------- visual-fix-1108 (G4): news list and article measured against Figma 295:7412 / 295:9313 / 789:27673 / 797:33595 ---------- */
/* The Figma frame has the pill header floating OVER the 370px page header (title bottom at y=290). Here the header is sticky and in the flow, so the whole page
   started 125px (100px below 1400) too low. The page header pulls up by the header's own height; flow-root keeps the breadcrumb right below the header. */
.samf-news, .samf-news-detail { display: flow-root; --_header-h: 100px; }
@media (min-width: 1400px) { .samf-news, .samf-news-detail { --_header-h: 125px; } }
.samf-news__hero, .samf-news-detail__hero-band { margin-block-start: calc(-1 * var(--_header-h)); }
/* Figma gradient runs the other way: darkest (0.8) at the top under the header, transparent at the title (dark theme only; the light theme keeps its own) */
html:not([data-theme="light"]) .samf-news__hero, html:not([data-theme="light"]) .samf-news-detail__hero-band { background: linear-gradient(to bottom, rgba(3, 3, 3, .8), rgba(27, 30, 4, 0)); }
/* Figma card text is not clamped (4 lines at 375, 3-4 on desktop); keep a 4-line guard for very long titles */
.samf-news__card-title a { -webkit-line-clamp: 4; line-clamp: 4; }
/* the <img> carries height="675" which beat the 1180/664 aspect ratio (675px tall instead of 619px at 1100 wide) */
.samf-news-detail__image { block-size: auto; }
/* Figma 432:10622: the bold lead paragraph is its own block, 40px above the light text block (site had the 20px paragraph gap) */
.samf-news-detail__body > :first-child:not(:only-child) { margin-block-end: 40px; }
/* Figma 432:10627 "img with caption": 16:9 image radius 16, 16px, 12/16 caption at 60% white, 40px to the next block; headings sit flush on their text (gap 0) */
.samf-news-detail__body figure { margin: 40px 0; display: grid; gap: 16px; }
.samf-news-detail__body figure img { inline-size: 100%; block-size: auto; aspect-ratio: 1180 / 664; object-fit: cover; border-radius: 16px; display: block; }
.samf-news-detail__body figcaption { font-size: 12px; line-height: 16px; font-weight: 400; color: color-mix(in srgb, var(--samf-color-text) 60%, transparent); }
.samf-news-detail__body h2, .samf-news-detail__body h3, .samf-news-detail__body h4 { margin-block-end: 0; }
.samf-news-detail__share-title { letter-spacing: -.02em; }
@media (max-width: 1024px) { .samf-news-detail__section-label { font-size: 48px; line-height: 52px; } }
/* Mobile Figma: page header 230px (header 100 included, title 32/36 on the bottom edge), 20px page padding, filter panel radius 16 / padding 20 */
@media (max-width: 640px) {
  .samf-news, .samf-news-detail { --_hero-top: 120px; }
  .samf-news__hero, .samf-news-detail__hero-band { min-block-size: 230px; padding-block-end: 0; }
  .samf-news__title, .samf-news-detail__section-label { font-size: 32px; line-height: 36px; }
  .samf-news__wrap, .samf-news-detail__wrap, .samf-news-detail__related-inner { padding-inline: 20px; }
  .samf-news__panel { padding: 20px; border-radius: 16px; }
}
