/* =========================================================
   ALLINFOWORLD119 · RELATED ENGINE V1
   글 ↔ 계산기 자동 연결
========================================================= */

.aiw-related-section{
  width:100%;
  margin:38px 0 8px;
  padding:24px;
  border:1px solid #dfe7f0;
  border-radius:18px;
  background:
    radial-gradient(circle at 100% 0%,rgba(45,106,168,.07),transparent 34%),
    linear-gradient(180deg,#ffffff 0%,#f9fbfd 100%);
  box-shadow:0 10px 30px rgba(16,42,67,.055);
}

.aiw-related-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:20px;
  margin-bottom:17px;
}

.aiw-related-head-copy{
  min-width:0;
}

.aiw-related-eyebrow{
  display:block;
  margin-bottom:5px;
  color:#2d6aa8;
  font-size:10px;
  line-height:1.4;
  font-weight:900;
  letter-spacing:.12em;
}

.aiw-related-head h3{
  margin:0;
  color:#101828;
  font-size:20px;
  line-height:1.4;
  font-weight:880;
  letter-spacing:-.04em;
}

.aiw-related-head p{
  margin:5px 0 0;
  color:#7c8898;
  font-size:11.5px;
  line-height:1.6;
  word-break:keep-all;
}

.aiw-related-badge{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  min-height:27px;
  padding:0 9px;
  border:1px solid #d9e5f1;
  border-radius:999px;
  background:#f4f8fc;
  color:#426f9e;
  font-size:9.5px;
  font-weight:850;
  letter-spacing:.05em;
}

.aiw-related-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:11px;
}

.aiw-related-card{
  position:relative;
  display:flex;
  flex-direction:column;
  min-width:0;
  min-height:132px;
  padding:17px;
  border:1px solid #e2e8ef;
  border-radius:14px;
  background:#fff;
  color:inherit!important;
  text-decoration:none!important;
  box-shadow:0 3px 10px rgba(16,24,40,.025);
  transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease;
}

.aiw-related-card:hover{
  transform:translateY(-3px);
  border-color:#c5d7e8;
  box-shadow:0 10px 24px rgba(16,42,67,.075);
}

.aiw-related-card-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:12px;
}

.aiw-related-card-icon{
  display:grid;
  place-items:center;
  width:34px;
  height:34px;
  border-radius:10px;
  background:#eef5fb;
  color:#2d6aa8;
}

.aiw-related-card-icon .aiw-icon{
  width:17px;
  height:17px;
}

.aiw-related-card-arrow{
  color:#9aa8b8;
  font-size:18px;
  line-height:1;
  transition:transform .18s ease,color .18s ease;
}

.aiw-related-card:hover .aiw-related-card-arrow{
  transform:translateX(2px);
  color:#2d6aa8;
}

.aiw-related-card strong{
  display:block;
  color:#172b44;
  font-size:14px;
  line-height:1.45;
  font-weight:850;
  letter-spacing:-.025em;
  word-break:keep-all;
}

.aiw-related-card p{
  display:-webkit-box;
  margin:6px 0 0;
  overflow:hidden;
  color:#718095;
  font-size:10.8px;
  line-height:1.55;
  word-break:keep-all;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
}

.aiw-related-card small{
  display:block;
  margin-top:auto;
  padding-top:11px;
  color:#98a2b3;
  font-size:9.5px;
  line-height:1.35;
}

.aiw-related-list{
  display:grid;
  gap:8px;
}

.aiw-related-article{
  display:grid;
  grid-template-columns:34px minmax(0,1fr) 18px;
  gap:11px;
  align-items:center;
  min-width:0;
  padding:12px 13px;
  border:1px solid #e5eaf0;
  border-radius:12px;
  background:#fff;
  color:inherit!important;
  text-decoration:none!important;
  transition:background .16s ease,border-color .16s ease,transform .16s ease;
}

.aiw-related-article:hover{
  transform:translateY(-1px);
  border-color:#cddbe9;
  background:#f7fafd;
}

.aiw-related-article-no{
  display:grid;
  place-items:center;
  width:34px;
  height:34px;
  border-radius:10px;
  background:#eef5fb;
  color:#2d6aa8;
  font-size:9.5px;
  font-weight:900;
}

.aiw-related-article-copy{
  min-width:0;
}

.aiw-related-article-title{
  display:block;
  overflow:hidden;
  color:#26384f;
  font-size:12.5px;
  line-height:1.45;
  font-weight:800;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.aiw-related-article-meta{
  display:block;
  margin-top:3px;
  overflow:hidden;
  color:#98a2b3;
  font-size:9.5px;
  line-height:1.35;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.aiw-related-article-arrow{
  color:#9aa8b8;
  font-size:18px;
  line-height:1;
}

.aiw-related-footer{
  display:flex;
  justify-content:flex-end;
  margin-top:12px;
}

.aiw-related-more{
  display:inline-flex;
  align-items:center;
  min-height:30px;
  color:#2d6aa8!important;
  font-size:10.5px;
  font-weight:800;
  text-decoration:none!important;
}

.aiw-related-empty{
  padding:17px;
  border:1px dashed #d8e1ea;
  border-radius:12px;
  background:#fbfcfe;
  color:#7b8797;
  font-size:11.5px;
  line-height:1.65;
}

.aiw-related-loading{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:54px;
  color:#7b8797;
  font-size:11px;
}

.aiw-related-spinner{
  width:18px;
  height:18px;
  border:2px solid #e0e8f0;
  border-top-color:#2d6aa8;
  border-radius:50%;
  animation:aiwRelatedSpin .75s linear infinite;
}

@keyframes aiwRelatedSpin{
  to{transform:rotate(360deg);}
}

/* 일반 글 안의 추천박스 링크는 본문 기본 underline 규칙에서 제외 */
.allinfo-article-body + .aiw-related-section a,
.aiw-related-section a{
  text-decoration:none!important;
}

/* 계산기 페이지에서 추천 글 블록 */
body.allinfo-has-calculator .aiw-related-section{
  width:min(var(--ai-width-wide),100%);
  margin:28px auto 10px;
}

@media (max-width:800px){
  .aiw-related-grid{
    grid-template-columns:1fr;
  }

  .aiw-related-section{
    margin-top:30px;
    padding:19px;
    border-radius:15px;
  }

  .aiw-related-head{
    align-items:flex-start;
    flex-direction:column;
    gap:8px;
  }

  .aiw-related-head h3{
    font-size:18px;
  }

  .aiw-related-card{
    min-height:110px;
  }
}

@media (max-width:480px){
  .aiw-related-section{
    padding:16px;
  }

  .aiw-related-article{
    grid-template-columns:30px minmax(0,1fr) 14px;
    gap:8px;
    padding:10px;
  }

  .aiw-related-article-no{
    width:30px;
    height:30px;
  }

  .aiw-related-article-title{
    font-size:11.5px;
  }
}
