/* YFI V60 — Photo-radius consistency & 10-language editorial typography.
   Safe visual-only overrides. Loaded LAST on all 154 HTML pages.
   Existing language switcher, hero fades, language fonts, logos, flags,
   links, carousels, contact forms and original photo files stay unchanged. */
:root{
  --yfi-v60-photo-radius:clamp(17px,2.1vw,26px);
  --yfi-v60-photo-radius-small:clamp(13px,1.7vw,19px);
}

/* PHOTOGRAPHS: clip both the original image and its colored frame. SVG icons,
   brand images, flag illustrations and QR codes are not photographs. */
main img:not([class*="logo"]):not([class*="flag"]):not([class*="icon"]):not([src*="/flags/"]):not([src*="qr"]):not([src*="QR"]):not([src*="favicon"]),
article img:not([class*="logo"]):not([class*="flag"]):not([class*="icon"]):not([src*="/flags/"]):not([src*="qr"]):not([src*="QR"]){
  border-radius:var(--yfi-v60-photo-radius)!important;
}
/* Shared photo frames need a clipped border, otherwise the square neutral
   canvas behind letterboxed photos remains visible beyond rounded corners. */
main :is(.yfi-photo-frame,.portrait,.editorial-media,figure.story-photo,figure.feature-photo,figure.global-image,
          .tile,.para-gallery figure,.gallery-grid figure,.ab-hero-portrait,.i18n-latest-card,
          .photo-story-grid figure,.school-promo,.article-cover,.featured-article),
article :is(.yfi-photo-frame,.article-cover,.featured-article){
  border-radius:var(--yfi-v60-photo-radius)!important;
  overflow:hidden!important;
}
/* Round backgrounds as well as foregrounds on photography with captions. */
main .yfi-photo-frame>img,
main .school-promo .yfi-photo-frame>img,
main .editorial-media>img,
main :is(.story-photo,.feature-photo,.global-image,.portrait)>img,
main .yfi-para-gallery,
main .i18n-about>img,
main .i18n-feature>img,
main .i18n-global>img,
main .i18n-latest-card img,
main .ab-hero-portrait>img,
main .article-card>img,
article img.cover,
article .authorbox>img{
  border-radius:var(--yfi-v60-photo-radius)!important;
}
/* Legacy fade selectors had higher specificity and forced square corners.
   The image alpha-mask is deliberately left intact, so the lower edge
   continues fading toward navy while the visible top edges are rounded. */
main #about.intro-grid .portrait,
main #about.i18n-about>img{
  border-radius:var(--yfi-v60-photo-radius)!important;
}
/* Image captions are text, not part of the photo crop. */
main :is(.story-photo,.feature-photo,.global-image) figcaption,
main .photo-story-grid figcaption{
  font-size:clamp(12px,1.1vw,14px)!important;
  line-height:1.55!important;
  overflow-wrap:break-word;
  white-space:normal;
  letter-spacing:.08em;
  padding-inline:clamp(5px,1vw,13px)!important;
}
/* Gallery photographs have a slightly smaller uniform radius inside a collage. */
main :is(.para-gallery,.gallery-grid) img,
main :is(.para-gallery,.gallery-grid) figure{
  border-radius:var(--yfi-v60-photo-radius-small)!important;
}
/* Deliberate full-bleed hero art and the portrait-to-navy fade retain their
   existing blended edges. Only the containing card is rounded where present. */
main :is(.hero-media,.i18n-hero-photo) img{border-radius:0!important}
main .yfi-portrait-fade img{border-radius:var(--yfi-v60-photo-radius)!important}
/* Keep logo, QR and flag treatments exactly as in V59; do not apply
   generic image filtering or object-fit changes to non-photographic assets. */

/* TYPOGRAPHIC RHYTHM: retain the original font families of each locale.
   Only text sizing, leading and line breaks are adjusted; no automatic
   word spacing or language-dependent digit conversions are introduced. */
main :is(h1,h2,h3,h4), .ab-section-title{
  max-width:100%;
  overflow-wrap:break-word!important;
  word-break:normal!important;
  text-wrap:balance;
}
main :is(p,li,blockquote,figcaption),.ab-country p,.ab-detail-card p{
  max-width:100%;
  overflow-wrap:break-word!important;
  word-break:normal!important;
}
main :is(.intro-copy p,.editorial-copy p,.para-copy p,.champion-copy p,
         .i18n-about p,.i18n-feature p,.i18n-global p,.i18n-services p,
         .ab-country p,.ab-detail-card p){
  line-height:1.72;
}
main .ab-country p{font-size:clamp(16px,1.25vw,18px)!important;line-height:1.78!important}
main .ab-detail-card p{font-size:clamp(16.5px,1.25vw,19px)!important}
main .i18n-service p{font-size:clamp(16px,1.2vw,18px)!important;line-height:1.72!important}
main .yfi-network-header p{font-size:clamp(14px,1.2vw,16px)!important;line-height:1.65!important}
/* School-promotion caption: contemporary, strong but sized not to spill over
   the photo in 360–430px devices. Keep existing red/navy/gold colors. */
main .school-promo .school-promo-copy{
  /* Keep the campaign headline below the team photo on desktop as well:
     text no longer covers athletes or competes with bright uniforms. */
  position:relative!important;
  inset:auto!important;
  background:#071321!important;
  padding:clamp(20px,3vw,35px)!important;
  gap:10px!important;
}
main .school-promo-copy strong{
  font-family:Inter,ui-sans-serif,system-ui,sans-serif!important;
  font-size:clamp(27px,3.5vw,49px)!important;
  font-weight:850!important;
  line-height:1.13!important;
  letter-spacing:-.025em;
  overflow-wrap:break-word!important;
  text-wrap:balance;
}
main .school-promo-copy span{font-size:clamp(15px,1.3vw,18px)!important;line-height:1.6!important;letter-spacing:.04em;overflow-wrap:break-word}
/* High-visibility article headlines: don't force all-caps or split words into letters. */
main .yfi-v47-card-title{overflow-wrap:break-word!important;word-break:normal!important}
main .i18n-latest-card h2, main .article-card h3{line-height:1.24!important;overflow-wrap:break-word!important}

/* Arabic and Persian already use Estedad+Vazirmatn from V53. Preserve
   their natural letter joins, ZWNJ, diacritics and numeric behavior. */
html:is([lang="fa"],[lang="ar"]) main :is(h1,h2,h3,h4,p,li,figcaption),
html:is([lang="fa"],[lang="ar"]) main :is(.school-promo-copy strong,.school-promo-copy span){
  letter-spacing:normal!important;
  word-spacing:normal!important;
  hyphens:none!important;
}
html:is([lang="fa"],[lang="ar"]) main .school-promo .school-promo-copy{
  /* Keep the campaign headline below the team photo on desktop as well:
     text no longer covers athletes or competes with bright uniforms. */
  position:relative!important;
  inset:auto!important;
  background:#071321!important;
  padding:clamp(20px,3vw,35px)!important;
  gap:10px!important;
}
main .school-promo-copy strong{
  font-family:'YFI Estedad','Estedad','YFI Vazirmatn',Tahoma,sans-serif!important;
  font-weight:700!important;
  line-height:1.52!important;
}
html:is([lang="fa"],[lang="ar"]) main .school-promo-copy span{
  font-family:'YFI Vazirmatn','Vazirmatn',Tahoma,sans-serif!important;
  line-height:1.75!important;
}
html:is([lang="fa"],[lang="ar"]) main :is(.story-photo,.feature-photo,.global-image) figcaption{letter-spacing:normal!important}

@media(max-width:760px){
  :root{--yfi-v60-photo-radius:19px;--yfi-v60-photo-radius-small:15px}
  /* Prevent oversized display titles from being clipped at narrow widths;
     keep the principal home hero display treatment unchanged. */
  main :is(.section-heading h2,.intro-copy h2,.editorial-copy h2,.champion-copy h3,
           .para-copy h2,.final-cta h2,.i18n-section h2,.i18n-feature h2,
           .i18n-contact h2,.ab-section-title,.ab-cta h2){
    font-size:clamp(27px,7.6vw,39px)!important;
    line-height:1.23!important;
    letter-spacing:-.025em;
  }
  main :is(.i18n-service h3,.service h3,.ab-detail-card h2){
    font-size:clamp(21px,5.8vw,27px)!important;
    line-height:1.31!important;
  }
  main .yfi-network-header h2{font-size:clamp(26px,7vw,36px)!important;line-height:1.27!important}
  main .school-promo-copy{
    padding:clamp(18px,4.8vw,24px)!important;
    gap:10px!important;
  }
  main .school-promo-copy strong{
    font-size:clamp(26px,7.2vw,34px)!important;
    line-height:1.17!important;
  }
  main .school-promo-copy span{
    font-size:clamp(14px,4vw,16px)!important;
    line-height:1.57!important;
    letter-spacing:.025em;
  }
  main :is(.intro-copy p,.editorial-copy p,.para-copy p,.champion-copy p,
           .i18n-feature p,.i18n-global p,.i18n-about p,.i18n-lead){
    font-size:clamp(16px,4.25vw,18px)!important;
    line-height:1.75!important;
  }
  main :is(.story-photo,.feature-photo,.global-image) figcaption{
    font-size:12px!important;
    letter-spacing:.055em;
    line-height:1.55!important;
  }
  main .yfi-v47-card-title{font-size:clamp(16px,4.25vw,18px)!important;line-height:1.55!important}
  main .i18n-latest-card h2,main .article-card h3{font-size:clamp(23px,6.25vw,32px)!important;line-height:1.28!important}
  html:is([lang="fa"],[lang="ar"]) main :is(.section-heading h2,.i18n-section h2,.i18n-feature h2,.ab-section-title){
    letter-spacing:normal!important;
    line-height:1.5!important;
  }
  html:is([lang="fa"],[lang="ar"]) main .school-promo-copy strong{line-height:1.55!important}
  html:is([lang="fa"],[lang="ar"]) main .school-promo-copy span{letter-spacing:normal!important;line-height:1.8!important}
}
@media(max-width:390px){
  main .school-promo-copy strong{font-size:clamp(24px,6.9vw,29px)!important}
  main :is(.section-heading h2,.intro-copy h2,.editorial-copy h2,.para-copy h2,.i18n-section h2,.i18n-feature h2){font-size:clamp(26px,7.2vw,32px)!important}
}
