/* ============================================================
   부자테이프 공개 홈페이지 — 공통 레이아웃 & 컴포넌트
   theme.css(토큰) 다음에 로드한다.
   ============================================================ */

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

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

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.7;
    color: var(--body);
    background: var(--bg);
    word-break: keep-all;
    overflow-wrap: anywhere;
}

h1, h2, h3, h4, h5, p, figure, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }

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

/* HTML 의 hidden 속성은 display 를 지정한 클래스에 명시도로 진다.
   프레임워크 없는 프로젝트라 이 한 줄이 없으면 닫아둔 패널이 계속 보인다. */
[hidden] { display: none !important; }

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

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Layout ---------- */
.shell {
    width: 100%;
    max-width: var(--shell);
    margin: 0 auto;
    padding-inline: var(--gutter);
}

.site-main { display: block; min-height: 40vh; }

.section { padding: 100px 0; }
.section--soft { background: var(--bg-soft); }
.section--dark { background: var(--ink); color: #FFFFFF; }
.section--tight { padding: 72px 0; }

@media (max-width: 768px) {
    .section { padding: 64px 0; }
    .section--tight { padding: 48px 0; }
}

/* ---------- Section heading ---------- */
.sec-head { margin-bottom: 48px; }
.sec-head--center { text-align: center; }

.sec-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-en);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--brand);
    margin-bottom: 14px;
}

.sec-eyebrow::before {
    content: '';
    width: 24px;
    height: 2px;
    background: var(--brand);
}

.sec-head--center .sec-eyebrow::before { display: none; }

.sec-title {
    font-size: 38px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.section--dark .sec-title { color: #FFFFFF; }

.sec-desc {
    margin-top: 16px;
    font-size: 17px;
    color: var(--muted);
    max-width: 720px;
}

.sec-head--center .sec-desc { margin-inline: auto; }
.section--dark .sec-desc { color: rgba(255, 255, 255, .72); }

@media (max-width: 768px) {
    .sec-title { font-size: 28px; }
    .sec-desc { font-size: 15px; }
    .sec-head { margin-bottom: 32px; }
}

/* ---------- Buttons ---------- */
.btn {
    box-sizing: border-box;              /* <a class="btn"> 도 <button> 과 같은 상자여야 한다 */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
    padding: 0 30px;
    border: 1px solid transparent;
    border-radius: 2px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.btn--block { width: 100%; }
.btn--sm { min-height: 40px; padding: 0 18px; font-size: 14px; }

.btn--primary { background: var(--brand); border-color: var(--brand); color: #FFFFFF; }
/* 공용 a:hover 가 컴포넌트 클래스를 이기지 않도록 hover 를 명시한다.
   hover 는 밝히지 않고 어둡게 — 흰 글자의 대비를 잃지 않기 위해서다. */
.btn--primary:hover,
.btn--primary:focus-visible { background: var(--brand-dark); border-color: var(--brand-dark); color: #FFFFFF; }

.btn--dark { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }
.btn--dark:hover, .btn--dark:focus-visible { background: #000000; border-color: #000000; color: #FFFFFF; }

.btn--outline { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn--outline:hover, .btn--outline:focus-visible { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }

.btn--ghost-light { background: transparent; border-color: rgba(255, 255, 255, .5); color: #FFFFFF; }
.btn--ghost-light:hover, .btn--ghost-light:focus-visible { background: #FFFFFF; border-color: #FFFFFF; color: var(--ink); }

/* ---------- Text link ---------- */
.link-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--ink);
}

.link-more::after { content: '→'; transition: transform .18s ease; }
.link-more:hover { color: var(--brand); }
.link-more:hover::after { transform: translateX(4px); }
.section--dark .link-more { color: #FFFFFF; }
.section--dark .link-more:hover { color: var(--brand-hover); }

/* ============================================================
   Utility bar
   ============================================================ */
.util-bar {
    background: var(--ink);
    color: rgba(255, 255, 255, .7);
    font-size: 13px;
    height: var(--util-h);
}

.util-bar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--util-h);
    gap: 16px;
}

.util-bar__tag { letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.util-bar__links { display: flex; align-items: center; gap: 18px; white-space: nowrap; }
.util-bar__links a { color: rgba(255, 255, 255, .78); }
.util-bar__links a:hover { color: #FFFFFF; }

.util-bar__cta {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 12px;
    background: var(--brand);
    color: #FFFFFF !important;
    font-weight: 600;
    border-radius: 2px;
}

.util-bar__cta:hover { background: var(--brand-dark); }

.util-bar__lang {
    font-family: var(--font-en);
    font-weight: 700;
    letter-spacing: .08em;
    color: rgba(255, 255, 255, .35);
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .util-bar__tag { display: none; }
    .util-bar__inner { justify-content: flex-end; }
    /* 좁은 폭에서 4개가 다 안 들어가면 flex 가 왼쪽으로 넘쳐 전화번호 앞자리가 잘린다.
       스크롤로도 닿지 않는 좌측 오버플로라 부가 항목을 접는다. */
    .util-bar__links { gap: 12px; font-size: 12px; }
    .util-bar__mail,
    .util-bar__lang { display: none; }
}

@media (max-width: 360px) {
    .util-bar__links a:not(.util-bar__cta) { display: none; }
}

/* ============================================================
   Header
   ============================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    background: #FFFFFF;
    border-bottom: 1px solid var(--line);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
    gap: 24px;
}

.brand { display: inline-flex; align-items: baseline; gap: 10px; }

.brand__mark {
    font-family: var(--font-en);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.brand__mark em { font-style: normal; color: var(--brand); }

.brand__sub {
    font-size: 12px;
    color: var(--muted);
    letter-spacing: .02em;
}

/* ---------- Desktop nav ---------- */
.gnb { display: flex; align-items: stretch; height: var(--header-h); }

.gnb__item { position: relative; display: flex; align-items: stretch; }

.gnb__link {
    display: inline-flex;
    align-items: center;
    padding: 0 26px;
    font-size: 16px;
    font-weight: 600;
    color: var(--ink-3);
    letter-spacing: -0.01em;
    transition: color .16s ease;
}

.gnb__link:hover { color: var(--brand); }
.gnb__item.is-active .gnb__link { color: var(--brand); }

.gnb__item.is-active .gnb__link::after {
    content: '';
    position: absolute;
    left: 26px;
    right: 26px;
    bottom: -1px;
    height: 2px;
    background: var(--brand);
}

.header__actions { display: flex; align-items: center; gap: 12px; }

.header__tel {
    display: inline-flex;
    flex-direction: column;
    line-height: 1.25;
    text-align: right;
}

.header__tel span { font-size: 11px; color: var(--muted); letter-spacing: .1em; font-family: var(--font-en); }
.header__tel strong { font-size: 18px; color: var(--ink); font-weight: 800; }

/* ---------- Mega dropdown ---------- */
.mega {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 200px;
    background: #FFFFFF;
    border: 1px solid var(--line);
    border-top: 2px solid var(--brand);
    box-shadow: 0 16px 32px rgba(0, 0, 0, .08);
    padding: 14px 0;
    z-index: var(--z-dropdown);
}

.mega a {
    display: block;
    padding: 9px 26px;
    font-size: 15px;
    color: var(--body);
    white-space: nowrap;
}

.mega a:hover { color: var(--brand); background: var(--bg-soft); }

/* 키보드 사용자도 열 수 있어야 하므로 hover 만이 아니라 focus-within 도 함께 건다. */
.gnb__item:hover > .mega,
.gnb__item:focus-within > .mega { display: block; }

/* ---------- Hamburger ---------- */
.hamburger {
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border: 0;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--ink);
    transition: transform .2s ease, opacity .2s ease;
}

.drawer-open .hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.drawer-open .hamburger span:nth-child(2) { opacity: 0; }
.drawer-open .hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1100px) {
    .gnb, .header__tel { display: none; }
    .hamburger { display: flex; }
}

/* ============================================================
   Mobile drawer — 헤더보다 위 레이어여야 한다.
   ============================================================ */
.drawer {
    position: fixed;
    inset: 0;
    z-index: var(--z-drawer);
    background: #FFFFFF;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.drawer__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
    border-bottom: 1px solid var(--line);
    padding-inline: var(--gutter);
}

.drawer__close {
    width: 44px; height: 44px;
    background: transparent; border: 0; cursor: pointer;
    font-size: 26px; line-height: 1; color: var(--ink);
}

.drawer__body { padding: 8px var(--gutter) 40px; }

.drawer__group { border-bottom: 1px solid var(--line); }

.drawer__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 18px 2px;
    background: transparent;
    border: 0;
    text-align: left;
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
    cursor: pointer;
}

.drawer__toggle::after { content: '+'; font-size: 20px; color: var(--muted); font-weight: 400; }
.drawer__group.is-open .drawer__toggle { color: var(--brand); }
.drawer__group.is-open .drawer__toggle::after { content: '−'; color: var(--brand); }

.drawer__sub { padding: 0 2px 18px; display: grid; gap: 2px; }
.drawer__sub a { display: block; padding: 9px 0; font-size: 15px; color: var(--muted); }
.drawer__sub a:hover { color: var(--brand); }

.drawer__cta { margin-top: 28px; display: grid; gap: 10px; }

.drawer__contact {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
    font-size: 14px;
    color: var(--muted);
    display: grid;
    gap: 6px;
}

body.drawer-open { overflow: hidden; }

/* ============================================================
   Page hero (sub pages)
   ============================================================ */
.page-hero {
    position: relative;
    background: var(--ink);
    color: #FFFFFF;
    overflow: hidden;
}

.page-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(60% 120% at 82% 20%, rgba(208, 20, 28, .38), transparent 62%),
        repeating-linear-gradient(115deg, rgba(255, 255, 255, .05) 0 2px, transparent 2px 18px);
    pointer-events: none;
}

.page-hero__inner {
    position: relative;
    z-index: 1;
    padding-block: 84px 76px;
}

.page-hero__eyebrow {
    font-family: var(--font-en);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--brand-hover);
    margin-bottom: 14px;
}

.page-hero__title {
    font-size: 44px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.page-hero__desc {
    margin-top: 14px;
    font-size: 17px;
    color: rgba(255, 255, 255, .72);
    max-width: 680px;
}

@media (max-width: 768px) {
    .page-hero__inner { padding-block: 56px 50px; }
    .page-hero__title { font-size: 30px; }
    .page-hero__desc { font-size: 15px; }
}

/* ---------- Breadcrumb ---------- */
.crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, .6);
    margin-bottom: 18px;
}

.crumbs li::after { content: '/'; margin-left: 8px; color: rgba(255, 255, 255, .3); }
.crumbs li:last-child::after { display: none; }
.crumbs li { display: flex; align-items: center; gap: 8px; }
.crumbs a:hover { color: #FFFFFF; }

/* ---------- Sub navigation tabs ---------- */
.subnav { border-bottom: 1px solid var(--line); background: #FFFFFF; }

.subnav__list {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}

.subnav__list::-webkit-scrollbar { display: none; }

.subnav__list a {
    display: inline-flex;
    align-items: center;
    height: 60px;
    padding: 0 22px;
    font-size: 15px;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}

.subnav__list a:hover { color: var(--ink); }

.subnav__list a.is-active {
    color: var(--brand);
    border-bottom-color: var(--brand);
}

/* ============================================================
   Cards
   ============================================================ */
.grid { display: grid; gap: 24px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 992px) {
    .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
    .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
}

.card {
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    border: 1px solid var(--line);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
    height: 100%;
}

.card:hover {
    border-color: var(--brand);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .08);
    transform: translateY(-3px);
}

.card__media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--bg-soft);
}

.card__media img { width: 100%; height: 100%; object-fit: cover; }

/* 이미지가 없을 때의 대체 — 깨진 이미지 아이콘 대신 의도된 플레이스홀더를 보여준다. */
.ph {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(135deg, #2B2B2B 0%, #18191A 55%, #000000 100%);
    color: rgba(255, 255, 255, .92);
}

.ph::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(125deg, rgba(255, 255, 255, .06) 0 3px, transparent 3px 16px);
}

.ph__label {
    position: relative;
    font-family: var(--font-en);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, .35);
}

.ph--brand { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%); }
.ph--soft { background: linear-gradient(135deg, #3A3B3D 0%, #212121 100%); }

.card__body { padding: 24px; display: flex; flex-direction: column; gap: 8px; flex: 1; }

.card__title {
    font-size: 19px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.01em;
}

.card:hover .card__title { color: var(--brand); }

.card__desc {
    font-size: 15px;
    color: var(--muted);
    line-height: 1.6;
}

.card__meta {
    margin-top: auto;
    padding-top: 14px;
    font-size: 13px;
    color: var(--muted-2);
    font-family: var(--font-en);
    letter-spacing: .06em;
}

/* ---------- Empty state ---------- */
.empty {
    padding: 72px 24px;
    text-align: center;
    border: 1px dashed var(--line-strong);
    background: var(--bg-softer);
    color: var(--muted);
}

.empty__title { font-size: 17px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.empty__desc { font-size: 15px; }

/* ============================================================
   Definition table (회사개요 등)
   ============================================================ */
.deftable { width: 100%; border-top: 2px solid var(--ink); border-collapse: collapse; }

.deftable th,
.deftable td {
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    font-size: 16px;
    text-align: left;
    vertical-align: top;
}

.deftable th {
    width: 200px;
    background: var(--bg-soft);
    font-weight: 700;
    color: var(--ink);
}

.deftable td { color: var(--body); }

@media (max-width: 640px) {
    .deftable th, .deftable td { display: block; width: 100%; }
    .deftable th { border-bottom: 0; padding-bottom: 8px; }
    .deftable td { padding-top: 0; }
}

/* ============================================================
   Prose — 운영자가 입력한 본문.
   전역 리셋이 여백을 다 벗기므로 자손 타이포그래피를 여기서 되돌린다.
   ============================================================ */
.prose { font-size: 16px; line-height: 1.85; color: var(--body); }
.prose > * + * { margin-top: 1.1em; }
.prose p { margin: 0; }
.prose h2 { font-size: 24px; font-weight: 800; color: var(--ink); line-height: 1.4; margin-top: 1.8em; }
.prose h3 { font-size: 19px; font-weight: 700; color: var(--ink); line-height: 1.5; margin-top: 1.6em; }
.prose h4 { font-size: 17px; font-weight: 700; color: var(--ink-2); margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-top: .4em; }
.prose a { color: var(--brand); text-decoration: underline; }
.prose strong { font-weight: 700; color: var(--ink); }
.prose blockquote {
    padding: 4px 0 4px 18px;
    border-left: 3px solid var(--brand);
    color: var(--muted);
}
.prose table { width: 100%; border-collapse: collapse; }
.prose th, .prose td { padding: 10px 12px; border: 1px solid var(--line); text-align: left; }
.prose img { margin-inline: auto; }

/* ============================================================
   Messages (django.contrib.messages)
   ============================================================ */
.flash { display: grid; gap: 10px; margin-bottom: 28px; }

.flash__item {
    padding: 14px 18px;
    border-left: 3px solid var(--brand);
    background: var(--brand-soft);
    color: var(--ink-2);
    font-size: 15px;
}

.flash__item.is-success { border-left-color: #1B8A3A; background: #ECF7EF; }
.flash__item.is-error { border-left-color: var(--brand); background: var(--brand-soft); }

/* ============================================================
   CTA band
   ============================================================ */
.cta-band { background: var(--brand); color: #FFFFFF; }

.cta-band__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding-block: 56px;
    flex-wrap: wrap;
}

.cta-band__title { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.35; }
.cta-band__desc { margin-top: 8px; font-size: 16px; color: rgba(255, 255, 255, .85); }
.cta-band__actions { display: flex; gap: 12px; flex-wrap: wrap; }

.cta-band .btn--light { background: #FFFFFF; border-color: #FFFFFF; color: var(--brand); }
.cta-band .btn--light:hover, .cta-band .btn--light:focus-visible { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }

@media (max-width: 768px) {
    .cta-band__title { font-size: 23px; }
    .cta-band__inner { padding-block: 44px; }
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer { background: var(--ink); color: rgba(255, 255, 255, .6); font-size: 14px; }

.site-footer__top { padding: 64px 0 48px; }

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr repeat(4, 1fr);
    gap: 32px;
}

.footer-brand__mark {
    font-family: var(--font-en);
    font-size: 22px;
    font-weight: 800;
    color: #FFFFFF;
    letter-spacing: -0.02em;
}

.footer-brand__mark em { font-style: normal; color: var(--brand-hover); }
.footer-brand__desc { margin-top: 12px; line-height: 1.8; }

.footer-col__title {
    font-size: 15px;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 16px;
}

.footer-col ul { display: grid; gap: 9px; }
.footer-col a:hover { color: #FFFFFF; }

.site-footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, .12);
    padding: 26px 0 40px;
}

.footer-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer-meta span { min-width: 0; }
/* 주소처럼 긴 항목은 반드시 줄바꿈돼야 한다 — nowrap 이면 뷰포트를 넘겨 페이지 전체에
   가로 스크롤을 만든다. 항목 구분은 flex gap 이 이미 하고 있다. */
.footer-copy { margin-top: 14px; font-size: 13px; color: rgba(255, 255, 255, .4); font-family: var(--font-en); }

@media (max-width: 992px) {
    .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
    .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
    .footer-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Scroll-to-top ---------- */
.to-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ink);
    color: #FFFFFF;
    border: 0;
    border-radius: 2px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease, background .2s ease;
    z-index: var(--z-toast);
}

.to-top.is-visible { opacity: 1; visibility: visible; }
.to-top:hover { background: var(--brand); }
