/*
 * Projects archive (archive-project.php) styles.
 * Scoped to .pl-pa root; enqueued only on is_post_type_archive('project').
 */

.pl-pa {
    --pl-teal:        #40A3A1;
    --pl-teal-dark:   #2d7a78;
    --pl-ember:       #D16D32;
    --pl-ember-dark:  #b85d2a;
    --pl-bone-50:     #fbfaf6;
    --pl-bone-100:    #f5f2ea;
    --pl-neutral-50:  #f6f6f5;
    --pl-neutral-100: #e5e5e3;
    --pl-neutral-200: #d6d6d2;
    --pl-neutral-400: #9d9d9b;
    --pl-neutral-500: #757572;
    --pl-neutral-600: #616160;
    --pl-neutral-700: #4a4a48;
    --pl-neutral-800: #2b2b2a;
    --pl-neutral-900: #1a1a1a;

    background: var(--pl-bone-50);
    color: var(--pl-neutral-900);
    font-family: 'Cabin', sans-serif;
    -webkit-font-smoothing: antialiased;
}
.pl-pa a { color: inherit; }
.pl-pa button { font-family: inherit; }

/* ---------- Containers ---------- */
.pl-pa-container {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
}
.pl-pa-container-narrow { max-width: 896px; }

/* ---------- Breadcrumb ---------- */
.pl-pa-breadcrumb {
    background: var(--pl-bone-50);
    border-bottom: 1px solid var(--pl-neutral-100);
    font-size: 12px;
    color: var(--pl-neutral-600);
}
.pl-pa-breadcrumb .pl-pa-container {
    padding-top: 12px;
    padding-bottom: 12px;
    display: flex;
    gap: 8px;
    align-items: center;
}
.pl-pa-breadcrumb a { text-decoration: none; transition: color 0.15s ease; }
.pl-pa-breadcrumb a:hover { color: var(--pl-teal); }
.pl-pa-breadcrumb-sep { opacity: 0.4; }
.pl-pa-breadcrumb-current { color: var(--pl-neutral-900); font-weight: 500; }

/* ---------- Hero ---------- */
.pl-pa-hero {
    background: var(--pl-bone-50);
    padding: 64px 0;
    border-bottom: 1px solid var(--pl-neutral-100);
    text-align: center;
}
@media (min-width: 1024px) { .pl-pa-hero { padding: 80px 0; } }
.pl-pa-hero-eyebrow {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--pl-teal);
}
.pl-pa-hero-title {
    margin: 16px auto 0;
    max-width: 720px;
    font-size: 36px;
    line-height: 1.05;
    font-weight: 600;
    color: var(--pl-neutral-900);
}
@media (min-width: 640px)  { .pl-pa-hero-title { font-size: 48px; } }
@media (min-width: 1024px) { .pl-pa-hero-title { font-size: 60px; } }
.pl-pa-hero-accent { color: var(--pl-teal); }
.pl-pa-hero-sub {
    margin: 20px auto 0;
    max-width: 640px;
    font-size: 18px;
    line-height: 1.55;
    color: var(--pl-neutral-600);
}
.pl-pa-hero-stats {
    list-style: none;
    margin: 40px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 16px 40px;
    color: var(--pl-neutral-600);
    font-size: 14px;
}
.pl-pa-hero-stats li {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    position: relative;
}
.pl-pa-hero-stats li + li::before {
    content: '';
    display: inline-block;
    width: 1px;
    height: 24px;
    background: var(--pl-neutral-200);
    margin-right: 24px;
    margin-left: -32px;
    align-self: center;
}
.pl-pa-hero-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--pl-neutral-900);
}

/* ---------- Featured anchor ---------- */
.pl-pa-featured-section {
    padding: 64px 0;
    background: var(--pl-bone-50);
}
.pl-pa-section-header { margin-bottom: 24px; }
.pl-pa-section-title {
    margin: 4px 0 0;
    font-size: 24px;
    font-weight: 600;
    color: var(--pl-neutral-900);
}
.pl-pa-eyebrow {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.18em;
}
.pl-pa-eyebrow-teal { color: var(--pl-teal); }

.pl-pa-featured-card {
    display: block;
    text-decoration: none;
    background: #fff;
    border: 1px solid var(--pl-neutral-100);
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 4px 12px -4px rgba(0,0,0,0.06);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.pl-pa-featured-card:hover { border-color: var(--pl-teal); box-shadow: 0 8px 20px rgba(0,0,0,0.06); }

.pl-pa-featured-card {
    display: grid;
    grid-template-columns: 1fr;
}
@media (min-width: 768px) {
    .pl-pa-featured-card {
        grid-template-columns: 1fr 1fr;
    }
}

.pl-pa-featured-cover {
    position: relative;
    aspect-ratio: 16 / 10;
    background: var(--pl-neutral-800);
    overflow: hidden;
}
.pl-pa-featured-cover img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
    display: block;
}
.pl-pa-featured-card:hover .pl-pa-featured-cover img {
    transform: scale(1.05);
}
.pl-pa-featured-flag {
    position: absolute;
    top: 16px;
    left: 16px;
    background: var(--pl-teal);
    color: #fff;
    padding: 4px 8px;
    border-radius: 2px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.18em;
}
.pl-pa-featured-body {
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
@media (min-width: 1024px) { .pl-pa-featured-body { padding: 40px; } }
.pl-pa-featured-name {
    margin: 12px 0 0;
    font-size: 24px;
    line-height: 1.2;
    font-weight: 600;
    color: var(--pl-neutral-900);
    transition: color 0.15s ease;
}
@media (min-width: 1024px) { .pl-pa-featured-name { font-size: 30px; } }
.pl-pa-featured-card:hover .pl-pa-featured-name { color: var(--pl-teal); }
.pl-pa-featured-sub {
    margin: 16px 0 0;
    color: var(--pl-neutral-600);
    line-height: 1.55;
}
.pl-pa-featured-cta {
    margin-top: 32px;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    background: var(--pl-teal);
    color: #fff;
    padding: 10px 20px;
    border-radius: 2px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 12px -4px rgba(0,0,0,0.18);
    transition: background 0.15s ease;
}
.pl-pa-featured-card:hover .pl-pa-featured-cta { background: var(--pl-ember-dark); }

/* ---------- Filters ---------- */
.pl-pa-filters {
    padding: 16px 0;
    background: rgba(245, 242, 234, 0.92);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--pl-neutral-100);
    border-bottom: 1px solid var(--pl-neutral-100);
    position: sticky;
    top: 80px; /* below the sticky site header, matching .pl-kc-filter */
    z-index: 30;
    scroll-margin-top: 0;
}
body.admin-bar .pl-pa-filters { top: 112px; }
@media screen and (max-width: 782px) {
    body.admin-bar .pl-pa-filters { top: 126px; }
}

.pl-pa-filters-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 24px;
}
.pl-pa-filter-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.pl-pa-filter-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--pl-neutral-600);
    margin-right: 4px;
}
.pl-pa-filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.pl-pa-filter-pill {
    background: #fff;
    border: 1px solid var(--pl-neutral-200);
    color: var(--pl-neutral-700);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
/* Explicit hover/focus surface: Hello Elementor reset.css paints bare
   <button> hover/focus pink (#CC3366) and white text; out-specificity it. */
.pl-pa-filter-pill:hover,
.pl-pa-filter-pill:focus,
.pl-pa-filter-pill:active {
    border-color: var(--pl-neutral-900);
    background: #fff;
    color: var(--pl-neutral-700);
}
.pl-pa-filter-pill.is-active {
    background: var(--pl-neutral-900);
    color: var(--pl-bone-50);
    border-color: var(--pl-neutral-900);
}
.pl-pa-filter-group--search {
    margin-left: auto;
    flex: 1 1 240px;
    min-width: 240px;
}
input.pl-pa-search-input {
    width: 100%;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23707070' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='16.5' y1='16.5' x2='21' y2='21'/%3E%3C/svg%3E") no-repeat 10px center;
    border: 1px solid var(--pl-neutral-200);
    color: var(--pl-neutral-900);
    padding: 6px 12px 6px 32px;
    border-radius: 0;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    transition: border-color 0.15s ease;
}
input.pl-pa-search-input:focus {
    outline: none;
    border-color: var(--pl-neutral-900);
}
input.pl-pa-search-input::placeholder { color: var(--pl-neutral-600); opacity: 1; }
@media (max-width: 767px) {
    .pl-pa-filter-group--search { margin-left: 0; width: 100%; }
    input.pl-pa-search-input { width: 100%; }
}
/* ---------- Grid ---------- */
.pl-pa-grid-section { padding: 48px 0 80px; background: var(--pl-bone-50); }
.pl-pa-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}
@media (min-width: 640px)  { .pl-pa-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .pl-pa-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Cards flex-column + stretch (grid default) so every card fills its row
   height; the body grows and the CTA is pinned to the bottom (margin-top:
   auto). Eyebrow/title/description reserve consistent heights so the whole
   row lines up element-for-element regardless of copy length. */
.pl-pa-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    background: #fff;
    border: 1px solid var(--pl-neutral-100);
    border-radius: 2px;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.pl-pa-card:hover { border-color: var(--pl-teal); box-shadow: 0 8px 20px rgba(0,0,0,0.06); }
.pl-pa-card-cover {
    aspect-ratio: 4 / 3;
    background: var(--pl-neutral-800);
    overflow: hidden;
    flex: 0 0 auto;
}
.pl-pa-card-cover img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transition: transform 0.5s ease;
}
.pl-pa-card:hover .pl-pa-card-cover img { transform: scale(1.05); }
.pl-pa-card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}
.pl-pa-card-eyebrow {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--pl-teal);
    font-weight: 600;
    line-height: 1.4;
    /* allow up to two lines (long crop+app+location combos keep the full
       location) but reserve the height so every title shares a baseline */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    min-height: calc(1.4em * 2);
}
.pl-pa-card-name {
    margin-top: 4px;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--pl-neutral-900);
    transition: color 0.15s ease;
    /* cap at two lines for the rare long name; no reserved height so a
       one-line title sits right above its description (no dead space) */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}
.pl-pa-card:hover .pl-pa-card-name { color: var(--pl-teal); }
.pl-pa-card-sub {
    margin: 8px 0 0;
    font-size: 14px;
    color: var(--pl-neutral-600);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    /* reserve three lines so the CTA sits at a consistent height */
    min-height: calc(1.55em * 3);
}
.pl-pa-card-cta {
    margin-top: auto;
    padding-top: 16px;
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--pl-teal);
}
.pl-pa-card:hover .pl-pa-card-cta { color: var(--pl-teal-dark); }

/* ---------- Empty state ---------- */
.pl-pa-empty {
    padding: 64px 24px;
    text-align: center;
    color: var(--pl-neutral-600);
}
.pl-pa-empty-title { font-weight: 600; font-size: 18px; color: var(--pl-neutral-900); }
.pl-pa-empty-sub a { color: var(--pl-teal); font-weight: 600; }
.pl-pa-empty-sub a:hover { color: var(--pl-teal-dark); }

/* ---------- Bottom CTA ---------- */
.pl-pa-cta-section {
    position: relative;
    padding: 80px 0;
    background: var(--pl-neutral-800);
    color: var(--pl-bone-50);
    overflow: hidden;
    isolation: isolate;
}
.pl-pa-cta-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(26,26,26,0.85), rgba(26,26,26,0.35));
    z-index: -1;
}
.pl-pa-cta-content {
    max-width: 1024px;
    position: relative;
    text-align: center;
}
.pl-pa-cta-heading {
    margin: 0 auto;
    max-width: 720px;
    font-size: 30px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--pl-bone-50);
}
@media (min-width: 640px) { .pl-pa-cta-heading { font-size: 36px; } }
.pl-pa-cta-sub {
    margin: 16px auto 0;
    max-width: 640px;
    font-size: 18px;
    line-height: 1.55;
    color: rgba(245,242,234,0.85);
}
.pl-pa-cta-actions {
    margin-top: 32px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 16px;
}
.pl-pa-cta-btn {
    display: inline-flex;
    align-items: center;
    padding: 16px 28px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 2px;
    transition: background 0.15s ease, color 0.15s ease;
}
.pl-pa-cta-btn-primary { background: var(--pl-teal); color: #fff; }
.pl-pa-cta-btn-primary:hover { background: var(--pl-ember-dark); }
.pl-pa-cta-btn-ghost {
    padding: 16px 8px;
    color: var(--pl-bone-50);
    text-decoration: underline;
    text-decoration-color: rgba(245,242,234,0.4);
    text-underline-offset: 4px;
    text-decoration-thickness: 1px;
}
.pl-pa-cta-btn-ghost:hover {
    color: #5dc5c3;
    text-decoration-color: #5dc5c3;
}

/* ---------- Reveal animation ---------- */
.pl-pa-reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.7s cubic-bezier(0.2,0.7,0.3,1),
                transform 0.7s cubic-bezier(0.2,0.7,0.3,1);
    transition-delay: var(--reveal-delay, 0ms);
}
.pl-pa-reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .pl-pa-reveal, .pl-pa-reveal.is-visible {
        opacity: 1; transform: none; transition: none;
    }
}


/* ---------- Grid count (above grid, shows when filtering active) ---------- */
.pl-pa-grid-count {
    margin: 0 0 16px;
    font-size: 12px;
    color: var(--pl-neutral-600);
}
.pl-pa-grid-count strong { color: var(--pl-neutral-900); font-weight: 700; }

/* ---------- Load more ---------- */
.pl-pa-loadmore-wrap {
    margin-top: 48px;
    display: flex;
    justify-content: center;
}
.pl-pa-loadmore {
    display: inline-flex;
    align-items: center;
    padding: 16px 32px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: var(--pl-teal);
    border: none;
    border-radius: 2px;
    cursor: pointer;
    transition: background 0.15s ease;
}
.pl-pa-loadmore:hover { background: var(--pl-ember-dark); }
.pl-pa-loadmore:disabled { opacity: 0.6; cursor: default; }
.pl-pa-loadmore[hidden] { display: none; }

/* ---------- Elementor-page integration (shortcode band) ----------
   The archive chrome (hero / CTA) is built in Elementor; the dynamic part
   is the [pl_projects_archive] shortcode. The shortcode's Elementor section
   is full-width (so the sticky filter bar bleeds edge to edge) and
   .pl-pa-container re-boxes the content to the 1280 grid. */

/* On desktop, match the 10px column inset Elementor's boxed sections give
   their content so the featured card + grid sit on the same left edge as
   the boxed sections above/below. Mobile keeps 24px (matches Elementor's
   section padding inset at narrow widths). */
@media (min-width: 1281px) {
    .pl-pa-container { padding-left: 10px; padding-right: 10px; }
}
.pl-pa-grid-count[hidden] { display: none; }
