/* Interactions (from the Figma Make prototype). Loaded after all other styles. */
html{scroll-behavior:smooth;scroll-padding-top:90px}

/* ---- Header: stays at the top; turns white after a little scrolling ---- */
.wp-site-blocks>.wp-block-template-part:first-child{position:sticky;top:0;z-index:50}
.admin-bar .wp-site-blocks>.wp-block-template-part:first-child{top:32px}
.site-header{transition:background-color .3s,box-shadow .3s}
.site-header__logo img.logo-dark{display:none}
.site-header.is-scrolled{background:#fff!important;box-shadow:0 1px 12px rgba(11,37,69,.12)}
body.has-hero .site-header.is-scrolled{position:fixed}
.site-header.is-scrolled .logo-light{display:none}
.site-header.is-scrolled .logo-dark{display:block}
.site-header.is-scrolled .site-nav .wp-block-navigation-item__content{color:var(--wp--preset--color--navy)}
.site-header.is-scrolled .site-nav .is-cta>.wp-block-navigation-item__content{color:#fff}
.site-header.is-scrolled .wp-block-navigation__responsive-container-open{color:var(--wp--preset--color--navy)}
body.has-hero .site-header{transition:background-color .3s,box-shadow .3s}
/* Menu links: a thin line grows from the left on hover */
.site-nav .wp-block-navigation-item__content:hover{text-decoration:none}
.site-nav .wp-block-navigation-item:not(.is-cta):not(.current-menu-item)>.wp-block-navigation-item__content{position:relative}
.site-nav .wp-block-navigation-item:not(.is-cta):not(.current-menu-item)>.wp-block-navigation-item__content::after{content:"";position:absolute;left:0;right:0;bottom:-4px;height:1px;background:currentColor;transform:scaleX(0);transform-origin:left;transition:transform .3s}
.site-nav .wp-block-navigation-item:not(.is-cta):not(.current-menu-item)>.wp-block-navigation-item__content:hover::after{transform:scaleX(1)}
.site-header .is-menu-open .wp-block-navigation-item>.wp-block-navigation-item__content::after{display:none}
.site-nav .is-cta>.wp-block-navigation-item__content{transition:background-color .2s,transform .15s,filter .2s}
.site-nav .is-cta>.wp-block-navigation-item__content:hover{filter:none;background:#9f1632}

@media (prefers-reduced-motion:no-preference){
  /* Open mobile menu slides down */
  .site-header .wp-block-navigation__responsive-container.is-menu-open{animation:amSlide .3s ease both}
  @keyframes amSlide{from{opacity:0;transform:translateY(-14px)}to{opacity:1;transform:none}}

  /* Fade up on scroll (classes are added and removed by interactions.js) */
  .reveal{opacity:0;transform:translateY(24px);transition:opacity .7s,transform .7s}
  .reveal.in{opacity:1;transform:none}

  /* Buttons */
  .wp-block-button__link,.amcham-form__submit,.join-band .wp-block-button__link{transition:background-color .2s,color .2s,border-color .2s,transform .15s,filter .2s}
  .wp-block-button__link:active,.amcham-form__submit:active,.site-nav .is-cta>.wp-block-navigation-item__content:active{transform:scale(.98)}
  .wp-block-button:not(.is-style-outline):not(.member-cell__name .wp-block-button):not(.pub-card__dl .wp-block-button)>.wp-block-button__link:hover{filter:none;background-color:#9f1632}
  .wp-block-button.is-style-outline.has-arrow>.wp-block-button__link:hover{background:var(--wp--preset--color--navy);color:#fff}
  .btn-light>.wp-block-button__link:hover{background:rgba(255,255,255,.1)!important;border-color:#fff!important;color:#fff!important}

  /* Arrows nudge to the right */
  .has-arrow .wp-block-button__link::after,.has-arrow-white .wp-block-button__link::after,.dia-hero__cta .wp-block-button__link::after,
  .link-more a::after,.member-more .wp-block-button__link::after,.event-card__more::after,.ev-card__more::after,.pub-card__view .wp-block-button__link::after{transition:transform .25s}
  .has-arrow .wp-block-button__link:hover::after,.has-arrow-white .wp-block-button__link:hover::after,.dia-hero__cta .wp-block-button__link:hover::after,
  .link-more a:hover::after,.member-more .wp-block-button__link:hover::after,.event-card:hover .event-card__more::after,.ev-card:hover .ev-card__more::after,.pub-card:hover .pub-card__view .wp-block-button__link::after{transform:translateX(4px)}

  /* Cards lift */
  .card,.event-card,.ev-card,.person-card,.dia-area{transition:transform .3s,box-shadow .3s}
  .card:hover,.event-card:hover,.ev-card:hover,.person-card:hover,.dia-area:hover{transform:translateY(-6px);box-shadow:0 16px 32px rgba(11,37,69,.14)}
  .home-what .card:hover{box-shadow:0 14px 30px rgba(0,0,0,.25)}

  /* Photos zoom slowly */
  .event-card__image,.ev-card__image,.person-card__photo,.home-who__photo2{overflow:hidden}
  .event-card__image img,.ev-card__image img,.person-card__photo img,.home-who__photo2 img{transition:transform .7s}
  .event-card:hover .event-card__image img,.ev-card:hover .ev-card__image img,.person-card:hover .person-card__photo img,.home-who__photo2:hover img{transform:scale(1.05)}

  /* Objectives: the text slides right */
  .objective__text{transition:transform .3s}
  .objective:hover .objective__text{transform:translateX(6px)}

  /* Benefits */
  .benefit{transition:filter .3s}
  .benefit:hover{filter:brightness(1.25)}
  .benefit__icon img{transition:transform .3s}
  .benefit:hover .benefit__icon img{transform:scale(1.1)}

  /* Member logos grow a little; "+N more" cell tints */
  .logo-grid .member-more{transition:background-color .2s}
  .logo-grid .member-more:hover{background:var(--wp--preset--color--ice)}

  /* Footer */
  .site-footer a{transition:color .2s,opacity .2s}
  .site-footer a:hover{color:#fff;text-decoration:none}
  .site-footer__social a{transition:transform .2s,opacity .2s,background-color .2s}
  .site-footer__social a:hover{transform:scale(1.1);opacity:.8}
}

/* ---- Page width: content is kept inside 1920px and centred; backgrounds and heroes stay full width.
   The header/menu bar is fluid (never capped). On screens wider than 1920px the side gutter grows
   so that the content block stays 1920px wide (side padding of 80px stays inside that). ---- */
@media (min-width:1921px){
  :root{--gutter:calc((100vw - 1920px) / 2 + 80px)}
  .site-footer{padding-left:var(--gutter);padding-right:var(--gutter)}
  .events-page,.dia-community,.dia-areas,.dia-purpose--join,.esingle-gallery{padding-left:var(--gutter);padding-right:var(--gutter)}
  .dia-purpose{padding-left:var(--gutter);padding-right:var(--gutter)}
  .esingle-hero__content,.esingle-body{max-width:none;padding-left:var(--gutter);padding-right:var(--gutter)}
  .dia-hero{padding-left:var(--gutter);padding-right:var(--gutter)}
  .dia-hero__photo{right:var(--gutter)}
  .dia-register,.contact-page{padding-left:calc((100% - 850px) / 2);padding-right:calc((100% - 850px) / 2)}
}

/* Publication cards: the View PDF and download buttons never get a background on hover */
.pub-card__view .wp-block-button__link:hover,.pub-card__view .wp-block-button__link:focus,.pub-card__dl .wp-block-button__link:hover,.pub-card__dl .wp-block-button__link:focus{background-color:transparent!important;filter:none!important;box-shadow:none}

/* Publication cards: buttons always show the hand cursor. The download icon gets a bigger click area (40px around the 20px icon) and a small downward nudge on hover. */
.pub-card__view .wp-block-button__link,.pub-card__dl .wp-block-button__link{cursor:pointer}
.pub-card__dl .wp-block-button__link{box-sizing:content-box;padding:10px;margin:-10px;background-clip:content-box;background-origin:content-box}
@media (prefers-reduced-motion:no-preference){
  .pub-card__dl .wp-block-button__link{transition:transform .2s}
  .pub-card__dl .wp-block-button__link:hover{transform:translateY(2px)}
}

/* Member logo boxes: clean hover. The logo's white box blends into the blue (so no pale square), nothing scales,
   and the name fades in while the logo fades out, so the two never overlap in a jerky way. */
.logo-grid .wp-block-post .member-cell__logo{transition:opacity .2s ease}
.logo-grid .wp-block-post:hover .member-cell__logo,.logo-grid .wp-block-post:has(:focus-visible) .member-cell__logo{mix-blend-mode:multiply;opacity:.12}
@media (prefers-reduced-motion:no-preference){
  .logo-grid .wp-block-post:hover .member-cell__name .wp-block-button__link,.logo-grid .wp-block-post:has(:focus-visible) .member-cell__name .wp-block-button__link{animation:amNameIn .25s ease both}
  @keyframes amNameIn{from{opacity:0}to{opacity:1}}
}

/* "+N more" box: the whole box is the link; the card tints on hover and the text never gets a background */
.logo-grid .member-more{position:relative;cursor:pointer;transition:background-color .2s}
.logo-grid .member-more .wp-block-button__link::before{content:"";position:absolute;inset:0;z-index:1}
.logo-grid .member-more:hover,.logo-grid .member-more:has(:focus-visible){background:#eff5ff}
.logo-grid .member-more .wp-block-button__link,.logo-grid .member-more .wp-block-button__link:hover,.logo-grid .member-more .wp-block-button__link:focus{background:transparent!important;background-color:transparent!important;filter:none;box-shadow:none;color:var(--wp--preset--color--crimson);cursor:pointer}
.logo-grid .member-more:hover .wp-block-button__link::after{transform:translateX(4px)}
/* "+N more": the link itself fills the whole box (more reliable than an overlay) */
.logo-grid .member-more{padding:0!important}
.logo-grid .member-more .wp-block-button{width:100%;height:100%;display:flex;margin:0}
.logo-grid .member-more .wp-block-button__link{width:100%;height:100%;display:flex!important;align-items:center;justify-content:center;gap:6px;box-sizing:border-box}
.logo-grid .member-more .wp-block-button__link::before{display:none}

/* Diaspora hero on wide screens: text and photo stay together as one block (the gap stays as in the 1440 design) and the block is centred, instead of the photo drifting to the far right */
@media (min-width:1441px){
  .dia-hero{justify-content:center}
  .dia-hero__text{flex:none}
  .dia-hero__photo,.dia-hero__photo{position:relative;right:auto;top:auto;bottom:auto;height:463px;flex:none;margin-left:106px}
}

/* No lonely last words: paragraphs wrap so the last line is never a single word; headings and short labels are balanced across their lines */
p,li,figcaption,blockquote,.wp-block-button__link{text-wrap:pretty}
h1,h2,h3,h4,h5,h6,.join-type__label,.event-card__title,.ev-card__title,.pub-card__title{text-wrap:balance}

/* One button size across the site: 48px tall, 16px semibold text, centred. (Menu button, small text links such as View PDF and the directory controls keep their own style.) */
.join-buttons .wp-block-button__link,
.home-hero__cta .wp-block-button__link,
.dia-hero__cta .wp-block-button__link,
.page-hero__cta .wp-block-button__link,
.home-who .wp-block-buttons .wp-block-button__link{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;text-align:center;height:48px;padding:0 24px;font-size:16px;line-height:20px;font-weight:600}
.join-buttons .wp-block-button__link{width:280px;min-width:0}
.dia-hero__cta .wp-block-button__link{min-width:0}
.amcham-form__submit,.wpcf7-form input[type=submit]{height:48px;font-size:16px;line-height:20px}
@media (max-width:781px){
  .join-buttons .wp-block-button__link{min-width:0;width:100%}
  .amcham-form__submit,.wpcf7-form input[type=submit]{height:48px}
}
.join-buttons .wp-block-button:first-child .wp-block-button__link,.join-buttons .wp-block-button .wp-block-button__link{font-size:16px;padding:0 24px}
.home-hero__cta .wp-block-button__link,.dia-hero__cta .wp-block-button__link,.page-hero__cta .wp-block-button__link,.home-who .wp-block-buttons .wp-block-button__link{min-width:232px}

/* Home hero on tablets and phones: text first, then the whole photo underneath, left aligned, so every person in the picture is visible */
@media (max-width:1099px){
  .home-hero{flex-direction:column;align-items:stretch;min-height:0}
  .home-hero__content{order:1;padding-bottom:36px}
  .home-hero__photo{order:2;position:relative;left:0;top:auto;bottom:auto;width:100%;height:auto}
  .home-hero__photo{aspect-ratio:1.44;overflow:hidden}
  .home-hero__photo figure{height:auto}
  .home-hero__photo img{position:absolute;max-width:none;width:135%;height:auto;aspect-ratio:2200/1742;left:-33.3%;top:-44%;object-fit:fill}
  .home-hero__scrim{display:none}
  .home-hero__photo::after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,#0b2545 0%,rgba(11,37,69,.5) 22%,rgba(11,37,69,0) 60%)}
}
@media (max-width:1099px){
  .home-hero__content{padding-top:140px}
}
