/* =====================================================
   Blackship Theme
   읽기 쉬운 정적 쇼핑 페이지용 CSS
===================================================== */
:root {
    --bg: #eef7f4;
    --card: #fff;
    --ink: #17363a;
    --muted: #5f7475;
    --line: #cfe3df;
    --accent: #0b6b69;
    --soft: #dff3ec;
    --danger: #a94a3f;
    --shadow: 0 14px 30px rgba(13, 76, 73, .10);
}

/* Reset */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a, button { -webkit-tap-highlight-color: transparent; }

/* Header: 스크롤 시 본문과 겹치지 않도록 배경/경계 추가 */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    width: 100%;
    padding: 16px clamp(18px, 4vw, 48px);
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 4px 18px rgba(15, 23, 42, .06);
    backdrop-filter: blur(8px);
}
.logo {
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: -.02em;
    white-space: nowrap;
}
.nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}
.nav a {
    padding: 8px 10px;
    border-radius: 0;
    color: var(--muted);
    font-size: .95rem;
    font-weight: 700;
}
.nav a:hover { background: var(--soft); color: var(--ink); }

/* Page Layout: 좌우 여백 확보 */
main {
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto;
    padding: 34px 0 48px;
}
main > h1 {
    margin: 0 0 22px;
    font-size: clamp(1.8rem, 4vw, 2.7rem);
    line-height: 1.2;
}

/* Hero Section
   hero-bg.png는 PROJECT_ROOT/images/hero-bg.png에 두면
   빌드 시 treasure/images/hero-bg.png와 treasure/en/images/hero-bg.png로 복사된다.
*/
.hero {
    position: relative;
    display: block;

    /* hero-bg.png는 배경 이미지라서 원본 이미지 높이를 따르지 않는다.
       화면 높이는 여기서 직접 잡는다. */
    min-height: clamp(140px, 18vw, 220px);

    margin-bottom: 30px;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, .18), rgba(0, 0, 0, .02), rgba(0, 0, 0, .18)),
        #050505 url("images/hero-bg.png") center center / cover no-repeat;
    border: 1px solid rgba(180, 139, 58, .55);
    border-radius: 0;
    box-shadow: var(--shadow);
}

/* 배너 이미지 안에 타이틀이 이미 들어 있으므로 텍스트는 접근성/SEO용으로만 남긴다. */
.hero h1,
.hero p {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Product Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
}
.card,
.product-card {
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 0;
    box-shadow: var(--shadow);
}
.product-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    transition: transform .18s ease, box-shadow .18s ease;
}
.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 36px rgba(15, 23, 42, .12);
}

/* Product Image: 이미지가 없어도 같은 자리 유지 */
.image-wrap {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #eef0f3;
    border-bottom: 1px solid var(--line);
}
.image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.image-wrap.image-missing::before,
.image-placeholder {
    content: "";
    position: absolute;
    inset: 0;
    display: block;
    background:
        linear-gradient(135deg, rgba(255,255,255,.45), rgba(255,255,255,0)),
        #eef0f3;
}
.no-image { display: none; }

/* Product Info */
.product-body,
.card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
}
.product-body h2 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.35;
}
.product-body h2 a:hover { text-decoration: underline; }
.price-line {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
}
.price {
    color: var(--danger);
    font-size: 1.05rem;
    font-weight: 900;
}
.original,
.original-price {
    color: var(--muted);
    font-size: .9rem;
    text-decoration: line-through;
}
.buy-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 44px;
    padding: 10px 16px;
    background: var(--accent);
    color: #fff;
    border-radius: 0;
    font-weight: 900;
    text-align: center;
}
.buy-button:hover { filter: brightness(1.15); }

.update-notice {
    margin: 0 0 20px;
    padding: 12px 16px;
    border: 1px solid var(--line);
    background: #f8f8f8;
    font-size: .95rem;
    color: var(--muted);
}

/* Detail Page */
.detail {
    display: grid;
    grid-template-columns: minmax(260px, 430px) 1fr;
    gap: 28px;
    align-items: start;
    padding: clamp(18px, 4vw, 32px);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 0;
    box-shadow: var(--shadow);
}
.detail .detail-image {
    border: 1px solid var(--line);
    border-radius: 0;
}
.detail h1 {
    margin: 0 0 14px;
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    line-height: 1.2;
}
.detail p { color: var(--muted); }
.detail .price {
    color: var(--danger);
    font-size: 1.4rem;
}


/* Toolbox Detail */
.toolbox-detail {
    grid-template-columns: minmax(320px, 44%) minmax(0, 1fr);
    gap: clamp(28px, 4vw, 52px);
}
.toolbox-detail-media {
    position: sticky;
    top: 92px;
    min-width: 0;
}
.toolbox-detail-media img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 72vh;
    object-fit: contain;
    background: #f7faf9;
    border: 1px solid var(--line);
    box-shadow: 0 12px 28px rgba(13, 76, 73, .10);
}
.toolbox-detail-placeholder {
    width: 100%;
    aspect-ratio: 16 / 10;
    background:
        linear-gradient(135deg, rgba(255,255,255,.55), rgba(255,255,255,0)),
        #eef0f3;
    border: 1px solid var(--line);
}
.toolbox-detail-content {
    min-width: 0;
}
.toolbox-detail-content h1 {
    margin-bottom: 8px;
}
.toolbox-detail-version {
    margin: 0 0 22px;
    color: var(--muted);
    font-size: .95rem;
    font-weight: 800;
}
.toolbox-detail-description {
    margin-bottom: 28px;
}
.toolbox-detail-description p {
    margin: 0 0 14px;
    color: var(--ink);
    line-height: 1.8;
}
.toolbox-detail-actions {
    display: grid;
    gap: 12px;
    margin-top: 24px;
}
.toolbox-detail-actions .badamail-link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 44px;
    margin-top: 0;
    padding: 10px 16px;
    border: 1px solid var(--accent);
    color: var(--accent);
    text-decoration: none;
}
.toolbox-detail-actions .badamail-link:hover {
    background: var(--soft);
}
.toolbox-detail-back {
    margin-top: 24px;
}



/* Badamail */
.badamail-list {
    display: grid;
    gap: 14px;
}
.badamail-item {
    padding: 16px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 0;
    box-shadow: var(--shadow);
}
.badamail-date {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: .9rem;
    font-weight: 700;
}
.badamail-text {
    margin: 0;
    white-space: pre-wrap;
}
.badamail-link {
    display: inline-block;
    margin-top: 10px;
    font-weight: 900;
    text-decoration: underline;
}
.badamail-post {
    display: grid;
    gap: 16px;
    max-width: 860px;
}
.badamail-post p {
    margin: 0;
    white-space: pre-wrap;
}
.badamail-post-image {
    display: block;
    width: 100%;
    max-width: 860px;
    height: auto;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}


/* Home Deck */
.home-voyage {
    margin: 0 0 28px;
    padding: 24px;
    background:
        linear-gradient(135deg, rgba(255,255,255,.04), rgba(255,255,255,0)),
        #0b5f63;
    color: #f4eedf;
    border: 1px solid #c7a75a;
    box-shadow: var(--shadow);
}
.home-voyage .eyebrow,
.home-log .eyebrow {
    margin: 0 0 8px;
    color: #e0bf67;
    font-weight: 900;
}
.home-voyage h2 { margin: 0 0 8px; font-size: clamp(1.4rem, 3vw, 2rem); }
.home-voyage p:last-child { margin-bottom: 0; color: #e8f3ef; }
.home-route-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:24px;
    margin-bottom:28px;
}
.treasure-route {
    display: grid;
    grid-template-columns: minmax(160px, 210px) 1fr;
    gap: 0;
    margin:0;
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}
.treasure-route .route-image {
    min-height: 280px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
}
.route-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: clamp(11px, 2vw, 21px);
}
.route-copy h2 {
    margin: 0;
    font-size: clamp(1.35rem, 2.2vw, 1.9rem);
    line-height: 1.25;
}
.route-copy p { margin: 0; color: var(--muted); }
.route-product-title {
    color: var(--ink) !important;
    font-weight: 800;
    line-height: 1.4;
    height: calc(1.4em * 4);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
}
.route-price { color: var(--danger) !important; font-size: 1.2rem; font-weight: 900; }
.route-button {
    width: auto;
    align-self: flex-start;
    min-width: 180px;
    margin-top: auto;
}
.home-log {
    margin: 34px 0 24px;
    padding: clamp(22px, 4vw, 38px);
    background: #f8fcfa;
    border: 1px solid #a8ccc5;
    box-shadow: var(--shadow);
}
.home-log h2 { margin: 0 0 18px; }
.home-log-entry { padding: 14px 0; border-top: 1px solid #e8dfc5; }
.home-log-entry:first-of-type { border-top: 0; padding-top: 0; }
.home-log-entry p { margin: 4px 0 0; white-space: pre-wrap; }
.home-log-more { display: inline-block; margin-top: 12px; font-weight: 900; text-decoration: underline; }
.home-update {
    margin-top: 30px;
    color: var(--muted);
    font-size: .92rem;
    text-align: center;
}

@media (max-width: 860px) {
    .toolbox-detail {
        grid-template-columns: 1fr;
    }
    .toolbox-detail-media {
        position: static;
    }
    .toolbox-detail-media img {
        max-height: none;
    }
}

@media (max-width: 760px) {
    .home-route-grid{grid-template-columns:1fr;}
    .treasure-route { grid-template-columns: 1fr; }
    .treasure-route .route-image { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }
    .route-button { width: 100%; }
}

/* Footer */
.site-footer {
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto;
    padding: 28px 0 42px;
    color: var(--muted);
    border-top: 1px solid var(--line);
    font-size: .9rem;
    text-align: center;
}

.site-footer p {
    margin: 4px 0;
    text-align: center;
}

/* Tablet */
@media (max-width: 860px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
    }
    .nav {
        justify-content: flex-start;
    }
    .detail {
        grid-template-columns: 1fr;
    }
}

/* Mobile */
@media (max-width: 560px) {
    .site-header {
        padding: 14px 16px;
    }
    .nav a {
        padding: 6px 8px;
        font-size: .9rem;
    }
    main {
        width: min(100% - 24px, 1180px);
        padding-top: 22px;
    }
    .hero {
        min-height: 120px;
        background-position: center center;
    }
    .grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}
