/* ============================================================
   Construction Cost SEO Page
   Breakpoints: 768px (mobile), 1120px (PC 2-column)
   ============================================================ */

/* ── Global: Inline dynamic value alignment ──
   Fixes height mismatch between injected numbers (strong/span)
   and surrounding text caused by font-weight change in Noto Sans KR */
.pa-page strong,
.pa-page .cost-value,
.pa-page .card-value,
.pa-page .card-unit,
.pa-page .cost-unit,
.pa-page .cost-separator,
.pc-sticky-menu strong {
    vertical-align: baseline;
    line-height: inherit;
}

.trust-badge,
.case-count,
.cta-trust-item {
    display: inline-flex;
    align-items: baseline;
    line-height: 1.4;
}

.participant-card .card-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 2px;
    line-height: 1.2;
}

.range-card dd {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    margin: 0;
}

/* ── Layout ── */
.page-shell {
    display: flex;
    max-width: 1280px;
    margin: 0 auto;
    gap: 32px;
    padding: 0 20px;
}

.pa-page {
    flex: 1;
    min-width: 0;
    max-width: 960px;
}

.frame {
    padding-bottom: 80px;
}

/* ── Hero ── */
.hero {
    padding: 40px 0 24px;
}

.hero h1 {
    font-size: 26px;
    font-weight: 700;
    color: #111827;
    line-height: 1.4;
    margin: 0 0 12px;
}

.hero p {
    font-size: 15px;
    color: #6B7280;
    line-height: 1.6;
    margin: 0;
}

/* ── Tab Navigation ── */
.tab-wrap {
    position: sticky;
    top: 64px;
    z-index: 5;
    background: #fff;
    border-bottom: 1px solid #E5E7EB;
    margin: 0 -20px;
    padding: 0 20px;
}

.tabs {
    display: flex;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

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

.tab {
    flex-shrink: 0;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #9CA3AF;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.tab:hover {
    color: #374151;
}

.tab.active {
    color: #0094FF;
    border-bottom-color: #0094FF;
    font-weight: 600;
}

/* ── Section Common ── */
.pa-page section {
    padding: 32px 0;
    scroll-margin-top: 130px;
}

.pa-page section > h2 {
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #111827;
}

/* ── Cost Summary (#cost-summary) ── */
.cost-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.filter-group {
    flex: 1;
    min-width: 140px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-label {
    font-size: 12px;
    font-weight: 600;
    color: #6B7280;
    letter-spacing: 0.02em;
}

.cost-filters select,
.cost-filters input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    background: #fff;
    appearance: none;
    -webkit-appearance: none;
}

.cost-filters select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239CA3AF' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.cost-filters input[type="number"] {
    max-width: 160px;
}

.range-card {
    background: #F0F7FF;
    border: 1px solid #BFDBFE;
    border-radius: 12px;
    padding: 24px;
    margin: 20px 0;
}

.range-label {
    font-size: 13px;
    color: #6B7280;
    margin: 0 0 8px;
    font-weight: 500;
}

.range-card .cost-value {
    font-size: 28px;
    font-weight: 700;
    color: #0094FF;
    margin: 0;
}

.range-card .cost-unit {
    font-size: 14px;
    color: #6B7280;
    font-weight: 400;
}

.range-card .cost-separator {
    font-size: 20px;
    color: #9CA3AF;
    margin: 0 8px;
    line-height: 1.2;
}

#formulaText {
    font-size: 13px;
    color: #9CA3AF;
    margin: 12px 0 0;
}

#costNarrative {
    font-size: 14px;
    color: #6B7280;
    line-height: 1.6;
    margin: 8px 0 0;
}

/* ── Primary Button ── */
.primary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 24px;
    background: #0094FF;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 16px;
}

.primary-btn:hover {
    background: #0080E6;
}

.secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 24px;
    background: #fff;
    color: #0094FF;
    font-size: 15px;
    font-weight: 600;
    border: 1px solid #0094FF;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 8px;
}

.secondary-btn:hover {
    background: #F0F7FF;
}

/* ── Similar Cases (#similar-cases) ── */
.case-count {
    font-size: 14px;
    color: #6B7280;
    margin-bottom: 16px;
}

.case-count strong {
    color: #0094FF;
    font-weight: 700;
    line-height: 1;
}

/* Mobile card list */
#caseList {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.case-card {
    display: block;
    padding: 16px;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.case-card:hover {
    border-color: #0094FF;
    box-shadow: 0 2px 8px rgba(21, 101, 192, 0.1);
}

.case-title {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 8px;
}

.case-meta {
    font-size: 13px;
    color: #9CA3AF;
    margin: 0 0 4px;
}

.case-desc {
    font-size: 14px;
    color: #6B7280;
    margin: 0;
}

/* PC table */
.table-wrap {
    display: none;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table .th-col {
    padding: 12px 16px;
    background: #F9FAFB;
    font-weight: 600;
    color: #374151;
    text-align: left;
    border-bottom: 2px solid #E5E7EB;
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #F3F4F6;
    color: #374151;
}

.data-table tbody tr {
    cursor: pointer;
    transition: background 0.15s;
}

.data-table tbody tr:hover {
    background: #EBF5FF;
}

/* ── Login CTA in table/card ── */
.login-cta {
    color: #1565C0;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ── Cost Factors (#cost-factors) ── */
.factor-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.factor-card {
    padding: 20px;
    background: #FAFAFA;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
}

.factor-card h3 {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 8px;
}

.factor-card p {
    font-size: 14px;
    color: #6B7280;
    line-height: 1.6;
    margin: 0;
}

/* ── Participant Reference (#participant-ref) ── */
.participant-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.participant-card {
    padding: 20px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    text-align: center;
}

.participant-card .card-label {
    font-size: 12px;
    color: #9CA3AF;
    margin: 0 0 8px;
    font-weight: 500;
}

.participant-card .card-unit {
    font-size: 13px;
    color: #6B7280;
    font-weight: 400;
}

/* ── Budget Guide (#budget-guide) ── */
.guide-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: step;
}

.guide-card {
    position: relative;
    padding: 20px 20px 20px 60px;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    margin-bottom: 12px;
}

.guide-card::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 20px;
    top: 20px;
    width: 28px;
    height: 28px;
    line-height: 28px;
    background: #0094FF;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.guide-card h3 {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 6px;
}

.guide-card p {
    font-size: 14px;
    color: #6B7280;
    line-height: 1.5;
    margin: 0;
}

/* ── Breadcrumb ── */
.breadcrumb {
    padding: 12px 0;
}

.breadcrumb ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 13px;
    color: #9CA3AF;
}

.breadcrumb li::after {
    content: "›";
    margin: 0 6px;
    color: #D1D5DB;
}

.breadcrumb li:last-child::after {
    display: none;
}

.breadcrumb a {
    color: #6B7280;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: #0094FF;
    text-decoration: underline;
}

.breadcrumb [aria-current="page"] {
    color: #374151;
    font-weight: 500;
}

/* ── Hero Trust ── */
.hero-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.trust-badge {
    font-size: 13px;
    color: #0094FF;
    background: #EFF6FF;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.trust-badge strong {
    font-weight: 700;
}

/* ── FAQ ── */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.faq-item {
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    overflow: hidden;
}

.faq-item summary {
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: "+";
    font-size: 20px;
    color: #9CA3AF;
    font-weight: 400;
    flex-shrink: 0;
    margin-left: 12px;
}

.faq-item[open] summary::after {
    content: "−";
}

.faq-item p {
    padding: 0 20px 16px;
    font-size: 14px;
    color: #6B7280;
    line-height: 1.6;
    margin: 0;
}

/* ── Related Links ── */
.related-link-groups {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.related-link-group h3 {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 10px;
}

.tag-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-link {
    display: inline-block;
    padding: 6px 14px;
    font-size: 13px;
    color: #374151;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s;
}

.tag-link:hover {
    background: #EFF6FF;
    border-color: #0094FF;
    color: #0094FF;
}

/* ── CTA Box ── */
.cta-box {
    background: linear-gradient(135deg, #0094FF, #0080E6);
    color: #fff;
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    margin: 32px 0;
}

.cta-box h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px;
}

.cta-box p {
    font-size: 14px;
    opacity: 0.9;
    margin: 0 0 20px;
}

.cta-trust-items {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.cta-trust-item {
    font-size: 13px;
    opacity: 0.9;
}

.cta-trust-item strong {
    font-weight: 700;
    font-size: 15px;
}

.cta-box .primary-btn {
    background: #fff;
    color: #0094FF;
    max-width: 280px;
    margin: 0 auto;
}

.cta-box .primary-btn:hover {
    background: #F0F7FF;
}

/* ── Signup Modal ── */
.pa-signup-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    padding: 32px 24px;
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 24px;
    background: none;
    border: none;
    color: #9CA3AF;
    cursor: pointer;
}

.modal-content h3 {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px;
}

.modal-content > p {
    font-size: 14px;
    color: #6B7280;
    margin: 0 0 20px;
}

.modal-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #E5E7EB;
}

.modal-tab {
    flex: 1;
    padding: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #9CA3AF;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
}

.modal-tab.active {
    color: #0094FF;
    border-bottom-color: #0094FF;
}

.modal-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 12px;
    box-sizing: border-box;
}

.signup-guide {
    font-size: 14px;
    color: #6B7280;
    text-align: center;
    margin: 0 0 16px;
}

/* ── Sticky CTA ── */
.sticky-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 12px 16px;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.1);
    z-index: 50;
}

.sticky-cta .primary-btn {
    margin: 0;
}

/* ── Ranking (Mobile) ── */
.mobile-ranking {
    display: block;
}

.rank-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: rank;
}

.rank-list > li {
    counter-increment: rank;
    padding: 16px;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    margin-bottom: 8px;
    position: relative;
    padding-left: 52px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.rank-list > li:hover {
    border-color: #0094FF;
    box-shadow: 0 2px 8px rgba(21, 101, 192, 0.1);
}

.rank-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.rank-list > li::before {
    content: counter(rank);
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background: #F3F4F6;
    color: #374151;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.rank-list > li:nth-child(1)::before { background: #FEF3C7; color: #92400E; }
.rank-list > li:nth-child(2)::before { background: #F3F4F6; color: #374151; }
.rank-list > li:nth-child(3)::before { background: #FED7AA; color: #9A3412; }

.rank-main {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin: 0;
}

.rank-key {
    font-size: 12px;
    color: #9CA3AF;
    font-weight: 500;
}

.rank-val {
    font-size: 14px;
    color: #374151;
    margin: 0;
}

/* ── PC Sticky Sidebar ── */
.pc-sticky-menu {
    display: none;
}

/* ── Sticky Rank Table ── */
.sticky-rank-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
    font-size: 13px;
}

.sticky-rank-table .th-col {
    padding: 8px 10px;
    font-weight: 600;
    color: #6B7280;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sticky-rank-table tbody tr {
    background: #F9FAFB;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.sticky-rank-table tbody tr:hover {
    background: #EBF5FF;
}

.sticky-rank-table tbody td {
    padding: 10px;
    color: #374151;
    vertical-align: middle;
}

.sticky-rank-table tbody td:first-child {
    border-radius: 8px 0 0 8px;
    font-weight: 700;
    color: #0094FF;
    text-align: center;
    width: 36px;
}

.sticky-rank-table tbody td:last-child {
    border-radius: 0 8px 8px 0;
}

.sticky-section {
    margin-bottom: 24px;
}

.sticky-section h3 {
    font-size: 14px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #E5E7EB;
}

.sticky-region-label {
    font-size: 12px;
    color: #0094FF;
    font-weight: 600;
    margin-bottom: 8px;
}

/* ============================================================
   Responsive
   ============================================================ */

/* Tablet / small desktop */
@media (min-width: 769px) {
    .cost-filters {
        flex-wrap: nowrap;
    }

    .participant-cards {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* PC 2-column layout */
@media (min-width: 1120px) {
    #caseList {
        display: none;
    }

    .table-wrap {
        display: block;
    }

    .mobile-ranking {
        display: none;
    }

    .sticky-cta {
        display: none !important;
    }

    .pc-sticky-menu {
        display: block;
        width: 280px;
        flex-shrink: 0;
        position: sticky;
        top: 80px;
        align-self: flex-start;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
        padding-top: 40px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .page-shell {
        padding: 0 16px;
    }

    .hero h1 {
        font-size: 22px;
    }

    .hero p {
        font-size: 14px;
    }

    .cost-filters select,
    .cost-filters input {
        min-width: 100%;
    }

    .range-card .cost-value {
        font-size: 22px;
    }

    .participant-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .guide-card {
        padding-left: 52px;
    }
}
