/* Shared site components from the Homepage UI Audit redesign (Oct 2026):
   the project card, news card and numbers band used on every page, plus the
   home sections around them. Loaded site-wide, so a change here shows up
   everywhere the component appears. Colors come from the SATC tokens; font
   sizes are owned by typography.css. */

.hm-section{padding-block:var(--section-y)}
.hm-panel{
  width:min(1440px,calc(100% - 2 * var(--space-page-inline)));
  margin-inline:auto;
  padding:var(--card-padding);
  border-radius:var(--radius-panel);
  background:var(--satc-paper);
}

/* Section head: small label, title with its tabs or filters beside it, and
   the "view all" link on the far side. */
.hm-head{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:var(--pc-space-xl) var(--pc-space-3xl);margin-bottom:var(--pc-space-3xl)}
.hm-head-main{min-width:0}
.hm-head .satc-kicker{display:block;margin-bottom:var(--pc-space-xs);color:var(--satc-wild-hillside);white-space:nowrap}
.hm-head .satc-kicker::before,.hm-head .satc-kicker::after{content:none}
.hm-title-row{display:flex;flex-wrap:wrap;align-items:center;gap:var(--pc-space-md) clamp(32px,4vw,56px)}
.hm-title-row .satc-title{margin:0}
.hm-title-row .satc-title::after{content:none}
.hm-more{display:inline-flex;align-items:center;gap:var(--pc-space-md);color:var(--satc-root-brew);font-weight:600;text-decoration:none;white-space:nowrap}
.hm-more:hover,.hm-more:focus-visible{color:var(--satc-wild-hillside)}

/* News tabs: plain text, the active one underlined. */
.hm-tabs{display:flex;gap:var(--pc-space-3xl)}
.hm-tabs button{
  padding:var(--pc-space-xs) 0;
  border:0;
  border-bottom:2px solid transparent;
  border-radius:0;
  background:none;
  color:var(--color-text-muted,#7a6f66);
  cursor:pointer;
}
.hm-tabs button.active{border-bottom-color:var(--satc-root-brew);color:var(--satc-root-brew);font-weight:700}

/* Project type filters. */
.hm-filters{display:flex;flex-wrap:wrap;gap:var(--pc-space-md)}
.hm-filters button{
  padding:var(--pc-space-sm) var(--pc-space-xl);
  border:1px solid color-mix(in srgb,var(--satc-root-brew) 30%,transparent);
  border-radius:var(--radius-control);
  background:var(--satc-white);
  color:var(--satc-root-brew);
  cursor:pointer;
  transition:background-color var(--motion-fast) ease,color var(--motion-fast) ease,border-color var(--motion-fast) ease;
}
.hm-filters button:hover{border-color:var(--satc-root-brew)}
.hm-filters button.active{border-color:var(--satc-root-brew);background:var(--satc-root-brew);color:var(--satc-white)}

/* Cards: three per row, the whole card is one link. */
.hm-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--pc-space-xl)}
.hm-card{display:flex;min-width:0;overflow:hidden;border:1px solid var(--color-border);border-radius:var(--radius-panel);background:var(--satc-white)}
.hm-card[hidden]{display:none}
.hm-card-link{display:flex;flex:1;flex-direction:column;color:inherit;text-decoration:none}
.hm-card-media{position:relative;display:block;overflow:hidden;background:var(--satc-stone)}
.hm-card-media--news{aspect-ratio:12/5}
.hm-card-media--project{aspect-ratio:2/1}
.hm-card-media img{width:100%;height:100%;display:block;object-fit:cover;transition:transform 600ms cubic-bezier(.2,.65,.3,1)}
.hm-card-body{display:flex;flex:1;flex-direction:column;gap:var(--pc-space-xs);padding:var(--pc-space-xl)}
.hm-card-body h3{margin:0}
.hm-meta{color:var(--satc-wild-hillside)}
.hm-card .hm-meta{display:block}
.hm-cta{display:inline-flex;align-items:center;gap:var(--pc-space-md);color:var(--satc-root-brew);font-weight:600}
.hm-cta i{transition:translate var(--motion-fast) ease}
.hm-card-foot{display:flex;align-items:center;justify-content:space-between;gap:var(--pc-space-lg);margin-top:auto;padding-top:var(--pc-space-lg)}
.news-card .hm-cta{margin-top:var(--pc-space-xs)}
.hm-badge{
  position:absolute;
  inset-block-start:var(--pc-space-lg);
  inset-inline-start:var(--pc-space-lg);
  padding:2px var(--pc-space-lg);
  border-radius:var(--radius-control);
  background:var(--satc-white);
  color:var(--satc-root-brew);
}
.hm-status{padding:2px var(--pc-space-md);border-radius:var(--radius-control);background:color-mix(in srgb,var(--satc-veiling-waterfalls) 28%,var(--satc-white));color:var(--satc-root-brew)}
.hm-card:hover{border-color:color-mix(in srgb,var(--satc-root-brew) 35%,transparent)}
.hm-card:hover .hm-card-media img{transform:scale(1.04)}
.hm-card:hover .hm-cta i{translate:-4px 0}
[dir=ltr] .hm-card:hover .hm-cta i{translate:4px 0}
.hm-card-link:focus-visible{outline:2px solid var(--satc-wild-hillside);outline-offset:-2px}
.hm-card.map-active{border-color:var(--satc-root-brew)}

/* Numbers: one dark band, title beside four figures. */
.hm-numbers-panel{
  width:min(1440px,calc(100% - 2 * var(--space-page-inline)));
  margin-inline:auto;
  display:grid;
  grid-template-columns:minmax(220px,1.1fr) minmax(0,4fr);
  align-items:center;
  padding:var(--card-padding);
  border-radius:var(--radius-panel);
  background:var(--satc-root-brew);
  color:var(--satc-white);
}
.hm-numbers-head{padding-inline-end:var(--pc-space-3xl)}
.hm-numbers-head .satc-kicker{display:block;margin-bottom:var(--pc-space-xs);color:var(--satc-veiling-waterfalls)}
.hm-numbers-head .satc-kicker::before,.hm-numbers-head .satc-kicker::after,.hm-numbers-head .satc-title::after{content:none}
.hm-numbers-head .satc-title{margin:0;color:var(--satc-white)}
.hm-numbers-head p{margin:var(--pc-space-md) 0 0;color:rgb(255 255 255 / 72%)}
.hm-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr))}
.hm-stat{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:var(--pc-space-xs);
  padding-inline:var(--pc-space-3xl);
  border-inline-start:1px solid rgb(255 255 255 / 14%);
}
.hm-stat-icon{margin-bottom:var(--pc-space-xs);color:var(--satc-veiling-waterfalls)}
.hm-stat b{color:color-mix(in srgb,var(--satc-veiling-waterfalls) 55%,var(--satc-white));font-weight:700;line-height:1.15}
.hm-stat strong{color:var(--satc-white);font-weight:500}
.hm-stat small{color:rgb(255 255 255 / 58%)}

/* About: copy beside the photo, one frame behind it, key facts. The framed
   photo (.hm-about-media) is shared: investor relations uses it too. */
/* About sits on the page itself, with no panel background. */
.hm-about-panel{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,.9fr);align-items:center;gap:clamp(24px,4vw,64px);padding:0;background:none}
.hm-kicker-line{display:inline-flex;align-items:center;gap:var(--pc-space-lg);color:var(--satc-wild-hillside);white-space:nowrap}
.hm-kicker-line::before{content:"";width:28px;height:1px;background:currentColor}
.hm-kicker-line::after{content:none}
.hm-about-copy .satc-title{margin-block:var(--pc-space-md) 0}
.hm-about-copy .satc-title::after{content:none}
.hm-facts{display:flex;flex-wrap:wrap;gap:var(--pc-space-xl) var(--pc-space-6xl);margin-top:var(--pc-space-3xl)}
.hm-facts>div{display:flex;flex-direction:column;gap:var(--pc-space-xs)}
.hm-facts b{color:var(--satc-root-brew);font-weight:700;line-height:1.2}
.hm-facts span{color:var(--color-text-muted,#7a6f66)}
.hm-about-copy .satc-actions{margin-top:var(--pc-space-3xl)}
.hm-about-media{position:relative;margin:0 0 var(--pc-space-xl);margin-inline-end:var(--pc-space-xl)}
.hm-about-media::before{
  content:"";
  position:absolute;
  inset-block:var(--pc-space-xl) calc(-1 * var(--pc-space-xl));
  inset-inline:var(--pc-space-xl) calc(-1 * var(--pc-space-xl));
  border-radius:var(--radius-panel);
  background:var(--satc-root-brew);
}
.hm-about-media img{position:relative;width:100%;height:auto;aspect-ratio:16/10;display:block;object-fit:cover;border-radius:var(--radius-panel)}

@media(max-width:1100px){
  .hm-numbers-panel{grid-template-columns:1fr;row-gap:var(--pc-space-3xl)}
  .hm-numbers-head{padding-inline-end:0}
  .hm-stat:nth-child(1){border-inline-start:0;padding-inline-start:0}
}
@media(max-width:1024px){
  .hm-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:800px){
  .hm-about-panel{grid-template-columns:1fr}
  .hm-about-media{order:-1}
  .hm-stats{grid-template-columns:repeat(2,minmax(0,1fr));row-gap:var(--pc-space-3xl)}
  .hm-stat{padding-inline:0 var(--pc-space-xl);border-inline-start:0}
  .hm-stat:nth-child(odd){padding-inline-end:var(--pc-space-xl);border-inline-end:1px solid rgb(255 255 255 / 14%)}
  .hm-stat:nth-child(even){padding-inline-start:var(--pc-space-xl)}
}
@media(max-width:700px){
  .hm-grid{grid-template-columns:1fr}
  .hm-head{align-items:flex-start;flex-direction:column}
  .hm-tabs,.hm-filters{flex-wrap:nowrap;max-width:100%;overflow-x:auto;scrollbar-width:none}
  .hm-filters button,.hm-tabs button{flex:none}
}
@media(prefers-reduced-motion:reduce){
  .hm-card-media img,.hm-cta i{transition:none}
}

/* Colors that brand-2026.css sets on every heading and label (some with
   !important) are restated here with the same weight for these sections. */
.shared-layout main .hm-head .satc-kicker,
.shared-layout main .hm-kicker-line{color:var(--satc-wild-hillside)}
.shared-layout main .hm-numbers-panel .satc-kicker{color:var(--satc-veiling-waterfalls)}
.shared-layout main .hm-numbers-panel .satc-title{color:var(--satc-white)!important;-webkit-text-fill-color:var(--satc-white)}
.shared-layout main .hm-numbers-panel p{color:rgb(255 255 255 / 72%)!important}
.shared-layout main .hm-numbers-panel strong{color:var(--satc-white)}
.shared-layout main .hm-numbers-panel small{color:rgb(255 255 255 / 58%)}

/* Type, status and category names come from the CMS in lowercase English. */
[dir=ltr] :is(.hm-filters button,.hm-badge,.hm-status,.hm-meta){text-transform:capitalize}

/* Numbers, projects and news: the section background runs the full width
   with square edges; only the content keeps the page width. */
.hm-numbers,.hm-projects,.hm-news{padding-block:0}
.hm-projects>.hm-panel,.hm-news>.hm-panel,.hm-numbers-panel{
  width:100%;
  border-radius:0;
  padding-block:var(--section-y);
  padding-inline:max(var(--space-page-inline),calc((100% - 1440px) / 2));
}

/* Projects carousel: the new cards on a scrolling rail, three per view on
   desktop, moved by autoplay and swipe. main.js drives it through the
   data-project-* hooks (counter, autoplay and the looping clones). */
.hm-head-side{display:flex;flex-wrap:wrap;align-items:center;gap:var(--pc-space-xl) var(--pc-space-3xl)}
.hm-rail-controls{display:flex;align-items:center;gap:var(--pc-space-md)}
.hm-rail-count{display:inline-flex;align-items:center;gap:var(--pc-space-md);color:var(--color-text-muted,#7a6f66)}
.hm-rail-count b{color:var(--satc-root-brew);font-weight:700}
.hm-rail-count i{width:24px;height:1px;background:currentColor}
.hm-rail{
  display:flex;
  gap:var(--pc-space-xl);
  overflow-x:auto;
  overscroll-behavior-x:contain;
  scroll-snap-type:x mandatory;
  scrollbar-width:none;
}
.hm-rail::-webkit-scrollbar{display:none}
.hm-rail>.hm-card{flex:0 0 calc((100% - 2 * var(--pc-space-xl)) / 3);scroll-snap-align:start}
@media(max-width:1024px){.hm-rail>.hm-card{flex-basis:calc((100% - var(--pc-space-xl)) / 2)}}
@media(max-width:700px){
  .hm-rail>.hm-card{flex-basis:85%}
  .hm-head-side{width:100%;justify-content:space-between}
}

/* Numbers band, matched to the redesign: warm gold label and icons, warm
   beige figures, dividers only between the four figures. */
.hm-numbers-panel{--hm-gold:#c9a66b;--hm-figure:#e8cf9f}
.shared-layout main .hm-numbers-panel .satc-kicker,.hm-stat-icon{color:var(--hm-gold)}
.hm-stat b{color:var(--hm-figure)}
.hm-stat:first-child{border-inline-start:0}

/* Project filters and the photo type badge are pills, as in the redesign
   (an exception to the site's fixed 4px corner). */
.hm-filters button,.hm-badge{border-radius:999px}

/* News section and news card, matched colour for colour to the redesign.
   The card rules key on the card itself so it looks the same on every page. */
.hm-news,.news-card{--hm-news-ink:#2a231d;--hm-news-gold:#8a6a33;--hm-news-muted:#7a6d60;--hm-news-link:#6b5440}
.hm-news>.hm-panel{background:#fff}
.shared-layout main .news-card.hm-card.satc-surface{border-color:#e2d8ca!important;border-radius:8px!important;background:#fff}
.shared-layout main .hm-news .hm-head .satc-kicker,.shared-layout main .news-card .hm-meta{color:var(--hm-news-gold)}
.shared-layout main :is(.hm-news .hm-title-row .satc-title,.news-card :is(h2,h3)){color:var(--hm-news-ink)!important;-webkit-text-fill-color:var(--hm-news-ink)}
.hm-news .hm-tabs button{color:var(--hm-news-muted)}
.hm-news .hm-tabs button.active{border-bottom-color:var(--hm-news-ink);color:var(--hm-news-ink)}
.hm-news .hm-more{color:var(--hm-news-ink);font-weight:700}
.news-card .hm-cta{color:var(--hm-news-link);font-weight:700}

/* Project card hover (mouse only, and only when motion is welcome): the card
   lifts, the photo zooms slowly under a warm brown fade, a gold rule draws
   along the bottom edge, the title turns gold and the arrow steps forward.
   Shared card, so it plays on the home rail, the archive and related lists. */
.project-card .hm-card-link{position:relative}
.project-card .hm-card-media::after{content:"";position:absolute;inset:0;background:linear-gradient(to top,rgb(57 39 30 / 55%),rgb(57 39 30 / 0%) 65%);opacity:0;pointer-events:none}
.project-card .hm-badge{z-index:1}
.project-card .hm-card-link::after{content:"";position:absolute;inset-inline:0;bottom:0;height:3px;background:#c9a66b;transform:scaleX(0);transform-origin:right;pointer-events:none}
[dir=ltr] .project-card .hm-card-link::after{transform-origin:left}
/* Room above the rail so a lifted card is not clipped by its scroll box. */
.hm-rail{padding-top:8px;margin-top:-8px}
@media (hover:hover) and (prefers-reduced-motion:no-preference){
  .project-card.hm-card{transition:transform .5s cubic-bezier(.2,.65,.3,1),border-color .3s ease}
  .project-card .hm-card-media img{transition:transform 900ms cubic-bezier(.2,.65,.3,1)}
  .project-card .hm-card-media::after{transition:opacity .5s ease}
  .project-card .hm-card-link::after{transition:transform .55s cubic-bezier(.2,.65,.3,1)}
  .project-card .hm-cta i{transition:translate .35s ease}
  .project-card.hm-card:hover{transform:translateY(-6px);border-color:#c9a66b}
  .project-card.hm-card:hover .hm-card-media img{transform:scale(1.08)}
  .project-card.hm-card:hover .hm-card-media::after{opacity:1}
  .project-card.hm-card:hover .hm-card-link::after{transform:scaleX(1)}
  .shared-layout main .project-card.hm-card.satc-surface:hover :is(h2,h3){color:#8a6a33;-webkit-text-fill-color:#8a6a33;transition:color .3s ease,-webkit-text-fill-color .3s ease}
  .project-card.hm-card:hover .hm-cta i{translate:-6px 0}
  [dir=ltr] .project-card.hm-card:hover .hm-cta i{translate:6px 0}
}

/* Arrow cursor on project and news photos, as on roshn.sa: a round glass
   disc with a thin diagonal arrow grows in at the photo's centre when the
   card is hovered and follows the pointer across the photo (main.js sets
   --cx/--cy). Mouse only; with reduced motion it stays centred. */
.hm-card-cursor{
  position:absolute;
  z-index:2;
  top:var(--cy,50%);
  left:var(--cx,50%);
  width:88px;
  height:88px;
  margin:-44px 0 0 -44px;
  display:grid;
  place-items:center;
  border:1px solid rgb(255 255 255 / 35%);
  border-radius:50%;
  background:rgb(255 255 255 / 18%);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  color:#fff;
  opacity:0;
  transform:scale(.4);
  pointer-events:none;
}
[dir=ltr] .hm-card-cursor svg{transform:scaleX(-1)}
.hm-card:hover .hm-card-cursor{opacity:1;transform:scale(1)}
@media (hover:none){.hm-card-cursor{display:none}}
@media (hover:hover){.hm-card-media.is-tracking{cursor:none}}
@media (prefers-reduced-motion:no-preference){
  .hm-card-cursor{transition:opacity .3s ease,transform .45s cubic-bezier(.2,.65,.3,1)}
  .hm-card-media.is-tracking .hm-card-cursor{transition:opacity .3s ease,transform .45s cubic-bezier(.2,.65,.3,1),top .12s linear,left .12s linear}
}

/* Home projects rail parallax (main.js shifts each photo with `translate`):
   photos sit pre-zoomed so the 5% drift never uncovers an edge, and zoom a
   little further on hover. Off when reduced motion is requested. */
@media (prefers-reduced-motion:no-preference){
  .hm-rail .hm-card-media img{transform:scale(1.12);will-change:translate}
}
@media (hover:hover) and (prefers-reduced-motion:no-preference){
  .hm-rail .project-card.hm-card:hover .hm-card-media img{transform:scale(1.18)}
}

/* Phones: the section head stacks and its main block sized to its content,
   so a long filter row (English) made it wider than the screen. Cap it so
   only the filter row scrolls. */
@media(max-width:700px){.hm-head-main,.hm-head-main .hm-title-row{max-width:100%}.hm-head-main{width:100%}}
