/**
 * 아티클 새 디자인 (includes/ubw-posts.php 가 붙인 body 클래스로만 적용)
 * - body.ubw-article      : 글 상세 (Divi single.php)
 * - body.ubw-post-archive : 분류/검색 목록 (Divi index.php) + 위 검정 배너(.ubw-page-banner)
 * - body.ubw-news-page    : /news/ (Divi 빌더: 전체폭 헤더 + 블로그 그리드 모듈)
 */

:is(body.ubw-article, body.ubw-post-archive, body.ubw-news-page){
  --ps-ink:#0D1412;--ps-mint:#1FD1A5;--ps-mint-d:#0FA883;--ps-lime:#D9FF3F;--ps-paper:#F5F4EE;
  --ps-muted:#6B7570;--ps-line:rgba(13,20,18,.1);--ps-text:#3b4541;
}

/* ---------- 공통 틀: 베이지 바탕, 사이드바 배너 숨김 ---------- */
:is(body.ubw-article, body.ubw-post-archive) #main-content{background-color:var(--ps-paper)}
:is(body.ubw-article, body.ubw-post-archive) #main-content .container{padding-top:40px}
:is(body.ubw-article, body.ubw-post-archive) #main-content .container::before{display:none}
:is(body.ubw-article, body.ubw-post-archive) #sidebar{display:none}
:is(body.ubw-article, body.ubw-post-archive) #page-container #left-area{width:100%;float:none;padding:0 0 80px}

/* ---------- 검정 배너 (분류/검색 목록) ---------- */
.ubw-page-banner{position:relative;overflow:hidden;padding:70px 0 64px;background:var(--ps-ink,#0D1412)}
.ubw-page-banner::before{
  content:"";position:absolute;right:-160px;top:-220px;width:620px;height:620px;border-radius:50%;
  background:radial-gradient(circle,rgba(31,209,165,.32),transparent 62%);pointer-events:none;
}
.ubw-page-banner .container{position:relative;z-index:1}
.ubw-page-banner small{
  display:block;margin:0 0 12px;font-family:'Manrope',sans-serif;font-size:12px;font-weight:800;letter-spacing:.2em;text-transform:uppercase;color:#1FD1A5;
}
.ubw-page-banner h1{
  margin:0;padding:0;font-family:'Unbounded','Manrope','Pretendard',sans-serif;font-size:44px;font-weight:700;line-height:1.15;
  letter-spacing:-.02em;color:#fff;word-break:keep-all;
}
body:not(.search) .ubw-page-banner h1{text-transform:capitalize} /* 분류 이름(notice → Notice). 검색어는 입력 그대로 */

/* ---------- 글 상세 ---------- */
body.ubw-article #left-area{max-width:820px;margin:0 auto}
body.ubw-article article.et_pb_post{margin:0;padding:0}
body.ubw-article .et_post_meta_wrapper:first-child{margin:0 0 22px}
body.ubw-article .et_post_meta_wrapper h1.entry-title{
  margin:0 0 14px;padding:0;font-family:'Manrope','Pretendard',sans-serif;font-size:34px;font-weight:800;line-height:1.3;
  letter-spacing:-.015em;color:var(--ps-ink);word-break:keep-all;
}
body.ubw-article p.post-meta,
body.ubw-post-archive p.post-meta{
  margin:0 0 20px;padding:0;font-family:'Manrope','Pretendard',sans-serif;font-size:13px;font-weight:600;color:var(--ps-muted);
}
:is(body.ubw-article, body.ubw-post-archive) p.post-meta a{color:var(--ps-mint-d);font-weight:700;text-decoration:none}
:is(body.ubw-article, body.ubw-post-archive) p.post-meta a:hover{text-decoration:underline}
body.ubw-article .et_post_meta_wrapper > img{display:block;width:100%;max-height:440px;object-fit:cover;border-radius:22px}

/* 본문: 흰 카드 */
body.ubw-article .entry-content{
  padding:40px 44px !important;border:1px solid var(--ps-line);border-radius:22px;background:#fff;
  font-family:'Pretendard','Manrope',sans-serif;font-size:16px;line-height:1.85;color:var(--ps-text);overflow-wrap:anywhere;
}
body.ubw-article .entry-content p{padding:0 0 1em}
body.ubw-article .entry-content :is(h2,h3,h4){
  margin:1.4em 0 .6em;padding:0;font-family:'Manrope','Pretendard',sans-serif;font-weight:800;line-height:1.35;color:var(--ps-ink);
}
body.ubw-article .entry-content h2{font-size:24px}
body.ubw-article .entry-content h3{font-size:20px}
body.ubw-article .entry-content :is(h2,h3,h4):first-child{margin-top:0}
body.ubw-article .entry-content strong{color:var(--ps-ink)}
body.ubw-article .entry-content a{color:var(--ps-mint-d);font-weight:700;text-decoration:underline;text-underline-offset:3px}
body.ubw-article .entry-content img{border-radius:16px}
body.ubw-article .entry-content :is(ul,ol){padding-left:1.3em;margin:0 0 1em}

/* 댓글 */
body.ubw-article #comment-wrap{
  margin:20px 0 0;padding:32px 40px 30px;border:1px solid var(--ps-line);border-radius:22px;background:#fff;
  font-family:'Manrope','Pretendard',sans-serif;
}
body.ubw-article #comment-section.nocomments{display:none}
body.ubw-article #comment-wrap :is(#comments,.comment-reply-title){
  margin:0 0 14px;padding:0;font-family:'Manrope','Pretendard',sans-serif;font-size:18px;font-weight:800;color:var(--ps-ink);
}
body.ubw-article #commentform{padding:0}
body.ubw-article #commentform :is(input[type="text"],input[type="email"],input[type="url"],textarea){
  width:100%;margin:0;padding:12px 14px;box-sizing:border-box;border:1.5px solid rgba(13,20,18,.12) !important;border-radius:12px;
  background:#fff !important;font-family:'Pretendard','Manrope',sans-serif;font-size:15px;color:var(--ps-ink);
}
body.ubw-article #commentform textarea{min-height:120px}
body.ubw-article #commentform :is(input,textarea):focus{outline:none;border-color:var(--ps-mint) !important;box-shadow:0 0 0 3px rgba(31,209,165,.18)}
body.ubw-article #commentform .form-submit{float:none;margin:12px 0 0;padding:0;text-align:right}
body.ubw-article #commentform .submit{
  float:none;margin:0;padding:12px 26px !important;border:0 !important;border-radius:999px !important;background:var(--ps-lime) !important;
  color:var(--ps-ink) !important;font-family:'Manrope','Pretendard',sans-serif;font-size:14px !important;font-weight:800;cursor:pointer;
}
body.ubw-article #commentform .submit:hover{box-shadow:0 10px 26px rgba(217,255,63,.4)}
body.ubw-article #commentform .submit::after{display:none}

/* 다른 글 목록 (Ad Inserter 블록: .post-navigation-rel) */
body.ubw-article .post-navigation-rel{
  margin:20px 0 0;padding:28px 36px;border:0;border-radius:22px;background:var(--ps-ink);color:#fff;
}
body.ubw-article .post-navigation-rel h3{
  margin:0 0 12px;padding:0;font-family:'Manrope',sans-serif;font-size:12px;font-weight:800;letter-spacing:.2em;text-transform:uppercase;color:var(--ps-mint);
}
body.ubw-article .post-navigation-rel p{margin:0;padding:10px 0;border-top:1px solid rgba(255,255,255,.1);font-size:15px;line-height:1.5}
body.ubw-article .post-navigation-rel p:first-of-type{border-top:0}
body.ubw-article .post-navigation-rel p:empty{display:none}
body.ubw-article .post-navigation-rel a{color:#fff;font-weight:700;text-decoration:none}
body.ubw-article .post-navigation-rel a:hover{color:var(--ps-lime)}
body.ubw-article :is(.code-block-1, #left-area > div[class^="code-block"]) hr,
body.ubw-article .post-navigation-rel hr{display:none}

/* ---------- 분류/검색 목록: 카드 그리드 ---------- */
body.ubw-post-archive #left-area{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px}
body.ubw-post-archive #left-area > article.et_pb_post{
  display:block;margin:0;padding:0 24px 22px;border:1px solid var(--ps-line);border-radius:22px;background:#fff;overflow:hidden;
  font-family:'Pretendard','Manrope',sans-serif;font-size:14px;line-height:1.7;color:var(--ps-text);
  transition:transform .2s,box-shadow .2s;
}
body.ubw-post-archive #left-area > article.et_pb_post:hover{transform:translateY(-3px);box-shadow:0 18px 40px rgba(13,20,18,.08)}
body.ubw-post-archive article .entry-featured-image-url{display:block;margin:0 -24px 20px;aspect-ratio:16/10;overflow:hidden}
body.ubw-post-archive article .entry-featured-image-url img{width:100%;height:100%;object-fit:cover}
body.ubw-post-archive article:not(:has(.entry-featured-image-url)){padding-top:24px}
body.ubw-post-archive article h2.entry-title{
  margin-top:0;margin-bottom:8px;padding:0;font-family:'Manrope','Pretendard',sans-serif;font-size:19px;font-weight:800;line-height:1.4;word-break:keep-all;
}
body.ubw-post-archive article h2.entry-title a{color:var(--ps-ink);text-decoration:none}
body.ubw-post-archive article p.post-meta{margin-bottom:10px}
body.ubw-post-archive #left-area > :is(.pagination, p, h1, .entry){grid-column:1 / -1}
body.ubw-post-archive .pagination a{
  display:inline-flex;align-items:center;padding:10px 20px;border-radius:999px;background:var(--ps-ink);color:#fff;
  font-family:'Manrope',sans-serif;font-size:14px;font-weight:800;text-decoration:none;
}

/* ---------- /news/ 페이지 (Divi 빌더) ---------- */
body.ubw-news-page .et_pb_section:has(> .et_pb_fullwidth_header){background:#0D1412 !important}
body.ubw-news-page .et_pb_section:has(> .et_pb_fullwidth_header) .et_parallax_bg_wrap{display:none}
body.ubw-news-page .et_pb_fullwidth_header{position:relative;overflow:hidden;background:#0D1412 !important}
body.ubw-news-page .et_pb_fullwidth_header .et_pb_fullwidth_header_overlay{background:transparent !important}
body.ubw-news-page .et_pb_fullwidth_header::before{
  content:"";position:absolute;right:-160px;top:-220px;width:620px;height:620px;border-radius:50%;
  background:radial-gradient(circle,rgba(31,209,165,.32),transparent 62%);pointer-events:none;
}
body.ubw-news-page .et_pb_fullwidth_header .et_pb_fullwidth_header_container{position:relative;z-index:1}
body.ubw-news-page .et_pb_fullwidth_header .et_pb_module_header{
  font-family:'Manrope','Pretendard',sans-serif !important;font-size:12px !important;font-weight:800 !important;
  letter-spacing:.2em !important;text-transform:uppercase;color:#1FD1A5 !important;
}
body.ubw-news-page .et_pb_fullwidth_header .et_pb_fullwidth_header_subhead{
  font-family:'Unbounded','Manrope','Pretendard',sans-serif !important;font-size:44px !important;font-weight:700 !important;
  line-height:1.15 !important;letter-spacing:-.02em;color:#fff !important;
}
body.ubw-news-page #main-content .et_pb_section:not(:has(> .et_pb_fullwidth_header)){background-color:#F5F4EE}
body.ubw-news-page #main-content .et_pb_section:last-child{margin-bottom:0 !important;padding-bottom:80px}
/* 블로그 그리드 카드 */
body.ubw-news-page .et_pb_blog_grid .et_pb_post{
  margin-bottom:22px;padding:0 0 22px;border:1px solid var(--ps-line) !important;border-radius:22px;background:#fff;overflow:hidden;
  font-family:'Pretendard','Manrope',sans-serif;transition:transform .2s,box-shadow .2s;
}
body.ubw-news-page .et_pb_blog_grid .et_pb_post:hover{transform:translateY(-3px);box-shadow:0 18px 40px rgba(13,20,18,.08)}
body.ubw-news-page .et_pb_blog_grid .et_pb_image_container{margin:0 0 18px}
body.ubw-news-page .et_pb_blog_grid .et_pb_post .entry-featured-image-url{margin:0}
body.ubw-news-page .et_pb_blog_grid .et_pb_post > :not(.et_pb_image_container){margin-left:22px;margin-right:22px}
body.ubw-news-page .et_pb_blog_grid h2.entry-title{
  padding:0 0 8px;font-family:'Manrope','Pretendard',sans-serif !important;font-size:17px !important;font-weight:800 !important;line-height:1.4 !important;word-break:keep-all;
}
body.ubw-news-page .et_pb_blog_grid h2.entry-title a{color:var(--ps-ink) !important}
body.ubw-news-page .et_pb_blog_grid p.post-meta{margin:0 0 10px;font-family:'Manrope','Pretendard',sans-serif;font-size:12px;font-weight:600;color:var(--ps-muted) !important}
body.ubw-news-page .et_pb_blog_grid p.post-meta a{color:var(--ps-mint-d) !important;font-weight:700}
body.ubw-news-page .et_pb_blog_grid .post-content{font-size:14px;line-height:1.7;color:var(--ps-text)}

/* ---------- 모바일 ---------- */
@media (max-width:980px){
  body.ubw-post-archive #left-area{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:640px){
  body.ubw-post-archive #left-area{grid-template-columns:minmax(0,1fr)}
}
@media (max-width:760px){
  .ubw-page-banner{padding:50px 0 46px}
  .ubw-page-banner h1,
  body.ubw-news-page .et_pb_fullwidth_header .et_pb_fullwidth_header_subhead{font-size:28px !important}
  body.ubw-article .et_post_meta_wrapper h1.entry-title{font-size:24px}
  body.ubw-article .entry-content{padding:26px 22px !important;font-size:15px}
  body.ubw-article #comment-wrap{padding:24px 22px}
  body.ubw-article .post-navigation-rel{padding:24px 22px}
}

/* ---------- 404 (404.php) ---------- */
body.error404 #main-content.ubw-404{background:#0D1412}
.ubw-404__box{position:relative;overflow:hidden;padding:110px 0 120px;text-align:center;color:#fff}
.ubw-404__box :is(.ubw-404__kicker,.ubw-404__num,.ubw-404__title,.ubw-404__desc){text-align:center !important}
.ubw-404__box::before{
  content:"";position:absolute;left:50%;top:-260px;width:720px;height:720px;transform:translateX(-50%);border-radius:50%;
  background:radial-gradient(circle,rgba(31,209,165,.28),transparent 62%);pointer-events:none;
}
.ubw-404__box .container{position:relative;z-index:1}
.ubw-404__kicker{display:block;font-family:'Manrope',sans-serif;font-size:12px;font-weight:800;letter-spacing:.2em;text-transform:uppercase;color:#1FD1A5}
.ubw-404__num{
  margin:6px 0 0;padding:0;font-family:'Unbounded','Manrope',sans-serif;font-size:150px;font-weight:700;line-height:1;letter-spacing:-.04em;color:#D9FF3F;
}
.ubw-404__title{
  margin:18px 0 10px;padding:0;font-family:'Unbounded','Manrope','Pretendard',sans-serif;font-size:32px;font-weight:700;line-height:1.2;color:#fff;
}
.ubw-404__desc{margin:0 auto;padding:0;max-width:460px;font-family:'Pretendard','Manrope',sans-serif;font-size:16px;line-height:1.7;color:rgba(255,255,255,.7)}
.ubw-404__cta{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin-top:30px}
.ubw-404__btn{
  display:inline-flex;align-items:center;min-height:48px;padding:0 24px;border:1px solid rgba(255,255,255,.25);border-radius:999px;
  font-family:'Manrope','Pretendard',sans-serif;font-size:14px;font-weight:800;color:#fff !important;text-decoration:none;transition:border-color .2s,box-shadow .2s;
}
.ubw-404__btn:hover{border-color:#fff}
.ubw-404__btn.is-lime{border-color:#D9FF3F;background:#D9FF3F;color:#0D1412 !important}
.ubw-404__btn.is-lime:hover{box-shadow:0 10px 26px rgba(217,255,63,.35)}
@media (max-width:760px){
  .ubw-404__box{padding:70px 0 80px}
  .ubw-404__num{font-size:96px}
  .ubw-404__title{font-size:24px}
}

/* 검색 결과 없음 (Divi no-results): 카드 그리드 전체 폭 안내 상자 */
body.ubw-post-archive #left-area > :is(article.not_found, .entry){
  grid-column:1 / -1;padding:50px 24px;border:1px dashed var(--ps-line);border-radius:22px;background:#fff;text-align:center;
  font-family:'Pretendard','Manrope',sans-serif;font-size:15px;line-height:1.7;color:var(--ps-muted);
}
body.ubw-post-archive :is(article.not_found, .entry) .not-found-title{
  margin:0 0 8px;padding:0;font-family:'Manrope','Pretendard',sans-serif;font-size:20px;font-weight:800;color:var(--ps-ink);
}
