/* 폰트를 정한다. */
/* https://noonnu.cc/font_page/415 */
@font-face {
  font-family: 'ChosunGu';
  src: url('https://fastly.jsdelivr.net/gh/projectnoonnu/noonfonts_20-04@1.0/ChosunGu.woff') format('woff');
}

/* 자주 사용하는 클래스 이름을 정리한다. */
/* tailwind css에서 사용하는 이름을 쓴다. */
/* html에서 쉽게 css를 설정할 수 있도록 한다. */
.justify-center {
  /* 가로로 가운데 정렬한다. */
  display: flex;
  justify-content: center;
  align-items: center;
}

.items-center {
  /* 세로로 가운데 정렬한다. */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* 위에서부터 정렬한다. */
.items-start {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
}

/* 광고 위치를 정할 때 사용한다. */
/* sticky가 되려면 부모의 display가 flex이면 안 된다. */
/* div 태그를 하나 더 만들고 그 안에 광고를 넣는다. */
/* 화면 가운데에 고정한다. */
.sticky-center {
  position: sticky;
  /* 화면의 1/2에서 400px을 빼고 40px를 더한다. */
  /* 원래는 300px를 뺐다. 광고 크기가 따라서 빼는 값을 다르게 한다. */
  /* 빼는 값이 크면 광고가 위로 올라간다. */
  top: calc(50vh - 400px + 40px);
}

/* 위쪽에 고정한다. */
.sticky-top {
  position: sticky;
  /* header 높이에서 값을 더한다. */
  top: calc(var(--header-height) + 20px);
}

.hidden{
    display: none !important;
}

:root {
  /* header의 높이다. */
  --header-height: 5rem;
  /* 하얀색이다. */
  /* #fff는 기본 하얀색으로 따로 변수를 정하지 않는다. */
  --white-1: #fefeff;
  /* 검은색이다. */
  /* #000는 기본 검은색으로 따로 변수를 정하지 않는다. */
  --black-1: #222;
  /* 숫자는 중요도 순이다. */
  --site-color-1: #fdb0ae;
  --site-color-2: rgb(255, 177, 158);
  /* 테두리 관련이다.*/
  --border-color-lightgray: #d9d9d9;
  --box-shadow-1: rgba(0, 0, 0, 0.2);
  --box-shadow-2: rgba(0, 0, 0, 0.4);
  --box-shadow-3: rgba(0, 0, 0, 0.6);
  /* 앱의 너비다. */
  --app-width: 880px;
  /* 폰트를 설정한다. */
  /* 기본 폰트다. */
  --font-basic: 'ChosunGu';
  /* 제목 폰트다. */
  --font-title: 'ChosunGu';
}

/* 리셋을 한다. */
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  /* 모바일에서 클릭했을 때 파란색 부분이 나오지 않도록 한다.*/
  -webkit-tap-highlight-color: transparent !important;
  /* 이미지를 선명하게 해준다. */
  image-rendering: -webkit-optimize-contrast;
}

body,
html {
    /* height를 100%로 한다. */
    height: 100%;
    /* 많이 줄어들지 않기 위해서 min-height를 설정한다. */
    /* min-height 값이 너무 크면 모바일에서 아래 공간이 생긴다. */
    min-height: 400px;
    font-family: var(--font-basic);
    /* 폰트를 정한다. */
}

html {
    /* 부드럽게 움직이게 한다. */
    scroll-behavior: smooth;
}

body {
    /* overflow-x를 설정하지 않으면 mobile에서 사이드 메뉴가 옆에서 나왔을 때 아래에 공간이 생긴다. */
    /* overflow-x: hidden; */
    /* 애드센스 앵커 광고가 나올 때 레이아웃이 깨지지 않기 위해서 설정한다. */
    padding: 0 !important;
    max-width: 100%;
    /* 드래그 하지 못하게 한다. */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

li {
    /* 앞에 디스크 모양이 나오지 않게 한다. */
    list-style: none;
}

a,
a:hover,
a:visited {
    /* 밑줄이 없도록 한다. */
    text-decoration: none;
    /* 글자색은 검정색으로 정해서 다른 색으로 바뀌지 않도록 한다. */
    color: #000000;
}

button {
    /* 버튼의 테두리를 없앤다. */
    outline: 0;
    border: none;
    /* 버튼은 기본 폰트가 있어서 font-familiy를 정한다. */
    font-family: var(--font-basic);
    /* 버튼 위에서 마우스 모양이 바뀌도록 한다. */
    cursor: pointer;
}

input {
    /* input은 기본 폰트가 있어서 font-familiy를 지정한다. */
    font-family: var(--font-basic);
}

input::placeholder {
    /* placeholder는 기본 폰트가 있어서 font-familiy를 지정한다. */
    font-family: var(--font-basic);
}

/* 로딩화면이다. */
/* body 안에서 가장 위에 있다. */
.loader-container {
    z-index: 10;
    position: fixed;
    top: 0;
    left: 0;
    /* 화면 전체를 사용한다. */
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;    
    /* 2번째 색깔로 정한다. */
    background: var(--site-color-2);
}

/* 1초 있다가 사라진다. */
.loader-container.hidden {
    animation: fadeOut 1s forwards;
}

@keyframes fadeOut {
    50% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        visibility: hidden;
    }
}

.loader {
    animation: rotate 1s infinite;
    height: 50px;
    width: 50px;
}

.loader:after,
.loader:before {
    border-radius: 50%;
    content: '';
    display: block;
    height: 20px;
    width: 20px;
}

.loader:before {
    animation: ball1 1s infinite;
    background: #fff;
    box-shadow: 30px 0 0 #fff;
    margin-bottom: 10px;
}

.loader:after {
    animation: ball2 1s infinite;
    background: #fff;
    box-shadow: 30px 0 0 #fff;
}

@keyframes rotate {
    0% {
        -webkit-transform: rotate(0deg) scale(0.8);
        -moz-transform: rotate(0deg) scale(0.8);
    }

    50% {
        -webkit-transform: rotate(360deg) scale(1.2);
        -moz-transform: rotate(360deg) scale(1.2);
    }

    100% {
        -webkit-transform: rotate(720deg) scale(0.8);
        -moz-transform: rotate(720deg) scale(0.8);
    }
}

@keyframes ball1 {
    0% {
        box-shadow: 30px 0 0 #fff;
    }

    50% {
        box-shadow: 0 0 0 #fff;
        margin-bottom: 0;
        -webkit-transform: translate(15px, 15px);
        -moz-transform: translate(15px, 15px);
    }

    100% {
        box-shadow: 30px 0 0 #fff;
        margin-bottom: 10px;
    }
}

@keyframes ball2 {
    0% {
        box-shadow: 30px 0 0 #fff;
    }

    50% {
        box-shadow: 0 0 0 #fff;
        margin-top: -20px;
        -webkit-transform: translate(15px, 15px);
        -moz-transform: translate(15px, 15px);
    }

    100% {
        box-shadow: 30px 0 0 #fff;
        margin-top: 0;
    }
}

/* header를 위에 고정한다. */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 5;
    background: var(--site-color-1);
    color: #fff;
    height: var(--header-height);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 메뉴 버튼과 메뉴 패널의 기준점이 된다. */
nav {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    justify-content: space-between;
    width: var(--app-width);
    max-width: 100%;
}

.logo p{
    font-size: 20px;
    font-weight: bold;
    text-shadow: 1px 1px #ffffff;
}

/* 메뉴 버튼이다. */
#menuBtn {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    /* 마우스 포인터가 생긴다. */
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: transform 0.08s ease;
}

#menuBtn:active {
    transform: scale(0.98);
}

/* focus-visible는 tab키를 눌러서 선택되었을 때다.  */
#menuBtn:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.55);
    outline-offset: 2px;
}

.menu-panel {
    position: absolute;
    /* nav보다 10px만큼 아래에 있는다. */
    top: calc(100% + 10px);   
    right: 10px;
    left: auto;
    /* 애드센스 사각형 광고보다 조금 크도록 한다. */
    width: 360px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #fff;
    border: 2px solid var(--site-color-2);
    border-radius: 20px;
    box-shadow: var(--box-shadow-heavy);
    padding: 10px;
    /* 처음에는 보이지 않는다. */
    opacity: 0;
    transform: translateY(-6px);
    pointer-events: none;
    transition: opacity 0.14s ease, transform 0.14s ease;
}

/* #menuBtn를 클릭하면 is-open 클래스가 추가된다. */
.menu-panel.is-open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 4px;    
}
.menu-item a {
    /* 가운데 정렬한다. */
    display: flex;
    align-items: center;  
    justify-content: center;
    padding: 10px 10px;
    border-radius: 10px;
    text-decoration: none;
    color: #0f172a;
    font-size: 20px;
}
.menu-item a:hover {
    background: #f1f5f9;
}

.menu-item a:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.35);
    outline-offset: 2px;
}

main {
    /* header의 높이만큼 위에 공간을 둔다. */
    margin-top: var(--header-height);
    display: flex;
}

/* section 나머지 공간을 사용한다. */
aside {
    flex: 1;
}

section{
    width: var(--app-width);
    /* 가운데 정렬한다. */
    margin: 0 auto;
    /* 최소 높이를 정한다. */
    min-height: calc(100vh - var(--header-height));
}

/* footer를 정한다. */
footer {
    width: 100%;
    margin: 0 auto;
    padding: 30px 30px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    background: var(--site-color-1);
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.2);
    font-size: 1.1rem;   
}
.footer-notice ul {
    /* margin-left와 padding-right를 설정해서 디스크가 왼쪽으로 너무 나가지 않도록 한다. */
    margin-left: 20px;
    padding-right: 20px;
}

.footer-notice li {
    list-style-type: disc;
    /* 글자 단위로 줄바꿈한다. */
    word-break: keep-all;
}

/* 저작권에 관한 내용이다. */
#copyright p {
    text-align: center;
}

/* 사이드바 광고가 보이지 않도록 정한다. */
@media screen and (max-width: 1620px) {
    aside {
        display: none !important;
    }
}

/* 880px를 mobile 기준값으로 정했다. */
@media screen and (max-width: 880px) {
    /* mobile에서는 너비를 100%로 한다.*/
    header,
    footer
    {
        width: 100%;
    }   
    
}

