/**
 * Lab Tools Infographic
 * Page-specific styles (base styles in _base.css)
 */

/* =========================================================
   PAGE SETUP
   ========================================================= */

body.lab-tools-infographic-page {
    background: var(--card-bg, #fff);
}

.lab-tools-infographic-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.lab-tools-infographic {
    background: var(--card-bg, #fff);
}

/* =========================================================
   HEADER
   ========================================================= */

.lab-tools-infographic__header {
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--line-gray, #dcd1c3);
    padding-bottom: 1.5rem;
}

.lab-tools-infographic__meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

/* =========================================================
   LEGEND (category overview strip)
   ========================================================= */

.lab-tools-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--entry-bg, #fffaf0);
    border: 1px solid var(--line-gray, #dcd1c3);
    border-radius: var(--radius-main, 12px);
}

.lab-tools-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid;
    transition: opacity 0.2s;
}

.lab-tools-legend__item:hover {
    opacity: 0.8;
}

.lab-tools-legend__color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.lab-tools-legend__item small {
    color: #666;
    font-weight: 400;
}

.lab-tools-legend__count {
    background: rgba(0, 0, 0, 0.08);
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* =========================================================
   CATEGORY SECTIONS
   ========================================================= */

.lab-tools-section {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--line-gray, #e0e0e0);
}

.lab-tools-section:last-of-type {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

/* Section title */
.lab-tools-section__title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 1rem;
    padding: 0 0 0.5rem;
    border-bottom: 3px solid;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-dark, #3b2411);
}

.lab-tools-section__title-mn {
    font-size: 1.15rem;
}

.lab-tools-section__title-jp {
    font-size: 0.9rem;
    color: var(--ink-soft, #5a4943);
    font-weight: 400;
}

.lab-tools-section__count {
    margin-left: auto;
    background: var(--entry-bg, #fffaf0);
    border: 1px solid var(--line-gray, #dcd1c3);
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ink-soft, #5a4943);
}

/* =========================================================
   SPLIT LAYOUT (image + cards side by side)
   ========================================================= */

.lab-tools-section__split {
    display: grid;
    grid-template-columns: clamp(360px, 45vw, 692px) minmax(300px, 560px);
    gap: 24px;
    align-items: start;
}

/* =========================================================
   VISUAL PANEL (image with hotspots)
   ========================================================= */

.lab-tools-section__visual {
    position: sticky;
    top: 90px;
}

.lab-tools-canvas {
    position: relative;
    background: linear-gradient(135deg, #f8f6f3, #ebe7e0);
    border: 1px solid var(--line-gray, #dcd1c3);
    border-radius: var(--radius-main, 12px);
    overflow: hidden;
    aspect-ratio: 692 / 461;
}

.lab-tools-canvas img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Hotspot buttons on images */
.lab-tools-hotspot {
    position: absolute;
    width: 28px;
    height: 28px;
    color: #fff;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: bold;
    font-size: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.25, 1, 0.5, 1);
    border: 2px solid #fff;
    transform: translate(-50%, -50%);
    z-index: 10;
    padding: 0;
    line-height: 1;
}

.lab-tools-hotspot:hover,
.lab-tools-hotspot.active {
    transform: translate(-50%, -50%) scale(1.25);
    background: var(--text-dark, #3b2411) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

/* =========================================================
   CARDS PANEL
   ========================================================= */

.lab-tools-section__cards {
    min-width: 0;
    max-width: 560px;
}

/* =========================================================
   CARD GRID
   ========================================================= */

.lab-tools-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 270px));
    justify-content: start;
}

/* =========================================================
   TOOL CARDS
   ========================================================= */

.lab-tool-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: var(--card-bg, var(--entry-bg, #fffaf0));
    border: 2px solid var(--line-gray, #dcd1c3);
    border-radius: var(--radius-main, 12px);
    border-left: 4px solid var(--card-accent, var(--wood-orange, #e07a00));
    transition: all 0.22s cubic-bezier(0.25, 1, 0.5, 1);
}

.lab-tool-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 36, 17, 0.1);
    border-color: var(--card-accent, var(--wood-orange, #e07a00));
}

/* Active state (from hotspot click) */
.lab-tool-card.active {
    border-color: var(--card-accent, var(--wood-orange, #e07a00));
    transform: scale(1.03);
    z-index: 5;
    box-shadow: 0 10px 28px rgba(59, 36, 17, 0.18);
    background: #fff;
}

/* Number badge */
.lab-tool-card__number {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    background: var(--card-accent, var(--wood-orange, #e07a00));
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    margin-top: 1px;
}

/* Card body */
.lab-tool-card__body {
    flex: 1;
    min-width: 0;
}

.lab-tool-card__mn {
    margin: 0 0 3px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-dark, #3b2411);
    line-height: 1.3;
}

.lab-tool-card__jp {
    margin: 0;
    font-size: 0.85rem;
    color: var(--ink-soft, #5a4943);
    line-height: 1.4;
}

.lab-tool-card__untranslated {
    display: inline-block;
    font-size: 0.78rem;
    color: var(--wood-orange, #e07a00);
    font-weight: 600;
}

/* =========================================================
   FOOTER
   ========================================================= */

.lab-tools-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--line-gray, #dcd1c3);
    text-align: center;
}

.lab-tools-footer__total {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    color: var(--ink-soft, #5a4943);
    font-weight: 600;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 900px) {
    .lab-tools-infographic-layout {
        padding: 1.5rem 1rem 3rem;
    }

    .lab-tools-section__split {
        grid-template-columns: 1fr;
    }

    .lab-tools-section__visual {
        position: static;
        max-width: 420px;
        margin: 0 auto;
    }

    .lab-tools-canvas {
        aspect-ratio: 692 / 461;
    }
}

@media (max-width: 640px) {
    .lab-tools-infographic-layout {
        padding: 1rem 0.75rem 2rem;
    }

    .lab-tools-infographic__header {
        padding-bottom: 1rem;
    }

    .lab-tools-legend {
        padding: 0.75rem;
        gap: 6px;
    }

    .lab-tools-legend__item {
        font-size: 0.75rem;
        padding: 4px 8px;
    }

    .lab-tools-legend__item small {
        display: none;
    }

    .lab-tools-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .lab-tools-section__title {
        font-size: 1rem;
        flex-wrap: wrap;
        gap: 4px;
    }

    .lab-tools-section__title-jp {
        font-size: 0.8rem;
    }

    .lab-tool-card {
        padding: 10px 12px;
    }

    .lab-tools-section__visual {
        max-width: 260px;
    }

    .lab-tools-hotspot {
        width: 24px;
        height: 24px;
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .lab-tools-section__title {
        font-size: 0.95rem;
    }

    .lab-tools-section__count {
        margin-left: 0;
    }

    .lab-tools-hotspot {
        width: 22px;
        height: 22px;
        font-size: 0.6rem;
    }
}

/* =========================================================
   PRINT
   ========================================================= */

@media print {
    .lab-tools-legend {
        border: 1px solid #ccc;
    }

    .lab-tool-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .lab-tools-section {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .lab-tools-section__split {
        grid-template-columns: 1fr;
    }

    .lab-tools-section__visual {
        position: static;
    }

    .lab-tools-hotspot {
        display: none;
    }
}