/* =========================
   CARDS
   ========================= */

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    justify-content: center;
    gap: 24px;
    padding: 40px 20px;
    max-width: 1100px;
    margin: 0 auto;
    align-items: stretch;
}

.museum-card {
    width: 100%;
    height: 100%;

    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;

    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.04);

    display: flex;
    flex-direction: column;

    transition: all 0.25s ease;
}

.museum-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 30px rgba(0,0,0,0.12);
}

.museum-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.museum-card h2 {
    margin: 16px 18px 8px;
    font-size: 18px;
    color: var(--primary);
}

.museum-card p {
    margin: 0 18px 18px;
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}


/* =========================
   DROPDOWN
   ========================= */

.dropdown {
    position: relative;
}

.dropdown-title {
    color: #fff;
    cursor: pointer;
    padding: 6px 10px;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--primary);
    display: none;
    min-width: 180px;
    border-radius: 8px;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 12px;
    color: #fff;
}

.dropdown-menu a:hover {
    background: rgba(255,255,255,0.1);
}


/* =========================
   MODAL
   ========================= */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;

    background: rgba(0,0,0,0.75);

    justify-content: center;
    align-items: center;

    padding: 20px;
    overflow-y: auto;
}

.modal-content {
    background: #fff;
    width: 100%;
    max-width: 1100px;
    max-height: 90vh;

    display: flex;

    border-radius: 18px;
    overflow: hidden;

    animation: modalShow 0.25s ease;
}

@keyframes modalShow {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;

    font-size: 34px;
    cursor: pointer;

    color: #fff;
    background: rgba(0,0,0,0.5);

    width: 42px;
    height: 42px;
    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    transition: 0.2s;
}

.modal-close:hover {
    transform: scale(1.08);
}

.modal-image-wrapper {
    width: 50%;
    min-height: 500px;
    background: #ddd;
}

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

.modal-info {
    width: 50%;
    padding: 35px;
    overflow-y: auto;

    white-space: pre-line;
    overflow-wrap: anywhere;
}

.modal-info h2 {
    margin-bottom: 20px;
}

.modal-info p {
    margin-bottom: 20px;
    line-height: 1.7;
}

.modal-info::-webkit-scrollbar {
    width: 8px;
}

.modal-info::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}


/* =========================
   HISTORY PAGE
   ========================= */

.history-hero {
    background: linear-gradient(135deg, var(--accent), #8fa177);
    padding: 80px 20px;
    text-align: center;
}

.history-content {
    padding: 60px 20px;
}

.history-text {
    max-width: 900px;
    margin: 0 auto 60px;
    background: #fff;
    padding: 40px;
    border-radius: 14px;
}

.history-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.history-gallery a {
    display: block;
    border-radius: 12px;
    overflow: hidden;
}

.history-gallery img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}


/* =========================
   FILTER CATEGORIES
   ========================= */

.categories-filter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 35px 20px 15px;
}

.category-filter-btn {
    background: #fff;
    color: var(--primary);

    border: 1px solid rgba(47,62,70,0.12);

    padding: 12px 24px;
    border-radius: 999px;

    font-weight: 600;

    box-shadow: 0 4px 12px rgba(0,0,0,0.06);

    transition: all .25s ease;
}

.category-filter-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    background: var(--primary);
    color: #fff;
}

.category-filter-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}


/* =========================
   READ MORE BUTTON
   ========================= */

.read-more {
    margin: auto 20px 20px;
    padding: 12px 18px;

    border: none;
    border-radius: 10px;

    background: var(--primary);
    color: #fff;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    transition: 0.25s ease;
}

.read-more:hover {
    background: var(--accent);
    transform: translateY(-2px);
}


/* =========================
   AUTH FORM
   ========================= */

.auth-form {
    max-width: 420px;
    margin: 80px auto;
    padding: 40px;

    background: #fff;
    border-radius: 18px;

    box-shadow: 0 10px 30px rgba(0,0,0,0.1);

    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-form h2 {
    text-align: center;
    color: var(--primary);
}

.auth-form label {
    font-weight: 600;
    color: var(--primary);
}

.auth-form input {
    padding: 12px 14px;
    border-radius: 10px;

    border: 1px solid #ddd;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(163,177,138,0.25);
}

.auth-form button {
    padding: 12px;
    border: none;
    border-radius: 10px;

    background: var(--primary);
    color: #fff;

    cursor: pointer;
}

.auth-form button:hover {
    background: var(--accent);
}

.auth-error {
    background: #ffe5e5;
    color: #b02a37;

    padding: 10px;
    border-radius: 10px;

    text-align: center;
}

/* =========================
   HISTORY PAGE FIX (TEXT READABILITY)
   ========================= */

.history-page {
    padding-bottom: 60px;
}

/* Заголовок подзаголовок */
.history-subtitle {
    margin-top: 10px;
    font-size: 16px;
    opacity: 0.8;
}

/* Главный текстовый блок */
.history-text {
    max-width: 900px;
    margin: 0 auto 60px;

    background: #fff;
    padding: 40px;

    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.05);

    font-size: 16px;
    line-height: 1.8;
}

/* Абзацы — ключ к “не каше” */
.history-text p {
    margin-bottom: 16px;
}

/* Галерея */
.history-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

/* Картинки */
.history-gallery a {
    display: block;
    border-radius: 14px;
    overflow: hidden;
}

.history-gallery img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;

    transition: transform 0.25s ease;
}

.history-gallery a:hover img {
    transform: scale(1.04);
}