/*
 * 여행노트 도구 — 화면 스타일.
 *
 * 테마(yeohaengnote)의 토큰(--yn-*)을 쓴다. 테마가 없어도 깨지지 않게 대체값을 둔다.
 * 홈에 얹히는 허브 카드(.ync-hub / .ync-card)의 칸은 테마가 다시 잡는다 —
 * 테마 CSS 가 .yn-tool-hub 를 앞에 붙여 이긴다.
 *
 * ⚠️ 표에 display:block 을 주지 마라. thead 와 tbody 가 각각 별도 익명 테이블이 되어
 *    열 너비가 어긋난다. 가로 스크롤은 바깥 div(.ync-scroll)가 맡는다.
 *    site1 에서 실제로 겪은 사고다.
 */

.ync {
    --c-brand: var(--yn-brand, #1f5132);
    --c-accent: var(--yn-accent, #c2703d);
    --c-ink: var(--yn-ink, #22271f);
    --c-muted: var(--yn-muted, #6d7570);
    --c-line: var(--yn-line, #e4e7e2);
    --c-soft: var(--yn-soft, #f7f6f2);

    margin: 2em 0;
    padding: 22px;
    border: 1px solid var(--c-line);
    border-radius: 14px;
    background: #fff;
    color: var(--c-ink);
}

/* 제목처럼 보이지만 h 태그가 아니다.
   '간편한 목차'가 본문 첫 제목 앞에 목차를 끼워 넣어, 폼 안에 h 가 있으면
   목차가 이 상자 안으로 들어간다. */
.ync-h {
    margin: 0 0 8px;
    font-size: 1.15em;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--c-brand);
}

.ync-lead {
    margin: 0 0 20px;
    font-size: 0.94em;
    line-height: 1.7;
    color: var(--c-muted);
}

/* ---- 폼 ---- */

.ync-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.ync-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.88em;
    font-weight: 700;
    color: var(--c-ink);
}

.ync-field select,
.ync-field input[type="number"],
.ync-field input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--c-line);
    border-radius: 8px;
    background: #fff;
    font-size: 0.95em;
    color: var(--c-ink);
}

.ync-field select:focus,
.ync-field input:focus {
    outline: 2px solid var(--c-brand);
    outline-offset: -1px;
}

.ync-field select:disabled {
    background: var(--c-soft);
    color: var(--c-muted);
}

.ync-field--check label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.ync-field--check input {
    width: auto;
}

.ync-hint {
    margin: 6px 0 0;
    font-size: 0.8em;
    line-height: 1.55;
    color: var(--c-muted);
}

/* ---- 결과 ---- */

.ync-result {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 2px solid var(--c-brand);
}

.ync-r-h {
    margin: 0 0 4px;
    font-size: 0.88em;
    font-weight: 700;
    color: var(--c-muted);
}

.ync-r-big {
    margin: 0 0 6px;
    font-size: 1.7em;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.3;
    color: var(--c-brand);
}

.ync-r-h2 {
    margin: 26px 0 8px;
    font-size: 1em;
    font-weight: 800;
    color: var(--c-ink);
}

.ync-r-sub {
    margin: 0 0 4px;
    font-size: 0.85em;
    line-height: 1.65;
    color: var(--c-muted);
}

.ync-r-line {
    margin: 0 0 6px;
    font-size: 1.05em;
}

.ync-r-line strong {
    font-size: 1.25em;
    color: var(--c-brand);
}

.ync-r-warn {
    margin: 0;
    padding: 12px 14px;
    border-left: 4px solid var(--c-accent);
    border-radius: 0 8px 8px 0;
    background: #fdf4ee;
    font-size: 0.9em;
    line-height: 1.7;
}

.ync-r-danger {
    color: #b3402a;
    font-weight: 700;
    white-space: nowrap;
}

/* 표 — 가로 스크롤은 바깥 상자가 맡는다(위 주석 참고). */
.ync-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ync-r-table {
    width: 100%;
    margin: 14px 0 0;
    border-collapse: collapse;
    font-size: 0.9em;
}

.ync-r-table th,
.ync-r-table td {
    padding: 9px 12px;
    border: 1px solid var(--c-line);
    text-align: left;
    vertical-align: top;
}

.ync-r-table tbody th {
    width: 34%;
    background: var(--c-soft);
    font-weight: 700;
    white-space: nowrap;
}

.ync-r-table thead th {
    background: var(--c-soft);
    font-weight: 700;
    white-space: nowrap;
}

.ync-r-table--entry {
    min-width: 460px;   /* 세 열이 짓눌리지 않게. 좁으면 바깥에서 스크롤한다 */
}

/*
 * 어디서 온 숫자인지 표시.
 * 공식 자료와 우리가 정한 값을 눈으로 구분할 수 있어야 한다 —
 * 우리 판단을 공식 숫자인 척 내미는 것이 제일 나쁜 실패다.
 */
.ync-r-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    background: #e8efe9;
    color: #2c5b3c;
    font-size: 0.76em;
    font-weight: 700;
    white-space: nowrap;
}

.ync-r-tag--ours {
    background: #fbeee4;
    color: #8a4a23;
}

/* ---- 안내·출처 ---- */

.ync-note {
    margin: 22px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--c-line);
    font-size: 0.82em;
    line-height: 1.7;
    color: var(--c-muted);
}

.ync-source {
    margin: 8px 0 0;
    font-size: 0.8em;
    line-height: 1.6;
    color: var(--c-muted);
}

.ync-source a {
    color: var(--c-brand);
}

/* ---- 전용 페이지의 설명·FAQ ---- */

.ync-copy {
    margin-top: 2.4em;
}

.ync-faq-q {
    margin: 1.4em 0 0.3em;
    font-weight: 800;
}

.ync-faq-a {
    margin: 0 0 0.6em;
    color: #444a42;
}

/* ---- 허브 카드 ----
   홈에서는 테마가 칸을 다시 잡는다(.yn-tool-hub .ync-hub).
   여기 값은 /dogu/ 페이지와 글 안에서 쓰인다. */

.ync-hub {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
    margin: 1.8em 0;
}

.ync-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
    border: 1px solid var(--yn-line, #e4e7e2);
    border-radius: 14px;
    background: #fff;
    text-decoration: none;
    color: var(--yn-ink, #22271f);
    transition: border-color 0.18s ease, transform 0.18s ease;
}

.ync-card:hover {
    border-color: var(--yn-brand, #1f5132);
    transform: translateY(-2px);
}

.ync-card-title {
    display: block;
    font-size: 1.02em;
    font-weight: 800;
    line-height: 1.4;
    color: var(--yn-brand, #1f5132);
}

.ync-card-desc {
    display: block;
    font-size: 0.87em;
    line-height: 1.6;
    color: var(--yn-muted, #6d7570);
}

/* ---- 용어 사전 ---- */

.ync-dict-index {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 1.8em;
    padding: 14px;
    border-radius: 12px;
    background: var(--yn-soft, #f7f6f2);
}

.ync-dict-index a {
    padding: 4px 10px;
    border-radius: 999px;
    background: #fff;
    font-size: 0.85em;
    font-weight: 600;
    text-decoration: none;
    color: var(--yn-brand, #1f5132);
}

.ync-dict-index a:hover {
    background: var(--yn-brand, #1f5132);
    color: #fff;
}

.ync-dict-list {
    margin: 0;
}

.ync-dict-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--yn-line, #e4e7e2);
    scroll-margin-top: 84px;   /* 헤더가 고정이라 앵커로 뛰면 제목이 가린다 */
}

.ync-dict-term {
    margin: 0 0 4px;
    font-size: 1.05em;
    font-weight: 800;
    color: var(--yn-brand, #1f5132);
}

.ync-dict-def {
    margin: 0;
    line-height: 1.75;
}

/* 본문에 밑줄이 그인 용어 */
.ync-term {
    text-decoration: none;
    border-bottom: 1px dashed var(--yn-accent, #c2703d);
    cursor: help;
}

/* ---- 여행 달력 ---- */

.ync-cal-h {
    margin: 2em 0 0.8em;
}

.ync-cal-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

/* ⚠️ 본문 폭이 760px 이라 칸을 작게 유지해야 4열이 버틴다.
   좁은 화면 대응을 860px 에서 걸면 창을 조금만 줄여도 접힌다 —
   site1 에서 바로 지적받았다. 420px 아래에서만 3열로 줄인다. */
@media (max-width: 420px) {
    .ync-cal-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.ync-cal-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 12px 4px;
    border: 1px solid var(--yn-line, #e4e7e2);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.ync-cal-cell:hover {
    border-color: var(--yn-brand, #1f5132);
}

.ync-cal-cell.is-current {
    border-color: var(--yn-brand, #1f5132);
    background: var(--yn-brand, #1f5132);
    color: #fff;
}

.ync-cal-month {
    font-size: 0.95em;
    font-weight: 800;
}

.ync-cal-count {
    font-size: 0.75em;
    opacity: 0.75;
}

.ync-cal-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ync-cal-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--yn-line, #e4e7e2);
}

.ync-cal-item span {
    display: block;
}

.ync-cal-title {
    font-weight: 800;
}

.ync-cal-when {
    margin-top: 2px;
    font-size: 0.9em;
    color: var(--yn-brand, #1f5132);
    font-weight: 700;
}

.ync-cal-who,
.ync-cal-note {
    margin-top: 3px;
    font-size: 0.9em;
    line-height: 1.65;
}

.ync-cal-source {
    margin-top: 6px;
    font-size: 0.78em;
    color: var(--yn-muted, #6d7570);
}

.ync-cal-empty {
    margin: 0;
    padding: 18px 0;
    color: var(--yn-muted, #6d7570);
}

/* ---- 좁은 화면 ---- */

@media (max-width: 600px) {
    .ync {
        padding: 18px 14px;
    }

    .ync-form {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .ync-r-big {
        font-size: 1.45em;
    }

    .ync-r-table tbody th {
        width: 40%;
    }
}
