/* =========================================================
   Universal Catalog — base styles
   inc/universal_catalog/ucatalog.css
   ========================================================= */

.ucatalog-group {
    margin: 32px 0;
}

.ucatalog-field {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.ucatalog-field__label {
    flex: none;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.ucatalog-field__value {
    flex: 1;
    font-size: 15px;
    color: #222;
}

/* Repeater */
.ucatalog-repeater {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.ucatalog-repeater__row {
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 12px;
}

/* Group field */
.ucatalog-group-field {
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 12px;
    width: 100%;
}

/* Вложенные поля внутри repeater/group не нужна граница */
.ucatalog-repeater__row .ucatalog-field,
.ucatalog-group-field .ucatalog-field {
    border-bottom: 1px solid #e5e5e5;
}

.ucatalog-repeater__row > .ucatalog-field:last-child,
.ucatalog-group-field > .ucatalog-field:last-child,
.ucatalog-flex__layout > .ucatalog-field:last-child {
    border-bottom: none;
}
.ucatalog-group > .ucatalog-field:last-child {
    border-bottom: none;
}

/* Flexible content */
.ucatalog-flex {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.ucatalog-flex__layout {
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 16px;
}

/* Gallery */
.ucatalog-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ucatalog-gallery img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
}

/* Image */
.ucatalog-field--image img {
    max-width: 320px;
    height: auto;
    border-radius: 4px;
}

/* List */
.ucatalog-list {
    margin: 0;
    padding: 0 0 0 18px;
}

/* True/False */
.ucatalog-true  { color: #2e7d32; font-weight: 600; }
.ucatalog-false { color: #c62828; font-weight: 600; }

/* Color */
.ucatalog-color {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 6px;
    border: 1px solid #ccc;
}

/* Mobile */
@media ( max-width: 600px ) {

    .ucatalog-field__label {
        flex: none;
    }
}

/* Single */
.ucatalog-single {}

.ucatalog-single__header {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 32px;
}

.ucatalog-single__logo {
    flex: 0 0 120px;
}

.ucatalog-single__logo img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 8px;
}

.ucatalog-single__meta {
    flex: 1;
}

.ucatalog-single__title {
    margin: 0 0 8px;
    font-size: 28px;
}

.ucatalog-single__terms {
    margin-bottom: 4px;
    font-size: 14px;
    color: #555;
}

.ucatalog-single__terms-label {
    font-weight: 600;
    margin-right: 4px;
}

.ucatalog-single__term {
    margin-right: 8px;
    color: #2271b1;
    text-decoration: none;
}

.ucatalog-single__term:hover {
    text-decoration: underline;
}

.ucatalog-single__excerpt {
    margin-bottom: 32px;
    padding: 16px;
    background: #f9f9f9;
    border-left: 4px solid #2271b1;
    border-radius: 0 4px 4px 0;
    font-size: 15px;
    color: #444;
}

.ucatalog-single__group {
    margin-bottom: 40px;
}

.ucatalog-single__group-title {
    font-size: 20px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #eee;
}

.ucatalog-single__fields {
    margin: 0;
}

.ucatalog-single__field {
    display: flex;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    align-items: baseline;
}

.ucatalog-single__field:last-child {
    border-bottom: none;
}

.ucatalog-single__field-label {
    flex: 0 0 200px;
    font-weight: 600;
    font-size: 14px;
    color: #555;
}

.ucatalog-single__field-value {
    flex: 1;
    font-size: 15px;
    color: #222;
}

.ucatalog-single__content {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 2px solid #eee;
}

.ucatalog-single__content-title {
    font-size: 20px;
    margin-bottom: 16px;
}

/* Mobile */
@media ( max-width: 600px ) {
    .ucatalog-single__header {
        flex-direction: column;
    }

    .ucatalog-single__field {
        flex-direction: column;
        gap: 4px;
    }

    .ucatalog-single__field-label {
        flex: none;
    }
}

/* Archive */
.ucatalog-archive {}

.ucatalog-archive__header {
    margin-bottom: 32px;
}

.ucatalog-archive__title {
    font-size: 32px;
    margin: 0 0 12px;
}

.ucatalog-archive__description {
    font-size: 15px;
    color: #555;
    max-width: 700px;
}

.ucatalog-archive__desc-below {
    margin-top: 20px;
}

.ucatalog-archive__layout {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.ucatalog-archive__sidebar {
    flex: 0 0 260px;
    position: sticky;
    top: 32px;
}

.ucatalog-archive__sidebar-header {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
}

.ucatalog-archive__content {
    flex: 1;
    min-width: 0;
}

.ucatalog-archive__toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 14px;
    color: #555;
}

.ucatalog-archive__list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ucatalog-archive__empty {
    padding: 32px;
    text-align: center;
    background: #f9f9f9;
    border-radius: 8px;
}

/* Card */
.ucatalog-card {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    align-items: flex-start;
}

.ucatalog-card__logo {
    flex: 0 0 80px;
}

.ucatalog-card__logo img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 6px;
}

.ucatalog-card__body {
    flex: 1;
    min-width: 0;
}

.ucatalog-card__title {
    font-size: 18px;
    margin: 0 0 8px;
}

.ucatalog-card__title a {
    text-decoration: none;
    color: #1d2327;
}

.ucatalog-card__title a:hover {
    color: #2271b1;
}

/* Теги таксономий на карточке */
.ucatalog-card__terms {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.ucatalog-card__term {
    display: inline-block;
    padding: 3px 10px;
    background: #f0f0f1;
    border-radius: 20px;
    font-size: 12px;
    color: #1d2327;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.ucatalog-card__term:hover {
    background: #2271b1;
    color: #fff;
}

.ucatalog-card__excerpt {
    font-size: 14px;
    color: #555;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ucatalog-card__fields {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    margin: 0 0 12px;
}

.ucatalog-card__field {
    display: flex;
    gap: 6px;
    font-size: 13px;
}

.ucatalog-card__field-label {
    color: #888;
    font-weight: 600;
}

.ucatalog-card__field-value {
    color: #333;
}

.ucatalog-card__link {
    font-size: 14px;
    color: #2271b1;
    text-decoration: none;
    font-weight: 600;
}

.ucatalog-card__link:hover {
    text-decoration: underline;
}

/* Filters */
.ucatalog-filters {
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
}

.ucatalog-filters__search {
    margin-bottom: 16px;
}

.ucatalog-filters__search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.ucatalog-filters__sort {
    margin-bottom: 16px;
}

.ucatalog-filters__sort-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.ucatalog-filter {
    margin-bottom: 16px;
}

.ucatalog-filter__label {
    font-weight: 600;
    font-size: 13px;
    color: #555;
    margin-bottom: 8px;
}

.ucatalog-filter__select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.ucatalog-filter__checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    margin-bottom: 4px;
    cursor: pointer;
}

.ucatalog-filters__actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.ucatalog-filters__submit {
    flex: 1;
    padding: 8px 16px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

.ucatalog-filters__submit:hover {
    background: #135e96;
}

.ucatalog-filters__reset {
    padding: 8px 16px;
    background: #f0f0f1;
    color: #555;
    border-radius: 4px;
    font-size: 14px;
    text-decoration: none;
    text-align: center;
}

.ucatalog-filters__reset:hover {
    background: #e0e0e0;
}

/* Pagination */
.ucatalog-pagination {
    margin-top: 32px;
}

.ucatalog-pagination__list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ucatalog-pagination__list .page-numbers {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    color: #2271b1;
    text-decoration: none;
    font-size: 14px;
}

.ucatalog-pagination__list .page-numbers.current {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.ucatalog-pagination__list .page-numbers:hover:not(.current) {
    background: #f0f0f1;
}

/* Mobile */
@media ( max-width: 768px ) {
    .ucatalog-archive__layout {
        flex-direction: column;
    }

    .ucatalog-archive__sidebar {
        flex: none;
        width: 100%;
        position: static;
    }

    .ucatalog-card {
        flex-direction: column;
    }

    .ucatalog-card__logo {
        flex: none;
    }
}

/* Featured блок */
.ucatalog-featured {
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #eee;
}

.ucatalog-featured__scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.ucatalog-featured__scroll::-webkit-scrollbar {
    height: 4px;
}

.ucatalog-featured__scroll::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 2px;
}

.ucatalog-featured__scroll::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

/* Featured карточка */
.ucatalog-card-featured {
    flex: 1;
    display: flex;
    min-width: 280px;
    max-width: 33.33%;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 8px 16px;
    background: #fff;
    border: 2px solid #2271b1;
    border-radius: 8px;
    gap: 8px;
}

.ucatalog-featured__header {
    margin-bottom: 8px;
}

.ucatalog-featured__title {
    font-weight: 500;
    margin: 0;
}

.ucatalog-card-featured__logo {
    width: 64px;
    height: 64px;
}

.ucatalog-card-featured__logo img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 4px;
}

.ucatalog-card-featured__title {
    font-size: 14px;
    margin: 0;
    line-height: 1.3;
}

.ucatalog-card-featured__title a {
    color: #1d2327;
    text-decoration: none;
}

.ucatalog-card-featured__title a:hover {
    color: #2271b1;
}

.ucatalog-card-featured__link {
    font-size: 12px;
    color: #2271b1;
    text-decoration: none;
    margin-top: auto;
}

.ucatalog-card-featured__link:hover {
    text-decoration: underline;
}

/* Highlight в основном списке */
.ucatalog-card--highlight {
    background: #f0f6ff;
    border-color: #b3d0f5;
    border-width: 2px;
}

.ucatalog-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.ucatalog-topbar__search {
    flex: 1;
    min-width: 200px;
    max-width: 70%;
    display: flex;
    gap: 8px;
}

.ucatalog-topbar__search-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.ucatalog-topbar__submit {
    padding: 8px 16px;
    background: #2271b1;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.ucatalog-topbar__submit:hover {
    background: #135e96;
}

.ucatalog-topbar__sort {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
}

.ucatalog-topbar__sort-label {
    font-size: 14px;
    color: #555;
    margin-right: 4px;
}

.ucatalog-topbar__sort-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    flex-shrink: 0;
}

.ucatalog-archive .place--articleBottom {
    margin-top: 10px;
}

/* Блок таксономий на странице архива */
.ucatalog-taxonomy-block {
    margin-bottom: 40px;
}

.ucatalog-taxonomy-block__title {
    font-size: 20px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.ucatalog-terms {
    display: grid;
    grid-template-columns: repeat( auto-fill, minmax( 200px, 1fr ) );
    gap: 16px;
}

.ucatalog-term-card {
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-decoration: none;
    color: #1d2327;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ucatalog-term-card:hover {
    border-color: #2271b1;
    box-shadow: 0 2px 8px rgba( 34, 113, 177, 0.1 );
    color: #2271b1;
}

.ucatalog-term-card__name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 8px;
}

.ucatalog-term-card__count {
    font-size: 13px;
    color: #666;
    margin-top: auto;
}