/*
Theme Name: vinttro_child_theme
Theme URI: 
Author: Stephen Collis
Author URI: 
Description: A vinttro theme as a child of "Twenty Twenty-Five"
Requires at least: 6.9
Tested up to: 6.9
Requires PHP: 5.7
Version: 
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Template: twentytwentyfive
Text Domain: vinttro_child_theme
*/

/* ==========================================================================
   1. LOGO STYLING
   ========================================================================== */
.vinttro-logo img {
    width: 160px !important;
    height: auto !important;
}

.vinttro-logo {
    margin-top: -50px !important;
    margin-bottom: 0 !important;
    position: relative;
    z-index: 9999;
    display: flex;
    justify-content: center;
}

.mob-menu-logo-holder {
    padding-top: 12px !important;
    display: flex !important;
    align-items: center !important;
}

.mob-standard-logo {
    height: 30px !important;
    width: auto !important;
    margin-top: 0 !important;
}

/* ==========================================================================
   CAR EXCHANGE RESULTS GRID (Scoped via Body Class)
   ========================================================================== */

/* 1. Target the column containing the cars ONLY on auto-listing pages */
.auto-listings .wp-block-column:has(.auto-listings-items),
.post-type-archive-auto-listing .wp-block-column:has(.auto-listings-items) {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 55px !important;
    width: 100% !important;
}

/* 2. Bridge the gap between the two <ul> tags */
.auto-listings ul.auto-listings-items.grid-view {
    display: contents !important;
}

/* 3. Force the cars to behave as proper grid cells */
.auto-listings .auto-listing.col-3 {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    list-style: none !important;
    display: flex !important;
    flex-direction: column !important;
}

/* 4. Responsive adjustments */
@media (max-width: 1100px) {
    .auto-listings .wp-block-column:has(.auto-listings-items) {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .auto-listings .wp-block-column:has(.auto-listings-items) {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================================================
   DESCRIPTION TRUNCATION (Scoped)
   ========================================================================== */

/* Ensure truncation only hits the car cards */
.auto-listing .description {
    max-height: 120px; 
    overflow: hidden;
    position: relative;
    transition: max-height 0.3s ease-out;
    margin-bottom: 10px;
}

.auto-listings .description:not(.expanded)::after,
.single-auto-listing .description:not(.expanded)::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50px;
    background: linear-gradient(transparent, white);
    pointer-events: none;
}

/* ==========================================================================
   3. LOGO & HEADER TWEAKS
   ========================================================================== */

/* Keep the negative margin logo fix ONLY on the homepage if that's where it's needed, 
   or remove the negative margin if it's breaking headers elsewhere. */
.home .vinttro-logo {
    margin-top: -50px !important;
}

/* If you need it on all pages BUT the exchange, use: */
body:not(.auto-listings):not(.single-auto-listing) .vinttro-logo {
    /* Adjust as needed for standard pages */
}

/* Ensure the main container fix doesn't eat the top of standard pages */
.auto-listings #wp--skip-link--target.wp-block-group,
.single-auto-listing #wp--skip-link--target.wp-block-group {
    margin-top: 0 !important;
    padding-top: 10px !important;
}

/* ==========================================================================
   SINGLE LISTING PAGE REPAIR
   ========================================================================== */

/* 1. Add Page Padding (Breathing room at the edges) */
.single-auto-listing .vinttro-showroom-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px !important; /* Adjust this for more/less side space */
    box-sizing: border-box;
}

/* 2. Rearrange the Layout: Gallery & Sidebar on top, Description Full Width below */
.single-auto-listing .vinttro-main-grid {
    display: grid !important;
    grid-template-columns: 1fr 350px; /* Gallery takes space, Sidebar is 350px */
    gap: 40px;
}

/* This is the secret: treat the inner content-area children as grid items */
.single-auto-listing .vinttro-content-area {
    display: contents !important; 
}

.single-auto-listing .vinttro-gallery-box {
    grid-column: 1;
    grid-row: 1;
}

.single-auto-listing .vinttro-sidebar-area {
    grid-column: 2;
    grid-row: 1;
}

/* Force Description to span both columns (Full Width) */
.single-auto-listing .vinttro-description-text {
    grid-column: 1 / span 2; 
    grid-row: 2;
    margin-top: 20px;
}

/* 3. Restore Image Rounding */
.single-auto-listing .vinttro-gallery-box,
.single-auto-listing .lSSlideWrapper,
.single-auto-listing .lSSlideWrapper img,
.single-auto-listing .lSPager li img {
    border-radius: 20px !important;
    overflow: hidden !important;
}

/* 4. Disable "Show More" and Truncation on this page */
.single-auto-listing .description {
    max-height: none !important;
    overflow: visible !important;
}

.single-auto-listing .description:after {
    display: none !important; /* Remove the white fade effect */
}

.single-auto-listing .show-more-toggle {
    display: none !important; /* Hide the button entirely */
}

/* 5. Responsive: Stack them on mobile */
@media (max-width: 1024px) {
    .single-auto-listing .vinttro-main-grid {
        grid-template-columns: 1fr; /* One column */
    }
    .single-auto-listing .vinttro-sidebar-area,
    .single-auto-listing .vinttro-description-text {
        grid-column: 1;
    }
    .single-auto-listing .vinttro-showroom-container {
        padding: 0 20px !important;
    }
}

/* ==========================================================================
   CAR EXCHANGE GRID CLEANUP
   ========================================================================== */

/* 1. Hide the redundant Make/Model title inside the description */
.auto-listing .description h3:first-of-type {
    display: none !important;
}

/* 2. Hide the "New Vehicle" tag and the "Show More" toggle */
.auto-listing .condition,
.auto-listing .show-more-toggle {
    display: none !important;
}

/* 3. Shrink the Description font size and limit its height */
.auto-listing .description {
    font-size: 0.85rem !important; /* Reduced size */
    line-height: 1.5 !important;
    color: #444;
    max-height: 90px !important; /* Limits the visible text to ~4 lines */
    overflow: hidden;
    margin-bottom: 10px;
}

/* 4. Hide heavy content (lists, tables, quotes, images) in the GRID view */
/* This ensures only the text intro is shown in the card */
.auto-listing .description .detail-title,
.auto-listing .description .detail-text,
.auto-listing .description ul,
.auto-listing .description blockquote,
.auto-listing .description figure,
.auto-listing .description hr {
    display: none !important;
}

/* 5. Remove the "Fade" effect we added earlier since we aren't showing more */
.auto-listing .description:after {
    display: none !important;
}

/* 6. Adjust the Price size to look better with smaller text */
.auto-listing .price {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
    display: block;
}

/* ==========================================================================
   CAR STATUS & PRICE STYLING
   ========================================================================== */

/* 1. Force Price and State onto one line */
.auto-listing .price {
    display: flex !important;
    align-items: center; /* Vertical center */
    flex-wrap: nowrap;   /* Absolute no wrapping */
    gap: 10px;           /* Space between price and state */
    margin-bottom: 12px;
}

/* 2. Strike-through the Price Amount */
/* Only apply line-through if there is a 'state' sibling (optional logic) 
   but for now, we'll target it specifically for unavailable cars */
.auto-listing li:has(.state) .price-amount {
    text-decoration: line-through !important;
    color: #999 !important; /* Dim the price as it's not the active price */
    opacity: 0.7;
}

/* 3. Style the "No Longer Available" text */
.auto-listing .state {
    font-size: 0.7rem !important; /* Much smaller */
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #fff8e1; /* Subtle background to make it look like a status */
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #dd9933;
    white-space: nowrap;
    line-height: 1;
}

/* 4. Ensure the currency symbol is also struck through */
.auto-listing li:has(.state) .currency-symbol {
    text-decoration: line-through;
}
/* 1. Hide Advanced Filter & Wrapper */
.als-toggle, 
.als-toggle-wrapper {
    display: none !important;
}

/* 2. The Search Button (Gold Pill) */
.als-submit {
    background-color: #C5A059 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 50px !important;
    padding: 14px 35px !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%; /* Makes it a prominent pill */
    margin-top: 10px;
}

.als-submit:hover {
    background-color: #b38f4d !important;
    box-shadow: 0 4px 12px rgba(197, 160, 89, 0.3);
}

/* 3. The Reset/Clear Button (Subtle Text) */
.als-reset {
    background: transparent !important;
    border: none !important;
    color: #999 !important;
    text-decoration: underline;
    font-size: 0.8rem !important;
    cursor: pointer;
    padding: 10px !important;
    display: block;
    margin: 0 auto; /* Centers it under the pill */
    text-align: center;
}

.als-reset:hover {
    color: #C5A059 !important;
}

/* 4. SumoSelect Dropdown Styling */
.SumoSelect > .CaptionCont {
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    transition: border-color 0.3s ease;
}

.SumoSelect:focus > .CaptionCont,
.SumoSelect:hover > .CaptionCont {
    border-color: #C5A059 !important;
}