/* Legu page specific styles */

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 6px;
}

.reading-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    display: flex;
    gap: 20px;
}

.sidebar {
    width: 250px;
    background: #667eea;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin: 20px 0 20px 20px;
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 80px;
}

.sidebar h3 {
    margin: 0 0 15px 0;
    color: white;
    font-size: 1.1rem;
}

.sidebar-toggle {
    display: none; /* Hidden on desktop */
}

.article-link {
    display: block;
    padding: 12px 15px;
    margin-bottom: 8px;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.2);
}

.article-link:hover {
    background-color: rgba(255,255,255,0.1);
    color: white;
    border-color: rgba(255,255,255,0.4);
}

.article-link:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
    background-color: rgba(255,255,255,0.2);
}

.article-link.active {
    background-color: white;
    color: #667eea;
    border-color: white;
}

.article-title {
    font-weight: bold;
    font-size: 0.95rem;
}

.article-author {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-top: 2px;
}

.essay-content {
    flex: 1;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 40px;
    margin: 20px 20px 20px 0;
    line-height: 1.8;
    font-size: 16px;
}

.essay-title {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 10px;
    text-align: center;
}

.essay-author {
    font-size: 1.2rem;
    color: #667eea;
    margin-bottom: 15px;
    text-align: center;
    font-style: italic;
}

.essay-publication {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 30px;
    text-align: center;
    line-height: 1.4;
}

.essay-links {
    margin: 20px 0;
    text-align: center;
}

.essay-link {
    display: inline-block;
    background: #667eea;
    color: white;
    text-decoration: none;
    padding: 12px 20px;
    margin: 8px 10px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.essay-link:hover {
    background: #5a67d8;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
    color: white;
    text-decoration: none;
}

.essay-link:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.essay-paragraph {
    margin-bottom: 20px;
    text-align: justify;
    color: #2d3748;
}

.essay-paragraph a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.essay-paragraph a:hover {
    color: #5a67d8;
    text-decoration: underline;
}

.essay-paragraph a:visited {
    color: #764ba2;
}

.essay-paragraph a:active {
    color: #4c51bf;
}

.chapter-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: #667eea;
    margin: 30px 0 15px 0;
    text-align: center;
}

.section-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #667eea;
    margin: 25px 0 15px 0;
}

.indented {
    margin-left: 40px;
    margin-right: 40px;
    border-left: 3px solid #667eea;
    font-style: italic;
    color: #555;
    background-color: #f8f9ff;
    padding: 15px 20px;
    border-radius: 4px;
    text-align: left;
}

.essay-content ul {
    margin-left: 40px;
    padding-left: 20px;
}

.essay-content ul li {
    margin-bottom: 8px;
}

.traduktabelo, .kructabelo {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.traduktabelo th, .kructabelo th {
    background-color: #667eea;
    color: white;
    font-weight: bold;
    padding: 12px 15px;
    text-align: left;
    border-bottom: 2px solid #5a67d8;
}

.traduktabelo td, .kructabelo td {
    padding: 10px 15px;
    border-bottom: 1px solid #e2e8f0;
    color: #2d3748;
}

/* traduktabelo: first row different color, rest same color */
.traduktabelo tr:first-child {
    background-color: #f8f9ff;
}

.traduktabelo tr:not(:first-child) {
    background-color: white;
}

/* kructabelo: all rows same color */
.kructabelo tr {
    background-color: white;
}



.traduktabelo tr:last-child td, .kructabelo tr:last-child td {
    border-bottom: none;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.error {
    text-align: center;
    padding: 40px;
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .reading-container {
        flex-direction: column;
        gap: 0;
    }

    .sidebar {
        width: auto;
        margin: 10px;
        position: static;
        order: 1;
        background: #667eea;
        border-radius: 8px;
        padding: 15px;
    }

    .sidebar h3 {
        display: none; /* Hide "Verkoj" title on mobile */
    }

    .sidebar-toggle {
        display: block;
        width: 100%;
        background: white;
        color: #667eea;
        border: none;
        padding: 12px 15px;
        border-radius: 6px;
        font-weight: bold;
        cursor: pointer;
        text-align: left;
        position: relative;
        font-size: 0.95rem;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .sidebar-toggle:focus {
        outline: 2px solid #667eea;
        outline-offset: 2px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1), 0 0 0 2px rgba(102, 126, 234, 0.3);
    }

    .sidebar-toggle::after {
        content: "▼";
        position: absolute;
        right: 15px;
        transition: transform 0.2s ease;
        font-size: 0.8rem;
    }

    .sidebar-toggle.expanded::after {
        transform: rotate(180deg);
    }

    .article-links {
        display: none;
        margin-top: 10px;
    }

    .article-links.expanded {
        display: block;
    }

    .article-link {
        margin-bottom: 5px;
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .article-title {
        font-size: 0.9rem;
    }

    .article-author {
        font-size: 0.75rem;
    }

    .essay-content {
        margin: 10px;
        padding: 20px;
        font-size: 14px;
        order: 2;
    }

    .essay-title {
        font-size: 2rem;
    }

    .essay-author {
        font-size: 1rem;
    }

    .essay-publication {
        font-size: 0.8rem;
    }

    .essay-links {
        margin: 15px 0;
    }

    .essay-link {
        display: block;
        margin: 8px auto;
        max-width: 280px;
        text-align: center;
        font-size: 0.9rem;
        padding: 10px 16px;
    }
}

/* Quote styling for poetry and quoted text */
.essay-quote {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    border-radius: 4px;
    font-style: italic;
}

.essay-quote .essay-paragraph {
    margin-bottom: 0;
    line-height: 1.6;
}

/* Floating image styling */
.essay-image-container {
    float: right;
    margin: 0 0 20px 20px;
    max-width: 200px;
    width: 100%;
}

.essay-image-float {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: block;
}

.essay-image-caption {
    font-size: 0.85em;
    color: #666;
    font-style: italic;
    text-align: center;
    margin-top: 8px;
    line-height: 1.3;
}

.essay-image-caption a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.essay-image-caption a:hover {
    color: #5a67d8;
    text-decoration: underline;
}

.essay-image-caption a:visited {
    color: #764ba2;
}

.essay-image-caption a:active {
    color: #4c51bf;
}

@media (max-width: 768px) {
    .essay-image-container {
        float: none;
        display: block;
        margin: 20px auto;
        max-width: 100%;
    }
}
