/**
 * Buddhism Deities Infographic
 * Page-specific styles (base styles in _base.css)
 *
 * Section types:
 * - section-mandala: single image with hotspots + term cards
 * - section-portrait-gallery: grid of individual vertical images
 * - section-featured: larger featured items
 * - section-horizontal: horizontal row of items
 * - section-compact: text-only compact list
 * - section-masters: two-column layout for historical figures
 */

/* ========================================
   Mandala Section
   ======================================== */

.mandala-layout {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: 2.5rem;
    align-items: start;
}

.mandala-image-container {
    position: sticky;
    top: 2rem;
}

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

.mandala-placeholder[data-aspect="1/1"] { aspect-ratio: 1 / 1; }
.mandala-placeholder[data-aspect="3/2"] { aspect-ratio: 3 / 2; }
.mandala-placeholder[data-aspect="4/5"] { aspect-ratio: 4 / 5; }

.placeholder-label {
    color: #999;
    font-size: 1rem;
    text-align: center;
    padding: 1rem;
}

.mandala-image-frame {
    padding: 0;
}

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

/* Hotspots */
.hotspot {
    position: absolute;
    width: 36px;
    height: 36px;
    background: var(--wood-orange, #e07a00);
    color: white;
    border: 3px solid white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
    transition: all 0.2s ease;
    transform: translate(-50%, -50%);
    z-index: 10;
}

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

/* Mini Term Cards */
.mandala-terms {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.term-card-mini {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.8rem 0.9rem;
    background: white;
    border: 1px solid var(--line-gray, #e0e0e0);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.term-card-mini:hover {
    border-color: var(--wood-orange, #e07a00);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.term-card-mini.highlight {
    border-color: var(--wood-orange, #e07a00);
    background: #fffaf5;
    box-shadow: 0 4px 16px rgba(224, 122, 0, 0.2);
}

.term-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;
    margin-top: 0.1rem;
}

.term-card-mini.highlight .term-number {
    background: var(--wood-dark, #6b4423);
}

.term-content {
    flex: 1;
    min-width: 0;
}

.term-content h3 {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--wood-dark, #6b4423);
}

.term-trans {
    display: block;
    font-size: 0.85rem;
    color: #777;
    margin-top: 0.125rem;
}

.term-link-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: #f5f5f5;
    color: var(--wood-orange, #e07a00);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.2s ease;
}

.term-link-icon:hover {
    background: var(--wood-orange, #e07a00);
    color: white;
}

/* ========================================
   Portrait Gallery Section
   ======================================== */

.portrait-gallery {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
}

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

.portrait-item {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s ease;
}

.portrait-item:hover {
    transform: translateY(-4px);
}

.portrait-image {
    background: linear-gradient(135deg, #f8f6f3, #ebe7e0);
    border: 1px solid var(--line-gray, #e0e0e0);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.portrait-image[data-aspect="3/4"] {
    aspect-ratio: 3 / 4;
}

.portrait-item:hover .portrait-image {
    border-color: var(--wood-orange, #e07a00);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.portrait-term {
    text-align: center;
}

.portrait-term h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--wood-dark, #6b4423);
}

.portrait-term span {
    display: block;
    font-size: 0.8rem;
    color: #777;
    line-height: 1.4;
}

/* ========================================
   Featured Section
   ======================================== */

.featured-layout {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.featured-item {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s ease;
}

.featured-item:hover {
    transform: translateY(-4px);
}

.featured-image {
    background: linear-gradient(135deg, #f8f6f3, #ebe7e0);
    border: 2px solid var(--line-gray, #e0e0e0);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.featured-image[data-aspect="3/4"] {
    aspect-ratio: 3 / 4;
}

.featured-item:hover .featured-image {
    border-color: var(--wood-orange, #e07a00);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.featured-term {
    text-align: center;
}

.featured-term h3 {
    margin: 0 0 0.375rem 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--wood-dark, #6b4423);
}

.featured-term span {
    display: block;
    font-size: 0.9rem;
    color: #777;
}

/* ========================================
   Horizontal Section
   ======================================== */

.horizontal-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.horizontal-item {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s ease;
}

.horizontal-item:hover {
    transform: translateY(-4px);
}

.horizontal-image {
    background: linear-gradient(135deg, #f8f6f3, #ebe7e0);
    border: 1px solid var(--line-gray, #e0e0e0);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.horizontal-image[data-aspect="3/4"] {
    aspect-ratio: 3 / 4;
}

.horizontal-item:hover .horizontal-image {
    border-color: var(--wood-orange, #e07a00);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.horizontal-term {
    text-align: center;
}

.horizontal-term h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--wood-dark, #6b4423);
}

.horizontal-term span {
    display: block;
    font-size: 0.8rem;
    color: #777;
}

.horizontal-term small {
    display: block;
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.25rem;
}

/* ========================================
   Compact Section
   ======================================== */

.compact-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}

.compact-item {
    display: block;
    padding: 0.875rem 1rem;
    background: white;
    border: 1px solid var(--line-gray, #e0e0e0);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.compact-item:hover {
    border-color: var(--wood-orange, #e07a00);
    background: #fffaf5;
    transform: translateX(4px);
}

.compact-item h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--wood-dark, #6b4423);
}

.compact-item span {
    display: block;
    font-size: 0.85rem;
    color: #777;
}

/* ========================================
   Masters Section
   ======================================== */

.masters-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.masters-subtitle {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--wood-dark, #6b4423);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--wood-orange, #e07a00);
}

.masters-column .compact-list {
    grid-template-columns: 1fr;
}

/* ========================================
   Footer Navigation
   ======================================== */

.related-infographics h3 {
    margin: 0 0 1.5rem 0;
    font-size: 1.2rem;
    color: var(--wood-dark, #6b4423);
    text-align: center;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.related-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 1.25rem 1rem;
    background: white;
    border: 1px solid var(--line-gray, #e0e0e0);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    text-align: center;
    transition: all 0.2s ease;
}

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

.related-card strong {
    font-size: 0.95rem;
    color: var(--wood-dark, #6b4423);
}

.related-card small {
    font-size: 0.8rem;
    color: #888;
}

.back-to-hub {
    text-align: center;
    margin-top: 2rem;
}

.btn-back {
    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;
}

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

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

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

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

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

@media (max-width: 768px) {
    .mandala-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .mandala-image-container {
        position: relative;
        top: 0;
    }

    .mandala-terms {
        grid-template-columns: 1fr;
    }

    .portrait-gallery,
    .portrait-gallery-4col {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    .featured-layout {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .horizontal-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .masters-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

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

    .hotspot {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .portrait-gallery,
    .portrait-gallery-4col {
        grid-template-columns: repeat(2, 1fr);
    }

    .featured-layout {
        grid-template-columns: 1fr;
    }

    .horizontal-gallery {
        grid-template-columns: 1fr 1fr;
    }

    .compact-list {
        grid-template-columns: 1fr;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }

    .term-card-mini {
        padding: 0.75rem;
    }

    .term-content h3 {
        font-size: 1rem;
    }
}

/* ========================================
   Print Styles
   ======================================== */

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

    .mandala-layout {
        grid-template-columns: 1fr;
    }

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