/* ==========================================================================
   돌봄다리 홈페이지 공통 스타일
   - 디자인 기준: desktop 1440px(본문 1120px) / mobile 390px(본문 342px)
   - 900px 미만에서 모바일 레이아웃으로 전환
   ========================================================================== */

:root {
    --black: #121b2d;
    --white: #ffffff;
    --main: #0370ff;
    --main-dark: #175ec3;
    --gray: #667085;
    --subtle: #e6edf6;
    --blue-tint: #eaf3ff;
    --bg-soft: #f4f7fb;
    --navy-grad: linear-gradient(136deg, #183e84 8.89%, #0b214d 82.96%);
    --deep-grad: linear-gradient(146deg, #102745 8.89%, #07192d 82.96%);

    --header-h: 80px;
    --content-w: 1120px;
    --gutter: 24px;

    --font: "Wanted Sans Variable", "Wanted Sans", -apple-system, BlinkMacSystemFont,
        "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font);
    font-weight: 400;
    line-height: 1.5;
    color: var(--black);
    background: var(--white);
    word-break: keep-all;
    overflow-wrap: break-word;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure {
    margin: 0;
}

ul, ol {
    padding: 0;
    list-style: none;
}

/* hidden 속성은 display를 지정한 클래스보다 항상 우선한다 */
[hidden] {
    display: none !important;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

:focus-visible {
    outline: 2px solid var(--main);
    outline-offset: 3px;
}

.container {
    width: min(var(--content-w), 100% - var(--gutter) * 2);
    margin-inline: auto;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* 화면 크기별 노출 */
.mo-only { display: none !important; }

@media (max-width: 899px) {
    .pc-only { display: none !important; }
    .mo-only { display: revert !important; }
}

/* --------------------------------------------------------------------------
   버튼 · 링크
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 56px;
    padding: 16px 24px;
    border-radius: 12px; /* 시안은 4px. 더 둥글게 조정 */
    background: var(--main);
    color: var(--white);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.5;
    white-space: nowrap;
    transition: background-color 0.2s ease;
}

.btn:hover {
    background: #0260dc;
}

.btn--sm {
    height: 48px;
}

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.45;
    white-space: nowrap;
}

.link-arrow img {
    width: 22px;
    height: 22px;
    transition: transform 0.2s ease;
}

.link-arrow:hover img {
    transform: translateX(4px);
}

.link-arrow--white {
    color: var(--white);
}

/* --------------------------------------------------------------------------
   헤더
   -------------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--white);
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: 32px;
    height: var(--header-h);
}

.site-header__brand {
    margin-right: auto;
}

.site-header__brand img {
    width: 130px;
    height: 36px;
}

.gnb {
    display: flex;
    align-items: center;
    gap: 32px;
}

.gnb__link {
    display: block;
    padding: 12px 0;
    font-size: 16px; /* 옆의 "문의하기" 버튼과 같은 크기 (시안은 15px) */
    font-weight: 700;
    line-height: 1.5;
    color: var(--black);
    white-space: nowrap;
    transition: color 0.2s ease, scale 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* 마우스를 올리면 글씨가 살짝 커진다 (자리는 차지하지 않아 옆 메뉴가 밀리지 않음) */
@media (hover: hover) {
    .gnb__link:hover,
    .gnb__link:focus-visible {
        scale: 1.12;
    }

    /* 연한 하늘색 배경: 글씨 뒤에 깔리는 둥근 판. 여백을 바꾸지 않도록 가상 요소로 그린다 */
    .gnb__link {
        position: relative;
        z-index: 0;
    }

    .gnb__link::before {
        content: "";
        position: absolute;
        inset: 4px -12px;
        z-index: -1;
        border-radius: 8px;
        background: var(--blue-tint);
        opacity: 0;
        transition: opacity 0.2s ease;
    }

    .gnb__link:hover::before,
    .gnb__link:focus-visible::before {
        opacity: 1;
    }

    .gnb__sub {
        z-index: 10;
    }

    /* 하위 메뉴: 항목이 패널 폭을 꽉 채우므로 통째로 키우면 배경이 패널 밖으로 나간다.
       배경은 패널 안쪽에 고정하고 글씨만 살짝 민다. */
    .gnb__sub .gnb__link {
        transition: color 0.2s ease, padding-left 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);
    }

    .gnb__sub .gnb__link::before {
        inset: 2px -12px;
    }

    .gnb__sub .gnb__link:hover,
    .gnb__sub .gnb__link:focus-visible {
        scale: none;
        padding-left: 4px;
    }
}

.gnb__link:hover,
.gnb__link[aria-current="page"] {
    color: var(--main);
}

.gnb__item {
    position: relative;
}

.gnb__sub {
    position: absolute;
    top: calc(100% + 16px);
    left: -24px;
    display: none;
    flex-direction: column;
    gap: 4px;
    width: 252px;
    padding: 20px 24px 24px;
    background: var(--white);
    border: 1px solid var(--subtle);
    border-radius: 16px;
}

/* 메뉴와 하위 메뉴 사이 빈 공간에서도 hover 유지 */
.gnb__sub::before {
    content: "";
    position: absolute;
    inset: -17px 0 100% 0;
}

.gnb__item.is-open .gnb__sub {
    display: flex;
}

.menu-toggle {
    display: none;
    width: 24px;
    height: 24px;
}

.menu-toggle img {
    width: 24px;
    height: 24px;
}

.mobile-nav {
    display: none;
}

@media (hover: hover) and (min-width: 900px) {
    .gnb__item:hover .gnb__sub {
        display: flex;
    }
}

@media (max-width: 899px) {
    .site-header__inner {
        gap: 24px;
    }

    .gnb,
    .site-header .btn {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    .mobile-nav {
        position: absolute;
        top: var(--header-h);
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 8px;
        max-height: calc(100dvh - var(--header-h));
        overflow-y: auto;
        padding: 20px var(--gutter) 24px;
        background: var(--white);
        border: 1px solid var(--subtle);
    }

    .site-header.is-menu-open .mobile-nav {
        display: flex;
    }

    .mobile-nav__label {
        font-size: 14px;
        font-weight: 700;
        line-height: 1.45;
        color: var(--main);
    }

    .mobile-nav__link {
        display: block;
        padding: 12px 0;
        font-size: 17px;
        font-weight: 600;
        line-height: 1.5;
    }

    .mobile-nav__link--sub {
        padding-left: 16px;
        font-size: 16px;
        font-weight: 700;
    }

    .mobile-nav__divider {
        height: 1px;
        border: 0;
        margin: 0;
        background: var(--subtle);
    }
}

/* --------------------------------------------------------------------------
   푸터
   -------------------------------------------------------------------------- */
.site-footer {
    padding: 48px 0;
    border-top: 1px solid var(--subtle);
    background: var(--white);
    color: var(--gray);
}

.site-footer__inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
}

.site-footer__brand img {
    width: 130px;
    height: 36px;
}

.site-footer__tagline {
    font-size: 16px;
    line-height: 1.5;
}

.site-footer__nav {
    display: flex;
    flex-wrap: wrap;
    font-size: 13px;
    line-height: 1.5;
}

.site-footer__nav li + li::before {
    content: "·";
    margin: 0 0.6em;
}

.site-footer__legal {
    display: flex;
    gap: 1.4em;
    font-size: 12px;
    line-height: 1.45;
}

.site-footer a:hover {
    color: var(--black);
}

.site-footer__info {
    font-size: 12px;
    line-height: 1.5;
    font-style: normal;
}

.site-footer__info .sep {
    margin: 0 0.7em;
}

@media (max-width: 899px) {
    .site-footer__tagline {
        font-size: 14px;
    }

    /* 모바일 시안: 메뉴를 3개씩 두 줄로 */
    /* 시안은 가운뎃점으로 이은 두 줄이라 오른쪽이 비어 보였다.
       3칸 격자로 화면 폭에 고르게 펼치고 가운뎃점은 뺀다. */
    /* 푸터 전체의 위아래 간격을 줄인다 */
    .site-footer {
        padding: 36px 0;
    }

    .site-footer__inner {
        gap: 14px;
    }

    .site-footer__nav {
        display: grid;
        grid-template-columns: repeat(3, max-content);
        gap: 0 28px;
        font-size: 14px;
    }

    .site-footer__nav li + li::before {
        content: none;
    }

    .site-footer__nav a {
        display: block;
        padding: 3px 0;
    }
}

/* --------------------------------------------------------------------------
   사업 영역 하위 서비스 탭 (business / jobs / operations 공통)
   현재 페이지 링크에 aria-current="page"

   시안은 144px 칸에 글씨를 가운데 두고 현재 탭에 하늘색 사각형을 깔았는데,
   첫 글씨가 본문 왼쪽 선보다 안쪽으로 들어가고 사각형이 덩어리져 보였다.
   글씨를 본문 왼쪽 선에 맞추고, 현재 탭은 밑줄로 표시하는 방식으로 바꿨다.
   -------------------------------------------------------------------------- */
.subnav {
    background: var(--white);
    border-bottom: 1px solid var(--subtle);
}

.subnav__list {
    display: flex;
    gap: 36px;
}

.subnav__link {
    position: relative;
    display: block;
    padding: 18px 0;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.45;
    color: var(--gray);
    transition: color 0.2s ease;
}

/* 현재 탭 밑줄: 아래 구분선 위에 겹쳐 그린다 */
.subnav__link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: var(--main);
    scale: 0 1;
    transition: scale 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.subnav__link:hover {
    color: var(--black);
}

.subnav__link[aria-current="page"] {
    font-weight: 700;
    color: var(--black);
}

.subnav__link[aria-current="page"]::after {
    scale: 1 1;
}

@media (max-width: 899px) {
    .subnav__list {
        gap: 28px;
    }

    .subnav__link {
        padding: 16px 0;
        font-size: 15px;
    }
}

/* --------------------------------------------------------------------------
   FAQ 아코디언 (jobs / adoption 공통) — <details class="faq"> 사용
   -------------------------------------------------------------------------- */
.faq {
    border-top: 1px solid var(--subtle);
    padding: 24px 0;
    line-height: 1.45;
}

.faq__q {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    font-size: 23px;
    font-weight: 600;
    color: var(--black);
    cursor: pointer;
    list-style: none;
}

.faq__q::-webkit-details-marker {
    display: none;
}

.faq__q::after {
    content: "+";
    flex: 0 0 24px;
    font-size: 24px;
    font-weight: 400;
    color: var(--gray);
    text-align: center;
}

.faq[open] .faq__q::after {
    content: "−";
}

.faq__a {
    margin-top: 16px;
    padding-right: 20px;
    font-size: 18px;
    color: var(--gray);
}

/* 모바일 메뉴: 현재 페이지 표시 */
.mobile-nav__link[aria-current="page"] {
    color: var(--main);
}

/* ==========================================================================
   모션
   - 스크롤 등장: site.js가 섹션 안의 제목·문단·카드·이미지에 .reveal을 붙인다
   - "동작 줄이기"를 켠 기기에서는 모두 꺼진다
   ========================================================================== */
:root {
    --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
    interpolate-size: allow-keywords;
}

/* 헤더: 스크롤하면 본문과 구분되는 옅은 그림자 */
.site-header {
    transition: box-shadow 0.3s ease;
}

.site-header.is-scrolled {
    box-shadow: 0 1px 0 var(--subtle), 0 8px 24px rgba(18, 27, 45, 0.06);
}

@media (prefers-reduced-motion: no-preference) {
    /* site.js가 준비를 마치기 전에 본문이 먼저 보였다가 사라지는 깜빡임 방지.
       스크립트가 실패해도 1.5초 뒤에는 반드시 보인다. */
    html.js:not(.motion-ready) main {
        animation: motion-failsafe 0s 1.5s both;
    }

    @keyframes motion-failsafe {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    /* 스크롤 등장 */
    /* html.js 를 앞에 붙여 우선순위를 높인다: 카드처럼 자체 transition(hover 효과)이
       있는 요소에서도 등장 전환이 덮어써지지 않도록 */
    html.js .reveal.is-in {
        transition: opacity 0.8s var(--ease-out), translate 0.8s var(--ease-out);
        transition-delay: var(--reveal-delay, 0ms);
    }

    /* 숨김 상태는 전환 없이 즉시 적용한다. 여기에 전환이 걸려 있으면 요소가
       "보임 → 숨김"으로 서서히 사라지는 도중에 등장이 시작되어, 첫 화면이 전환 없이 나타난다. */
    html.js .reveal:not(.is-in) {
        opacity: 0;
        translate: 0 24px;
        transition: none;
    }

    /* PC 하위 메뉴 · 모바일 메뉴: 부드럽게 열리고 닫힘 */
    .gnb__sub,
    .mobile-nav {
        opacity: 0;
        translate: 0 -8px;
        transition: opacity 0.22s ease, translate 0.22s var(--ease-out),
            display 0.22s allow-discrete;
    }

    .gnb__item.is-open .gnb__sub,
    .site-header.is-menu-open .mobile-nav {
        opacity: 1;
        translate: 0 0;
    }

    @media (hover: hover) and (min-width: 900px) {
        .gnb__item:hover .gnb__sub {
            opacity: 1;
            translate: 0 0;
        }
    }

    @starting-style {
        .gnb__item.is-open .gnb__sub,
        .gnb__item:hover .gnb__sub,
        .site-header.is-menu-open .mobile-nav {
            opacity: 0;
            translate: 0 -8px;
        }
    }

    /* FAQ: 답변이 펼쳐지는 높이 전환 (지원 브라우저에서만 동작, 나머지는 즉시 열림) */
    .faq::details-content {
        block-size: 0;
        overflow: clip;
        opacity: 0;
        transition: block-size 0.35s var(--ease-out), opacity 0.35s ease,
            content-visibility 0.35s allow-discrete;
    }

    .faq[open]::details-content {
        block-size: auto;
        opacity: 1;
    }

    .faq__q {
        transition: color 0.2s ease;
    }

    .faq__q:hover {
        color: var(--main);
    }

    /* 서류 확대 등 dialog */
    dialog[open] {
        animation: dialog-in 0.28s var(--ease-out);
    }

    dialog[open]::backdrop {
        animation: backdrop-in 0.28s ease;
    }

    @keyframes dialog-in {
        from { opacity: 0; translate: 0 12px; scale: 0.98; }
    }

    @keyframes backdrop-in {
        from { opacity: 0; }
    }
}

/* 인쇄할 때는 등장 전 요소도 모두 보이게 */
@media print {
    .reveal,
    main {
        opacity: 1 !important;
        translate: none !important;
        animation: none !important;
    }

    .site-header {
        position: static;
    }
}
