/* TOA Terms 1.2.1 — all rules opt in through the page body class.
   Keep the article directly inside the WordPress Post Content block.
   Bump the PHP version argument when changing this stylesheet. */
body.toa-terms-page {
  --terms-bg:#000;
  --terms-text:#d7d7d7;
  --terms-heading:#f2eee8;
  --terms-muted:#aaa;
  --terms-accent:#c7ae91;
  --terms-width:780px;
  --terms-side:22px;
  --terms-top:64px;
  --terms-bottom:96px;
  --terms-title:clamp(42px,7vw,78px);
  --terms-subtitle:clamp(19px,3vw,25px);
  --terms-body:16px;
  --terms-leading:1.95;
  --terms-section:56px;
  background:var(--terms-bg);
}
body.toa-terms-page .wp-site-blocks { background:var(--terms-bg); }
body.toa-terms-page main {
  box-sizing:border-box;
  width:100%; max-width:none; min-width:0;
  margin:0!important; padding:0!important;
  background:var(--terms-bg);
}
body.toa-terms-page main :is(.wp-block-post-title, .entry-title),
body.toa-terms-page .toa-terms h1 {
  box-sizing:border-box;
  width:100%; max-width:calc(var(--terms-width) + var(--terms-side) * 2);
  min-width:0;
  margin:var(--terms-top) auto 16px!important;
  padding:0 var(--terms-side);
  color:var(--terms-heading);
  font-family:Georgia,"Times New Roman",serif;
  font-size:var(--terms-title); font-weight:400; line-height:1.1;
  letter-spacing:-.035em; overflow-wrap:anywhere;
}
body.toa-terms-page main :is(.wp-block-post-content, .entry-content) {
  box-sizing:border-box;
  width:100%; max-width:none!important; min-width:0;
  margin:0!important;
  padding:0 var(--terms-side) var(--terms-bottom)!important;
}
body.toa-terms-page .toa-terms {
  box-sizing:border-box;
  width:100%; max-width:var(--terms-width)!important; min-width:0;
  margin:0 auto!important; padding:0;
  color:var(--terms-text);
  font-family:Arial,"Apple SD Gothic Neo","Malgun Gothic",sans-serif;
  font-size:var(--terms-body); font-weight:400; line-height:var(--terms-leading);
  text-align:left; letter-spacing:normal; text-transform:none;
  background:var(--terms-bg);
  word-break:keep-all; overflow-wrap:anywhere;
}
body.toa-terms-page .toa-terms *,
body.toa-terms-page .toa-terms *::before,
body.toa-terms-page .toa-terms *::after { box-sizing:border-box; }
/* Prevent common theme element typography from leaking into the article. */
body.toa-terms-page .toa-terms :is(p, li, dt, dd) {
  font-family:inherit; font-size:inherit; line-height:inherit;
  color:inherit; letter-spacing:normal; text-transform:none;
}
body.toa-terms-page .toa-terms p { margin:0 0 20px; }
body.toa-terms-page .toa-terms h1 {
  margin:var(--terms-top) 0 22px!important; padding:0;
}
/* Release only content ancestors containing the dedicated article. */
body.toa-terms-page main :is(.wp-block-group, .entry-content, .wp-block-post-content):has(.toa-terms) {
  width:100%; max-width:none!important; min-width:0;
}
body.toa-terms-page main .wp-block-group:has(.toa-terms) {
  margin-inline:0!important; padding-inline:0!important;
}
body.toa-terms-page .toa-terms .toa-terms__subtitle {
  font-size:var(--terms-subtitle); color:var(--terms-heading);
  margin:0 0 22px; line-height:1.5;
}
body.toa-terms-page .toa-terms .toa-terms__date {
  font-size:12px; letter-spacing:.03em; color:var(--terms-muted); margin-bottom:32px;
}
body.toa-terms-page .toa-terms .toa-terms__notice {
  font-size:13px; color:#bbb; border-block:1px solid #333;
  padding:18px 0; margin-bottom:40px;
}
body.toa-terms-page .toa-terms .toa-terms__chapter { margin:var(--terms-section) 0 0; min-width:0; }
body.toa-terms-page .toa-terms .toa-terms__chapter-label {
  color:var(--terms-accent); font-size:12px; letter-spacing:.06em; margin:0 0 18px;
}
body.toa-terms-page .toa-terms h2 {
  font:600 clamp(20px,2.5vw,24px)/1.5 Arial,"Apple SD Gothic Neo","Malgun Gothic",sans-serif;
  color:var(--terms-heading); margin:var(--terms-section) 0 22px;
  padding-top:24px; border-top:1px solid #303030; letter-spacing:-.025em;
  scroll-margin-top:24px;
}
body.toa-terms-page .toa-terms .toa-terms__chapter-label + h2 { margin-top:0; }
body.toa-terms-page .toa-terms :is(h3, h4, h5, h6) {
  font-family:inherit; font-weight:600; line-height:1.6;
  color:var(--terms-heading); letter-spacing:-.02em;
  margin:32px 0 14px; padding:0; text-transform:none;
  scroll-margin-top:24px;
}
body.toa-terms-page .toa-terms h3 { font-size:19px; }
body.toa-terms-page .toa-terms :is(h4, h5, h6) { font-size:var(--terms-body); }
body.toa-terms-page .toa-terms hr {
  width:100%; height:0; margin:32px 0; border:0;
  border-top:1px solid #303030; background:none;
}
body.toa-terms-page .toa-terms strong { color:#eee; font-weight:600; }
body.toa-terms-page .toa-terms a { color:var(--terms-accent); text-decoration:underline; text-underline-offset:4px; }
body.toa-terms-page .toa-terms a:focus-visible { outline:2px solid currentColor; outline-offset:4px; }
body.toa-terms-page .toa-terms .toa-terms__placeholder { color:var(--terms-accent); }
body.toa-terms-page .toa-terms :is(ol, ul) {
  margin:0 0 24px; padding:0 0 0 1.5em; list-style:decimal outside;
}
body.toa-terms-page .toa-terms ul { list-style:disc outside; }
body.toa-terms-page .toa-terms li::marker { color:var(--terms-muted); }
body.toa-terms-page .toa-terms li { margin:0 0 12px; padding:0 0 0 .15em; min-width:0; }
body.toa-terms-page .toa-terms li > :is(ol, ul) { margin:12px 0 0; padding-left:1.35em; }
body.toa-terms-page .toa-terms .toa-terms__info { margin:0; }
body.toa-terms-page .toa-terms .toa-terms__info > div {
  display:grid; grid-template-columns:minmax(0,160px) minmax(0,1fr);
  gap:8px 20px; border-bottom:1px solid #303030; padding:14px 0;
}
body.toa-terms-page .toa-terms dt { color:#aaa; font-size:14px; }
body.toa-terms-page .toa-terms dd { margin:0; min-width:0; }
/* Keep table semantics and column headers at every width. */
body.toa-terms-page .toa-terms :is(.toa-terms__table, .wp-block-table) {
  max-width:100%; margin:24px 0;
}
body.toa-terms-page .toa-terms table {
  width:100%; max-width:100%; table-layout:fixed; border-collapse:collapse;
  font-family:inherit; font-size:14px; line-height:1.8; color:var(--terms-text);
}
body.toa-terms-page .toa-terms :is(th, td) {
  padding:14px 12px; border:0; border-bottom:1px solid #303030;
  text-align:left; vertical-align:top; white-space:normal;
  word-break:normal; overflow-wrap:anywhere;
}
body.toa-terms-page .toa-terms th {
  background:#121212; color:var(--terms-heading); font-weight:500;
}
body.toa-terms-page .toa-terms :is(caption, figcaption) {
  margin:0 0 12px; color:var(--terms-muted); font-size:12px; text-align:left;
}
@media (min-width:768px) {
  body.toa-terms-page { --terms-side:36px; --terms-top:88px; --terms-body:17px; }
}
@media (max-width:599px) {
  body.toa-terms-page { --terms-section:40px; --terms-bottom:72px; }
  body.toa-terms-page .toa-terms :is(th, td) { padding:10px 6px; }
  body.toa-terms-page .toa-terms h3 { font-size:18px; }
  body.toa-terms-page .toa-terms .toa-terms__info > div { grid-template-columns:minmax(0,1fr); gap:4px; }
}

/* Keep unstructured text readable even before the enhancement script runs. */
body.toa-terms-page main :is(.wp-block-post-content, .entry-content):not(:has(.toa-terms)) {
  max-width:calc(var(--terms-width) + var(--terms-side) * 2)!important;
  margin-inline:auto!important;
  color:var(--terms-text);
  font-family:Arial,"Apple SD Gothic Neo","Malgun Gothic",sans-serif;
  font-size:var(--terms-body);
  line-height:var(--terms-leading);
  white-space:pre-line;
  overflow-wrap:anywhere;
}
/* Let the template title provide the top spacing for the live text version. */
body.toa-terms-page .toa-terms > .toa-terms__subtitle:first-child { margin-top:0; }

/* Explicit blank paragraphs and consecutive BRs retain one line of space. */
body.toa-terms-page .toa-terms p.toa-terms__blank {
  display:block;
  height:1em;
  min-height:1em;
  margin:0!important;
  padding:0!important;
}
/* 약관 상단 간격 조정 */
body.toa-terms-page main :is(.wp-block-post-title, .entry-title) {
  margin-bottom: 32px !important;
}
/* 검토용 안내 숨김 */
body.toa-terms-page .toa-terms .toa-terms__notice {
  display: none !important;
}
body.toa-terms-page .toa-terms .toa-terms__subtitle {
  margin-bottom: 8px !important;
}

body.toa-terms-page .toa-terms .toa-terms__date {
  margin: 0 !important;
}

/* 첫 번째 '제1장 총칙' 위 간격 */
body.toa-terms-page .toa-terms h2:first-of-type {
  margin-top: 25px !important;
}