/*
 * JYA Housing — OviPro single property detail pages
 * Applies only to sale (pdx_property) and rental (pdx_property_rent) pages.
 * Does not change the page/content width; it styles the existing content.
 */

body.single-pdx_property,
body.single-pdx_property_rent {
    --jya-single-panel: #f4f4f4;
    --jya-single-line: #dedede;
    --jya-single-ink: #171717;
    --jya-single-blue: #1c4482;
    --jya-single-bright: #19a3dd;
}

/* Keep the existing theme width. Lay OviPro sections out as a vertical stack
   so the map can be displayed before the enquiry form, like the reference. */
body.single-pdx_property .gh-plugin-wrapper,
body.single-pdx_property_rent .gh-plugin-wrapper {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
}

body.single-pdx_property .gh-plugin-wrapper > *,
body.single-pdx_property_rent .gh-plugin-wrapper > * {
    box-sizing: border-box;
    min-width: 0;
    margin-top: 0;
    margin-bottom: 0;
}

/* If the theme displays the long post title above the gallery, keep it
   available to assistive technology; the visible heading is repeated in the
   summary panel under the gallery. */
body.single-pdx_property .entry-header .entry-title,
body.single-pdx_property_rent .entry-header .entry-title {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Return-to-list link */
body.single-pdx_property .pdx-back-to-list,
body.single-pdx_property_rent .pdx-back-to-list {
    order: 1;
    padding: 0;
}

body.single-pdx_property .pdx-back-to-list > a,
body.single-pdx_property_rent .pdx-back-to-list > a {
    display: inline-block;
    padding: 0.55rem 0;
    background: transparent;
    color: var(--jya-single-blue);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    text-transform: none;
}

body.single-pdx_property .pdx-back-to-list > a:hover,
body.single-pdx_property_rent .pdx-back-to-list > a:hover {
    color: var(--jya-single-bright);
    text-decoration: underline;
}

/* Gallery and thumbnail strip */
body.single-pdx_property .apartment-images-slider-container,
body.single-pdx_property_rent .apartment-images-slider-container {
    order: 2;
    width: 100%;
    margin: 0;
}

body.single-pdx_property #apartment-main-slider,
body.single-pdx_property_rent #apartment-main-slider {
    margin: 0 0 1rem;
    border: 0;
}

body.single-pdx_property #apartment-main-slider .splide__slide__container .splide-image,
body.single-pdx_property_rent #apartment-main-slider .splide__slide__container .splide-image {
    aspect-ratio: 4 / 3;
    background: #f7f7f7;
}

body.single-pdx_property #apartment-main-slider .splide__slide__container .splide-image img,
body.single-pdx_property_rent #apartment-main-slider .splide__slide__container .splide-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

body.single-pdx_property #apartment-main-slider .splide__arrows button,
body.single-pdx_property_rent #apartment-main-slider .splide__arrows button {
    background: var(--jya-single-blue);
    color: #fff;
    opacity: 0.78;
    border-radius: 50%;
}

body.single-pdx_property #apartment-thumbnail-slider,
body.single-pdx_property_rent #apartment-thumbnail-slider {
    margin-top: 0;
}

body.single-pdx_property #apartment-thumbnail-slider .splide__slide,
body.single-pdx_property_rent #apartment-thumbnail-slider .splide__slide {
    background: #f2f2f2;
}

/* Summary panel inserted by the child-theme property-for-sale.php override. */
body.single-pdx_property .jya-property-summary,
body.single-pdx_property_rent .jya-property-summary {
    order: 3;
    padding: clamp(1.2rem, 3vw, 1.75rem);
    background: var(--jya-single-panel);
    color: var(--jya-single-ink);
}

body.single-pdx_property .jya-property-summary__address,
body.single-pdx_property_rent .jya-property-summary__address {
    margin: 0 0 0.65rem;
    color: #111;
    font-size: clamp(1.35rem, 2.5vw, 1.8rem);
    font-weight: 750;
    line-height: 1.2;
    text-transform: uppercase;
}

body.single-pdx_property .jya-property-summary__location,
body.single-pdx_property_rent .jya-property-summary__location,
body.single-pdx_property .jya-property-summary__specification,
body.single-pdx_property_rent .jya-property-summary__specification {
    margin: 0.15rem 0;
    line-height: 1.45;
}

body.single-pdx_property .jya-property-summary__columns,
body.single-pdx_property_rent .jya-property-summary__columns {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
    margin-top: 1rem;
}

body.single-pdx_property .jya-property-summary__primary-facts,
body.single-pdx_property_rent .jya-property-summary__primary-facts {
    display: grid;
    gap: 0.45rem;
}

body.single-pdx_property .jya-summary-fact,
body.single-pdx_property_rent .jya-summary-fact {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

body.single-pdx_property .jya-summary-fact__icon,
body.single-pdx_property_rent .jya-summary-fact__icon {
    display: inline-flex;
    flex: 0 0 1.7rem;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    border: 1px solid #7890b8;
    border-radius: 50%;
    color: var(--jya-single-blue);
    font-size: 1rem;
    line-height: 1;
}

body.single-pdx_property .jya-summary-fact__label,
body.single-pdx_property_rent .jya-summary-fact__label {
    display: block;
    color: #555;
    font-size: 0.78rem;
}

body.single-pdx_property .jya-summary-fact strong,
body.single-pdx_property_rent .jya-summary-fact strong {
    display: block;
    font-size: 1.15rem;
    line-height: 1.35;
}

body.single-pdx_property .jya-property-summary__details,
body.single-pdx_property_rent .jya-property-summary__details {
    display: grid;
    gap: 0.8rem;
    margin: 0;
}

body.single-pdx_property .jya-property-summary__details > div,
body.single-pdx_property_rent .jya-property-summary__details > div {
    display: grid;
    grid-template-columns: minmax(5.5rem, 0.9fr) minmax(0, 1fr);
    gap: 0.6rem;
}

body.single-pdx_property .jya-property-summary__details dt,
body.single-pdx_property_rent .jya-property-summary__details dt {
    color: #555;
    font-size: 0.9rem;
}

body.single-pdx_property .jya-property-summary__details dd,
body.single-pdx_property_rent .jya-property-summary__details dd {
    margin: 0;
    font-weight: 600;
}

/* Resource links and description panel */
body.single-pdx_property .pdx_presentation_urls,
body.single-pdx_property_rent .pdx_presentation_urls {
    order: 4;
    display: grid;
    gap: 0.35rem;
    margin: 0;
}

body.single-pdx_property .pdx_presentation_urls > a,
body.single-pdx_property_rent .pdx_presentation_urls > a {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0.75rem 1rem;
    background: var(--jya-single-blue);
    color: #fff;
    text-decoration: none;
    text-align: center;
    text-transform: none;
}

body.single-pdx_property .pdx_description,
body.single-pdx_property_rent .pdx_description {
    order: 5;
    margin: 0;
    padding: clamp(1.25rem, 3vw, 1.8rem);
    background: var(--jya-single-panel);
    line-height: 1.65;
}

body.single-pdx_property .pdx_description > :first-child,
body.single-pdx_property_rent .pdx_description > :first-child {
    margin-top: 0;
}

body.single-pdx_property .pdx_description > :last-child,
body.single-pdx_property_rent .pdx_description > :last-child {
    margin-bottom: 0;
}

/* Seller/agent and showing cards */
body.single-pdx_property .pdx_info_container_seller,
body.single-pdx_property_rent .pdx_info_container_seller {
    order: 6;
	margin: 0;
    padding: 1.2rem;
    background: var(--jya-single-panel);
}

body.single-pdx_property .pdx_info_container_seller > h2,
body.single-pdx_property_rent .pdx_info_container_seller > h2 {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
}

body.single-pdx_property .pdx_info_container_seller .pdx_info_estate_agent,
body.single-pdx_property_rent .pdx_info_container_seller .pdx_info_estate_agent {
    display: flex !important;
    align-items: center;
    gap: 1rem;
    margin: 0;
}

body.single-pdx_property .pdx_info_container_seller .pdx_info_estate_agent > img,
body.single-pdx_property_rent .pdx_info_container_seller .pdx_info_estate_agent > img {
    flex: 0 0 7rem;
    width: 7rem;
    max-width: 7rem;
    height: 7rem;
    margin: 0;
    border-radius: 50%;
    object-fit: cover;
}

body.single-pdx_property .pdx_info_container_seller .pdx_info_estate_agent > div,
body.single-pdx_property_rent .pdx_info_container_seller .pdx_info_estate_agent > div {
    min-width: 0;
    padding: 0;
}

@media (max-width: 640px) {
	body.single-pdx_property .pdx_info_container_seller .pdx_seller_company,
body.single-pdx_property_rent .pdx_info_container_seller .pdx_seller_company {
    padding-top: 1rem;
}
}	
	
body.single-pdx_property .pdx_info_container_showing,
body.single-pdx_property_rent .pdx_info_container_showing {
    order: 7;
    margin: 0;
    padding: 1.2rem;
    background: var(--jya-single-panel);
}

body.single-pdx_property .pdx_info_container_showing > h2,
body.single-pdx_property_rent .pdx_info_container_showing > h2 {
    margin: 0 0 0.8rem;
	font-size: 1.1rem;
}

body.single-pdx_property .pdx_no_showing,
body.single-pdx_property_rent .pdx_no_showing {
    padding: 0.7rem 0;
    color: #555;
}

/* Map and route link appear before the enquiry form. */
body.single-pdx_property .gh-plugin-wrapper > .pdx_map_canvas,
body.single-pdx_property_rent .gh-plugin-wrapper > .pdx_map_canvas {
    order: 8;
    width: 100%;
    margin: 0;
    overflow: hidden;
}

body.single-pdx_property .pdx_map_canvas iframe,
body.single-pdx_property_rent .pdx_map_canvas iframe {
    display: block;
    width: 100%;
    min-height: 18rem;
    border: 0;
}

body.single-pdx_property .gh-plugin-wrapper > .pdx_route_link,
body.single-pdx_property_rent .gh-plugin-wrapper > .pdx_route_link {
    order: 9;
    margin: -0.8rem 0 0;
    text-align: right;
}

body.single-pdx_property .pdx_route_link a,
body.single-pdx_property_rent .pdx_route_link a {
    color: var(--jya-single-blue);
    text-decoration: underline;
}

body.single-pdx_property .gh-plugin-wrapper > #apartment_map_container,
body.single-pdx_property_rent .gh-plugin-wrapper > #apartment_map_container {
    order: 10;
    margin: 0;
    padding: 1.2rem;
    background: var(--jya-single-panel);
}

/* Coded JYA contact form (handled by the child-theme admin-post action). */
body.single-pdx_property .gh-plugin-wrapper > .jya-property-contact,
body.single-pdx_property_rent .gh-plugin-wrapper > .jya-property-contact {
    order: 11;
    box-sizing: border-box;
    min-width: 0;
    margin: 0;
    padding: clamp(1.25rem, 3vw, 2.5rem);
    border: 1px solid var(--jya-single-line);
    background: #fff;
}

body.single-pdx_property .jya-property-contact__title,
body.single-pdx_property_rent .jya-property-contact__title {
    margin: 0 0 clamp(1.5rem, 4vw, 3rem);
    color: var(--jya-single-ink);
    font-size: clamp(1.2rem, 2vw, 1.4rem);
    font-weight: 500;
    line-height: 1.35;
    text-align: center;
}

.jya-property-contact-form,
.jya-property-contact-form * {
    box-sizing: border-box;
}

.jya-property-contact-form {
    width: 100%;
    margin: 0;
}

.jya-property-contact-form__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem 1rem;
    width: 100%;
}

.jya-property-contact-form__field {
    min-width: 0;
    margin: 0;
}

.jya-property-contact-form__field--full {
    grid-column: 1 / -1;
}

.jya-contact-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.jya-property-contact-form input[type="text"],
.jya-property-contact-form input[type="email"],
.jya-property-contact-form input[type="tel"],
.jya-property-contact-form select,
.jya-property-contact-form textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 2.75rem;
    margin: 0;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--jya-single-line);
    border-radius: 0;
    background: #fff;
    color: var(--jya-single-ink);
    box-shadow: none;
    font: inherit;
    line-height: 1.4;
}

.jya-property-contact-form textarea {
    min-height: 5rem;
    resize: vertical;
}

.jya-property-contact-form input::placeholder,
.jya-property-contact-form textarea::placeholder {
    color: #858b93;
    opacity: 1;
}

.jya-property-contact-form input:focus,
.jya-property-contact-form select:focus,
.jya-property-contact-form textarea:focus {
    border-color: var(--jya-single-blue);
    outline: 2px solid transparent;
    box-shadow: 0 0 0 1px var(--jya-single-blue);
}

.jya-property-contact-form__consent label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    color: var(--jya-single-ink);
    font-size: 0.85rem;
    line-height: 1.5;
}

.jya-property-contact-form__consent input[type="checkbox"] {
    flex: 0 0 auto;
    margin: 0.2rem 0 0;
}

.jya-property-contact-form__consent a {
    color: var(--jya-single-blue);
    text-decoration: underline;
}

.jya-property-contact-form__submit {
    padding-top: 0.25rem;
}

.jya-property-contact-form__button {
    display: inline-block;
    min-width: 6.5rem;
    min-height: 3rem;
    margin: 0;
    padding: 0.75rem 1.4rem;
    border: 0;
    border-radius: 0;
    background: var(--jya-single-bright);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
    cursor: pointer;
}

.jya-property-contact-form__button:hover {
    background: var(--jya-single-blue);
    color: #fff;
}

.jya-property-contact__notice {
    margin: 0 0 1rem;
    padding: 0.8rem 1rem;
    border-left: 3px solid var(--jya-single-blue);
    background: var(--jya-single-panel);
}

.jya-property-contact__notice--invalid,
.jya-property-contact__notice--error {
    border-left-color: #b42318;
}

.jya-property-contact-form__honeypot {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

.jya-property-contact__notice--success {
    border-left-color: #237447;
}

/* The full OviPro detail groups stay in place below the form. */
body.single-pdx_property .gh-plugin-wrapper > .pdx_info_container:not(.pdx_info_container_seller):not(.pdx_info_container_showing):not(#apartment_map_container),
body.single-pdx_property_rent .gh-plugin-wrapper > .pdx_info_container:not(.pdx_info_container_seller):not(.pdx_info_container_showing):not(#apartment_map_container) {
    order: 12;
    margin: 0;
    padding: 0;
    background: transparent;
}

body.single-pdx_property .pdx_info_container_title,
body.single-pdx_property_rent .pdx_info_container_title {
    margin: 0 0 0.55rem;
    padding: 0.85rem 1rem;
    background: var(--jya-single-panel);
    color: #171717;
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.35;
}

body.single-pdx_property .pdx_info_container > .pdx_info,
body.single-pdx_property_rent .pdx_info_container > .pdx_info {
    display: grid;
    grid-template-columns: minmax(0, 34%) minmax(0, 1fr);
    gap: 0.5rem 1rem;
    width: 100%;
    margin: 0;
    padding: 0.55rem 0.15rem;
    border-bottom: 1px solid #ededed;
    line-height: 1.45;
}

body.single-pdx_property .pdx_info_container > .pdx_info > label,
body.single-pdx_property_rent .pdx_info_container > .pdx_info > label {
    display: block;
    flex: initial;
    margin: 0;
    padding: 0;
    background: transparent;
    color: #171717;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: none;
}

body.single-pdx_property .pdx_info_container > .pdx_info > span,
body.single-pdx_property_rent .pdx_info_container > .pdx_info > span {
    display: block;
    min-width: 0;
    padding: 0;
    background: transparent;
    color: #282828;
    overflow-wrap: anywhere;
}

/* Keep the trade-bid details readable and styled with the same system. */
body.single-pdx_property .gre-tags,
body.single-pdx_property_rent .gre-tags {
    order: 0;
}

body.single-pdx_property .pdx_info_container a,
body.single-pdx_property_rent .pdx_info_container a {
    color: var(--jya-single-blue);
}

@media (max-width: 640px) {
    body.single-pdx_property .jya-property-contact-form__grid,
    body.single-pdx_property_rent .jya-property-contact-form__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    body.single-pdx_property .jya-property-summary__columns,
    body.single-pdx_property_rent .jya-property-summary__columns {
        grid-template-columns: minmax(0, 1fr);
        gap: 1rem;
    }

    body.single-pdx_property .jya-property-summary__details > div,
    body.single-pdx_property_rent .jya-property-summary__details > div {
        grid-template-columns: minmax(6.5rem, 0.8fr) minmax(0, 1fr);
    }

    body.single-pdx_property .pdx_info_container_seller .pdx_info_estate_agent,
    body.single-pdx_property_rent .pdx_info_container_seller .pdx_info_estate_agent {
        align-items: flex-start;
    }

    body.single-pdx_property .pdx_info_container_seller .pdx_info_estate_agent > img,
    body.single-pdx_property_rent .pdx_info_container_seller .pdx_info_estate_agent > img {
        flex-basis: 5rem;
        width: 5rem;
        max-width: 5rem;
        height: 5rem;
    }


    body.single-pdx_property .pdx_info_container > .pdx_info,
    body.single-pdx_property_rent .pdx_info_container > .pdx_info {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.2rem;
    }
}

@media only screen and (width <= 1240px) {
    .single-pdx_property .gh-plugin-wrapper, .single-pdx_property_rent .gh-plugin-wrapper {
        padding-left: 0;
        padding-right: 0;
    }
}

@media (min-width: 640px) {
.entry-content-wrap {
    padding: 0 0 2rem 0 !important;
}
}

@media (max-width: 640px) {
.entry-content-wrap {
    padding-bottom: 2rem!important;
	padding-top: 0!important;
}
}

.single-content {
    margin-top: 0!important;
}

/* Kuvien nuolet */
body.single-pdx_property #apartment-main-slider .splide__arrows button, body.single-pdx_property_rent #apartment-main-slider .splide__arrows button {
   fill: #FFF !important;
}

#apartment-main-slider .splide__arrows button svg {
    padding-top:5px;
}
