/* Increase global content width for case studies on desktop */
.case-study {
    max-width: 1200px !important;
    margin: 4rem auto;
    padding: 0 1rem;
}

/* True Two-Column Layout for Desktop */
.case-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.case-col-left, .case-col-right {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Narrative Styling */
.case-description {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--sc-slate);
    margin-bottom: 1rem;
}

.fact-block {
    margin-bottom: 1.5rem;
}
.fact-title {
    display: block;
    color: var(--sc-navy-deep);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}
.fact-block p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--sc-slate);
    margin: 0;
}

/* Visuals Styling */
.img-wrapper {
    margin-bottom: 2rem;
}
.full-img {
    width: 100%;
    border-radius: var(--sc-radius);
    box-shadow: var(--sc-shadow);
    display: block;
    height: auto;
}
.img-caption {
    font-size: 0.85rem;
    color: var(--sc-slate);
    margin-top: 0.5rem;
    font-style: italic;
    line-height: 1.4;
}

/* VLM Comparison */
.vlm-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}
.comp-box {
    display: flex;
    flex-direction: column;
}
.comp-img {
    width: 100%;
    border-radius: var(--sc-radius);
    box-shadow: var(--sc-shadow);
    display: block;
    height: auto;
}
.img-label {
    font-size: 0.8rem;
    color: var(--sc-navy-deep);
    font-weight: 600;
    margin-top: 0.5rem;
    text-align: center;
}

/* Monitoring Section */
.monitoring-section {
    background: var(--sc-offwhite);
    padding: 1.5rem;
    border-radius: var(--sc-radius);
    border-left: 4px solid var(--sc-orange);
    margin-bottom: 2rem;
}
.monitoring-section .fact-title {
    margin-bottom: 0.5rem;
}
.monitoring-section p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--sc-slate);
    margin-bottom: 1rem;
}
.monitoring-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}
.monitor-img {
    width: 100%;
    border-radius: var(--sc-radius);
    box-shadow: var(--sc-shadow);
    display: block;
    height: auto;
}

/* Result Section */
.result-section {
    padding: 1rem 0;
}
.result-section .fact-title {
    margin-bottom: 0.5rem;
}
.result-section p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--sc-slate);
    margin: 0;
}

/* Mobile/Tablet Breakpoint: Stack everything */
@media (max-width: 991px) {
    .case-layout {
        grid-template-columns: 1fr;
    }
    .case-col-right {
        order: -1;
    }
    .vlm-comparison, .monitoring-pair {
        grid-template-columns: 1fr;
    }
}
/* Updated Teaser Layout */
.case-teaser {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    background: var(--sc-offwhite, #f9f9f9);
    border-radius: var(--sc-radius);
    border-left: 4px solid var(--sc-orange, #f28c28);
    margin-bottom: 2rem;
    transition: box-shadow 0.2s ease;
}
.case-teaser:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.teaser-content {
    flex: 1;
}
.teaser-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.4rem;
    color: var(--sc-navy-deep, #001f3f);
}
.teaser-desc {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--sc-slate, #444);
    margin-bottom: 1.25rem;
}
.teaser-link {
    display: inline-block;
    color: var(--sc-orange, #f28c28);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95rem;
    transition: transform 0.2s ease, color 0.2s ease;
}
.teaser-link:hover {
    color: var(--sc-navy-deep, #001f3f);
    transform: translateX(3px);
}
.teaser-visual {
    flex: 0 0 auto;
    text-align: right;
}
.teaser-img {
    width: 200px !important;
    height: 130px !important;
    object-fit: cover !important;
    border-radius: var(--sc-radius);
    box-shadow: var(--sc-shadow);
    transition: opacity 0.2s ease;
    display: block;
}
.teaser-visual a:hover .teaser-img {
    opacity: 0.9;
}

/* Mobile Breakpoint */
@media (max-width: 768px) {
    .case-teaser {
        flex-direction: column-reverse;
        text-align: center;
        gap: 1.5rem;
    }
    .teaser-visual {
        flex: 0 0 auto;
        text-align: center;
    }
    .teaser-img {
        width: 100% !important;
        max-width: 300px !important;
        height: auto !important;
    }
}
/* Lightbox Overlay */
.scelaris-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    cursor: zoom-out;
    backdrop-filter: blur(5px);
    transition: opacity 0.3s ease;
}
.scelaris-lightbox.active {
    display: flex;
}
.scelaris-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}
.scelaris-lightbox-img {
    display: block;
    max-width: 100%;
    max-height: 90vh;
    border-radius: var(--sc-radius, 8px);
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    object-fit: contain;
}
.scelaris-lightbox-close {
    position: absolute;
    top: -40px;
    right: -40px;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
}
@media (max-width: 768px) {
    .scelaris-lightbox-close {
        top: -50px;
        right: 0;
    }
}
/*
 * Research essay (Article 22 — Engineering Reliable AI-Assisted Research)
 * Loads on the article page only; reuses Scelaris design language.
 * Scoped under .research-essay to avoid any effect on other pages.
 */

/* Essay rhythm: narrower reading column than case studies */
.research-essay .essay-part {
  max-width: 820px;
  margin: 2.2rem auto;
}
.research-essay .essay-intro {
  max-width: 820px;
  margin: 2rem auto;
}
.research-essay .essay-subtitle {
  font-size: 1.15rem;
  color: var(--sc-navy);
  font-weight: 600;
  margin-bottom: 1.2rem;
}

/* Layer table: layered-discipline representation */
.research-essay .research-layer-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 1.4rem 0;
}
.research-essay .research-layer-table th,
.research-essay .research-layer-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--sc-border, #ddd);
  text-align: left;
  vertical-align: top;
}
.research-essay .research-layer-table thead th {
  border-bottom: 2px solid var(--sc-orange);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sc-navy);
}
.research-essay .research-layer-table tbody td:first-child {
  white-space: nowrap;
  color: var(--sc-navy);
}

/* Pending-evidence note: quiet, honest */
.research-essay .essay-pending-note {
  border-left: 4px solid var(--sc-cyan);
  background: rgba(31, 198, 213, 0.06);
  padding: 1rem 1.2rem;
  border-radius: 4px;
  margin: 1.4rem 0;
}
.research-essay .essay-pending-note p { margin: 0; }

/* Cross-reference: subdued */
.research-essay .essay-crossref {
  border-top: 1px solid var(--sc-border, #ddd);
  padding-top: 1.2rem;
}
.research-essay .essay-crossref h2 { font-size: 1.1rem; }

/* Mobile */
@media (max-width: 768px) {
  .research-essay .research-layer-table { font-size: 0.82rem; }
  .research-essay .research-layer-table th,
  .research-essay .research-layer-table td { padding: 0.45rem 0.5rem; }
}