/* =========================================================
   Iva Sa'adon Portfolio (Block) — structural stylesheet
   Only what theme.json can't express: the sidebar grid,
   sticky positioning, image treatment, nav coloring, and
   the scroll-fade animation classes. Loaded on every view
   so the layout is identical across all templates.
   ========================================================= */

:root{
  --iva-radius:18px;
  --iva-gutter:64px;
  --iva-muted:#8c8c8c;
  --iva-muted-dim:#6e6e6e;
  --iva-body:#d8d8d8;
  --iva-divider:#2a2a2a;
  --iva-card:#161616;
}

/* Kill default block spacing that would fight the custom layout. */
body{margin:0;}

/* ---------- HEADER: full-width bar (logo + nav) ---------- */
.wp-block-group.site-header{
  max-width:1440px;
  margin-inline:auto;
  padding:34px var(--iva-gutter) 0;
  align-items:flex-start;
  gap:26px;
}
.site-header .site-branding .logo{
  margin:0;
  font-weight:700;
  letter-spacing:-0.02em;
  line-height:1.2;
}
.site-header .site-branding .logo a{color:#fff;text-decoration:none;}
.site-header .site-branding .logo-tagline{
  margin:2px 0 0;
  color:var(--iva-muted);
  letter-spacing:-0.02em;
  line-height:1.25;
}

/* Nav lives in the header now. */
.site-header .wp-block-navigation{
  font-weight:700;
  letter-spacing:-0.02em;
}
.site-header .wp-block-navigation .wp-block-navigation-item__content{
  color:var(--iva-muted-dim);
  transition:color .2s ease;
}
.site-header .wp-block-navigation .wp-block-navigation-item__content:hover,
.site-header .wp-block-navigation .current-menu-item .wp-block-navigation-item__content,
.site-header .wp-block-navigation .current_page_item .wp-block-navigation-item__content{
  color:#fff;
}

/* ---------- SHELL: two-column grid (sidebar + main) ---------- */
.wp-block-group.wrap{
  max-width:1440px;
  margin-inline:auto;
  padding-inline:var(--iva-gutter);
  padding-top:40px;
  display:grid;
  grid-template-columns:340px 1fr;
  column-gap:96px;
  align-items:start;
}

/* No-sidebar variant: single full-width column, sidebar removed. */
.wp-block-group.wrap.wrap--no-sidebar{
  display:block;
}
.wrap--no-sidebar .main--no-sidebar{
  max-width:none;
}
.wrap--no-sidebar .page-content--full{
  max-width:none;
}
/* No-sidebar templates render main directly (no .wrap). */
.wp-block-group.main--no-sidebar{
  max-width:1440px;
  margin-inline:auto;
  padding:40px var(--iva-gutter) 120px;
}

/* ---------- LEFT: sticky sidebar ---------- */
/* The sidebar template-part wrapper shouldn't create its own box. */
.wrap > .wp-block-template-part{display:contents;}

.wrap .sidebar{
  position:sticky;
  top:0;
  padding-top:0;
  padding-bottom:64px;
  min-height:100vh;
}

.sidebar .name{
  margin:0;
  font-weight:700;
  letter-spacing:-0.02em;
  line-height:1.2;
}
.sidebar .role{
  margin:0;
  font-weight:400;
  color:var(--iva-muted);
  line-height:1.25;
  letter-spacing:-0.02em;
}
.sidebar .divider.wp-block-separator{
  border:0;
  height:1px;
  background:var(--iva-divider);
  margin:30px 0 28px;
  max-width:none;
  opacity:1;
}
.sidebar .bio{
  transition:opacity .12s linear;
  will-change:opacity;
}
.sidebar .bio p{
  color:var(--iva-body);
  line-height:1.55;
  margin:0 0 20px;
  max-width:300px;
}
.sidebar .bio strong{color:#fff;font-weight:700;}
.sidebar .kiss{margin-top:20px;}
.sidebar .kiss p{
  color:var(--iva-body);
  line-height:1.55;
  margin:0;
  max-width:300px;
}
.sidebar .kiss strong{color:#fff;font-weight:700;}

.sidebar .contact{margin-top:36px;}
.sidebar .contact .contact-link{
  margin:0;
  padding:14px 0;
  font-size:13.5px;
  color:var(--iva-body);
}
.sidebar .contact .contact-link a{color:var(--iva-body);text-decoration:none;}
.sidebar .contact .contact-link:first-child{
  border-top:1px solid var(--iva-divider);
  border-bottom:1px solid var(--iva-divider);
}
.sidebar .arrow{display:inline-block;margin-left:2px;}

/* ---------- RIGHT: main column ---------- */
.wrap .main{
  padding-top:0;
  padding-bottom:120px;
}

/* ---------- PROJECTS ---------- */
.main .project{
  display:grid;
  grid-template-columns:420px 1fr;
  column-gap:64px;
  margin-bottom:96px;
  transition:opacity .12s linear;
  will-change:opacity;
}
.main .project:last-of-type{margin-bottom:0;}

.main .project-img{
  width:100%;
  aspect-ratio:1/1;
  border-radius:var(--iva-radius);
  overflow:hidden;
  background:var(--iva-card);
  margin:0;
}
.main .project-img img,
.main .project-img .wp-block-post-featured-image img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.main .project-img figure{margin:0;height:100%;}

.main .project-title{
  margin:0 0 24px;
  font-weight:700;
  letter-spacing:-0.03em;
  line-height:1.15;
}
.main .project-title a{color:#fff;text-decoration:none;}
.main .project-body p,
.main .project-body{
  color:var(--iva-muted);
  line-height:1.5;
  margin:0 0 16px;
  max-width:430px;
}
.main .project-body p:last-child{margin-bottom:0;}

/* ---------- GENERIC PAGE / POST CONTENT ---------- */
.main .page-content{max-width:720px;}
.main .page-content--full{max-width:none;}
.main .page-title{
  margin:0 0 24px;
  font-weight:700;
  letter-spacing:-0.03em;
  line-height:1.15;
}
.main .page-content p{color:var(--iva-body);line-height:1.6;}
.main .page-content a{color:#fff;text-decoration:underline;}
.main .page-content h2,
.main .page-content h3{color:#fff;letter-spacing:-0.02em;}

.main .post-meta{
  color:var(--iva-muted-dim);
  gap:16px;
  margin:0 0 28px;
}
.main .post-meta a{color:var(--iva-muted-dim);}

.main .end-rule.wp-block-separator{
  border:0;
  height:1px;
  background:var(--iva-divider);
  margin-top:8px;
  max-width:none;
  opacity:1;
}

.main .pagination{margin-top:64px;color:var(--iva-muted);}
.main .pagination a{color:var(--iva-body);}

/* ---------- RESPONSIVE ---------- */
@media (max-width:1100px){
  .wp-block-group.site-header{padding-inline:40px;}
  .wp-block-group.wrap{
    padding-inline:40px;
    grid-template-columns:300px 1fr;
    column-gap:56px;
  }
  .wp-block-group.main--no-sidebar{padding-inline:40px;}
  .main .project{grid-template-columns:340px 1fr;column-gap:48px;}
}

@media (max-width:781px){
  .wp-block-group.wrap{
    grid-template-columns:1fr;
    row-gap:24px;
  }
  .wrap .sidebar{
    position:static;
    min-height:0;
    padding-bottom:24px;
  }
  .main .project{
    grid-template-columns:1fr;
    row-gap:20px;
    margin-bottom:64px;
  }
}

/* Respect reduced-motion: disable the fade transitions entirely. */
@media (prefers-reduced-motion:reduce){
  .sidebar .bio,
  .main .project{transition:none;opacity:1 !important;}
}
