/**
 * Story Server Frontend Styles
 */

.story-matrix {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin: 1.5em 0;
    max-width: 100%;
}

.story-matrix a {
    display: block;
    line-height: 0;
}

.story-matrix.visual-matrix {
    gap: 8px;
}

.story-matrix.visual-matrix img.story-stub {
    width: var(--story-stub-width, 100px);
    height: var(--story-stub-width, 100px);
    object-fit: cover;
    border-radius: 4px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.story-matrix.visual-matrix a:hover img.story-stub {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 10;
}

.story-matrix.visual-matrix a.current-item img {
    outline: 3px solid #ffcc00;
    outline-offset: -3px;
}

.story-matrix img.PokerFace {
    display: block;
    width: 7px;
    height: 7px;
    border: none;
    padding: 0;
    margin: 0;
}

/* Pictorial TOC (PicTOC) */
.story-pictoc-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.story-pictoc-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    align-items: start;
    gap: 20px;
    padding: 15px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #eee;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.story-pictoc-row:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    border-color: #ddd;
}

.story-pictoc-row:nth-child(even) {
    grid-template-columns: 1fr 120px;
}

.story-pictoc-img {
    text-align: center;
}

.story-pictoc-img img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: filter 0.3s ease;
}

.story-pictoc-row:hover .story-pictoc-img img {
    filter: brightness(1.05);
}

.story-pictoc-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
}

.story-pictoc-text a {
    text-decoration: none;
}

.story-pictoc-text h5 {
    margin: 0 0 8px 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
}

.story-pictoc-text .pictoc-moreinfo {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.5;
}

.story-pictoc-row:nth-child(even) .story-pictoc-text {
    text-align: right;
    grid-column: 1;
}

.story-pictoc-row:nth-child(even) .story-pictoc-img {
    grid-column: 2;
}

/* Big Pictorial TOC (PicTOCBig) */
.story-pictoc-big-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 60px;
    padding: 20px 0;
}

.story-pictoc-big-item {
    position: relative;
    overflow: hidden;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.08);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.story-pictoc-big-item:hover {
    transform: scale(1.01);
}

.story-pictoc-big-img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.story-pictoc-big-title {
    margin: 25px 0 10px 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: #111;
    letter-spacing: -0.02em;
    padding: 0 25px;
}

.story-pictoc-big-item .pictoc-moreinfo {
    font-size: 1.1rem;
    color: #444;
    line-height: 1.7;
    padding: 0 25px 30px 25px;
}

@media (max-width: 600px) {
    .story-pictoc-row, .story-pictoc-row:nth-child(even) {
        grid-template-columns: 1fr !important;
        text-align: center !important;
    }
    .story-pictoc-text {
        text-align: center !important;
    }
    .story-pictoc-img {
        order: -1;
    }
}


.story-matrix .current-dot {
    display: block;
    width: 7px;
    height: 7px;
}

/* Global Annotations (Highlighters) */
.story-annotation {
    background-color: #fff9c4; /* Light highlighter yellow */
    border-left: 5px solid #fbc02d; /* Gold accent */
    padding: 20px;
    margin: 2em 0;
    border-radius: 4px 8px 8px 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    font-size: 1.1em;
    line-height: 1.6;
    color: #333;
    position: relative;
    clear: both;
}

.story-annotation-title {
    position: absolute;
    top: -12px;
    left: 20px;
    background: #fbc02d;
    color: #fff;
    font-size: 0.7em;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 4px;
    letter-spacing: 0.05em;
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    z-index: 10;
}

a.story-annotation-title:hover {
    background: #f9a825;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    color: #fff;
}

.story-annotation.story-error {
    background-color: #ffebee;
    border-left-color: #d32f2f;
}

.story-annotation.story-error .story-annotation-title {
    background: #d32f2f;
}

.story-annotation-content {
    margin-top: 5px;
}
