.masters-page {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 44px 24px 64px;
}

.masters-heading {
    margin-bottom: 30px;
}

.masters-heading span {
    display: block;
    margin-bottom: 8px;
    color: #a17d3d;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.masters-heading h1 {
    margin: 0;
    color: #27231d;
    font-size: clamp(32px, 5vw, 52px);
    line-height: 1.05;
}

.masters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
    gap: clamp(18px, 2.5vw, 30px);
    align-items: start;
}

.master-card {
    display: block;
    padding: 0;
    min-width: 0;
    overflow: hidden;
    color: inherit;
    font: inherit;
    text-align: left;
    background: #fff;
    border: 1px solid rgba(201, 169, 110, .25);
    border-radius: 22px;
    box-shadow: 0 16px 38px rgba(40, 32, 22, .09);
    transition: transform .25s ease, box-shadow .25s ease;
}

.master-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 22px 46px rgba(40, 32, 22, .14);
}

.master-card:focus-visible {
    outline: 3px solid rgba(161, 125, 61, .55);
    outline-offset: 4px;
}

.master-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: linear-gradient(145deg, #f4ede2, #e8dcc8);
}

.master-card-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}

.master-card:hover .master-card-image img {
    transform: scale(1.035);
}

.master-card-image .master-card-placeholder {
    padding: 24%;
    object-fit: contain;
}

.master-card h2 {
    margin: 0;
    padding: 18px 20px 12px;
    color: #2d2821;
    font-size: clamp(18px, 2vw, 22px);
    line-height: 1.3;
    text-align: center;
}

.master-experience-badge,
.master-about-experience {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 2;
    padding: 7px 11px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    background: rgba(43, 34, 24, .78);
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 999px;
    backdrop-filter: blur(8px);
}

.master-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 0 14px 16px;
}

.master-card-actions button {
    min-width: 0;
    min-height: 42px;
    padding: 9px 10px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
}

.master-card-about {
    color: #735a30;
    background: #fff;
    border: 1px solid #c9a96e;
}

.master-card-book {
    color: #fff;
    background: linear-gradient(135deg, #b18a45, #856329);
    border: 1px solid transparent;
}

.master-about-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    z-index: 10050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(30, 25, 20, .68);
    backdrop-filter: blur(7px);
    box-sizing: border-box;
}

.master-about-overlay.is-open { display: flex; }
body.master-about-modal-open { overflow: hidden; }

.master-about-modal {
    position: relative;
    width: min(920px, 100%);
    max-height: calc(100dvh - 48px);
    overflow: auto;
    background: #fffaf3;
    border: 1px solid rgba(201, 169, 110, .42);
    border-radius: 28px;
    box-shadow: 0 30px 90px rgba(28, 21, 13, .32);
}

.master-about-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 4;
    width: 42px;
    height: 42px;
    color: #3b3024;
    font-size: 28px;
    line-height: 1;
    background: rgba(255, 255, 255, .9);
    border: 1px solid rgba(126, 99, 54, .22);
    border-radius: 50%;
    cursor: pointer;
}

.master-about-loading { padding: 80px 30px; text-align: center; }
.master-about-content { display: grid; grid-template-columns: minmax(260px, 42%) 1fr; }
.master-about-photo-wrap { position: relative; min-height: 520px; overflow: hidden; border-radius: 27px 0 0 27px; }
.master-about-photo-wrap img { width: 100%; height: 100%; object-fit: cover; }
.master-about-details { padding: 54px 42px 42px; }
.master-about-kicker { color: #a17d3d; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.master-about-details h2 { margin: 8px 0 24px; color: #2d2821; font-size: clamp(28px, 4vw, 42px); }
.master-about-facts { display: grid; gap: 0; margin: 0; }
.master-about-facts div { display: grid; grid-template-columns: minmax(120px, .8fr) 1.2fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid rgba(126, 99, 54, .14); }
.master-about-facts dt { color: #8a7d6d; }
.master-about-facts dd { min-width: 0; margin: 0; color: #2d2821; font-weight: 650; overflow-wrap: anywhere; }
.master-about-facts a { color: #866527; }
.master-about-description { margin-top: 26px; }
.master-about-description h3 { margin: 0 0 8px; color: #3b3024; }
.master-about-description p { margin: 0; color: #665d52; line-height: 1.65; white-space: pre-line; }

.masters-empty {
    grid-column: 1 / -1;
    padding: 42px 24px;
    color: #766f65;
    text-align: center;
    background: #fff;
    border: 1px dashed #cfbea0;
    border-radius: 20px;
}

@media (max-width: 600px) {
    .masters-page {
        padding: 32px 16px 48px;
    }

    .masters-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .master-card {
        border-radius: 16px;
    }

    .master-card h2 {
        padding: 14px 10px 16px;
        font-size: 16px;
    }

    .master-card-actions { grid-template-columns: 1fr; padding: 0 10px 12px; }
    .master-experience-badge { right: 8px; bottom: 8px; padding: 5px 8px; font-size: 10px; }
    .master-about-overlay { padding: 10px; }
    .master-about-modal { max-height: calc(100dvh - 20px); border-radius: 20px; }
    .master-about-content { grid-template-columns: 1fr; }
    .master-about-photo-wrap { min-height: 0; aspect-ratio: 4 / 3; border-radius: 19px 19px 0 0; }
    .master-about-details { padding: 28px 20px 24px; }
    .master-about-facts div { grid-template-columns: 1fr; gap: 4px; }
}

@media (max-width: 380px) {
    .masters-grid {
        grid-template-columns: 1fr;
    }
}
