/* FMhub theme styles. Brand: blue #005C91, green #28A745, mint #61CE70, amber #FFC107, Tajawal. */
:root{
  --fm-blue:#005C91; --fm-blue-deep:#003F66; --fm-green:#28A745; --fm-mint:#61CE70; --fm-amber:#FFC107;
  --fm-bg:#F6F9FB; --fm-surface:#FFFFFF; --fm-fg:#13212B; --fm-muted:#4F6371; --fm-line:#DCE5EB; --fm-chip:#E6F1F7;
}
body{ -webkit-font-smoothing:antialiased; margin:0 }
.wp-site-blocks > main, .wp-site-blocks > footer{ margin-block-start:0 }
.fmhub-footer a{ color:var(--fm-mint) }
a:focus-visible,button:focus-visible,input:focus-visible,textarea:focus-visible{ outline:3px solid var(--fm-amber); outline-offset:2px }

/* Header */
.wp-site-blocks > header{ position:sticky; top:0; z-index:50; box-shadow:0 1px 0 rgba(0,0,0,.15) }
.admin-bar .wp-site-blocks > header{ top:32px }
@media (max-width:782px){ .admin-bar .wp-site-blocks > header{ top:46px } }
.fmhub-header .fmhub-logo{ display:block }
.fmhub-nav a{ color:#fff; text-decoration:none; padding:6px 12px; border-radius:999px }
.fmhub-nav a:hover,.fmhub-nav .current-menu-item > a{ background:rgba(255,255,255,.16) }
.fmhub-nav .wp-block-navigation__responsive-container-open{ color:#fff }

/* Hero */
.fm-hero{ background:linear-gradient(160deg,var(--fm-blue) 0%,var(--fm-blue-deep) 100%); color:#fff }
.fm-hero .fm-eyebrow{ font-size:13px; letter-spacing:.14em; text-transform:uppercase; color:var(--fm-mint); font-weight:700; margin:0 }
.fm-hero h1{ color:#fff; text-wrap:balance; margin:.3em 0 .4em }
.fm-hero h1 em,.fm-hero h1 mark{ font-style:normal; color:var(--fm-amber); background:none }
.fm-hero p{ color:#D6E8F3 }
.fm-hero .fm-ar{ color:#EAF4FA; font-size:18px }
.fm-hero .wp-block-button.is-style-outline .wp-block-button__link{ color:#fff; border-color:rgba(255,255,255,.55); background:transparent }
.fm-book{ background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.2); border-radius:14px; padding:24px }
.fm-book .fm-tag{ display:inline-block; background:var(--fm-green); color:#fff; font-size:12px; font-weight:700; padding:3px 10px; border-radius:999px; letter-spacing:.05em; margin:0 }
.fm-book h2{ color:#fff }
.fm-book blockquote{ margin:14px 0 0; padding-inline-start:14px; border-inline-start:3px solid var(--fm-amber); color:#EAF4FA }
.fm-book cite{ display:block; font-style:normal; font-weight:700; color:var(--fm-mint) }

/* Sections */
.fm-section{ padding-block:64px }
.fm-sec-head{ display:flex; justify-content:space-between; align-items:baseline; gap:16px; flex-wrap:wrap; margin-bottom:24px }
.fm-sec-head h2{ margin:0 }
.fm-sec-head .fm-ar,.fm-rtl{ direction:rtl; text-align:right }
.fm-sec-head .fm-ar{ color:var(--fm-muted); font-size:1.2rem; font-weight:700; margin:0 }
.fm-card{ background:var(--fm-surface); border:1px solid var(--fm-line); border-radius:12px; padding:22px; min-width:0 }
.fm-card .fm-k{ font-size:12px; letter-spacing:.12em; text-transform:uppercase; color:var(--fm-green); font-weight:700; margin:0 0 4px }
.fm-card h3{ margin:0 0 6px; font-size:1.15rem }
.fm-card p{ color:var(--fm-muted); font-size:15.5px; margin:0 }
.fm-team{ display:flex; flex-wrap:wrap; gap:8px; list-style:none; padding:0; margin:0 }
.fm-team li{ background:var(--fm-chip); border-radius:999px; padding:6px 12px; font-size:14.5px }

/* Program rotations */
.fm-years{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px }
.fm-year{ background:var(--fm-surface); border:1px solid var(--fm-line); border-radius:12px; padding:18px; min-width:0 }
.fm-year h4{ margin:0 0 10px; color:var(--fm-blue) }
.fm-year ul{ list-style:none; margin:0; padding:0; display:grid; gap:6px }
.fm-year li{ display:flex; justify-content:space-between; gap:10px; font-size:15px; border-bottom:1px dashed var(--fm-line); padding-bottom:4px }
.fm-year li b{ font-variant-numeric:tabular-nums; white-space:nowrap }
.fm-wk{ display:flex; height:8px; border-radius:4px; overflow:hidden; margin:0 0 12px; background:var(--fm-chip) }
.fm-wk span{ display:block; height:100% }
.fm-note{ font-size:12px; color:var(--fm-muted) }
.fm-pill{ display:inline-block; background:var(--fm-chip); border-radius:999px; padding:2px 10px; font-size:13px; font-weight:700 }

/* Community + X */
.fm-community{ background:var(--fm-surface); border-block:1px solid var(--fm-line) }
.fm-x{ background:#0F1419; color:#E7E9EA; border-radius:12px; padding:20px }
.fm-x a{ color:#1D9BF0 }

/* Contact */
.fm-info .fm-card small{ display:block; color:var(--fm-muted); font-size:12px; letter-spacing:.1em; text-transform:uppercase; font-weight:700 }
.fm-info .fm-card .fm-v{ font-size:1.1rem; font-weight:700; color:var(--fm-fg); word-break:break-word }

@media (max-width:860px){
  .fm-years{ grid-template-columns:1fr }
}
@media (prefers-reduced-motion:no-preference){ html{ scroll-behavior:smooth } }

/* Forum (bbPress) in FMhub style */
#bbpress-forums{ font-size:15px; font-family:inherit }
#bbpress-forums ul.bbp-forums,#bbpress-forums ul.bbp-topics,#bbpress-forums ul.bbp-replies{ border:1px solid var(--fm-line); border-radius:12px; overflow:hidden; background:var(--fm-surface); font-size:15px }
#bbpress-forums li.bbp-header,#bbpress-forums li.bbp-footer{ background:var(--fm-chip); border-color:var(--fm-line); font-weight:700; color:var(--fm-fg) }
#bbpress-forums li.bbp-body ul.forum,#bbpress-forums li.bbp-body ul.topic{ border-top:1px solid var(--fm-line); padding:14px 12px }
#bbpress-forums .bbp-forum-title{ font-size:1.05rem; font-weight:700; color:var(--fm-blue); text-decoration:none }
#bbpress-forums .bbp-forum-content{ color:var(--fm-muted); font-size:14px; margin-top:4px }
#bbpress-forums div.bbp-breadcrumb,#bbpress-forums div.bbp-search-form{ font-size:14px; margin-bottom:10px }
#bbpress-forums #bbp-search-form input[type=text]{ border:1px solid var(--fm-line); border-radius:8px; padding:6px 10px }
#bbpress-forums button,#bbpress-forums input[type=submit]{ background:var(--fm-amber); border:0; border-radius:8px; padding:6px 14px; font-weight:700; cursor:pointer }
#bbpress-forums li.bbp-footer:empty{ display:none }

/* v1.1: E-book nav tab */
.fmhub-nav .fm-nav-ebook > a,.fmhub-nav .fm-nav-ebook a.wp-block-navigation-item__content{ background:var(--fm-amber); color:#13212B !important; font-weight:700; box-shadow:0 2px 0 rgba(0,0,0,.18) }
.fmhub-nav .fm-nav-ebook > a:hover,.fmhub-nav .fm-nav-ebook a.wp-block-navigation-item__content:hover{ background:#FFD54F }
.fmhub-nav .fm-nav-ebook a::before{ content:"📖"; margin-inline-end:6px }

/* E-book card */
.fm-book-cover{ display:block; margin:-8px -8px 16px; border-radius:10px; overflow:hidden; background:#1c1c1c; transition:transform .2s }
.fm-book-cover:hover{ transform:translateY(-2px) }
.fm-book-cover img{ display:block; width:100%; height:auto }
.fm-btn-amber .wp-block-button__link{ background:var(--fm-amber); color:#13212B; font-weight:700 }
.fm-book .wp-block-buttons{ margin-top:18px }

/* Scientific committee */
.fm-team-title{ display:flex; gap:12px; align-items:baseline; flex-wrap:wrap; margin-top:40px }
.fm-team-title span{ color:var(--fm-muted); font-size:.9em }
.fm-members{ list-style:none; margin:16px 0 0; padding:0; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px }
.fm-member{ position:relative; background:var(--fm-surface); border:1px solid var(--fm-line); border-radius:14px; overflow:hidden; display:flex; flex-direction:column; transition:transform .2s, box-shadow .2s }
.fm-member:hover{ transform:translateY(-3px); box-shadow:0 10px 24px rgba(0,63,102,.12) }
.fm-member figure{ margin:0; aspect-ratio:4/5; background:var(--fm-chip); overflow:hidden }
.fm-member img{ width:100%; height:100%; object-fit:cover; object-position:50% 20%; display:block }
.fm-member h4{ margin:12px 14px 2px; font-size:1.02rem; color:var(--fm-fg) }
.fm-member p{ margin:0 14px; font-size:13.5px; line-height:1.4 }
.fm-member .fm-role{ color:var(--fm-blue); font-weight:700 }
.fm-member .fm-sub{ color:var(--fm-muted) }
.fm-member .fm-meta{ margin:8px 14px 14px; color:var(--fm-muted); font-size:12.5px; padding-top:8px; border-top:1px dashed var(--fm-line) }
.fm-mbody > p:last-child{ margin-bottom:14px }
.fm-member.is-founder{ grid-column:span 2; flex-direction:row; border-color:var(--fm-blue); background:linear-gradient(160deg,#fff 55%,var(--fm-chip)) }
.fm-member.is-founder figure{ flex:0 0 46%; aspect-ratio:auto }
.fm-mbody{ display:flex; flex-direction:column; flex:1 }
.fm-member.is-founder h4{ margin-top:44px; font-size:1.25rem }
.fm-badge{ position:absolute; top:12px; inset-inline-end:12px; background:var(--fm-green); color:#fff; font-size:11px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; padding:3px 10px; border-radius:999px }

/* X feed */
.fm-xfeed{ display:grid; grid-template-columns:300px minmax(0,1fr); gap:20px; align-items:start }
.fm-xprofile{ background:#0F1419; color:#E7E9EA; border-radius:16px; padding:22px; position:sticky; top:88px }
.fm-xprofile > img{ width:64px; height:64px; border-radius:50%; background:#fff; object-fit:contain; padding:6px; float:left; margin-inline-end:12px }
.fm-xprofile > div b{ display:block; font-size:1.1rem; padding-top:8px }
.fm-xprofile > div span{ color:#8B98A5; font-size:14px }
.fm-xprofile p{ clear:both; margin:14px 0 0; font-size:14.5px; color:#C9D1D9; line-height:1.5 }
.fm-xprofile .fm-xstats{ color:#8B98A5 } .fm-xprofile .fm-xstats b{ color:#fff }
.fm-xfollow{ display:inline-flex; gap:8px; align-items:center; margin-top:16px; background:#fff; color:#0F1419 !important; font-weight:700; text-decoration:none; padding:9px 16px; border-radius:999px }
.fm-xfollow:hover{ background:#E7E9EA }
.fm-posts{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px }
.fm-post{ display:flex; flex-direction:column; gap:10px; background:var(--fm-surface); border:1px solid var(--fm-line); border-radius:16px; padding:18px; color:var(--fm-fg) !important; text-decoration:none; transition:border-color .2s, transform .2s, box-shadow .2s }
.fm-post:hover{ border-color:#1D9BF0; transform:translateY(-2px); box-shadow:0 8px 20px rgba(15,20,25,.08) }
.fm-post-head{ display:flex; gap:10px; align-items:center }
.fm-post-head img{ width:36px; height:36px; border-radius:50%; background:#fff; border:1px solid var(--fm-line); object-fit:contain; padding:3px }
.fm-post-head > span{ display:flex; flex-direction:column; line-height:1.2; flex:1 }
.fm-post-head small{ color:var(--fm-muted); font-size:12.5px }
.fm-post-head svg{ color:#0F1419 }
.fm-post-text{ font-size:15px; line-height:1.55 }
.fm-post-text em{ font-style:normal; color:#1D9BF0 }
.fm-post-cta{ margin-top:auto; font-size:13px; font-weight:700; color:var(--fm-blue) }
.fm-cta-band{ margin-top:28px; background:var(--fm-chip); border-radius:14px; padding:18px 22px; gap:16px }
.fm-cta-band p{ margin:0 }

@media (max-width:1000px){
  .fm-members{ grid-template-columns:repeat(3,minmax(0,1fr)) }
  .fm-xfeed{ grid-template-columns:1fr } .fm-xprofile{ position:static }
}
@media (max-width:700px){
  .fm-members{ grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px }
  .fm-member.is-founder{ flex-direction:column } .fm-member.is-founder figure{ aspect-ratio:4/5 } .fm-member.is-founder h4{ margin-top:12px }
  .fm-posts{ grid-template-columns:1fr }
}
/* v1.1 tweaks */
.fm-member figure{ aspect-ratio:1/1 }
.fm-member img{ object-position:50% 15% }
.fm-member.is-founder .fm-mbody{ justify-content:center; padding:24px 8px }
.fm-member.is-founder h4{ margin-top:0 }
.fm-xprofile{ position:static }
@media (max-width:700px){ .fm-member.is-founder figure{ aspect-ratio:1/1 } .fm-member.is-founder .fm-mbody{ padding:0 } .fm-member.is-founder h4{ margin-top:12px } }
/* v1.2: X feed with media, profile banner on top, 2-column masonry */
.fm-xfeed{ display:block }
.fm-xprofile{ display:grid; grid-template-columns:64px 1fr auto; grid-template-areas:"av name follow" "av bio follow"; column-gap:16px; row-gap:4px; align-items:center; margin-bottom:20px }
.fm-xprofile > img{ grid-area:av; float:none; margin:0 }
.fm-xprofile > div{ grid-area:name } .fm-xprofile > div b{ display:inline; padding:0; margin-inline-end:8px }
.fm-xprofile p{ grid-area:bio; margin:0; clear:none }
.fm-xprofile p.fm-xstats{ display:none }
.fm-xfollow{ grid-area:follow; margin:0 }
.fm-posts{ display:block; columns:2; column-gap:18px }
.fm-post{ break-inside:avoid; margin:0 0 18px; display:flex }
.fm-post:hover{ transform:none }
.fm-post-head{ color:inherit; text-decoration:none }
.fm-post-text{ margin:0; white-space:normal; overflow-wrap:anywhere }
.fm-post-media{ display:grid; gap:4px; border-radius:14px; overflow:hidden; margin:2px -4px 0; background:#0F1419 }
.fm-post-media.n2,.fm-post-media.n4{ grid-template-columns:1fr 1fr }
.fm-post-media.n3{ grid-template-columns:1fr 1fr } .fm-post-media.n3 > :first-child{ grid-row:span 2 }
.fm-post-media img,.fm-post-media video{ display:block; width:100%; height:100%; max-height:640px; object-fit:cover; background:#0F1419 }
.fm-post-media.n1 img,.fm-post-media.n1 video{ object-fit:contain; height:auto }
.fm-post-media.n2 img,.fm-post-media.n3 img,.fm-post-media.n4 img{ aspect-ratio:1/1 !important }
.fm-post-cta{ text-decoration:none }
@media (max-width:1000px){ .fm-xfeed{ display:block } }
@media (max-width:700px){
  .fm-posts{ columns:1 }
  .fm-xprofile{ grid-template-columns:52px 1fr; grid-template-areas:"av name" "bio bio" "follow follow" }
  .fm-xprofile > img{ width:52px; height:52px }
  .fm-xfollow{ justify-self:start; margin-top:8px }
  .fm-post{ padding:14px } .fm-post-media{ margin:2px -14px 0; border-radius:0 }
}
/* v1.2 phone polish */
@media (max-width:700px){
  .fm-section{ padding-block:36px }
  .fm-member.is-founder figure{ flex:none; aspect-ratio:4/3 }
  .fm-member.is-founder .fm-mbody{ padding:0; justify-content:flex-start }
  .fm-member p{ margin:0 10px; font-size:12.5px } .fm-member h4{ margin:10px 10px 2px; font-size:.95rem } .fm-member .fm-meta{ margin:6px 10px 10px }
  .wp-site-blocks main > .wp-block-post-content{ padding-top:24px }
}
/* v1.3: bigger, crisper logo that links home */
.fmhub-logo-link{ display:inline-flex; align-items:center; line-height:0 }
.fmhub-header .fmhub-logo{ height:68px !important; width:auto; image-rendering:auto; filter:drop-shadow(0 1px 1px rgba(0,0,0,.25)) }
.fmhub-header .fmhub-logo-link:hover .fmhub-logo{ opacity:.92 }
@media (max-width:700px){ .fmhub-header .fmhub-logo{ height:52px !important } }