/* Team cards - FSOL. Uses the site palette (styles.css variables) with safe fallbacks. */
.tm-page{
  --tm-green:      var(--first-color, #3e6a55);
  --tm-green-dark: var(--first-color-alt, #355e4a);
  --tm-yellow:     #fbf456;                 /* the FSOL logo / carousel yellow */
  --tm-text:       #2c3a32;                 /* dark enough to read on the light card */
  --tm-card:       #e8f2cb;                 /* a lighter tint of the page green (#d2e497) */
  max-width: 1080px;
  margin: 0 auto;
  padding: 12rem 1rem 4rem;                 /* fallback: clears the fixed header (JS refines it) */
  font-family: inherit;                     /* same font as the rest of the site (home page etc.) */
}
@media (max-width: 991px){ .tm-page{ padding-top: 8.5rem; } }
.tm-title{
  display: block;
  width: fit-content;            /* the yellow bar follows the title's own width */
  max-width: 100%;
  margin: 0 auto 2.5rem;
  text-align: center;
  font-size: clamp(1.9rem, 4.5vw, 2.6rem);
  font-weight: 700;
  color: var(--tm-green-dark);
  letter-spacing: .01em;
}
.tm-title::after{
  content: "";
  display: block;
  width: 100%;
  height: 5px;
  margin-top: .6rem;
  border-radius: 3px;
  background: var(--tm-yellow);
  box-shadow: 0 0 0 1px rgba(53,94,74,.15);
}
.tm-list{
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
}

.tm-card{
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
  padding: 1.25rem;
  background: var(--tm-card);
  border-radius: 16px;
  border-inline-start: 6px solid var(--tm-green);
  box-shadow: 0 8px 22px rgba(38,70,54,.14);
  transition: transform .25s ease, box-shadow .25s ease;
}
.tm-card:hover{ transform: translateY(-3px); box-shadow: 0 12px 28px rgba(38,70,54,.20); }
@media (min-width: 576px){
  .tm-card{ grid-template-columns: 170px 1fr; gap: 1.5rem; padding: 1.4rem; }
}
@media (min-width: 992px){
  .tm-card{ grid-template-columns: 210px 1fr; gap: 2rem; padding: 1.6rem; }
}

/* every photo gets exactly the same frame */
.tm-photo{
  width: 100%;
  max-width: 220px;
  aspect-ratio: 4 / 5;
  margin-inline: auto;
  border-radius: 12px;
  overflow: hidden;
  background: #d2e497;
  box-shadow: 0 3px 10px rgba(38,70,54,.18);
}
@media (min-width: 576px){ .tm-photo{ max-width: none; margin: 0; } }
.tm-photo img{
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center top;
}
.tm-photo--empty{
  display: flex; align-items: center; justify-content: center;
  font-size: 3.2rem; color: var(--tm-green);
}

.tm-body{ min-width: 0; }
.tm-name{
  margin: 0 0 .55rem;
  font-size: clamp(1.3rem, 1rem + 1vw, 1.7rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--tm-green-dark);
}
.tm-desc{
  margin: 0 0 1rem;
  font-size: clamp(1rem, .94rem + .35vw, 1.15rem);
  line-height: 1.85;
  color: var(--tm-text);
  text-align: start;
  overflow-wrap: anywhere;
}
.tm-actions{ display: flex; flex-wrap: wrap; gap: .6rem; }
.tm-card .tm-btn{
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .5rem 1.05rem;
  border-radius: 999px;
  background: var(--tm-green);
  color: #fff;
  font-size: .95rem; font-weight: 600;
  text-decoration: none;
  transition: background .2s, color .2s;
}
.tm-card .tm-btn:hover,
.tm-card .tm-btn:focus-visible{ background: var(--tm-yellow); color: #1f3a2e; }
.tm-card .tm-btn--icon{ padding: .5rem .8rem; }

/* sponsors: logos are shown whole (contain) in a square frame */
.tm-photo--logo{
  aspect-ratio: 1 / 1;
  background: #fff;
  padding: .75rem;
}
.tm-photo--logo img{
  object-fit: contain;
  object-position: center;
}

/* a logo that is also a link */
a.tm-photo{ display: block; }

/* ===== one-time title animation (3 effects, picked per page load by PHP: tm-fx-1..3) ===== */
.tm-page{ --tm-d: 1; }
.tm-page[dir="rtl"]{ --tm-d: -1; }

/* 1) Rise: title floats up, the yellow bar grows from the centre */
.tm-fx-1{ animation: tm-rise .7s cubic-bezier(.2,.7,.2,1) both; }
.tm-fx-1::after{ animation: tm-bar .6s .35s cubic-bezier(.2,.7,.2,1) both; }

/* 2) Focus: title sharpens from a soft blur, the bar springs open */
.tm-fx-2{ animation: tm-focus .8s ease-out both; }
.tm-fx-2::after{ animation: tm-bar-spring .7s .4s cubic-bezier(.34,1.56,.64,1) both; }
.tm-page[dir="rtl"] .tm-fx-2{ animation-name: tm-focus-ar; }   /* no letter-spacing on Arabic: it breaks letter joining */

/* 3) Slide: title glides in from the reading-start side, the bar wipes across */
.tm-fx-3{ animation: tm-slide .7s cubic-bezier(.2,.7,.2,1) both; }
.tm-fx-3::after{ animation: tm-bar .6s .35s cubic-bezier(.2,.7,.2,1) both; transform-origin: left center; }
.tm-page[dir="rtl"] .tm-fx-3::after{ transform-origin: right center; }

@keyframes tm-rise  { from{ opacity:0; transform: translateY(18px); } to{ opacity:1; transform:none; } }
@keyframes tm-slide { from{ opacity:0; transform: translateX(calc(var(--tm-d) * -28px)); } to{ opacity:1; transform:none; } }
@keyframes tm-focus { from{ opacity:0; filter: blur(8px); letter-spacing: .14em; } to{ opacity:1; filter:none; letter-spacing:.01em; } }
@keyframes tm-focus-ar{ from{ opacity:0; filter: blur(8px); transform: scale(.94); } to{ opacity:1; filter:none; transform:none; } }
@keyframes tm-bar   { from{ transform: scaleX(0); } to{ transform: scaleX(1); } }
@keyframes tm-bar-spring{ from{ transform: scaleX(0); } to{ transform: scaleX(1); } }

@media (prefers-reduced-motion: reduce){
  .tm-title[class*="tm-fx-"], .tm-title[class*="tm-fx-"]::after{ animation: none !important; }
}


/* intro / note card (single column, no photo) - used by Scientific_Committee.php */
.tm-card--note{ grid-template-columns: 1fr !important; }
.tm-card--note .tm-desc{ margin-bottom: 0; }
.tm-card--note .tm-desc p{ margin: 0 0 .9rem; }
.tm-card--note .tm-desc p:last-child{ margin-bottom: 0; }
.tm-desc a{ color: var(--tm-green-dark); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.tm-desc a:hover{ color: #1f3a2e; background: var(--tm-yellow); }
/* name-only member cards: centre the name against the photo */
.tm-body--center{ display: flex; flex-direction: column; justify-content: center; }


/* ===== Scientific committee: text + members in ONE frame ===== */
.tm-card--wide:hover{ transform: none; box-shadow: 0 8px 22px rgba(38,70,54,.14); }
.tm-card--wide .tm-desc{ margin-bottom: 1.4rem; }

.tm-members{
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin: 0; padding: 1.4rem 0 0;
  border-top: 2px solid rgba(53,94,74,.18);
  list-style: none;
}
.tm-member{
  flex: 1 1 160px;   /* الحد الأدنى للعرض 160px، وما يتبقى في الصف يُوزَّع على أعضائه */
  min-width: 0;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: .6rem;
}

.tm-member .tm-photo{ max-width: none; margin: 0; }
.tm-member .tm-name{ margin: 0; font-size: clamp(1rem, .95rem + .3vw, 1.2rem); }
.tm-member .tm-actions{ justify-content: center; }
.tm-member .tm-btn{ font-size: .85rem; padding: .4rem .9rem; }

/* first-appearance effect for the members (one of 3, picked per page load: tm-rv-1..3) */
.tm-members.is-armed .tm-member{ opacity: 0; transition: none; }
.tm-members.is-armed .tm-member.is-in{ opacity: 1; }
.tm-members.tm-rv-1.is-armed .tm-member.is-in{ animation: tm-rise  .7s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i) * 90ms); }
.tm-members.tm-rv-2.is-armed .tm-member.is-in{ animation: tm-focus-ar .8s ease-out both; animation-delay: calc(var(--i) * 90ms); }
.tm-members.tm-rv-3.is-armed .tm-member.is-in{ animation: tm-slide .7s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i) * 90ms); }
.tm-members.is-armed .tm-member.is-in{ opacity: 1; }
@media (prefers-reduced-motion: reduce){
  .tm-members.is-armed .tm-member{ opacity: 1 !important; animation: none !important; }
}

/* intro card with carousel (publications) */
.tm-card--intro{ align-items: center; }
@media (min-width: 768px){ .tm-card--intro{ grid-template-columns: 1.1fr 1fr !important; gap: 2rem; } }
.tm-slider{
  aspect-ratio: 4 / 3; width: 100%; overflow: hidden;
  border-radius: 12px; background: #d2e497;
  box-shadow: 0 3px 10px rgba(38,70,54,.18);
}
.tm-slider .carousel, .tm-slider .carousel-inner, .tm-slider .carousel-item{ height: 100%; }
.tm-slider img{ display: block; width: 100%; height: 100%; object-fit: cover; }

/* square icon frame for items without a picture (publications / links) */
.tm-photo--icon{ aspect-ratio: 1 / 1; max-width: 120px; }
@media (min-width: 576px){ .tm-photo--icon{ max-width: none; width: 100%; } }
.tm-photo--icon i{ font-size: 2.8rem; }

/***********************************************************************************************/


/* ===== maps page (map1.php) ===== */
.tm-sub{
  display: block; width: fit-content; max-width: 100%;
  margin: 1rem auto .25rem; text-align: center;
  font-size: clamp(1.4rem, 3.2vw, 1.9rem); font-weight: 700;
  color: var(--tm-green-dark);
}
.tm-sub::after{
  content: ""; display: block; height: 4px; margin-top: .45rem;
  border-radius: 3px; background: var(--tm-yellow);
}
.tm-maps{
  display: grid; gap: 1.75rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}
.tm-card--map{ grid-template-columns: 1fr !important; align-content: start; }
.tm-mapimg{
  display: block; aspect-ratio: 4 / 3; overflow: hidden;
  border-radius: 12px; background: #fff;
  box-shadow: 0 3px 10px rgba(38,70,54,.18);
}
.tm-mapimg img{ display: block; width: 100%; height: 100%; object-fit: contain; transition: transform .3s ease; }
.tm-mapimg:hover img{ transform: scale(1.04); }
.tm-card--map .tm-desc{ margin: 0; text-align: center; }

.tm-stats{
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}
.tm-stat{
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .35rem; padding: 1.4rem 1rem; text-align: center;
  background: #fff; border-radius: 12px;
  box-shadow: 0 3px 10px rgba(38,70,54,.12);
}
.tm-stat i{ font-size: 1.6rem; color: var(--tm-green); }
.tm-stat-num{
  font-size: clamp(2rem, 1.4rem + 2vw, 2.8rem); font-weight: 800; line-height: 1.1;
  color: var(--tm-green-dark); font-variant-numeric: tabular-nums;
}
.tm-stat-label{ font-size: 1rem; font-weight: 600; color: var(--tm-text); }
