/* Kingdom Detail Pages */
.kingdom-detail-hero {
    position: relative;
    height: 50vh;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    color: white;
    text-align: left;
    overflow: hidden;
    padding-bottom: 2rem;
    margin-top: -60px;
}

.kingdom-detail-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background-size: cover;
    background-position: center;
    z-index: -2;
}

.kingdom-detail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    z-index: -1;
}

.kingdom-content {
    padding: 3rem 0;
    background: var(--color-black);
}

.kingdom-title {
    font-size: 5rem;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.kingdom-motto {
    color: var(--color-yellow);
    font-size: 1.2rem;
    margin-bottom: 0;
    font-style: normal;
}

/* Стили для секции Великих Домов */
.great-houses-section {
    padding: 3rem 0;
    background: var(--color-black);
}

.great-houses-title {
    text-align: center;
    color: var(--color-yellow);
    margin-bottom: 2rem;
    font-size: 2.5rem;
}

.houses-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.house-flag {
    position: relative;
    width: 150px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s ease;
}

.house-flag:hover {
    transform: translateY(-5px);
    z-index: 100;
}

.flag-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
}

.house-info {
    position: absolute;
    bottom: -70px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(0, 0, 0, 0.95);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    text-align: center;
    width: auto;
    min-width: 140px;
    max-width: 180px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    pointer-events: none;
    border: 1px solid var(--color-yellow);
    box-shadow: 0 5px 25px rgba(0,0,0,0.8);
}

.house-info::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background: var(--color-yellow);
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.house-flag:hover .house-info {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.house-name {
    color: var(--color-yellow);
    font-weight: bold;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
    white-space: nowrap;
}

.house-lord {
    color: var(--color-white);
    font-size: 0.8rem;
    white-space: nowrap;
}

/* Анимация покачивания флага */
.flag-shake {
    animation: shakeFlag 3s ease-in-out;
    transform-origin: center bottom;
}

@keyframes shakeFlag {
    0%, 100% { transform: rotate(0); }
    5% { transform: rotate(-5deg); }
    10% { transform: rotate(5deg); }
    15% { transform: rotate(-4deg); }
    20% { transform: rotate(4deg); }
    25% { transform: rotate(-3deg); }
    30% { transform: rotate(3deg); }
    35% { transform: rotate(-2deg); }
    40% { transform: rotate(2deg); }
    45% { transform: rotate(-1deg); }
    50% { transform: rotate(1deg); }
    55% { transform: rotate(-0.5deg); }
    60% { transform: rotate(0.5deg); }
    65%, 100% { transform: rotate(0); }
}

/* Шаблон 1: Картинка слева - текст справа */
.content-section {
    padding: 1rem 0;
}

.section-with-image {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.section-image {
    width: 100%;
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.section-content h2 {
    color: var(--color-yellow);
    margin-bottom: 1.5rem;
    font-size: 2.2rem;
}

.section-content p {
    color: var(--color-white);
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

/* Шаблон 2: Картинка справа - текст слева */
.section-image-right {
    grid-template-columns: 1fr 1fr;
}

.section-image-right .section-image {
    order: 2;
}

.section-image-right .section-content {
    order: 1;
}

/* Шаблон 3: Хронологическая полоса */
.timeline-section {
    padding: 4rem 0;
}

.timeline {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 6px;
    background: var(--color-yellow);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -3px;
}

.timeline-point {
    position: relative;
    width: 50%;
    padding: 15px 30px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.timeline-point:nth-child(odd) {
    left: 0;
}

.timeline-point:nth-child(even) {
    left: 50%;
}

.timeline-dot {
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--color-yellow);
    border-radius: 50%;
    top: 27px;
    z-index: 1;
    transition: all 0.3s ease;
}

.timeline-point:nth-child(odd) .timeline-dot {
    right: -10px;
}

.timeline-point:nth-child(even) .timeline-dot {
    left: -10px;
}

.timeline-point.active .timeline-dot {
    background: var(--color-green);
    transform: scale(1.4);
}

.timeline-point:hover .timeline-dot {
    transform: scale(1.6);
    background: var(--color-green);
}

.timeline-year {
    color: var(--color-yellow);
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 5px;
    transition: all 0.3s ease;
}

.timeline-event-title {
    color: var(--color-white);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    opacity: 0.3;
    transition: all 0.3s ease;
}

.timeline-point:hover .timeline-event-title,
.timeline-point.active .timeline-event-title {
    opacity: 1;
    font-size: 1.3rem;
}

.timeline-point:hover .timeline-year,
.timeline-point.active .timeline-year {
    font-size: 1.2rem;
}

.timeline-point:nth-child(odd) .timeline-content-wrapper {
    text-align: right;
    padding-right: 20px;
}

.timeline-point:nth-child(even) .timeline-content-wrapper {
    text-align: left;
    padding-left: 20px;
}

/* Скрываем старые блоки контента таймлайна */
.timeline-content {
    display: none !important;
}

/* Стили для модального окна */
.timeline-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 2rem;
    box-sizing: border-box;
}

.timeline-modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: var(--color-black);
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    border: 2px solid var(--color-yellow);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalAppear 0.3s ease-out;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    width: 30px;
    height: 30px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close::before,
.modal-close::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background: white;
    transition: all 0.3s ease;
}

.modal-close::before {
    transform: rotate(45deg);
}

.modal-close::after {
    transform: rotate(-45deg);
}

.modal-close:hover::before,
.modal-close:hover::after {
    background: red;
    transform: rotate(0deg);
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100%;
    max-height: 80vh;
}

.event-image-container {
    position: relative;
    overflow: hidden;
}

.event-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.event-details {
    padding: 2rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.event-details h3 {
    color: var(--color-yellow);
    font-size: 1.8rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.event-year {
    color: var(--color-green);
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.event-description {
    color: var(--color-white);
    line-height: 1.6;
    font-size: 1rem;
    flex: 1;
}

/* Адаптивность */
@media (max-width: 768px) {
    .kingdom-detail-hero {
        height: 40vh;
        padding-bottom: 1.5rem;
        margin-top: -60px;
    }
    
    .kingdom-title {
        font-size: 3rem;
    }
    
    .kingdom-motto {
        font-size: 1.3rem;
    }
    
    /* Адаптивность для Великих Домов */
    .houses-container {
        gap: 1.5rem;
        padding: 0 0.5rem;
    }
    
    .house-flag {
        width: calc(25% - 1.5rem);
        min-width: 70px;
    }
    
    .flag-image {
        height: 120px;
    }
    
    .house-info {
        bottom: -75px;
        padding: 0.6rem 0.8rem;
        min-width: 120px;
        max-width: 150px;
    }
    
    .house-name {
        font-size: 0.8rem;
    }
    
    .house-lord {
        font-size: 0.7rem;
    }
    
    .great-houses-title {
        font-size: 2rem;
    }
    
    /* Адаптивность для секций с изображениями */
    .section-with-image {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Адаптивность для таймлайна */
    .timeline::after {
        left: 31px;
    }
    
    .timeline-point {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }
    
    .timeline-point:nth-child(even) {
        left: 0;
    }
    
    .timeline-dot {
        left: 21px !important;
    }
    
    .timeline-point:nth-child(odd) .timeline-content-wrapper,
    .timeline-point:nth-child(even) .timeline-content-wrapper {
        text-align: left;
        padding: 0;
    }
    
    .timeline-event-title {
        font-size: 1rem;
        opacity: 0.5;
    }
    
    .timeline-point:hover .timeline-event-title,
    .timeline-point.active .timeline-event-title {
        font-size: 1.1rem;
    }
    
    .timeline-year {
        font-size: 0.9rem;
    }
    
    .timeline-point:hover .timeline-year,
    .timeline-point.active .timeline-year {
        font-size: 1rem;
    }
    
    /* Адаптивность для модального окна */
    .timeline-modal {
        padding: 1rem;
    }
    
    .modal-body {
        grid-template-columns: 1fr;
        max-height: 95vh;
    }
    
    .event-image-container {
        max-height: 40vh;
    }
    
    .event-details {
        padding: 1.5rem;
        max-height: 55vh;
    }
    
    .event-details h3 {
        font-size: 1.5rem;
    }
}

/* В медиа-запросе для десктопов */
@media (min-width: 769px) {
    .modal-content {
        max-width: 1100px; /* Было 900px */
    }
    
    .modal-body {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .house-flag {
        width: calc(33.333% - 1rem);
        min-width: 60px;
    }
    
    .flag-image {
        height: 100px;
    }
    
    .house-info {
        bottom: -80px;
        padding: 0.5rem 0.6rem;
        min-width: 100px;
        max-width: 130px;
    }
    
    .house-name {
        font-size: 0.75rem;
    }
    
    .house-lord {
        font-size: 0.65rem;
    }
    
    .kingdom-title {
        font-size: 2.5rem;
    }
    
    .great-houses-title {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }
    
    .houses-container {
        gap: 1rem;
    }

    .event-image-container {
    position: relative;
    overflow: hidden;
}



}