/* Apps archive, apps page and app cards */
.apps-directory-page {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0;
}

.apps-directory-title {
    margin: 0 0 24px;
    font-size: clamp(1.65rem, 3vw, 2.2rem);
    line-height: 1.2;
    color: #111827;
}

.apps-page-template {
    padding-top: 22px;
}

.apps-page-title {
    margin-bottom: 14px;
}

.apps-section {
    margin-bottom: 1.5rem;
}

.apps-widget-section {
    margin-bottom: 3rem;
}

.apps-section-title {
    margin: 0 0 16px;
    font-size: 1.35rem;
    color: #111827;
}

.apps-filter-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 26px;
}

.apps-filter-field {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #ffffff;
    color: #111827;
    padding: 10px 12px;
    font-size: 0.95rem;
}

.apps-filter-field:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.apps-filter-action {
    display: flex;
    align-items: flex-end;
}

.apps-filter-button {
    width: 100%;
    border: 0;
    border-radius: 10px;
    background: #2563eb;
    color: #ffffff;
    font-weight: 700;
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.apps-filter-button:hover {
    background: #1d4ed8;
}

.apps-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.apps-cards-grid-compact-gap {
    gap: 10px;
}

.apps-empty-message {
    margin: 0;
    color: #6b7280;
}

.apps-load-more-wrap {
    margin-top: 16px;
}

.apps-widget-box {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.05);
    padding: 24px;
}

/* App card */
.app-card {
    display: block;
    width: 100%;
    text-decoration: none;
    height: 100%;
}

.app-card-surface {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 7px 18px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 336px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.app-card:hover .app-card-surface {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px rgba(15, 23, 42, 0.12);
    background: #f8fbff;
}

.app-card-media-wrap {
    width: 100%;
    height: 224px;
    border-bottom: 1px solid #f3f4f6;
    background: #f9fafb;
}

.app-card-banner {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.app-card-fallback {
    height: 100%;
    padding: 20px;
    border: 1px solid #f3f4f6;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    color: #1f2937;
}

.app-card-fallback-category {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
}

.app-card-fallback-excerpt {
    margin: 10px 0 0;
    color: #4b5563;
    font-size: 0.9rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.app-card-fallback-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #9ca3af;
    font-size: 0.72rem;
    margin-top: 14px;
}

.app-card-body {
    display: flex;
    align-items: center;
    padding: 12px;
    min-height: 94px;
}

.app-card-icon-wrap {
    margin-right: 14px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.app-card-icon,
.app-card-icon-placeholder {
    width: 56px;
    height: 56px;
    border-radius: 10px;
}

.app-card-icon {
    object-fit: cover;
    border: 2px solid #e5e7eb;
}

.app-card-icon-placeholder {
    background: #f3f4f6;
}

.app-card-content {
    flex: 1;
}

.app-card-title {
    color: #111827;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.app-card:hover .app-card-title {
    color: #2563eb;
}

.app-card-rating {
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #374151;
    font-size: 0.9rem;
}

.app-card-rating-star {
    color: #f59e0b;
}

.app-card-developer {
    margin-top: 4px;
    color: #6b7280;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 1023px) {
    .apps-filter-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .apps-cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .apps-directory-page {
        width: min(1280px, calc(100% - 22px));
        padding: 20px 0;
    }

    .apps-filter-form {
        grid-template-columns: 1fr;
    }

    .apps-cards-grid {
        grid-template-columns: 1fr;
    }
}
