/* ==========================================================================
   Horse Ads – ASCHK style
   Primary: #0081D5 | Dark: #002B47 | Light bg: #f5f7fa
   ========================================================================== */

/* --- Form --- */

.horse-ad-form {
    max-width: 100%;
    margin: 2rem auto;
    padding: 2rem;
    border: 1px solid #dde2e8;
    border-radius: 0;
    background-color: #fff;
}

.horse-ad-form h4 {
    color: #002B47;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 1.1rem;
    letter-spacing: 0.03em;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #0081D5;
}

.horse-ad-form .form-label {
    font-weight: 600;
    color: #313131;
    font-size: 0.9rem;
}

.horse-ad-form .form-control,
.horse-ad-form .form-select {
    border-radius: 0;
    border: 1px solid #ccd3db;
    font-size: 0.95rem;
    padding: 0.5rem 0.75rem;
    transition: border-color 0.2s ease;
}

.horse-ad-form .form-control:focus,
.horse-ad-form .form-select:focus {
    border-color: #0081D5;
    box-shadow: 0 0 0 2px rgba(0, 129, 213, 0.15);
}

.horse-ad-form .form-text {
    font-size: 0.8rem;
    color: #6c757d;
}

/* --- Field validation states --- */

.horse-ad-form .form-control.is-invalid,
.horse-ad-form .form-select.is-invalid {
    border-color: #dc3545;
}

.horse-ad-form .form-control.is-invalid:focus,
.horse-ad-form .form-select.is-invalid:focus {
    border-color: #dc3545;
    -webkit-box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

.horse-ad-form .file-upload-label.is-invalid-file {
    border-color: #dc3545;
}

.horse-ad-form .invalid-feedback {
    display: block;
    font-size: 0.8rem;
    color: #dc3545;
    margin-top: 0.25rem;
}

.horse-ad-form hr {
    border-color: #dde2e8;
}

.horse-ad-form .btn-primary {
    background-color: #0081D5;
    border: none;
    border-radius: 0;
    padding: 0.65rem 2rem;
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: background-color 0.2s ease;
}

.horse-ad-form .btn-primary:hover,
.horse-ad-form .btn-primary:focus {
    background-color: #002B47;
}

/* --- Alerts (info / success / error) --- */

.horse-ad-form + .alert,
.alert + .horse-ad-form,
form#horse-ad-form ~ .alert,
div > .alert.alert-info,
div > .alert.alert-success,
div > .alert.alert-danger {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    border-radius: 0;
    font-size: 0.9rem;
}

.alert.alert-info {
    background-color: #e8f4fc;
    border: 1px solid #b8ddf2;
    color: #002B47;
}

.alert.alert-success {
    background-color: #e6f5ea;
    border: 1px solid #b3dfc0;
    color: #1a5c2b;
}

.alert.alert-danger {
    background-color: #fce8e8;
    border: 1px solid #f2b8b8;
    color: #7a1a1a;
}

/* --- Ad List / Cards --- */

.horse-ads-list .horse-ad-card {
    border: 1px solid #dde2e8;
    border-radius: 0;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.horse-ads-list .horse-ad-card:hover {
    box-shadow: 0 4px 16px rgba(0, 43, 71, 0.1);
    transform: translateY(-2px);
}

.horse-ads-list .card-img-top-wrapper {
    aspect-ratio: 4 / 3;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.horse-ads-list .card-img-top-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

.horse-ads-list .card-title {
    font-weight: 700;
    color: #002B47;
    font-size: 1.05rem;
}

.horse-ads-list .card-text .text-muted {
    color: #6c757d !important;
}

.horse-ads-list .btn-outline-primary {
    color: #0081D5;
    border-color: #0081D5;
    border-radius: 0;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    transition: all 0.2s ease;
}

.horse-ads-list .btn-outline-primary:hover {
    background-color: #0081D5;
    border-color: #0081D5;
    color: #fff;
}

/* --- Single Ad Detail --- */

.horse-specs .table {
    border-radius: 0;
}

.horse-specs .table th {
    background-color: #f5f7fa;
    color: #002B47;
    font-weight: 600;
    width: 40%;
    font-size: 0.9rem;
    border-color: #dde2e8;
}

.horse-specs .table td {
    font-size: 0.9rem;
    border-color: #dde2e8;
}

.horse-description h3,
.horse-specs h3 {
    color: #002B47;
    font-weight: 700;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #0081D5;
}

/* Sidebar contact */
.horse-ad-sidebar {
    border: 1px solid #dde2e8;
    background-color: #f5f7fa;
}

.horse-ad-sidebar h3 {
    color: #002B47;
    font-weight: 700;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #0081D5;
}

.horse-ad-price {
    font-size: 1.6rem;
    font-weight: 700;
    color: #0081D5;
}

.horse-ad-sidebar .bg-btn {
    background-color: #0081D5;
    color: #fff;
    border: none;
    border-radius: 0;
    padding: 0.65rem 1.5rem;
    font-size: 0.9rem;
    letter-spacing: 0.03em;
    -webkit-transition: background-color 0.2s ease;
    transition: background-color 0.2s ease;
}

.horse-ad-sidebar .bg-btn:hover {
    background-color: #002B47;
    color: #fff;
}

.horse-ad-sidebar .btn-outline-primary {
    color: #0081D5;
    border-color: #0081D5;
    border-radius: 0;
    padding: 0.65rem 1.5rem;
    font-size: 0.9rem;
    letter-spacing: 0.03em;
    -webkit-transition: all 0.2s ease;
    transition: all 0.2s ease;
}

.horse-ad-sidebar .btn-outline-primary:hover {
    background-color: #0081D5;
    border-color: #0081D5;
    color: #fff;
}

/* --- Pagination --- */

.horse-ads-list .page-numbers {
    display: inline-block;
    padding: 0.4rem 0.75rem;
    margin: 0 0.15rem;
    border: 1px solid #dde2e8;
    color: #0081D5;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.horse-ads-list .page-numbers:hover {
    background-color: #0081D5;
    border-color: #0081D5;
    color: #fff;
}

.horse-ads-list .page-numbers.current {
    background-color: #002B47;
    border-color: #002B47;
    color: #fff;
}

/* --- File input (custom Czech labels) --- */

.horse-ad-form .file-upload-field {
    position: relative;
}

.horse-ad-form .file-upload-field input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.horse-ad-form .file-upload-label {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: stretch;
    -ms-flex-align: stretch;
    align-items: stretch;
    border: 1px solid #ccd3db;
    border-radius: 0;
    background-color: #fff;
    cursor: pointer;
    overflow: hidden;
    -webkit-transition: border-color 0.2s ease;
    transition: border-color 0.2s ease;
}

.horse-ad-form .file-upload-field input[type="file"]:focus + .file-upload-label {
    border-color: #0081D5;
    -webkit-box-shadow: 0 0 0 2px rgba(0, 129, 213, 0.15);
    box-shadow: 0 0 0 2px rgba(0, 129, 213, 0.15);
}

.horse-ad-form .file-upload-btn {
    display: inline-block;
    background-color: #0081D5;
    color: #fff;
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    -webkit-transition: background-color 0.2s ease;
    transition: background-color 0.2s ease;
}

.horse-ad-form .file-upload-label:hover .file-upload-btn {
    background-color: #002B47;
}

.horse-ad-form .file-upload-name {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    color: #6c757d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- reCAPTCHA alignment --- */

.horse-ad-form .g-recaptcha {
    margin-top: 0.5rem;
}

/* --- Checkboxes (Primární využití) --- */

.horse-ad-form .form-check {
    padding-left: 1.6rem;
    margin-bottom: 0.4rem;
}

.horse-ad-form .form-check-input {
    margin-left: -1.6rem;
    margin-top: 0.25rem;
    width: 1rem;
    height: 1rem;
    border-radius: 0;
    border: 1px solid #ccd3db;
}

.horse-ad-form .form-check-input:checked {
    background-color: #0081D5;
    border-color: #0081D5;
}

.horse-ad-form .form-check-input.is-invalid {
    border-color: #dc3545;
}

.horse-ad-form .form-check-label {
    font-size: 0.95rem;
    color: #313131;
    cursor: pointer;
}

/* --- Date of birth row --- */

.horse-ad-form .row.g-2 > [class*="col-"] {
    padding-right: 0.25rem;
    padding-left: 0.25rem;
}

/* --- Gallery picker chips --- */

.horse-ad-gallery-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.horse-ad-gallery-chips:empty {
    display: none;
}

.horse-ad-gallery-chip {
    display: inline-flex;
    align-items: center;
    background-color: #f5f7fa;
    border: 1px solid #ccd3db;
    border-radius: 0;
    padding: 0.25rem 0.5rem 0.25rem 0.25rem;
    font-size: 0.85rem;
    max-width: 100%;
}

.horse-ad-gallery-chip-thumb {
    width: 32px;
    height: 32px;
    margin-right: 0.5rem;
    flex-shrink: 0;
    background-color: #ccd3db;
    overflow: hidden;
}

.horse-ad-gallery-chip-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.horse-ad-gallery-chip-name {
    color: #313131;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 0.5rem;
}

.horse-ad-gallery-chip-remove {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0 0.2rem;
    cursor: pointer;
    transition: color 0.15s ease;
}

.horse-ad-gallery-chip-remove:hover,
.horse-ad-gallery-chip-remove:focus {
    color: #dc3545;
    outline: none;
}

/* --- Single Ad: gallery --- */

.horse-ad-gallery h3 {
    color: #002B47;
    font-weight: 700;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 1.5rem;
}

.horse-ad-gallery .horse-ad-fancybox {
    overflow: hidden;
    cursor: zoom-in;
}

.horse-ad-gallery .horse-ad-fancybox img {
    transition: transform 0.2s ease;
}

.horse-ad-gallery .horse-ad-fancybox:hover img {
    transform: scale(1.03);
}

/* --- Location autocomplete (SwiftFill) --- */
/* Zero-padding wrapper around the input so the absolutely-positioned dropdown
   (left/right: 0) lines up exactly with the input, not the padded grid column. */
.horse-ad-location-field { position: relative; }

/* Dropdown panel, styled to read as a select flyout attached to the input.
   Selectors are scoped (ul.… li.…) with explicit list resets and ::marker off
   so theme content rules (e.g. .entry-content ul li) cannot re-add bullets. */
.horse-ad-location ul.horse-ad-location-list {
	list-style: none;
	margin: -1px 0 0;
	padding: 0;
	position: absolute;
	z-index: 1050;
	left: 0;
	right: 0;
	max-height: 280px;
	overflow-y: auto;
	background: #fff;
	border: 1px solid #ced4da;
	border-top: 0;
	border-radius: 0 0 .25rem .25rem;
	box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
}
.horse-ad-location ul.horse-ad-location-list li.horse-ad-location-option {
	list-style: none;
	margin: 0;
	padding: .5rem .75rem;
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: .75rem;
	cursor: pointer;
	border-bottom: 1px solid #f0f0f0;
}
.horse-ad-location ul.horse-ad-location-list li.horse-ad-location-option::marker { content: none; }
.horse-ad-location ul.horse-ad-location-list li.horse-ad-location-option:last-child { border-bottom: 0; }
.horse-ad-location ul.horse-ad-location-list li.horse-ad-location-option.is-active,
.horse-ad-location ul.horse-ad-location-list li.horse-ad-location-option:hover { background: #eef2ff; }
.horse-ad-location .horse-ad-location-option-name { font-size: 15px; color: #212529; }
.horse-ad-location .horse-ad-location-option-region { font-size: 12px; color: #6c757d; white-space: nowrap; }

/* AJAX filter: dim results while a request is in flight */
#horse-ads-results { transition: opacity .15s ease; }
#horse-ads-results.is-loading { opacity: .55; pointer-events: none; }

/* Autocomplete status row (Hledáme… / no results) */
.horse-ad-location ul.horse-ad-location-list li.horse-ad-location-message {
	list-style: none;
	margin: 0;
	padding: .6rem .75rem;
	display: flex;
	align-items: center;
	gap: .5rem;
	color: #6c757d;
	font-size: 14px;
	cursor: default;
}
.horse-ad-location ul.horse-ad-location-list li.horse-ad-location-message::marker { content: none; }
.horse-ad-location-message.is-loading::before {
	content: "";
	flex: 0 0 auto;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	border: 2px solid #ccd3db;
	border-top-color: #0081D5;
	animation: thas-spin .6s linear infinite;
}
@keyframes thas-spin { to { transform: rotate(360deg); } }
