/* ============================================
   기본 변수 및 스타일
   ============================================ */

:root {
  /* color */
  --color-primary: #1b9af7;
  --color-secondary: #6c757d;
  --color-success: #198754;
  --color-info: #0dcaf0;
  --color-warning: #ffc107;
  --color-danger: #dc3545;
  --color-light: #f8f9fa;
  --color-dark: #212529;
  --color-white: #ffffff;
  --color-black: #000000;
  --color-disabled: #dddddd;
}

pre,
code,
kbd,
samp {
  font-family: var(--font-sans-serif), var(--font-monospace);
  font-size: 1em;
  direction: ltr;
  unicode-bidi: bidi-override;
}

/* ============================================
   페이지 레이아웃
   ============================================ */

.page-wrapping {
    width: 50%;
    padding: 20px;
    margin: auto;
}

pre.code-block {
  position: relative;
}

span.btn-copy {
  display: table;
  position: absolute;
  top: 2px;
  right: 2px;
  padding: 3px 6px;
  background-color: rgb(46, 46, 46);
  cursor: pointer;
}

/* ============================================
   macOS 스타일 코드 윈도우
   ============================================ */

.codewin-mac {
  border: 1px solid #3b3b3b;
  border-radius: 0.5em;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.codewin-head,
.codewin-buttons {
  -webkit-box-align: center;
  -moz-box-align: center;
  align-items: center;
  display: -moz-box;
  display: flex;
  -webkit-box-pack: center;
  -moz-box-pack: center;
  justify-content: center;
  background-color: #eee;
}

.codewin-head {
  border-bottom: 1px solid #e6e6e6;
  height: 2rem;
  padding: 0 1rem;
  position: relative;
}

.codewin-buttons {
  bottom: 0;
  left: 0.5rem;
  position: absolute;
  top: 0;
  cursor: pointer;
}

.btn-mac {
  border-radius: 50%;
  height: 0.75rem;
  margin: 0 0.125rem;
  width: 0.75rem;
}

.mac-close {
  background-color: #ff5f56;
}

.mac-mini {
  background-color: #ffbd2e;
}

.mac-full {
  background-color: #27c93f;
}

.codewin-samples {
  background-color: #282a36;
  width: 100%;
  flex-direction: row;
  color: #dddddd;
}

.codewin-demo-html,
.codewin-demo-css,
.codewin-demo-js {
  display: flex;
  width: 100%;
  background-color: #282a36;
}

/* ============================================
   기타 요소 스타일
   ============================================ */

.icons {
    transition: transform 0.3s ease;
}

.icons:hover {
    transform: scale(1.1);
}

.maintext {
    font-size: 1.5rem;
    line-height: 1.6;
}

/* ============================================
   Highlight.js 코드 하이라이팅 스타일
   ============================================ */

pre code.hljs {
  display: block;
  overflow-x: auto;
  padding: 1em;
}

code.hljs {
  padding: 3px 5px;
}

.hljs {
  background: #272822;
  color: #ddd;
}

.hljs-keyword,
.hljs-literal,
.hljs-name,
.hljs-selector-tag,
.hljs-strong,
.hljs-tag {
  color: #f92672;
}

.hljs-code {
  color: #66d9ef;
}

.hljs-attribute,
.hljs-link,
.hljs-regexp,
.hljs-symbol {
  color: #bf79db;
}

.hljs-addition,
.hljs-built_in,
.hljs-bullet,
.hljs-emphasis,
.hljs-section,
.hljs-selector-attr,
.hljs-selector-pseudo,
.hljs-string,
.hljs-subst,
.hljs-template-tag,
.hljs-template-variable,
.hljs-title,
.hljs-type,
.hljs-variable {
  color: #a6e22e;
}

.hljs-class .hljs-title,
.hljs-title.class_ {
  color: #fff;
}

.hljs-comment,
.hljs-deletion,
.hljs-meta,
.hljs-quote {
  color: #75715e;
}

.hljs-doctag,
.hljs-keyword,
.hljs-literal,
.hljs-section,
.hljs-selector-id,
.hljs-selector-tag,
.hljs-title,
.hljs-type {
  font-weight: 700;
}

/* ============================================
   반응형 미디어 쿼리
   ============================================ */

/* 태블릿 (768px ~ 1024px) */
@media (max-width: 1024px) and (min-width: 771px) {
    .page-wrapping {
        width: 80%;
    }
    
    .maintext {
        font-size: 1.3rem;
    }
}

/* 모바일 (770px 이하) */
@media (max-width: 770px) {
    
    /* 페이지 래핑 */
    body > div > div.page-wrapping {
        margin: 0;
        width: 100%;
        padding: 10px;
    }
    
    .page-wrapping {
        width: 100%;
        padding: 10px;
    }

    /* 코드 윈도우 전체 */
    .codewin-mac {
        width: 100% !important;
        margin: 20px 0 !important;
        border-radius: 10px;
    }

    /* 코드창 헤더 */
    .codewin-head {
        height: 1.75rem;
        padding: 0 0.75rem;
    }
    
    .btn-mac {
        height: 0.65rem;
        width: 0.65rem;
    }

    /* 코드창 내부 스크롤 */
    .codewin-samples {
        overflow-x: auto;
        padding: 10px;
    }

    /* 코드 글자 크기 축소 */
    .codewin-demo-html pre,
    .code-block code {
        font-size: 14px !important;
        line-height: 1.4;
        white-space: pre;
        margin: 0 !important;
        padding: 5px !important;
    }
    
    pre code.hljs {
        padding: 0.75em;
        font-size: 14px;
    }
    
    /* 메인 텍스트 */
    .maintext {
        font-size: 1.1rem;
        padding: 0.5rem;
    }
    
    /* 아이콘 크기 조정 */
    .icons {
        max-width: 60px !important;
    }
}

/* 매우 작은 모바일 (480px 이하) */
@media (max-width: 480px) {
    .maintext {
        font-size: 1rem;
    }
    
    .codewin-demo-html pre,
    .code-block code {
        font-size: 12px !important;
    }
    
    pre code.hljs {
        font-size: 12px;
        padding: 0.5em;
    }
    
    .icons {
        max-width: 50px !important;
    }
}