/* Post Info layout (hero + 1140px content grid) */
.cew-post-info{
  display:flex;
  flex-direction:column;
  margin:0;
}

.cew-post-info__hero{
  position:relative;
  width:100%;
  min-height:320px;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  padding:90px 20px 54px;
  box-sizing:border-box;
  overflow:hidden;
}

.cew-post-info__hero-bg{
  position:absolute;
  inset:0;
  background-image:var(--cew-hero-image);
  background-size:cover;
  background-position:center;
  transform:scale(1.02);
  filter:brightness(.65) contrast(1.05);
}

.cew-post-info__hero-overlay{
  position:absolute;
  inset:0;
  background:linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.55) 60%, rgba(0,0,0,.78) 100%);
  pointer-events:none;
}

.cew-post-info__hero-inner{
  position:relative;
  width:min(1140px, 100%);
}

.cew-post-info__hero-title{
  margin:0;
  color:#fff;
  text-shadow:0 12px 34px rgba(0,0,0,.45);
}

.cew-post-info__title{
  margin:0;
}

.cew-post-info__title a{
  color:inherit;
  text-decoration:none;
}
.cew-post-info__title a:hover{
  text-decoration:underline;
}

.cew-post-info__meta{
  display:flex;
  gap:14px;
  flex-wrap:wrap;
  align-items:center;
  opacity:.85;
}

/* Meta placement: desktop in main column, mobile/tablet above TOC */
.cew-post-info__meta-wrap--toc{display:none;}
@media (max-width: 1024px){
  .cew-post-info__meta-wrap--toc{display:block;margin-bottom:14px;}
  .cew-post-info__meta-wrap--main{display:none;}
}

.cew-post-info__author{
  display:inline-flex;
  align-items:center;
  gap:10px;
}
.cew-post-info__avatar{
  display:inline-flex;
  line-height:0;
}
.cew-post-info__avatar img{
  display:block;
}
.cew-post-info__author-text{
  display:flex;
  flex-direction:column;
  gap:2px;
}
.cew-post-info__author-role{
  opacity:.75;
  font-size:.9em;
}

.cew-post-info__meta-parts{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.cew-post-info__meta-part + .cew-post-info__meta-part:before{
  content:"·";
  margin-right:10px;
  opacity:.6;
}

.cew-post-info__desc{
  opacity:.9;
}

.cew-post-info__content{
  width:100%;
  display:flex;
  justify-content:center;
  padding:var(--cew-content-pad-top, 28px) 20px 40px;
  box-sizing:border-box;
}

.cew-post-info__content-inner{
  width:min(1140px, 100%);
  position:relative;
}

.cew-post-info__grid{
  display:flex;
  gap:28px;
  align-items:flex-start;
}

.cew-post-info__col--toc{
  flex:0 0 30%;
  max-width:30%;
  align-self:flex-start;
}

.cew-post-info__col--main{
  flex:1 1 auto;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:16px;
}

@media (max-width: 1024px){
  .cew-post-info__grid{flex-direction:column}
  .cew-post-info__col--toc{flex:0 0 auto;max-width:none;width:100%}
}

/* Desktop-only: fixed TOC column */
@media (min-width: 1025px){
  .cew-post-info .cew-post-info__col--toc{
    position:static;
    top:auto;
    left:auto;
    width:auto;
    max-width:30%;
    z-index:auto;
  }

  /* Make room for fixed TOC when activated */
  .cew-post-info.cew-toc-fixed .cew-post-info__col--toc{
    position:fixed;
    top:calc(var(--cew-toc-top, 40px) + 50vh);
    transform:translateY(-50%);
    left:var(--cew-toc-left, calc(50% - 570px));
    width:var(--cew-toc-width, 342px);
    max-width:calc(100vw - 40px);
    z-index:10;
  }

  /* End-stop: pin TOC to bottom of content container near footer */
  .cew-post-info.cew-toc-bottom .cew-post-info__col--toc{
    position:absolute;
    top:auto;
    bottom:var(--cew-toc-bottom, 20px);
    left:0;
    width:var(--cew-toc-width, 342px);
    max-width:30%;
    z-index:10;
    transform:none;
  }

  .cew-post-info.cew-toc-fixed .cew-post-info__col--main{
    margin-left:calc(342px + 28px);
  }

  /* If width is dynamic, keep spacing in sync */
  .cew-post-info.cew-toc-fixed .cew-post-info__col--main{
    margin-left:calc(var(--cew-toc-width, 342px) + 28px);
  }
}

.cew-post-info__toc{
  position:relative;
  padding:22px 22px 18px;
  border-radius:20px;
  border:0;
  background:#f4f4f4;
  box-shadow:0 10px 30px rgba(0,0,0,.06);
}

.cew-post-info__toc-title{
  font-weight:500;
  margin:0 0 18px;
  opacity:.75;
  font-size:16px;
}

.cew-post-info__toc-list{
  list-style:none;
  padding:0;
  margin:0;
  display:flex;
  flex-direction:column;
}

.cew-post-info__toc-item a{
  text-decoration:none;
  color:inherit;
  opacity:.95;
  font-weight:500;
  display:inline-block;
  transform:translateX(0);
  transition:transform .18s ease, text-decoration-color .18s ease, opacity .18s ease;
}
.cew-post-info__toc-item a:hover{opacity:1;text-decoration:underline}
.cew-post-info__toc-item.is-h3{padding-left:10px;opacity:.95}
.cew-post-info__toc-item.is-h4{padding-left:18px;opacity:.9}

.cew-post-info__toc-item.is-active a{
  text-decoration:underline;
  transform:translateX(8px);
}

.cew-post-info__toc-footer{
  margin-top:18px;
  display:flex;
  flex-direction:column;
  gap:14px;
}

.cew-post-info__toc-progress{
  height:3px;
  width:100%;
  background:rgba(0,0,0,.18);
  border-radius:999px;
  overflow:hidden;
}
.cew-post-info__toc-progress-bar{
  display:block;
  height:100%;
  width:calc(var(--cew-toc-progress, 0) * 100%);
  background:#111;
  border-radius:999px;
  transition:width .08s linear;
}

.cew-post-info__share-icons{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

.cew-post-info__share-ico{
  width:34px;
  height:34px;
  border-radius:6px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:transparent;
  color:#111;
  text-decoration:none;
  border:0;
  cursor:pointer;
  padding:0;
}

.cew-post-info__share-ico svg{
  width:18px;
  height:18px;
  display:block;
}
.cew-post-info__share-ico:hover{
  background:rgba(0,0,0,.04);
}

/* Responsive behavior */
@media (max-width: 1024px){
  .cew-post-info__toc-progress{display:none !important;}
  .cew-post-info__toc-footer .cew-post-info__share-icons{display:none !important;}
  .cew-post-info__share-icons-end{display:block;}
}

@media (min-width: 1025px){
  .cew-post-info__share-icons-end{display:none;}
  /* Work Info: share in main column on desktop (TOC column is often empty; icons were easy to miss). */
  .elementor-widget-cew_work_info .cew-post-info__toc-footer .cew-post-info__share-icons{display:none !important;}
  .elementor-widget-cew_work_info .cew-post-info__share-icons-end{display:block !important;}
  .elementor-widget-cew_resource_info .cew-post-info__toc-footer .cew-post-info__share-icons{display:none !important;}
  .elementor-widget-cew_resource_info .cew-post-info__share-icons-end{display:block !important;}
}

.cew-post-info__share-icons-end{
  margin-top:18px;
}

.cew-post-info__content-body{
  line-height:1.65;
}

.cew-post-info__content-body h2,
.cew-post-info__content-body h3,
.cew-post-info__content-body h4{
  scroll-margin-top:90px;
}

.cew-post-info__share{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
.cew-post-info__share-label{
  opacity:.8;
}
.cew-post-info__share-links{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
.cew-post-info__share-link,
.cew-post-info__share-copy{
  background:transparent;
  border:0;
  padding:0;
  font:inherit;
  cursor:pointer;
  text-decoration:none;
}
.cew-post-info__share-link:hover,
.cew-post-info__share-copy:hover{
  text-decoration:underline;
}

