/* Container for all lore cards */
.lore-container {
    width: 75%;
    margin: 5% auto;
    display: flex;
    flex-direction: column;
    gap: 40px; /* Replaces the old <hr> tags */
}

/* Base style for the card using Glassmorphism */
.lore-card {
    display: flex;
    align-items: stretch;
    background: rgba(30, 30, 30, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transition: all 0.4s ease;
    min-height: 250px;
}

.lore-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.6);
    border-color: rgba(247, 177, 10, 0.4); /* Gold accent from the site */
}

/* Image wrapper to ensure perfect fit */
.lore-image-wrapper {
    flex: 0 0 40%;
    overflow: hidden;
    position: relative;
    background-color: rgba(0,0,0,0.5); /* fallback */
}

.lore-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

.lore-card:hover .lore-image-wrapper img {
    transform: scale(1.05);
}

/* Content area */
.lore-content {
    flex: 1;
    padding: 30px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Typography */
.lore-content h1 {
    font-size: 32px;
    font-family: 'Oswald', sans-serif;
    color: #f7b10a; /* Signature gold */
    margin-top: 0;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.lore-content h3 {
    font-size: 20px;
    font-family: 'Oswald', sans-serif;
    color: #ffd089;
    margin-top: 20px;
    margin-bottom: 5px;
}

.lore-content h5 {
    font-size: 16px;
    font-family: 'Nunito', sans-serif;
    color: #aaa;
    margin-top: 0;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Keep the old .text-or1 classes valid in case they are used elsewhere, but override styles here for safety */
.lore-content p {
    font-size: 18px;
    line-height: 1.6;
    color: #e0e0e0;
    margin: 0 0 15px 0;
    text-align: justify;
}

.lore-content p i,
.lore-content p em,
.lore-content em {
    color: #ffd089;
}

/* Layout variations */
.lore-card.left-layout {
    flex-direction: row;
}

.lore-card.right-layout {
    flex-direction: row-reverse;
}

/* Color accents based on factions (used in royaumes.php) */
.lore-card.humain { border-left: 4px solid #2255c4; }
.lore-card.elf { border-left: 4px solid #3ba3b6; }
.lore-card.nain { border-left: 4px solid #b36a17; }
.lore-card.orcs { border-left: 4px solid #ac1c12; }
.lore-card.gnomes { border-left: 4px solid #9b9925; }
.lore-card.mindiaes { border-left: 4px solid #107028; }

.lore-card.right-layout.humain { border-left: 1px solid rgba(255, 255, 255, 0.1); border-right: 4px solid #2255c4; }
.lore-card.right-layout.elf { border-left: 1px solid rgba(255, 255, 255, 0.1); border-right: 4px solid #3ba3b6; }
.lore-card.right-layout.nain { border-left: 1px solid rgba(255, 255, 255, 0.1); border-right: 4px solid #b36a17; }
.lore-card.right-layout.orcs { border-left: 1px solid rgba(255, 255, 255, 0.1); border-right: 4px solid #ac1c12; }
.lore-card.right-layout.gnomes { border-left: 1px solid rgba(255, 255, 255, 0.1); border-right: 4px solid #9b9925; }
.lore-card.right-layout.mindiaes { border-left: 1px solid rgba(255, 255, 255, 0.1); border-right: 4px solid #107028; }

/* Subheaders for categories */
.lore-category-title {
    font-size: 42px;
    font-family: 'Oswald', sans-serif;
    color: #fff;
    text-align: center;
    margin: 40px 0 10px 0;
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .lore-card.left-layout,
    .lore-card.right-layout {
        flex-direction: column;
    }
    
    .lore-image-wrapper {
        height: 250px;
    }
    
    .lore-container {
        width: 90%;
    }
    
    .lore-card.right-layout.humain,
    .lore-card.right-layout.elf,
    .lore-card.right-layout.nain,
    .lore-card.right-layout.orcs,
    .lore-card.right-layout.gnomes,
    .lore-card.right-layout.mindiaes {
        border-right: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .lore-card.right-layout.humain { border-top: 4px solid #2255c4; }
    .lore-card.right-layout.elf { border-top: 4px solid #3ba3b6; }
    .lore-card.right-layout.nain { border-top: 4px solid #b36a17; }
    .lore-card.right-layout.orcs { border-top: 4px solid #ac1c12; }
    .lore-card.right-layout.gnomes { border-top: 4px solid #9b9925; }
    .lore-card.right-layout.mindiaes { border-top: 4px solid #107028; }
}

/* Grid layout for multiple cards per row (e.g., Cultes) */
.lore-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    width: 75%;
    margin: 5% auto;
}

.lore-card.top-layout {
    flex-direction: column;
    min-height: auto;
}

.lore-card.top-layout .lore-image-wrapper {
    flex: 0 0 200px;
    background-color: rgba(0,0,0,0.8);
}

.lore-card.top-layout .lore-image-wrapper img {
    height: 200px;
    width: 100%;
    object-fit: cover;
}

.lore-card.top-layout .lore-content {
    padding: 20px;
    justify-content: flex-start;
}


/* Tooltip styles */
.lore-tooltip {
    color: #f7b10a;
    text-decoration: underline;
    text-decoration-style: dotted;
    cursor: help;
    position: relative;
    font-weight: bold;
    transition: color 0.3s;
}

.lore-tooltip:hover {
    color: #fff;
}

.lore-tooltip::after {
    content: attr(data-title);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, bottom 0.3s;
    z-index: 100;
    border: 1px solid rgba(247, 177, 10, 0.5);
    font-family: 'Nunito', sans-serif;
}

.lore-tooltip:hover::after {
    opacity: 1;
    bottom: 140%;
}


/* Navigation Tabs for SPA Lore */
.lore-navigation {
    width: 75%;
    margin: 0 auto 20px auto;
    text-align: center;
}

@media (max-width: 900px) {
    .lore-navigation { width: 90%; }
}

.lore-main-tabs {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.lore-tab-btn {
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 10px 30px;
    font-size: 20px;
    font-family: 'Oswald', sans-serif;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.lore-tab-btn:hover, .lore-tab-btn.active {
    background: rgba(247, 177, 10, 0.3);
    border-color: #f7b10a;
    color: #f7b10a;
}

.lore-sub-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    transition: opacity 0.4s ease;
}

.lore-subtab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #ccc;
    padding: 5px 15px;
    font-size: 16px;
    font-family: 'Nunito', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lore-subtab-btn:hover, .lore-subtab-btn.active {
    color: #fff;
    border-bottom: 2px solid #f7b10a;
}
