/* ==========================================================
   Block: Ach Category — frontend styles
   ========================================================== */

.ach-category {
    padding: 36px 0;
}

.ach-category .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.ach-category-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border);
    position: relative;
}

.ach-category-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 64px;
    height: 2px;
    background: linear-gradient(90deg, var(--blue), var(--red));
    border-radius: 2px;
}

.ach-cat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.ach-cat-icon.blue   { background: var(--blue-light); color: var(--blue); }
.ach-cat-icon.red    { background: var(--red-light);  color: var(--red); }
.ach-cat-icon.gold   { background: #fffbeb; color: #d97706; }
.ach-cat-icon.green  { background: #f0fdf4; color: #16a34a; }
.ach-cat-icon.purple { background: #f5f3ff; color: #7c3aed; }

.ach-cat-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 900;
    color: var(--dark);
}

/* Сетка карточек */
.ach-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.ach-card {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.ach-card:hover {
    border-color: var(--blue);
    transform: translateY(-5px);
    box-shadow: 0 14px 40px rgba(26, 86, 219, 0.13);
}

/* Превью */
.ach-preview {
    /*aspect-ratio: 4/3;*/
    aspect-ratio: 1/1.414;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}
.ach-preview.blue   { background: linear-gradient(135deg, #dbeafe, #bfdbfe); }
.ach-preview.red    { background: linear-gradient(135deg, #fee2e2, #fecaca); }
.ach-preview.gold   { background: linear-gradient(135deg, #fef9c3, #fef08a); }
.ach-preview.green  { background: linear-gradient(135deg, #dcfce7, #bbf7d0); }
.ach-preview.purple { background: linear-gradient(135deg, #ede9fe, #ddd6fe); }

.ach-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ach-preview-icon {
    font-size: 48px;
    opacity: 0.4;
}
.ach-preview.blue   .ach-preview-icon { color: var(--blue); }
.ach-preview.red    .ach-preview-icon { color: var(--red); }
.ach-preview.gold   .ach-preview-icon { color: #d97706; }
.ach-preview.green  .ach-preview-icon { color: #16a34a; }
.ach-preview.purple .ach-preview-icon { color: #7c3aed; }

.ach-preview-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.5;
}
.ach-preview.blue   .ach-preview-label { color: var(--blue); }
.ach-preview.red    .ach-preview-label { color: var(--red); }
.ach-preview.gold   .ach-preview-label { color: #d97706; }
.ach-preview.green  .ach-preview-label { color: #16a34a; }
.ach-preview.purple .ach-preview-label { color: #7c3aed; }

/* Тело карточки */
.ach-card-body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.ach-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 8px;
    width: fit-content;
}
.ach-badge.blue   { background: var(--blue-light); color: var(--blue); }
.ach-badge.red    { background: var(--red-light);  color: var(--red); }
.ach-badge.gold   { background: #fffbeb; color: #d97706; }
.ach-badge.green  { background: #f0fdf4; color: #16a34a; }
.ach-badge.purple { background: #f5f3ff; color: #7c3aed; }

.ach-card-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 800;
    color: var(--dark);
    line-height: 1.35;
    margin-bottom: 6px;
    flex: 1;
}

.ach-card-desc {
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 14px;
}

.ach-card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 50px;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: var(--blue);
    text-decoration: none;
    transition: all 0.2s;
    width: fit-content;
}

.ach-card-link:hover {
    background: var(--blue-light);
    border-color: var(--blue);
}

@media (max-width: 1024px) {
    .ach-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .ach-category .container { padding: 0 16px; }
    .ach-grid { grid-template-columns: 1fr; }
}

/* Ссылка glightbox на превью */
.ach-preview-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.ach-preview-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.ach-preview-link:hover img {
    transform: scale(1.05);
}

/* Оверлей с иконкой при наведении */
.ach-preview-overlay-front {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(26, 86, 219, 0.45);
    opacity: 0;
    transition: opacity 0.3s;
    color: #fff;
    font-size: 24px;
}

.ach-preview-link:hover .ach-preview-overlay-front {
    opacity: 1;
}
