/* HS Horse Listing Styles
 * Extracted from custom-frontend.css for shortcode-specific layouts
 */

/* === HORSE ARCHIVE === */

/* Main archive grid */
.horse-archive-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Card layout */
.horse-card {
    display: flex;
    width: 100%;
    height: 260px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.horse-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.horse-card a {
    display: flex;
    flex-direction: row;
    width: 100%;
    text-decoration: none;
    color: inherit;
}

.horse-card a:hover {
    text-decoration: none;
    color: inherit;
}

/* Image block with wrapper for overlay */
.horse-image {
    width: 347px !important;
    height: 260px !important;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

.horse-image-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}

.horse-image-wrapper img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
    border-radius: 0;
}

/* SOLD badge overlay */
.sold-overlay {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 0, 0, 0.85);
    color: #fff;
    font-weight: bold;
    padding: 6px 12px;
    font-size: 14px;
    border-radius: 4px;
    text-transform: uppercase;
    z-index: 2;
    pointer-events: none;
}

.horse-info {
    flex: 1 1 auto !important;
    width: auto !important;
    padding: 20px 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.horse-info h3 {
    margin: 5px 25px 25px 25px;
    font-size: 22px;
    color: #333;
}

.horse-info-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin: 5px 0 10px 0;
}

.horse-info-header h3 {
    margin: 0;
}

.horse-badge {
    display: inline-flex;
    align-items: center;
    padding: 0px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.horse-badge--closed {
    background: rgba(66, 101, 113, 0.1);
    color: #426571;
}

.horse-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 15px;
}

.horse-title {
    font-size: 22px;
    font-weight: 600;
    margin: 0;
    color: #333;
    flex-grow: 1;
}

.edit-link {
    font-size: 14px;
    color: #0073aa;
    text-decoration: none;
    white-space: nowrap;
    margin-left: 15px;
}

.edit-link:hover {
    text-decoration: underline;
}

.horse-meta {
    display: grid;
    line-height: 1.2em;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 20px;
    list-style: none;
    padding: 0;
    margin: 20px 0 20px 0;
}

.horse-meta li::before {
    content: none !important;
    display: none !important;
}

.horse-meta li {
    font-size: 15px;
    color: #555;
}

.horse-price {
    font-size: 23px;
    color: #426571;
    font-weight: bold;
    text-align: right;
    margin-top: auto;
    margin-right: 25px;
    margin-bottom: 10px;
}

/* === HORSE GRID SHORTCODE === */
.hs-horse-grid {
    --hs-grid-columns: 4;
    display: grid;
    grid-template-columns: repeat(var(--hs-grid-columns), minmax(0, 1fr));
    gap: 22px;
    width: 100%;
}

.hs-horse-grid-card {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e3e7ed;
    box-shadow: 0 10px 25px rgba(64, 80, 105, 0.08);
    overflow: hidden;
    height: 100%;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hs-horse-grid-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 32px rgba(48, 62, 80, 0.15);
}

.hs-horse-grid-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.hs-horse-grid-link,
.hs-horse-grid-link:visited,
.hs-horse-grid-link:hover,
.hs-horse-grid-link:focus {
    text-decoration: none !important;
}

.hs-horse-grid-photo {
    aspect-ratio: 4 / 3;
    width: 100%;
    background: #e8eef4;
    position: relative;
    overflow: hidden;
}

.hs-horse-grid-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hs-horse-grid-photo--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #6c7a89;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.hs-horse-grid-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 20px 22px 24px;
    gap: 16px;
}

.hs-horse-grid-title-row {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
}

.hs-horse-grid-title {
    font-size: 19px;
    margin: 0;
    color: #1f2c3d;
    flex: 1;
}

.hs-horse-grid-inline-meta {
    font-size: 14px;
    font-weight: 600;
    color: #3a4654;
    letter-spacing: 0.01em;
    display: grid;
    grid-template-columns: 23% 5% 40% 5% 18%;
    gap: 4px 8px;
}

.hs-horse-grid-inline-meta-item,
.hs-horse-grid-inline-meta-sep {
    min-height: 1.5em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hs-horse-grid-inline-meta-sep {
    justify-content: center;
    color: #c1c9d3;
    font-weight: 400;
}

.hs-horse-grid-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.hs-horse-grid-country {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #2f3e4f;
}

.hs-horse-grid-country .hs-country-flag {
    font-size: 20px;
    line-height: 1;
}

.hs-horse-grid-price {
    font-size: 18px;
    font-weight: 700;
    color: #2c6b5f;
    white-space: nowrap;
}

@media (max-width: 1200px) {
    .hs-horse-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .hs-horse-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .hs-horse-grid {
        grid-template-columns: 1fr;
    }

    .hs-horse-grid-title-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .hs-horse-grid-footer {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    .hs-horse-grid-title {
        font-size: 29px;
    }

    .hs-horse-grid-body {
        gap: 22px;
    }

    .hs-horse-grid-photo {
        aspect-ratio: auto;
    }

    .hs-horse-grid-photo img {
        height: auto;
    }

    .hs-horse-grid-inline-meta {
        grid-template-columns: 23% 5% 40% 5% 18%;
        gap: 6px 8px;
        font-size: 16px;
    }

    .hs-horse-grid-inline-meta-item,
    .hs-horse-grid-inline-meta-sep {
        font-size: 16px;
    }

    .hs-horse-grid-country {
        font-size: 16px;
    }

    .hs-horse-grid-price {
        font-size: 22px;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .horse-card,
    .horse-card a {
        flex-direction: column;
        height: auto;
        width: 100%;
    }

    .horse-image {
        width: 100% !important;
        height: auto !important;
    }

    .horse-image-wrapper {
        width: 100%;
        height: auto;
        aspect-ratio: 4 / 3;
    }

    .horse-image-wrapper img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover;
    }

    .horse-info {
        width: 100%;
        padding: 20px;
    }

    .horse-meta {
        grid-template-columns: 1fr;
    }

    .horse-price {
        font-size: 19px !important;
        text-align: right;
        margin-top: 10px;
        margin-bottom: 10px !important;
        margin-right: 25px;
    }

    .user-horse-dashboard-wrap .horse-controls-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .user-horse-dashboard-wrap .horse-action-buttons {
        margin-top: 10px;
    }
}

@media (max-width: 1100px) {
    .horse-info h3 {
        font-size: 20px !important;
    }

    .horse-meta li {
        font-size: 14px !important;
    }

    .horse-price {
        font-size: 22px !important;
    }
}

@media (max-width: 950px) {
    .horse-info h3 {
        font-size: 18px !important;
    }

    .horse-meta li {
        font-size: 13px !important;
    }

    .horse-price {
        font-size: 19px !important;
    }
}

@media (max-width: 768px) {
    .horse-info h3 {
        font-size: 22px !important;
    }

    .horse-meta li {
        font-size: 16px !important;
        line-height: 1.4em;
    }

    .horse-price {
        font-size: 22px !important;
    }
}

/* Scoped card style */
.user-horse-dashboard-wrap .horse-card {
    border-radius: 10px 10px 0 0;
    margin-bottom: 0;
}

/* HS pagination: single row, no borders */
.hs-pagination {
    margin: 20px 0;
    text-align: center;
}

.hs-pagination .page-numbers {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.hs-pagination .page-numbers li {
    display: block;
}

/* kill theme button styles */
.hs-pagination .page-numbers a,
.hs-pagination .page-numbers span {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    line-height: 1.2;
    min-width: auto;
    height: auto;
    color: inherit;
    text-decoration: none;
}

/* active + hover states (simple text) */
.hs-pagination .page-numbers .current {
    font-weight: 700;
    text-decoration: underline;
}

.hs-pagination .page-numbers a:hover {
    text-decoration: underline;
}

/* === CONTROLS SECTION === */
.user-horse-dashboard-wrap .horse-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 15px 25px;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 10px 10px;
    background: #f9f9f9;
    font-size: 14px;
    margin-top: 0;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.user-horse-dashboard-wrap .status-toggle-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
    flex-grow: 1;
}

/* Action buttons (right aligned) */
.user-horse-dashboard-wrap .horse-action-buttons {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.user-horse-dashboard-wrap .horse-controls-row a.edit-button,
.user-horse-dashboard-wrap .horse-controls-row a.delete-button {
    font-size: 12px;
    font-weight: 500;
    color: #0073aa;
    text-decoration: none;
    padding: 1px 8px;
    border: 1px solid #0073aa;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.user-horse-dashboard-wrap .horse-controls-row a.delete-button {
    color: #a00;
    border-color: #a00;
}

.user-horse-dashboard-wrap .horse-controls-row a.edit-button:hover {
    background-color: #0073aa;
    color: #fff;
}

.user-horse-dashboard-wrap .horse-controls-row a.delete-button:hover {
    background-color: #a00;
    color: #fff;
}

/* Status lines and labels */
.user-horse-dashboard-wrap .status-line {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.user-horse-dashboard-wrap .status-label {
    font-weight: 500;
}

/* Status color classes */
.user-horse-dashboard-wrap .status-label.status-unpublished {
    color: #c00;
}

.user-horse-dashboard-wrap .status-label.status-published {
    color: #2b9e44;
}

.user-horse-dashboard-wrap .status-label.status-under-review {
    color: #0073aa;
}

.user-horse-dashboard-wrap .status-label.status-rejected {
    color: #cc7a00;
}

.user-horse-dashboard-wrap .status-label.status-sold {
    color: #0073aa;
}

/* Mini status action buttons */
.user-horse-dashboard-wrap .status-action {
    font-size: 12px;
    color: #0073aa;
    text-decoration: none;
    border: 1px solid #0073aa;
    padding: 6px 10px;
    border-radius: 3px;
    background-color: #f2f9ff;
    display: inline-block;
    line-height: 1.2em;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
}

.user-horse-dashboard-wrap .status-action:hover {
    background-color: #0073aa;
    color: #fff;
}

/* Final alignments */
.user-horse-dashboard-wrap .horse-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-right: 25px;
    margin-top: auto;
}

.user-horse-dashboard-wrap .horse-archive-grid {
    gap: 0px;
}

.user-horse-dashboard-wrap .status-label.status-under-review {
    color: #28a745;
}

.user-horse-dashboard-wrap .status-action[href*="change_status=Under%20review"],
.user-horse-dashboard-wrap .status-action[href*="change_status=Published"] {
    border-color: #28a745;
    color: #28a745;
}

.user-horse-dashboard-wrap .status-action[href*="change_status=Under%20review"]:hover,
.user-horse-dashboard-wrap .status-action[href*="change_status=Published"]:hover {
    background-color: #28a745;
    color: #fff;
}

.user-horse-dashboard-wrap .status-action[href*="change_status=Unpublished"] {
    border-color: #c00;
    color: #c00;
}

.user-horse-dashboard-wrap .status-action[href*="change_status=Unpublished"]:hover {
    background-color: #c00;
    color: #fff;
}

.user-horse-dashboard-wrap .horse-controls-row a.preview-button {
    font-size: 12px;
    font-weight: 500;
    color: #0073aa;
    text-decoration: none;
    padding: 1px 8px;
    border: 1px solid #0073aa;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.user-horse-dashboard-wrap .horse-controls-row a.preview-button:hover {
    background-color: #0073aa;
    color: #fff;
}

@media (max-width: 768px) {
    .user-horse-dashboard-wrap .horse-controls-row {
        flex-direction: column;
        gap: 10px;
        padding: 12px 15px;
        margin-bottom: 20px;
    }

    .user-horse-dashboard-wrap .status-toggle-row {
        gap: 15px;
    }

    .user-horse-dashboard-wrap .horse-action-buttons {
        gap: 8px;
        justify-content: flex-end;
        width: 100%;
    }

    .user-horse-dashboard-wrap .status-line {
        gap: 3px !important;
    }
}
