/**
 * Infographic Base Styles
 *
 * Shared styles for all infographic/special pages in the Itako dictionary.
 * Import this file first, then page-specific styles override as needed.
 *
 * Contents:
 * 1. Common Page Setup (hide nav, body backgrounds)
 * 2. Layout Containers
 * 3. Card Components
 * 4. Header Patterns
 * 5. Interactive Elements (hover states, transitions)
 * 6. Grid Utilities
 * 7. Responsive Breakpoints
 */

/* =========================================================
   1. COMMON PAGE SETUP
   Hide Cyrillic navigation on all infographic pages
   ========================================================= */

body.periodic-table-page .dict-alpha-nav,
body.mineral-glossary-page .dict-alpha-nav,
body.ger-infographic-page .dict-alpha-nav,
body.buddhism-deities-page .dict-alpha-nav,
body.lab-tools-infographic-page .dict-alpha-nav,
body.solar-system-infographic-page .dict-alpha-nav,
body.geologic-timeline-page .dict-alpha-nav,
body.time-measurements-page .dict-alpha-nav {
    display: none;
}

/* =========================================================
   2. LAYOUT CONTAINERS
   Standard max-widths and padding for infographic pages
   ========================================================= */

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

.infographic-layout--wide {
    max-width: 1280px;
}

.infographic-layout--narrow {
    max-width: 1100px;
}

/* Full-width variant with white background */
.infographic-fullwidth {
    width: 100%;
    background: #fff;
    padding: 1.5rem 2rem;
    border-left: 1px solid var(--line-gray, #e0e0e0);
    border-right: 1px solid var(--line-gray, #e0e0e0);
}

/* =========================================================
   3. CARD COMPONENTS
   Shared card styles used across infographics
   ========================================================= */

.infographic-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--line-gray, #e0e0e0);
    border-radius: var(--radius-main, 12px);
    padding: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.infographic-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--wood-orange, #e07a00);
}

/* Card link wrapper (when entire card is clickable) */
.infographic-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Bordered card variant (stronger border) */
.infographic-card--bordered {
    border-width: 2px;
    border-color: var(--wood-orange, #e07a00);
}

/* Card with accent background */
.infographic-card--accent {
    background: var(--entry-bg, #fffaf0);
}

/* =========================================================
   4. HEADER PATTERNS
   Common header/intro section styles
   ========================================================= */

.infographic-header {
    text-align: center;
    margin-bottom: 2rem;
}

.infographic-header--left {
    text-align: left;
}

.infographic-header--bordered {
    border-bottom: 1px solid var(--line-gray, #dcd1c3);
    padding-bottom: 1rem;
}

.infographic-intro {
    max-width: 700px;
    margin: 1rem auto 0;
    line-height: 1.7;
    color: var(--ink-soft, #5a4943);
    font-size: 0.95rem;
}

.infographic-intro--left {
    margin-left: 0;
    margin-right: 0;
}

/* Breadcrumb styling */
.infographic-breadcrumb {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 1rem;
}

.infographic-breadcrumb a {
    color: var(--wood-orange, #e07a00);
    text-decoration: none;
}

.infographic-breadcrumb a:hover {
    text-decoration: underline;
}

/* Tag pill for metadata */
.infographic-tag {
    display: inline-block;
    background: rgba(224, 122, 0, 0.08);
    color: var(--wood-orange, #e07a00);
    padding: 2px 10px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.8rem;
}

/* =========================================================
   5. INTERACTIVE ELEMENTS
   Hotspots, hover states, transitions
   ========================================================= */

/* Hotspot markers (for image overlays) */
.infographic-hotspot {
    position: absolute;
    width: 32px;
    height: 32px;
    background: var(--wood-orange, #e07a00);
    color: #fff;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid #fff;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.infographic-hotspot:hover,
.infographic-hotspot.active {
    transform: translate(-50%, -50%) scale(1.15);
    background: var(--wood-dark, #6b4423);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

/* Term number badge */
.infographic-number {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: var(--wood-orange, #e07a00);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

/* =========================================================
   6. GRID UTILITIES
   Reusable grid patterns
   ========================================================= */

.infographic-grid {
    display: grid;
    gap: 1rem;
}

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

.infographic-grid--3col {
    grid-template-columns: repeat(3, 1fr);
}

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

.infographic-grid--5col {
    grid-template-columns: repeat(5, 1fr);
}

.infographic-grid--auto {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.infographic-grid--auto-sm {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.infographic-grid--auto-lg {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* Two-column layout with sticky sidebar */
.infographic-split {
    display: grid;
    grid-template-columns: 45% 1fr;
    gap: 2rem;
    align-items: start;
}

.infographic-sticky {
    position: sticky;
    top: 90px;
}

/* =========================================================
   7. SECTION DIVIDERS
   ========================================================= */

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

.infographic-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

.infographic-section-title {
    margin: 0 0 1.5rem 0;
    font-size: 1.3rem;
    color: var(--wood-dark, #6b4423);
}

/* =========================================================
   8. FOOTER / NAVIGATION
   ========================================================= */

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

.infographic-back-link {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--wood-dark, #6b4423);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.infographic-back-link:hover {
    background: var(--wood-orange, #e07a00);
}

/* =========================================================
   9. IMAGE CONTAINERS
   ========================================================= */

.infographic-image-frame {
    position: relative;
    background: linear-gradient(135deg, #f8f6f3, #ebe7e0);
    border: 1px solid var(--line-gray, #e0e0e0);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.infographic-image-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.infographic-image-frame[data-aspect="1/1"] { aspect-ratio: 1 / 1; }
.infographic-image-frame[data-aspect="3/2"] { aspect-ratio: 3 / 2; }
.infographic-image-frame[data-aspect="4/3"] { aspect-ratio: 4 / 3; }
.infographic-image-frame[data-aspect="3/4"] { aspect-ratio: 3 / 4; }
.infographic-image-frame[data-aspect="4/5"] { aspect-ratio: 4 / 5; }
.infographic-image-frame[data-aspect="16/9"] { aspect-ratio: 16 / 9; }

/* =========================================================
   10. LEGEND COMPONENTS
   ========================================================= */

.infographic-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}

.infographic-legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.6rem;
    border-radius: 0.4rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: opacity 0.2s;
}

.infographic-legend-item:hover {
    opacity: 0.8;
}

.infographic-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* =========================================================
   11. RESPONSIVE BREAKPOINTS
   ========================================================= */

@media (max-width: 1024px) {
    .infographic-grid--5col {
        grid-template-columns: repeat(4, 1fr);
    }
}

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

    .infographic-fullwidth {
        padding: 1.2rem 1.4rem;
    }

    .infographic-split {
        grid-template-columns: 1fr;
    }

    .infographic-sticky {
        position: static;
    }

    .infographic-grid--4col,
    .infographic-grid--5col {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .infographic-layout {
        padding: 1rem;
    }

    .infographic-grid--3col {
        grid-template-columns: repeat(2, 1fr);
    }

    .infographic-grid--4col,
    .infographic-grid--5col {
        grid-template-columns: repeat(2, 1fr);
    }

    .infographic-hotspot {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
}

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

    .infographic-fullwidth {
        padding: 1rem;
    }

    .infographic-grid--2col,
    .infographic-grid--3col {
        grid-template-columns: 1fr;
    }

    .infographic-card {
        padding: 0.875rem;
    }
}

@media (max-width: 480px) {
    .infographic-hotspot {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
    }

    .infographic-section-title {
        font-size: 1.15rem;
    }
}

/* =========================================================
   12. PRINT STYLES
   ========================================================= */

@media print {
    .infographic-hotspot,
    .infographic-back-link {
        display: none;
    }

    .infographic-section {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .infographic-split {
        grid-template-columns: 1fr;
    }

    .infographic-sticky {
        position: static;
    }
}