/* ============================================================
   LJLearn.com — WPBDP Custom Styles
   File: wpbdp.css
   Location: wp-content/themes/kadence-child/wpbdp.css
   WPBDP loads this automatically on all directory pages.
   ============================================================ */

/* ------------------------------------------------------------
   VARIABLES
   ------------------------------------------------------------ */
:root {
    --ljl-gold:         #d4a017;
    --ljl-gold-light:   #fff8ee;
    --ljl-gold-border:  #d4a017;
    --ljl-gold-text:    #8B4500;
    --ljl-red:          #a52020;
    --ljl-red-hover:    #8B1A1A;
    --ljl-red-light:    #fff0f0;
    --ljl-tag-bg:       #f5f0e8;
    --ljl-tag-color:    #6b4c1e;
    --ljl-tag-border:   #d4b896;
    --ljl-border:       #e0e0e0;
    --ljl-muted:        #555555;
    --ljl-text:         #1a1a1a;
    --ljl-radius:       10px;
}

/* ------------------------------------------------------------
   LISTING CARDS — EXCERPT VIEW
   ------------------------------------------------------------ */
.wpbdp-listing-excerpt {
    background: #ffffff;
    border: 0.5px solid var(--ljl-border);
    border-left: 4px solid var(--ljl-gold);
    border-radius: var(--ljl-radius);
    padding: 1.1rem 1.25rem 1rem;
    margin-bottom: 12px;
    transition: border-left-color 0.2s ease, box-shadow 0.2s ease;
}

.wpbdp-listing-excerpt:hover {
    border-left-color: var(--ljl-red);
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.08);
}



/* ------------------------------------------------------------
   THUMBNAIL IMAGE
   ------------------------------------------------------------ */
.wpbdp-listing-excerpt .wpbdp-excerpt-thumbnail {
    float: left;
    margin: 0 1rem 0.5rem 0;
    border-radius: 8px;
    border: 0.5px solid var(--ljl-border);
    width: 150px;
    height: 150px;
    object-fit: cover;
}

.wpbdp-listing-excerpt .wpbdp-no-thumb {
    float: none;
}

/* ------------------------------------------------------------
   HIDE FIELD LABELS (Listing Title, Listing Category, Website)
   ------------------------------------------------------------ */
.wpbdp-listing-excerpt .field-label {
    display: none;
}

/* ------------------------------------------------------------
   LISTING TITLE FIELD
   ------------------------------------------------------------ */
.wpbdp-listing-excerpt .wpbdp-field-listing_title .value a {
    font-size: 15px;
    font-weight: 500;
    color: var(--ljl-gold);
    text-decoration: underline;
    text-decoration-color: var(--ljl-gold);
    text-underline-offset: 3px;
    line-height: 1.4;
    display: block;
    margin-bottom: 6px;
}
.wpbdp-listing-excerpt .wpbdp-field-listing_title .value a:hover {
    color: var(--ljl-red);
    text-decoration-color: var(--ljl-red);
}
.wpbdp-listing-excerpt .wpbdp-field-listing_title {
    margin-bottom: 0;
}

/* ------------------------------------------------------------
   DESCRIPTION (custom output from excerpt_content.tpl.php)
   ------------------------------------------------------------ */
.ljl-listing-excerpt-desc {
    font-size: 13px;
    color: var(--ljl-muted);
    line-height: 1.65;
    margin: 6px 0 12px;
}

/* ------------------------------------------------------------
   CATEGORY TAGS
   ------------------------------------------------------------ */
.wpbdp-listing-excerpt .wpbdp-field-listing_category {
    margin-bottom: 10px;
}

.wpbdp-listing-excerpt .wpbdp-field-listing_category .value {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.wpbdp-listing-excerpt .wpbdp-field-listing_category .value a {
    font-size: 11px;
    background: var(--ljl-tag-bg);
    color: var(--ljl-tag-color);
    border: 0.5px solid var(--ljl-tag-border);
    border-radius: 20px;
    padding: 2px 10px;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s;
}

.wpbdp-listing-excerpt .wpbdp-field-listing_category .value a:first-child {
    background: var(--ljl-gold-light);
    color: var(--ljl-gold-text);
    border-color: var(--ljl-gold-border);
    font-weight: 500;
}

.wpbdp-listing-excerpt .wpbdp-field-listing_category .value a:hover {
    background: var(--ljl-red-light);
    color: var(--ljl-red);
    border-color: var(--ljl-red);
}

/* ------------------------------------------------------------
   WEBSITE FIELD — rendered as a button
   ------------------------------------------------------------ */
.wpbdp-listing-excerpt .wpbdp-field-website {
    margin-top: 10px;
}

.wpbdp-listing-excerpt .wpbdp-field-website .value a {
    display: inline-block;
    font-size: 12px;
    font-weight: 500;
    color: #ffffff;
    background: var(--ljl-red);
    border-radius: 20px;
    padding: 5px 16px;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s;
}

.wpbdp-listing-excerpt .wpbdp-field-website .value a:hover {
    background: var(--ljl-red-hover);
}

/* Hide the raw URL text, show only the button */
.wpbdp-listing-excerpt .wpbdp-field-website .value a[title]::after {
    content: "Visit Resource";
}

.wpbdp-listing-excerpt .wpbdp-field-website .value a {
    font-size: 0;
}

.wpbdp-listing-excerpt .wpbdp-field-website .value a::after {
    content: "Visit Resource";
    font-size: 12px;
}

/* ------------------------------------------------------------
   LISTING FOOTER — layout for tags + button row
   ------------------------------------------------------------ */
.wpbdp-listing-excerpt .listing-details {
    overflow: hidden;
}

/* ------------------------------------------------------------
   HIDE ADMIN BUTTONS FROM PUBLIC VIEW
   Non-admins should not see Edit / Flag / Delete
   Note: also add current_user_can() check in excerpt.tpl.php
   for full security — CSS alone is not sufficient.
   ------------------------------------------------------------ */
body:not(.logged-in) .wpbdp-listing-excerpt .listing-actions {
    display: none;
}

body.logged-in:not(.role-administrator) .wpbdp-listing-excerpt .listing-actions .edit-listing,
body.logged-in:not(.role-administrator) .wpbdp-listing-excerpt .listing-actions .delete-listing {
    display: none;
}

/* ------------------------------------------------------------
   CATEGORY PAGE HEADER (SFR Directory Category Display)
   ------------------------------------------------------------ */
.sfr-category-header {
    margin-bottom: 1.5rem;
}

/* ------------------------------------------------------------
   PAGINATION
   ------------------------------------------------------------ */
.wpbdp-pagination {
    margin-top: 1.5rem;
    text-align: center;
}

.wpbdp-pagination a,
.wpbdp-pagination span {
    display: inline-block;
    padding: 5px 12px;
    margin: 0 2px;
    border-radius: 6px;
    font-size: 13px;
    border: 0.5px solid rgba(255,255,255,0.2);
    text-decoration: none;
    color: #ffffff;
    background: rgba(255,255,255,0.05);
}

.wpbdp-pagination a:hover {
    background: var(--ljl-gold-light);
    border-color: var(--ljl-gold);
    color: var(--ljl-gold-text);
}

.wpbdp-pagination .current {
    background: var(--ljl-red);
    border-color: var(--ljl-red);
    color: #ffffff;
    font-weight: 500;
}

/* ------------------------------------------------------------
   SINGLE LISTING PAGE
   ------------------------------------------------------------ */
.wpbdp-listing-single .field-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--ljl-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 3px;
}

.wpbdp-listing-single .wpbdp-field {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 0.5px solid var(--ljl-border);
}

.wpbdp-listing-single .wpbdp-field:last-child {
    border-bottom: none;
}

.wpbdp-listing-single .wpbdp-field-website .value a {
    display: inline-block;
    font-size: 13px;
    font-weight: 500;
    color: #ffffff;
    background: var(--ljl-red);
    border-radius: 20px;
    padding: 6px 20px;
    text-decoration: none;
    transition: background 0.15s;
}

.wpbdp-listing-single .wpbdp-field-website .value a:hover {
    background: var(--ljl-red-hover);
}

/* ------------------------------------------------------------
   CLEARFIX
   ------------------------------------------------------------ */
.wpbdp-listing-excerpt::after {
    content: "";
    display: table;
    clear: both;
}


.ljl-listing-read-more {
    margin-top: 4px;
}

.ljl-listing-read-more a {
    font-size: 11px;
    color: var(--ljl-gold);
    text-decoration: none;
    opacity: 0.8;
}

.ljl-listing-read-more a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ------------------------------------------------------------
   SINGLE LISTING PAGE
   ------------------------------------------------------------ */
.wpbdp-listing-single .listing-title,
.wpbdp-listing-single h1 {
    color: var(--ljl-text);
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 1rem;
}

.ljl-single-card {
    background: #ffffff;
    border-radius: 12px;
    border-left: 4px solid var(--ljl-gold);
    padding: 2rem;
    max-width: 720px;
    margin: 0 auto;
}

.ljl-single-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 1.25rem;
}

.ljl-single-tags a {
    font-size: 11px;
    background: var(--ljl-tag-bg);
    color: var(--ljl-tag-color);
    border: 0.5px solid var(--ljl-tag-border);
    border-radius: 20px;
    padding: 2px 10px;
    text-decoration: none;
}

.ljl-single-tags a:first-child {
    background: var(--ljl-gold-light);
    color: var(--ljl-gold-text);
    border-color: var(--ljl-gold);
    font-weight: 500;
}

.ljl-single-divider {
    border: none;
    border-top: 0.5px solid var(--ljl-border);
    margin: 0 0 1.5rem;
}

.ljl-single-desc {
    font-size: 15px;
    color: var(--ljl-text);
    line-height: 1.75;
    margin-bottom: 1.75rem;
}

.ljl-single-cta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.ljl-single-btn {
    display: inline-block;
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    background: var(--ljl-red);
    border-radius: 25px;
    padding: 10px 28px;
    text-decoration: none;
    transition: background 0.15s;
}

.ljl-single-btn:hover {
    background: var(--ljl-red-hover);
}

.ljl-single-url {
    font-size: 12px;
    color: var(--ljl-muted);
    word-break: break-all;
}

/* Return to Resources link */
.wpbdp-listing-single .listing-actions .wpbdp-return-link {
    font-size: 12px;
    color: var(--ljl-gold);
    text-decoration: none;
    opacity: 0.85;
}

.wpbdp-listing-single .listing-actions .wpbdp-return-link:hover {
    opacity: 1;
}


</style>
