/* ============================================================
 * STOCK FOR SALE - PUBLIC AUTHOR PROFILE (WPADVERTS AUTHORS)
 * ============================================================
 * Scoped to single advert-author pages. Native Ads / Profile / Contact
 * tabs and contact permissions remain under WPAdverts control.
 */

/* The native background strip creates an unnecessary 2px rule above the avatar. */
body.single-advert-author .wpa-author-single .wpa-top-header-bg {
    display: none !important;
}

/* Profile name and avatar: keep the native markup, improve spacing. */
body.single-advert-author article .entry-title {
    margin-bottom: 22px;
    color: #1C1A19;
}
body.single-advert-author .wpa-author-single {
    width: 100%;
    min-width: 0;
}
body.single-advert-author .wpa-author-single .wpa-top-header {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 100px;
    padding: 14px 0;
    border-top: 1px solid #e5e5e5;
    border-bottom: 1px solid #e5e5e5;
}
body.single-advert-author .wpa-author-single .wpa-top-header img.avatar,
body.single-advert-author .wpa-author-single .wpa-top-header img[class*="avatar"] {
    display: block;
    width: 76px !important;
    height: 76px !important;
    max-width: none;
    object-fit: cover;
    border-radius: 50%;
}

/* The native tab links and per-tab functionality are unchanged. */
body.single-advert-author .wpa-author-single ul.wpadverts-authors-menu {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0;
    width: 100%;
    margin: 0 0 26px !important;
    padding: 0 !important;
    border-bottom: 1px solid #e5e5e5;
    list-style: none;
}
body.single-advert-author .wpa-author-single ul.wpadverts-authors-menu > li {
    display: flex;
    align-items: stretch;
    float: none;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}
body.single-advert-author .wpa-author-single ul.wpadverts-authors-menu > li > a {
    position: relative;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 44px;
    height: 100%;
    margin: 0 !important;
    padding: 10px 18px !important;
    border: 0 !important;
    border-bottom: 0 !important;
    background: transparent !important;
    color: #1C1A19 !important;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none !important;
    box-shadow: none !important;
}
body.single-advert-author .wpa-author-single ul.wpadverts-authors-menu > li > a:hover,
body.single-advert-author .wpa-author-single ul.wpadverts-authors-menu > li > a:focus-visible {
    color: #729929 !important;
}
body.single-advert-author .wpa-author-single ul.wpadverts-authors-menu > li.wpadverts-authors-menu-item-active > a,
body.single-advert-author .wpa-author-single ul.wpadverts-authors-menu > li[class*="active"] > a,
body.single-advert-author .wpa-author-single ul.wpadverts-authors-menu > li > a[aria-current="page"] {
    color: #1C1A19 !important;
}
/* One underline anchored to the link bottom; avoids Divi/WPAdverts hover shifts. */
body.single-advert-author .wpa-author-single ul.wpadverts-authors-menu > li > a::after {
    content: '' !important;
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 3px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: #8AB336 !important;
    opacity: 0;
    transform: none !important;
    pointer-events: none;
}
body.single-advert-author .wpa-author-single ul.wpadverts-authors-menu > li > a:hover::after,
body.single-advert-author .wpa-author-single ul.wpadverts-authors-menu > li > a:focus-visible::after,
body.single-advert-author .wpa-author-single ul.wpadverts-authors-menu > li.wpadverts-authors-menu-item-active > a::after,
body.single-advert-author .wpa-author-single ul.wpadverts-authors-menu > li[class*="active"] > a::after,
body.single-advert-author .wpa-author-single ul.wpadverts-authors-menu > li > a[aria-current="page"]::after {
    opacity: 1;
}
body.single-advert-author .wpa-author-single ul.wpadverts-authors-menu > li > a:focus-visible {
    outline: 2px solid #8AB336;
    outline-offset: -2px;
}

/* ============================================================
 * STOCK FOR SALE - AUTHOR'S ADVERTS MATCH THE CATALOGUE GRID
 * ============================================================
 * Authors currently outputs advert-item-col-1 (list mode). Limit these
 * overrides to the public author's Ads tab so Divi/catalogue is untouched.
 */
body.single-advert-author .wpa-author-single .wpa-author-offers .adverts-list:has(> .aacs-sfs-card) {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 20px !important;
    align-items: stretch;
    width: 100%;
}
body.single-advert-author .wpa-author-single .wpa-author-offers .adverts-list > .aacs-sfs-card {
    float: none !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0;
    height: 100%;
    margin: 0 !important;
    padding: 15px !important;
    border: 1px solid #e5e5e5;
    background: #FFFFFF;
}
body.single-advert-author .wpa-author-single .wpa-author-offers .adverts-list > .aacs-sfs-card .aacs-sfs-card__inner {
    display: flex;
    flex-direction: column !important;
    height: 100%;
}
body.single-advert-author .wpa-author-single .wpa-author-offers .adverts-list > .aacs-sfs-card .aacs-sfs-card__media {
    display: block;
    width: 100% !important;
    min-height: 0 !important;
    aspect-ratio: 4 / 3 !important;
    flex: 0 0 auto;
}
body.single-advert-author .wpa-author-single .wpa-author-offers .adverts-list > .aacs-sfs-card .aacs-sfs-card__content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 15px 0 0 !important;
}
body.single-advert-author .wpa-author-single .wpa-author-offers .adverts-list .aacs-sfs-card__title {
    margin: 0 0 12px !important;
    padding: 0 !important;
    font-family: var(--et_global_heading_font, Georgia, serif) !important;
    font-size: clamp(15px, 1.1vw, 19px) !important;
    line-height: 1.3 !important;
    font-weight: 700 !important;
}
body.single-advert-author .wpa-author-single .wpa-author-offers .adverts-list .aacs-sfs-card__title a,
body.single-advert-author .wpa-author-single .wpa-author-offers .adverts-list .aacs-sfs-card__title a:visited {
    color: #1C1A19 !important;
    font-size: inherit !important;
    font-family: inherit !important;
    font-weight: inherit !important;
    text-decoration: none !important;
}
body.single-advert-author .wpa-author-single .wpa-author-offers .adverts-list .aacs-sfs-card__title a:hover {
    color: #8AB336 !important;
}
body.single-advert-author .wpa-author-single .wpa-author-offers .adverts-list .aacs-sfs-card__category,
body.single-advert-author .wpa-author-single .wpa-author-offers .adverts-list .aacs-sfs-card__category > span {
    border-radius: 0 !important;
}

@media (max-width: 1100px) {
    body.single-advert-author .wpa-author-single .wpa-author-offers .adverts-list:has(> .aacs-sfs-card) {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}
@media (max-width: 680px) {
    body.single-advert-author .wpa-author-single .wpa-top-header {
        gap: 12px;
    }
    body.single-advert-author .wpa-author-single .wpa-top-header img.avatar,
    body.single-advert-author .wpa-author-single .wpa-top-header img[class*="avatar"] {
        width: 60px !important;
        height: 60px !important;
    }
    body.single-advert-author .wpa-author-single ul.wpadverts-authors-menu > li > a {
        min-height: 42px;
        padding: 9px 13px !important;
        font-size: 13px;
    }
    body.single-advert-author .wpa-author-single .wpa-author-offers .adverts-list:has(> .aacs-sfs-card) {
        grid-template-columns: minmax(0, 1fr) !important;
    }
    body.single-advert-author .wpa-author-single .wpa-author-offers .adverts-list .aacs-sfs-card__title {
        font-size: 18px !important;
    }
}

/* ============================================================
 * STOCK FOR SALE - AUTHOR ADS: HONOUR WPADVERTS LIST WRAPPERS
 * ============================================================
 * WPAdverts Authors may render its offer list in advert-item-col-1,
 * with or without an adverts-grid-row wrapper. The existing selector
 * using :has(> .aacs-sfs-card) can miss that structure, leaving a long
 * list instead of catalogue cards. Override only public author Ads.
 */
body.single-advert-author .wpa-author-single .wpa-author-offers .adverts-list {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 20px !important;
    align-items: stretch !important;
    width: 100% !important;
    margin: 0 !important;
}
/* Safely flatten an optional WPAdverts row wrapper into the grid. */
body.single-advert-author .wpa-author-single .wpa-author-offers .adverts-list > .adverts-grid-row {
    display: contents !important;
}
body.single-advert-author .wpa-author-single .wpa-author-offers .adverts-list .advert-item.aacs-sfs-card {
    display: flex !important;
    float: none !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 15px !important;
    box-sizing: border-box;
    border: 1px solid #e5e5e5 !important;
    background: #FFFFFF !important;
}
body.single-advert-author .wpa-author-single .wpa-author-offers .adverts-list .aacs-sfs-card__inner {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: 100% !important;
}
body.single-advert-author .wpa-author-single .wpa-author-offers .adverts-list .aacs-sfs-card__media {
    display: block !important;
    width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    aspect-ratio: 4 / 3;
    flex: 0 0 auto !important;
}
body.single-advert-author .wpa-author-single .wpa-author-offers .adverts-list .aacs-sfs-card__content {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    padding: 15px 0 0 !important;
    width: 100% !important;
}
body.single-advert-author .wpa-author-single .wpa-author-offers .adverts-list .aacs-sfs-card__footer {
    margin-top: auto;
}

/* ============================================================
 * STOCK FOR SALE - PUBLIC AUTHOR PROFILE DETAILS
 * ============================================================ */
body.single-advert-author .wpa-author-single .wpa-author-description {
    margin: 20px 0 26px;
    padding: 20px 22px;
    border-left: 3px solid #8AB336;
    background: transparent !important;
    color: #1E1E1E;
    font-size: 15px;
    line-height: 1.65;
}
body.single-advert-author .wpa-author-single .wpa-author-description > :last-child {
    margin-bottom: 0 !important;
}
body.single-advert-author .wpa-author-single .adverts-single-details .adverts-grid-row {
    border-bottom: 1px solid #E9E9E9;
}
body.single-advert-author .wpa-author-single .adverts-single-details .adverts-row-title,
body.single-advert-author .wpa-author-single .adverts-single-details .adverts-row-value {
    color: #1E1E1E;
    font-size: 14px;
}

/* ============================================================
 * STOCK FOR SALE - AUTHOR CONTACT FORM
 * ============================================================
 * Styling only. Fields, nonce, messages, consent and submit flow
 * remain the native WPAdverts Authors form.
 */
body.single-advert-author .wpa-author-single > form.adverts-form-aligned {
    max-width: 840px;
    width: 100%;
    margin: 22px 0 30px;
    padding: 25px;
    border: 1px solid #E5E5E5;
    background: #FFFFFF;
    box-sizing: border-box;
}
body.single-advert-author .wpa-author-single > form.adverts-form-aligned fieldset {
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}
body.single-advert-author .wpa-author-single > form.adverts-form-aligned .adverts-control-group {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 7px;
    clear: both;
    width: 100% !important;
    margin: 0 0 18px !important;
    padding: 0 !important;
    overflow: visible;
}
body.single-advert-author .wpa-author-single > form.adverts-form-aligned .adverts-control-group > label,
body.single-advert-author .wpa-author-single > form.adverts-form-aligned .adverts-control-group > .adverts-control-label {
    display: block !important;
    float: none !important;
    clear: both;
    flex: 0 0 auto;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
    color: #1C1A19 !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    font-weight: 600;
}
body.single-advert-author .wpa-author-single > form.adverts-form-aligned .adverts-controls,
body.single-advert-author .wpa-author-single > form.adverts-form-aligned .adverts-control-group > div {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    margin: 0 !important;
    padding-left: 0 !important;
    box-sizing: border-box;
}
body.single-advert-author .wpa-author-single > form.adverts-form-aligned input[type="text"],
body.single-advert-author .wpa-author-single > form.adverts-form-aligned input[type="email"],
body.single-advert-author .wpa-author-single > form.adverts-form-aligned input[type="tel"],
body.single-advert-author .wpa-author-single > form.adverts-form-aligned textarea {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    border: 1px solid #D8D8D8 !important;
    border-radius: 0 !important;
    background: #FFFFFF !important;
    color: #1E1E1E !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    font-size: 15px !important;
    line-height: 1.5 !important;
    padding: 11px 13px !important;
}
body.single-advert-author .wpa-author-single > form.adverts-form-aligned input[type="text"],
body.single-advert-author .wpa-author-single > form.adverts-form-aligned input[type="email"],
body.single-advert-author .wpa-author-single > form.adverts-form-aligned input[type="tel"] {
    min-height: 44px;
}
body.single-advert-author .wpa-author-single > form.adverts-form-aligned textarea {
    min-height: 150px;
    resize: vertical;
}
body.single-advert-author .wpa-author-single > form.adverts-form-aligned input:focus-visible,
body.single-advert-author .wpa-author-single > form.adverts-form-aligned textarea:focus-visible {
    outline: 2px solid #8AB336 !important;
    outline-offset: 1px;
    border-color: #8AB336 !important;
}
body.single-advert-author .wpa-author-single > form.adverts-form-aligned .adverts-field-actions {
    margin: 8px 0 0 !important;
    padding: 0 !important;
}
body.single-advert-author .wpa-author-single > form.adverts-form-aligned button[type="submit"],
body.single-advert-author .wpa-author-single > form.adverts-form-aligned input[type="submit"] {
    display: inline-block;
    box-sizing: border-box !important;
    -webkit-appearance: none;
    appearance: none;
    height: 46px !important;
    min-height: 46px !important;
    line-height: 44px !important;
    padding: 0 25px !important;
    vertical-align: middle;
    text-align: center !important;
    border: 1px solid #1C1A19 !important;
    border-radius: 0 !important;
    background: #1C1A19 !important;
    color: #FFFFFF !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: background-color 150ms ease, border-color 150ms ease;
}
body.single-advert-author .wpa-author-single > form.adverts-form-aligned button[type="submit"]:hover,
body.single-advert-author .wpa-author-single > form.adverts-form-aligned input[type="submit"]:hover {
    background: #8AB336 !important;
    border-color: #8AB336 !important;
    color: #1C1A19 !important;
}

@media (max-width: 1100px) {
    body.single-advert-author .wpa-author-single .wpa-author-offers .adverts-list {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}
@media (max-width: 680px) {
    body.single-advert-author .wpa-author-single .wpa-author-offers .adverts-list {
        grid-template-columns: minmax(0, 1fr) !important;
    }
    body.single-advert-author .wpa-author-single > form.adverts-form-aligned {
        padding: 16px;
    }
}
@media (prefers-reduced-motion: reduce) {
    body.single-advert-author .wpa-author-single > form.adverts-form-aligned button[type="submit"],
    body.single-advert-author .wpa-author-single > form.adverts-form-aligned input[type="submit"] {
        transition: none;
    }
}

/* ============================================================
 * STOCK FOR SALE - PUBLIC SELLER PROFILE BREADCRUMBS AND ACTIONS
 * ============================================================ */
body.single-advert-author .aacs-sfs-author-nav__breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 24px;
    color: #777777;
    font-size: 13px;
    line-height: 1.5;
}
body.single-advert-author .aacs-sfs-author-nav__breadcrumb a {
    color: #777777 !important;
    text-decoration: none !important;
}
body.single-advert-author .aacs-sfs-author-nav__breadcrumb a:hover,
body.single-advert-author .aacs-sfs-author-nav__breadcrumb a:focus-visible {
    color: #8AB336 !important;
}
body.single-advert-author .aacs-sfs-author-nav__separator {
    color: #777777;
    font-size: 18px;
    line-height: 1;
}
body.single-advert-author .aacs-sfs-author-nav__current {
    color: #777777;
}
body.single-advert-author .aacs-sfs-author-nav__location {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 5px 0 22px !important;
    padding: 0 !important;
    color: #5A5A5A;
    font-size: 14px;
    line-height: 1.5;
}
body.single-advert-author .aacs-sfs-author-nav__icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
}
body.single-advert-author .aacs-sfs-author-nav__icon svg {
    display: block;
    width: 100%;
    height: 100%;
}
body.single-advert-author .aacs-sfs-author-nav__location .aacs-sfs-author-nav__icon {
    color: #8AB336;
}
body.single-advert-author .wpa-author-single .wpa-top-header {
    flex-wrap: wrap;
}
body.single-advert-author .wpa-author-single .wpa-top-header > .aacs-sfs-author-nav__contact {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 44px;
    margin: 0 0 0 auto !important;
    padding: 11px 20px !important;
    border: 1px solid #8AB336 !important;
    border-radius: 0 !important;
    background: #8AB336 !important;
    color: #1C1A19 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    text-align: center;
    text-decoration: none !important;
    white-space: nowrap;
    box-shadow: none !important;
    transition: background-color 150ms ease, color 150ms ease;
}
body.single-advert-author .wpa-author-single .wpa-top-header > .aacs-sfs-author-nav__contact:hover {
    background: #1C1A19 !important;
    border-color: #1C1A19 !important;
    color: #FFFFFF !important;
}
body.single-advert-author .aacs-sfs-author-nav__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    margin: 28px 0 20px;
    padding: 20px 0 0;
    border-top: 1px solid #E5E5E5;
}
body.single-advert-author .aacs-sfs-author-nav__footer a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #1C1A19 !important;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
    text-decoration: none !important;
}
body.single-advert-author .aacs-sfs-author-nav__footer a:hover,
body.single-advert-author .aacs-sfs-author-nav__footer a:focus-visible {
    color: #8AB336 !important;
}
body.single-advert-author .aacs-sfs-author-nav__footer .aacs-sfs-author-nav__all {
    color: #8AB336 !important;
}
body.single-advert-author .aacs-sfs-author-nav__footer .aacs-sfs-author-nav__all:hover {
    color: #1C1A19 !important;
}
body.single-advert-author .aacs-sfs-author-nav__icon--right {
    transform: rotate(180deg);
}
body.single-advert-author .aacs-sfs-author-nav__footer .aacs-sfs-author-nav__icon {
    width: 15px;
    height: 15px;
    color: #8AB336;
}
body.single-advert-author .aacs-sfs-author-nav__breadcrumb a:focus-visible,
body.single-advert-author .aacs-sfs-author-nav__footer a:focus-visible,
body.single-advert-author .wpa-author-single .wpa-top-header > .aacs-sfs-author-nav__contact:focus-visible {
    outline: 2px solid #8AB336;
    outline-offset: 3px;
}
@media (max-width: 680px) {
    body.single-advert-author .aacs-sfs-author-nav__breadcrumb {
        gap: 7px;
        margin-bottom: 18px;
    }
    body.single-advert-author .wpa-author-single .wpa-top-header > .aacs-sfs-author-nav__contact {
        width: 100%;
        margin: 4px 0 0 !important;
    }
    body.single-advert-author .aacs-sfs-author-nav__footer {
        gap: 13px;
    }
}
@media (prefers-reduced-motion: reduce) {
    body.single-advert-author .wpa-author-single .wpa-top-header > .aacs-sfs-author-nav__contact {
        transition: none;
    }
}

/* ============================================================
 * STOCK FOR SALE - COMPACT SELLER HEADER (ONE NAME + LOCATION)
 * ============================================================
 * After the existing H1 moves next to the native avatar, hide the empty
 * Divi title wrapper and the redundant @username. The H1 remains in the
 * document, so this change does not remove the page's semantic heading.
 */
body.single-advert-author article.aacs-sfs-author-nav--compact .aacs-sfs-author-nav__old-title-wrap {
    display: none !important;
}
body.single-advert-author article.aacs-sfs-author-nav--compact .wpa-author-single .wpa-top-header {
    align-items: center;
    gap: 18px;
    min-height: 0;
    padding: 12px 0 16px;
    border-top: 0;
}
body.single-advert-author article.aacs-sfs-author-nav--compact .wpa-author-single .wpa-top-header-data {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-width: 0;
    flex: 1 1 auto;
}
body.single-advert-author article.aacs-sfs-author-nav--compact .wpa-author-single .wpa-top-header-data > h1.entry-title {
    margin: 0 0 5px !important;
    padding: 0 !important;
    color: #1C1A19 !important;
    font-family: var(--et_global_heading_font, Georgia, serif);
    font-size: clamp(26px, 2.4vw, 34px) !important;
    font-weight: 700;
    line-height: 1.15 !important;
    overflow-wrap: anywhere;
}
body.single-advert-author article.aacs-sfs-author-nav--compact .wpa-author-single .wpa-top-header-data .wpa-top-header-contact {
    display: none !important;
}
body.single-advert-author article.aacs-sfs-author-nav--compact .wpa-author-single .wpa-top-header-data > .aacs-sfs-author-nav__location {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 !important;
    color: #5A5A5A;
    font-size: 14px;
    line-height: 1.45;
}
body.single-advert-author article.aacs-sfs-author-nav--compact .aacs-sfs-author-nav__breadcrumb {
    margin-bottom: 17px;
}
@media (max-width: 680px) {
    body.single-advert-author article.aacs-sfs-author-nav--compact .wpa-author-single .wpa-top-header {
        gap: 12px;
    }
    body.single-advert-author article.aacs-sfs-author-nav--compact .wpa-author-single .wpa-top-header-data > h1.entry-title {
        font-size: 26px !important;
    }
}
