/* 전문 읽어보기 버튼 */
.recomm__quote .recomm-reader-trigger {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    padding: 0 22px;
    height: 52px;
    border-radius: 8px;
    background: #098fde;
    color: white;
    font: 800 16px var(--font-round);
}

.recomm-reader-trigger img {
    width: 18px;
}

/* 모달 기본 영역 및 배경 */
.recomm-reader {
    box-sizing: border-box;
    width: min(94vw, 1054px);
    height: min(92dvh, 1002px);
    max-height: 92vh;
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 32px;
    background: white;
    color: #171717;
    font-family: var(--font-round);
    overflow: hidden;
}

.recomm-reader[open] {
    display: flex;
    flex-direction: column;
}

.recomm-reader::backdrop {
    background: rgba(0,0,0,.55);
}

body:has(.recomm-reader[open]) {
    overflow: hidden;
}

/* 모달 헤더 및 닫기 버튼 */
.recomm-reader__head {
    position: relative;
    padding: 18px 64px 16px 28px;
    background: #ebf4ff;
}

.recomm-reader__head small {
    color: #61BEFE;
    font-weight: 800;
}

.recomm-reader__head h2 {
    margin: 5px 0 0;
    font: 900 18px/1.35 var(--font-neo);
}

.recomm-reader__close {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
}

.recomm-reader__close img {
    width: 60%;
    margin: auto;
}

/* 챕터 목차 및 읽기 진행 표시 */
.recomm-reader__chapters {
    display: flex;
    flex: none;
    overflow-x: auto;
    padding: 0 28px;
    gap: 24px;
    background: #fafafa;
    border-top: 1px solid #eee;
}

.recomm-reader__chapters button {
    flex: none;
    padding: 18px 0;
    color: #777;
    font-weight: bold;
}

.recomm-reader__chapters [aria-current] {
    color: #f97316;
}

.recomm-reader__track {
    height: 4px;
    background: #e8e8e8;
    flex: none;
}

.recomm-reader__track span {
    display: block;
    height: 100%;
    background: #f97316;
    transform-origin: left;
}

/* 본문 영역 및 텍스트 */
.recomm-reader__body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 32px 6.3% 20px;
}

/* iOS에서 터치 후 자동 포커스 테두리가 진행률 바 위로 보이지 않게 한다. */
.recomm-reader__body.is-pointer-focus:focus {
    outline: none;
}

.recomm-reader__body h3 {
    margin: 0 0 16px;
    font-family: var(--font-neo);
    font-size: 22px;
    font-weight: 900;
}

.recomm-reader__body p,
.recomm-reader__body li {
    margin: 20px 0;
    font-family: var(--font-round);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.85;
    color: #3f3f3f;
}

.recomm-reader__body strong {
    font-weight: 800;
}

/* 본문 강조 문구 */
.recomm-reader__body .recomm-reader__emphasis--orange {
    color: #f97316;
}

.recomm-reader__body .recomm-reader__emphasis--red {
    color: #eb0000;
}

.recomm-reader__body h4 {
    margin: 32px 0 12px;
    font-family: var(--font-round);
    font-size: 20px;
    font-weight: 800;
    color: #F97316;
}

.recomm-reader__body ul,
.recomm-reader__body ol {
    padding-inline-start: 1.6em;
}

.recomm-reader__body ul {
    list-style: disc;
}

.recomm-reader__body ol {
    list-style: decimal;
}

/* 본문 배너 및 도표 이미지 */
.recomm-reader__banner {
    display: block;
    width: 100%;
    aspect-ratio: 2.5;
    object-fit: cover;
}

.recomm-reader__illustration {
    display: block;
    width: 100%;
    height: auto;
    margin-block: 24px;
}

/* 이전·다음 챕터 버튼 */
.recomm-reader__navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 32px;
    visibility: hidden;
}

.recomm-reader__navigation button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    height: 62px;
    min-width: 156px;
    padding: 10px 16px;
    border: 1px solid #bdbdbd;
    border-radius: 10px;
    background: #fff;
    color: #303030;
    font: 800 15px/1.2 var(--font-round);
}

.recomm-reader__navigation img {
    width: 18px;
}

.recomm-reader__navigation [data-reader-next]:enabled {
    background: #303030;
    color: white;
}

.recomm-reader__navigation button:disabled {
    background: #e5e5e5;
    color: #a3a3a3;
    border-color: #e5e5e5;
}

.recomm-reader__navigation.is-visible {
    visibility: visible;
}

.recomm-reader__navigation [data-reader-next] img {
    transform: rotate(180deg);
}

.recomm-reader__navigation [data-reader-prev] img {
    transform: rotate(180deg);
}

.recomm-reader__navigation button:disabled img {
    visibility: hidden;
}

/* 본문 맨 위로 이동 버튼 */
.recomm-reader__foot {
    position: relative;
    flex: none;
    height: 0;
}

.recomm-reader__top {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    right: 6.3%;
    bottom: 100px;
    width: 70px;
    height: 70px;
    padding: 0;
    border: 1px solid #bdbdbd;
    border-radius: 50%;
    background: white;
    box-shadow: 0 4px 6px rgba(102, 102, 102, .14);
}

.recomm-reader__top img {
    width: 40px;
    height: 40px;
}

/* 태블릿 및 모바일 (768px 이하 또는 터치 기기의 가로 화면) */
@media (max-width: 768px), (max-height: 480px) and (pointer: coarse) {
    .recomm-reader {
        position: fixed;
        inset: 0;
        width: 100%;
        max-width: none;
        height: 100vh;
        height: 100dvh;
        max-height: none;
        margin: 0;
        border-radius: 0;
        /* 노치·홈 표시줄 영역은 모달 안쪽 여백으로 보호한다. */
        padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px)
                 env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    }

    .recomm-reader__head {
        padding: 14px 48px 14px 16px;
    }

    .recomm-reader__head small {
        font-size: 12px;
    }

    .recomm-reader__head h2 {
        font-size: 15px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .recomm-reader__close {
        right: 4px;
    }

    .recomm-reader__chapters {
        padding: 10px 16px;
        gap: 8px;
        background: white;
    }

    .recomm-reader__chapters button {
        padding: 8px 14px;
        border: 1px solid #ccc;
        border-radius: 24px;
        font-size: 14px;
    }

    .recomm-reader__chapters [aria-current] {
        color: white;
        background: #f97316;
        border-color: #f97316;
    }

    .recomm-reader__body {
        padding: 20px 16px;
    }

    .recomm-reader__body h3 {
        font-size: 20px;
    }

    .recomm-reader__body h4 {
        margin-top: 24px;
        font-size: 18px;
        line-height: 1.5;
    }

    .recomm-reader__body p,
    .recomm-reader__body li {
        font-size: 15px;
        line-height: 1.8;
        margin-block: 16px;
    }

    .recomm-reader__banner {
        width: calc(100% + 32px);
        max-width: none;
        margin-inline: -16px;
    }

    .recomm-reader__navigation {
        gap: 12px;
    }

    .recomm-reader__navigation button {
        flex: 1;
        min-width: 0;
        height: 52px;
        padding: 8px;
        gap: 6px;
        font-size: 14px;
    }

    /* 모바일 본문 맨 위로 이동 버튼 */
    .recomm-reader__top {
        width: 44px;
        height: 44px;
    }

    .recomm-reader__top img {
        width: 26px;
        height: 26px;
    }
}

/* 작은 모바일 (480px 이하) */
@media (max-width: 480px) {
    .recomm-reader__head small {
        font-size: 11px;
    }

    .recomm-reader__head h2 {
        font-size: 14px;
    }

    .recomm-reader__chapters {
        gap: 6px;
        padding-block: 8px;
    }

    .recomm-reader__chapters button {
        padding: 8px 12px;
        font-size: 12px;
    }

    .recomm-reader__body h3 {
        font-size: 18px;
        margin-bottom: 12px;
    }

    .recomm-reader__body h4 {
        font-size: 16px;
        margin-block: 22px 10px;
    }

    .recomm-reader__body p,
    .recomm-reader__body li {
        font-size: 14px;
        line-height: 1.8;
        margin-block: 14px;
    }

    .recomm-reader__illustration {
        margin-block: 18px;
    }

    .recomm-reader__navigation button {
        height: 44px;
        font-size: 12px;
    }
}
