.am-about-page {
    overflow: hidden;
}

.am-about-breadcrumbs {
    padding-top: 28px;
    text-align: center;
}

.am-about-breadcrumbs .woocommerce-breadcrumb {
    margin: 0;
    color: #686868;
    font-size: 14px;
}

.am-about-breadcrumbs .woocommerce-breadcrumb span {
    margin: 0 9px;
}

.am-about-section {
    padding: 36px 0;
}

.am-about-section-title {
    margin: 0 0 28px;
    color: #3E5338;
    font-size: 32px;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
}

.am-about-section-title--left {
    text-align: left;
}

/* Intro */
.am-about-hero {
    padding-top: 28px;
}

.am-about-hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(320px, .72fr);
    grid-template-areas:
        "title image"
        "content image";
    column-gap: 38px;
    align-items: start;
}

.am-about-hero__title {
    grid-area: title;
    margin: 0 0 20px;
    color: #3E5338;
    font-size: 32px;
    font-weight: 600;
    line-height: 1.15;
}

.am-about-hero__content {
    grid-area: content;
    color: #282828;
    font-size: 16px;
    line-height: 1.5;
}

.am-about-hero__content p {
    margin: 0 0 20px;
}

.am-about-hero__content p:last-child {
    margin-bottom: 0;
}

.am-about-hero__image {
    grid-area: image;
    height: 455px;
    margin: 0;
    overflow: hidden;
    border-radius: 4px;
}

.am-about-hero__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Specialties */
.am-about-specialties {
    padding-top: 34px;
}

.am-about-specialties .am-about-section-title {
    margin-bottom: 30px;
    color: #3F4636;
    font-size: 34px;
    letter-spacing: -.02em;
}

.am-about-specialties__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.am-about-specialty-card {
    min-height: 360px;
    display: flex;
    flex-direction: column;
    border: 0;
    border-radius: 0;
    padding: 24px 24px 20px;
    background: #F2F2F2;
}

.am-about-specialty-card__heading {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 18px;
}

.am-about-specialty-card__heading img {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    object-fit: contain;
}

.am-about-specialty-card h3 {
    margin: 0;
    color: #3F4636;
    font-size: 23px;
    font-weight: 600;
    line-height: 1.2;
}

.am-about-specialty-card ul {
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
    color: #282828;
    font-size: 17px;
    line-height: 1.35;
}

.am-about-specialty-card li {
    position: relative;
    padding-left: 17px;
}

.am-about-specialty-card li::before {
    content: "·";
    position: absolute;
    left: 0;
    top: 0;
    font-weight: 700;
}

.am-about-specialty-card__conditions {
    margin: 0 0 20px;
    color: #282828;
    font-size: 17px;
    line-height: 1.35;
}

.am-about-specialty-card > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: auto;
    color: #282828;
    font-size: 17px;
    font-weight: 600;
}

.am-about-specialty-card > a svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .25s ease;
}

.am-about-specialty-card > a:hover svg {
    transform: translateX(4px);
}

.am-about-slider__dots {
    display: none;
}

/* Quality text */
.am-about-quality {
    padding-top: 42px;
}

.am-about-quality__inner {
    max-width: 1120px;
}

.am-about-quality__content {
    color: #282828;
    font-size: 16px;
    line-height: 1.5;
}

.am-about-quality__content p {
    margin: 0 0 18px;
}

.am-about-quality__content p:last-child {
    margin-bottom: 0;
}

/* Diploma gallery */
.am-about-diplomas {
    padding-top: 34px;
}

.am-about-gallery {
    display: grid;
    grid-template-columns: minmax(0, 2.45fr) minmax(0, .68fr) minmax(0, .68fr) minmax(0, .90fr) minmax(0, 1fr);
    grid-template-rows: 100px 25px 70px 94px;
    grid-auto-rows: 180px;
    gap: 16px;
}

.am-about-gallery__item {
    min-width: 0;
    min-height: 0;
    position: relative;
    overflow: hidden;
    border: 1px solid #E5E7EB;
    border-radius: 4px;
    padding: 0;
    background: #F2F2F2;
    cursor: zoom-in;
}

.am-about-gallery__item--placeholder {
    border-color: #D4D4D4;
    background: #D4D4D4;
    cursor: default;
    pointer-events: none;
}

/* Desktop composition follows the approved diploma mockup. */
.am-about-gallery__item--1 {
    grid-column: 1;
    grid-row: 1 / 5;
}

.am-about-gallery__item--2 {
    grid-column: 2;
    grid-row: 1;
}

.am-about-gallery__item--3 {
    grid-column: 3;
    grid-row: 1;
}

.am-about-gallery__item--4 {
    grid-column: 2 / 4;
    grid-row: 2 / 5;
}

.am-about-gallery__item--5 {
    grid-column: 4;
    grid-row: 1 / 4;
}

.am-about-gallery__item--6 {
    grid-column: 4;
    grid-row: 4;
}

.am-about-gallery__item--7 {
    grid-column: 5;
    grid-row: 1 / 3;
}

.am-about-gallery__item--8 {
    grid-column: 5;
    grid-row: 3 / 5;
}

.am-about-gallery__item:nth-child(n+9) {
    min-height: 180px;
}

.am-about-gallery__item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform .35s ease;
}

.am-about-gallery__item::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(62, 83, 56, 0);
    transition: background .25s ease;
}

.am-about-gallery__item:hover img {
    transform: scale(1.025);
}

.am-about-gallery__item:hover::after {
    background: rgba(62, 83, 56, .05);
}

/* Consultation */
.am-about-consultation {
    padding-top: 42px;
    padding-bottom: 56px;
}

.am-about-consultation__block {
    border: 0;
}

.am-about-consultation__block .am-consultation-block__image img {
    min-height: 650px;
    border-radius: 4px;
}

/* Lightbox */
.am-about-lightbox[hidden] {
    display: none !important;
}

.am-about-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}

.am-about-lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.am-about-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 22, 16, .75);
    backdrop-filter: blur(2px);
}

.am-about-lightbox__dialog {
    position: relative;
    z-index: 1;
    width: min(1040px, 100%);
    height: min(820px, calc(100vh - 56px));
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    padding: 58px 72px 45px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
    transform: translateY(18px) scale(.98);
    transition: transform .3s ease;
}

.am-about-lightbox.is-open .am-about-lightbox__dialog {
    transform: translateY(0) scale(1);
}

.am-about-lightbox figure {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.am-about-lightbox figure img {
    max-width: 100%;
    max-height: calc(100% - 34px);
    object-fit: contain;
}

.am-about-lightbox figcaption {
    min-height: 24px;
    margin-top: 10px;
    color: #686868;
    font-size: 14px;
    text-align: center;
}

.am-about-lightbox__close,
.am-about-lightbox__nav {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: #3E5338;
    cursor: pointer;
}

.am-about-lightbox__close {
    top: 14px;
    right: 14px;
    width: 42px;
    height: 42px;
}

.am-about-lightbox__close svg,
.am-about-lightbox__nav svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.am-about-lightbox__nav {
    top: 50%;
    width: 52px;
    height: 70px;
    transform: translateY(-50%);
}

.am-about-lightbox__nav--prev { left: 8px; }
.am-about-lightbox__nav--next { right: 8px; }

.am-about-lightbox__counter {
    position: absolute;
    right: 20px;
    bottom: 14px;
    color: #686868;
    font-size: 13px;
}

@media (max-width: 991px) {
    .am-about-hero__grid {
        grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
        column-gap: 26px;
    }

    .am-about-specialties__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .am-about-gallery {
        grid-template-rows: 82px 20px 56px 76px;
        gap: 12px;
    }
}

@media (max-width: 767px) {
    .am-about-breadcrumbs {
        display: none;
    }

    .am-about-section {
        padding: 24px 0;
    }

    .am-about-section-title {
        margin-bottom: 16px;
        font-size: 24px;
        line-height: 1.2;
    }

    .am-about-section-title--left {
        text-align: left;
    }

    .am-about-hero {
        padding-top: 16px;
    }

    .am-about-hero__grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "title"
            "image"
            "content";
    }

    .am-about-hero__title {
        margin-bottom: 14px;
        font-size: 24px;
        line-height: 1.15;
    }

    .am-about-hero__image {
        height: auto;
        margin-bottom: 18px;
        aspect-ratio: 1 / 1.25;
    }

    .am-about-hero__content,
    .am-about-quality__content {
        font-size: 16px;
        line-height: 1.48;
    }

    .am-about-hero__content p,
    .am-about-quality__content p {
        margin-bottom: 18px;
    }

    .am-about-specialties .am-container,
    .am-about-diplomas .am-container {
        width: 100%;
    }

    .am-about-specialties .am-about-section-title,
    .am-about-diplomas .am-about-section-title {
        margin-left: 20px;
        margin-right: 20px;
    }

    .am-about-specialties .am-about-section-title {
        margin-bottom: 18px;
        font-size: 24px;
        letter-spacing: 0;
    }

    .am-about-slider,
    .am-about-gallery-wrap {
        overflow: hidden;
    }

    .am-about-specialties__grid,
    .am-about-gallery {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: 84%;
        grid-template-columns: none;
        grid-template-rows: none;
        gap: 10px;
        overflow-x: auto;
        padding: 0 20px 8px;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }

    .am-about-specialties__grid::-webkit-scrollbar,
    .am-about-gallery::-webkit-scrollbar {
        display: none;
    }

    .am-about-specialty-card,
    .am-about-gallery__item {
        grid-column: auto !important;
        grid-row: auto !important;
        scroll-snap-align: center;
    }

    .am-about-gallery__item--placeholder {
        display: none;
    }

    .am-about-specialty-card {
        min-height: 360px;
        padding: 20px 16px 17px;
    }

    .am-about-specialty-card__heading {
        justify-content: flex-start;
    }

    .am-about-specialty-card h3 {
        font-size: 18px;
    }

    .am-about-specialty-card ul,
    .am-about-specialty-card__conditions,
    .am-about-specialty-card > a {
        font-size: 14px;
    }

    .am-about-slider__dots {
        display: flex;
        justify-content: center;
        gap: 8px;
        margin-top: 10px;
    }

    .am-about-slider__dots button {
        width: 12px;
        height: 12px;
        border: 1px solid #282828;
        border-radius: 50%;
        padding: 2px;
        background: transparent;
    }

    .am-about-slider__dots button::before {
        content: "";
        display: block;
        width: 100%;
        height: 100%;
        border-radius: 50%;
        background: transparent;
    }

    .am-about-slider__dots button.is-active::before {
        background: #282828;
    }

    .am-about-quality {
        padding-top: 28px;
    }

    .am-about-gallery {
        grid-auto-columns: 86%;
    }

    .am-about-gallery__item {
        height: auto;
        min-height: 0;
        aspect-ratio: 1.25 / 1;
    }

    .am-about-consultation {
        padding-top: 28px;
        padding-bottom: 30px;
    }

    .am-about-consultation__block {
        display: block;
    }

    .am-about-consultation__block .am-consultation-block__image img {
        min-height: 0;
        aspect-ratio: 4 / 5;
    }

    .am-about-lightbox {
        padding: 10px;
    }

    .am-about-lightbox__dialog {
        height: calc(100vh - 20px);
        padding: 48px 38px 36px;
    }

    .am-about-lightbox__nav {
        width: 38px;
        height: 58px;
    }

    .am-about-lightbox__nav--prev { left: 0; }
    .am-about-lightbox__nav--next { right: 0; }

    .am-about-lightbox__close {
        top: 7px;
        right: 7px;
    }
}

@media (max-width: 420px) {
    .am-about-specialties__grid {
        grid-auto-columns: 88%;
    }

    .am-about-gallery {
        grid-auto-columns: 90%;
    }
}
