/* =========================================================================
   템플릿 공통 부품만 (tpl.css 의 바탕 초기화 · 공통 화면 없이)
   -------------------------------------------------------------------------
   캔버스 시안을 그대로 옮긴 템플릿(classic · catalog · trust · food)이 tpl.css 대신 쓴다.
   tpl.css 의 바탕 초기화(box-sizing · 제목 글자 크기 · 목록 여백 · img block …)가 시안 화면을 바꿔서,
   tpl.js 가 켜는 부품(본문 바로가기 · 전체 메뉴 · 맨 위로 · 미리보기 폼 안내)만 같은 모양으로 둔다.
   값은 tpl.css 와 같게 맞춘다(그쪽을 고치면 여기도).
   ========================================================================= */
@layer t-core, t-theme, t-inline;

@layer t-core {
  :root {
    --t-primary: #111;
    --t-primary-ink: #fff;
    --t-text: #111;
    --t-bg-dark: #111;
    --t-on-dark: #fff;
    --t-header-h: 88px;
    --t-container: 1360px;
    --t-gutter: 40px;
    --t-shadow: 0 10px 30px rgb(0 0 0 / .12);
  }
  @media (max-width: 768px) { :root { --t-header-h: 64px; --t-gutter: 20px; } }

  .t-skip a {
    position: absolute; left: 16px; top: -60px; z-index: 100;
    padding: 12px 18px; background: var(--t-primary); color: var(--t-primary-ink);
  }
  .t-skip a:focus { top: 16px; }
  .t-container { width: min(100% - var(--t-gutter) * 2, var(--t-container)); margin-inline: auto; }

  /* 전체 메뉴 */
  .t-allmenu {
    position: fixed; inset: 0; z-index: 60; box-sizing: border-box;
    background: var(--t-bg-dark); color: var(--t-on-dark);
    overflow-y: auto; opacity: 0; visibility: hidden;
    transition: opacity .3s, visibility 0s .3s;
  }
  .t-allmenu.is-open { opacity: 1; visibility: visible; transition: opacity .3s, visibility 0s; }
  .t-allmenu ul { margin: 0; padding: 0; list-style: none; }
  .t-allmenu a { color: inherit; text-decoration: none; }
  .t-allmenu__head { display: flex; justify-content: flex-end; align-items: center; height: var(--t-header-h); }
  .t-allmenu__close { position: relative; width: 36px; height: 36px; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; }
  .t-allmenu__close::before, .t-allmenu__close::after {
    content: ""; position: absolute; left: 4px; top: 17px; width: 28px; height: 2px; background: currentColor;
  }
  .t-allmenu__close::before { transform: rotate(45deg); }
  .t-allmenu__close::after { transform: rotate(-45deg); }
  .t-allmenu__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 48px 32px; padding: 40px 0 120px !important; }
  .t-allmenu__list > li > a { display: block; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid rgb(255 255 255 / .2); font-size: 22px; font-weight: 600; }
  .t-allmenu__list ul a { display: block; padding: 7px 0; font-size: 17px; opacity: .75; }
  .t-allmenu__list ul a:hover { opacity: 1; }
  .t-allmenu__list ul ul { padding-left: 12px; }
  .t-allmenu__list ul ul a { font-size: 15px; }
  body.is-locked { overflow: hidden; }

  /* 맨 위로 */
  .t-quick { position: fixed; right: 30px; bottom: 40px; z-index: 40; display: grid; gap: 20px; opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s .3s; }
  .t-quick.is-visible { opacity: 1; visibility: visible; transition: opacity .3s, visibility 0s; }
  .t-quick button {
    display: grid; place-items: center; width: 56px; height: 56px; border: 0; border-radius: 50%; cursor: pointer;
    background: var(--t-text); color: #fff; box-shadow: var(--t-shadow);
  }
  .t-quick__top::before { content: ""; width: 12px; height: 12px; border: solid currentColor; border-width: 2px 0 0 2px; transform: translateY(3px) rotate(45deg); }
  @media (max-width: 768px) { .t-quick { right: 16px; bottom: 20px; } .t-quick button { width: 46px; height: 46px; } }

  /* 미리보기 폼 안내 */
  .t-form__msg:empty { display: none; }
  .t-form__msg:not(:empty) { margin-top: 20px; padding: 14px 18px; border-radius: 6px; background: #f3f4f6; color: #333; font-size: 15px; text-align: center; }

  /* 화면에서는 숨기고 스크린리더에는 읽히는 글자(새 창 · PDF · 준비 중 안내) */
  .blind { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

  /* 키보드 초점: 밝은 바탕 · 어두운 바탕 모두 보이게 파란 선 + 흰 테두리 */
  :focus-visible { outline: 3px solid #1a5dd8; outline-offset: 2px; box-shadow: 0 0 0 5px #fff; }
  html { scroll-padding-top: 100px; }

  /* 정책 문서(개인정보처리방침 · 이용약관 · 이메일무단수집거부 · 윤리경영) */
  .t-doc { box-sizing: border-box; max-width: 860px; margin: 0 auto; padding: 72px 40px 120px; font-size: 16px; line-height: 1.85; color: #33383f; }
  .t-doc__note { margin: 0 0 40px; padding: 14px 18px; background: #f3f4f6; font-size: 15px; color: #444a52; }
  .t-doc h2 { margin: 44px 0 12px; font-size: 20px; line-height: 1.4; color: #15191e; }
  .t-doc p { margin: 0 0 12px; }
  .t-doc table { width: 100%; border-collapse: collapse; border-top: 2px solid #15191e; font-size: 15px; }
  .t-doc caption { text-align: left; padding-bottom: 8px; font-weight: 700; }
  .t-doc th, .t-doc td { padding: 12px 16px; border-bottom: 1px solid #dfe3e8; text-align: left; }
  .t-doc th { width: 140px; background: #f6f7f9; }
  @media (max-width: 768px) { .t-doc { padding: 48px 20px 80px; } }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; scroll-behavior: auto !important; }
  }
}
