@charset "UTF-8";

/* ==========================================
   Case page styles（Hub / NSP 共用）
   style.css の上に追加するページ固有スタイル
   ========================================== */

.site-title-link {
    color: inherit;
    text-decoration: none;
}
.site-title-link:hover { color: #2563eb; }

body.site-body { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }

.case-main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    min-width: 0;
}

.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;
}

/* ------------------------------------------
   Hero
   ------------------------------------------ */
.case-hero {
    display: grid;
    gap: 1.5rem;
    padding: 1.5rem;
    overflow: hidden;
}
@media (min-width: 768px) {
    .case-hero { padding: 2rem; }
}
@media (min-width: 1180px) {
    .case-hero {
        grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
        align-items: center;
        gap: 2rem;
    }
}

.case-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 1rem;
    font-size: 0.75rem;
    color: #9ca3af;
}
.case-breadcrumb a {
    color: #6b7280;
    text-decoration: none;
}
.case-breadcrumb a:hover { color: #2563eb; text-decoration: underline; }

.case-kicker {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.case-title {
    font-size: 2.25rem;
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #111827;
}
@media (min-width: 768px) {
    .case-title { font-size: 3rem; }
}

.case-title-small {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #111827;
    margin-bottom: 0.5rem;
}

.case-lead {
    margin-top: 0.875rem;
    font-size: 1rem;
    line-height: 1.75;
    color: #4b5563;
}

.case-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid #f3f4f6;
}
.case-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}
.case-meta-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9ca3af;
}
.case-meta-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
}

.case-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    margin-top: 1.5rem;
}

.case-figure {
    margin: 0;
    border: 1px solid #d1d5db;
    border-radius: 0.75rem;
    overflow: hidden;
    background-color: #f3f4f6;
    box-shadow: 0 18px 40px -28px rgba(15, 23, 42, 0.45);
}
.case-figure-img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 22rem;
    object-fit: contain;
    object-position: center;
    background-color: #f8fafc;
}
.case-caption {
    padding: 0.625rem 0.875rem;
    border-top: 1px solid #e5e7eb;
    background-color: #ffffff;
    font-size: 0.75rem;
    line-height: 1.6;
    color: #6b7280;
}

.case-figure-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    min-height: 18rem;
    padding: 2rem 1.5rem;
    text-align: center;
    background-color: #f8fafc;
    background-image:
        linear-gradient(#eef2f7 1px, transparent 1px),
        linear-gradient(90deg, #eef2f7 1px, transparent 1px);
    background-size: 1.5rem 1.5rem;
}
.placeholder-kicker {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #9ca3af;
}
.placeholder-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: #374151;
}
.placeholder-note {
    max-width: 22rem;
    font-size: 0.8rem;
    line-height: 1.6;
    color: #6b7280;
}

/* ------------------------------------------
   Sections
   ------------------------------------------ */
.case-section {
    padding: 1.5rem;
    scroll-margin-top: 2rem;
}
@media (min-width: 768px) {
    .case-section { padding: 2rem; }
}

.case-section-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f3f4f6;
}
.case-section-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.375rem;
    background-color: #111827;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}
.case-section-head .section-title {
    border-left: none;
    padding-left: 0;
    margin: 0;
}

.case-subtitle {
    margin-top: 1.75rem;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
}
.case-section > .case-subtitle:first-of-type { margin-top: 1rem; }

.panel-label {
    margin-bottom: 0.375rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #9ca3af;
}

/* ------------------------------------------
   Layout helpers
   ------------------------------------------ */
.case-grid {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}
@media (min-width: 768px) {
    .case-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.case-panel {
    padding: 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background-color: #f9fafb;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 1.5rem;
}
@media (min-width: 768px) {
    .metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.metric-card {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    padding: 0.875rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background-color: #ffffff;
}
.metric-value {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #111827;
    font-variant-numeric: tabular-nums;
}
.metric-label {
    font-size: 0.72rem;
    line-height: 1.4;
    color: #6b7280;
}

/* ------------------------------------------
   Lists
   ------------------------------------------ */
.check-list,
.cross-list,
.numbered-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-left: 0.25rem;
    font-size: 0.95rem;
    line-height: 1.65;
    color: #374151;
}
.check-list { list-style: none; }
.check-list li,
.cross-list li {
    position: relative;
    padding-left: 1.375rem;
}
.check-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #0d9488;
    font-weight: 700;
}
.cross-list { list-style: none; }
.cross-list li::before {
    content: "–";
    position: absolute;
    left: 0.125rem;
    color: #9ca3af;
    font-weight: 700;
}
.numbered-list {
    list-style: decimal;
    padding-left: 1.5rem;
}

.section-text + .case-subtitle { margin-top: 1.5rem; }
.case-panel .case-subtitle { margin-top: 0; }

/* ------------------------------------------
   Tables
   ------------------------------------------ */
.table-scroll {
    margin-top: 1rem;
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
}
.spec-table {
    width: 100%;
    min-width: 560px;
    border-collapse: collapse;
    font-size: 0.9rem;
    line-height: 1.6;
    text-align: left;
}
.spec-table th,
.spec-table td {
    padding: 0.75rem 0.875rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: top;
}
.spec-table thead th {
    background-color: #f9fafb;
    color: #374151;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}
.spec-table tbody th {
    width: 30%;
    color: #111827;
    font-weight: 700;
    background-color: #fcfcfd;
}
.spec-table tbody tr:last-child th,
.spec-table tbody tr:last-child td { border-bottom: none; }

.inline-code {
    padding: 0.125rem 0.375rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.25rem;
    background-color: #f9fafb;
    color: #374151;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.82em;
    overflow-wrap: anywhere;
}

/* ------------------------------------------
   Flow
   ------------------------------------------ */
.flow {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0;
    list-style: none;
}
.flow-step {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 0.75rem 0.875rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background-color: #ffffff;
}
.flow-step > div { min-width: 0; }
.flow-step strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: #111827;
}
.flow-step p {
    margin-top: 0.125rem;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #6b7280;
}
.flow-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 9999px;
    background-color: #eef2ff;
    color: #4f46e5;
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

/* ------------------------------------------
   Algorithm
   ------------------------------------------ */
.algo-block {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f3f4f6;
    scroll-margin-top: 2rem;
}
.algo-block:first-of-type { margin-top: 1rem; padding-top: 0; border-top: none; }

.algo-title {
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
    border-left: 4px solid #2563eb;
    padding-left: 0.75rem;
}

.code-block {
    margin-top: 0.75rem;
    padding: 0.875rem 1rem;
    overflow-x: auto;
    border: 1px solid #1f2937;
    border-radius: 0.5rem;
    background-color: #0f172a;
    color: #e2e8f0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8rem;
    line-height: 1.65;
    tab-size: 2;
}
.code-block code { font-family: inherit; }

.param-grid,
.limit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin-top: 0.75rem;
}
@media (min-width: 768px) {
    .param-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .limit-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.param,
.limit-card {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    background-color: #f9fafb;
}
.param-name {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #6b7280;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.param-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: #111827;
    font-variant-numeric: tabular-nums;
}
.limit-card { align-items: flex-start; }
.limit-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: #111827;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.limit-label {
    font-size: 0.72rem;
    color: #6b7280;
}

/* ------------------------------------------
   Development log
   ------------------------------------------ */
.devlog {
    list-style: none;
    margin-top: 1rem;
    padding: 0 0 0 1.125rem;
    border-left: 2px solid #e5e7eb;
}
.devlog-item {
    position: relative;
    padding-bottom: 1.25rem;
}
.devlog-item:last-child { padding-bottom: 0; }
.devlog-item::before {
    content: "";
    position: absolute;
    top: 0.35rem;
    left: calc(-1.125rem - 5px);
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    background-color: #2563eb;
    box-shadow: 0 0 0 3px #eff6ff;
}
.devlog-date {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
}
.devlog-title {
    display: block;
    margin-top: 0.125rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #111827;
}
.devlog-body {
    margin-top: 0.25rem;
    font-size: 0.9rem;
    line-height: 1.65;
    color: #4b5563;
}

/* ------------------------------------------
   Callouts
   ------------------------------------------ */
.callout {
    margin-top: 1.25rem;
    padding: 0.875rem 1rem;
    border: 1px solid #dbeafe;
    border-left: 4px solid #2563eb;
    border-radius: 0.375rem;
    background-color: #eff6ff;
    font-size: 0.9rem;
    line-height: 1.7;
    color: #1e3a8a;
}
.callout strong { font-weight: 700; }
.callout-warn {
    border-color: #fde68a;
    border-left-color: #d97706;
    background-color: #fffbeb;
    color: #78350f;
}

/* ------------------------------------------
   Tags
   ------------------------------------------ */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.tag-list .tag {
    font-size: 0.8rem;
    background-color: #ffffff;
}

/* ------------------------------------------
   CTA
   ------------------------------------------ */
.case-cta {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-color: #c7d2fe;
    background: linear-gradient(135deg, #ffffff 0%, #f5f7ff 100%);
}
@media (min-width: 900px) {
    .case-cta {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 2rem;
    }
    .case-cta > div:first-child { flex: 1; min-width: 0; }
    .case-cta .case-actions { margin-top: 0; flex-shrink: 0; }
}

@media (max-width: 520px) {
    .case-actions { flex-direction: column; }
    .case-actions .btn { width: 100%; }
    .case-meta { gap: 0.75rem 1.25rem; }
    .case-title { font-size: 2rem; }
    .case-section { padding-left: 1.125rem; padding-right: 1.125rem; }
}

@media print {
    .site-header,
    .sidebar-nav,
    .site-footer,
    .case-actions,
    .font-switcher { display: none; }
    .layout-container { display: block; }
    .card { border-color: #d1d5db; box-shadow: none; }
    .case-figure-placeholder { background-image: none; }
    .code-block { white-space: pre-wrap; }
}
