/**
 * Item Showcase Plugin Styles
 * Based on ACE Team Design
 */

:root {
    --ace-red: #8b1e1e;
    --ace-red-light: #b02a2a;
    --ace-red-bg: #fff5f5;
    --ink: #1a1a1a;
    --muted: #666;
}

/* ===============================
   Container & Layout
   =============================== */

.item-showcase-archive,
.item-showcase-single {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif;
    padding: 24px 0 56px;
}

.showcase-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===============================
   Archive Header
   =============================== */

.archive-header {
    margin-bottom: 32px;
}

.archive-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--ace-red);
    margin: 8px 0 6px;
}

.archive-description {
    color: var(--muted);
    margin: 0 0 20px;
    font-size: 14px;
}

/* Category Filter */
.category-filter {
    margin: 16px 0 24px;
}

.category-filter label {
    font-size: 14px;
    color: var(--ink);
    font-weight: 600;
    margin-right: 10px;
}

.category-filter select {
    padding: 8px 12px;
    border: 1px solid #e3caca;
    background: #fffafa;
    font-size: 14px;
    color: var(--ink);
    cursor: pointer;
    min-width: 200px;
}

.category-filter select:focus {
    outline: none;
    border-color: var(--ace-red);
    box-shadow: 0 0 0 3px rgba(139, 30, 30, 0.12);
}

/* ===============================
   Grid Layout
   =============================== */

.item-showcase-grid {
    display: grid;
    gap: 24px;
    margin-bottom: 32px;
}

@media (min-width: 1024px) {
    .item-showcase-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 640px) and (max-width: 1023px) {
    .item-showcase-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 639px) {
    .item-showcase-grid {
        grid-template-columns: 1fr;
    }
}

/* ===============================
   Team Member Cards
   =============================== */

.team-card {
    background: #fff;
    padding: 18px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.07);
    border: 1px solid #f2dddd;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    overflow: hidden;
}

.team-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(139, 30, 30, 0.18);
    border-color: #e3caca;
}

.team-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.team-card-image {
    margin-bottom: 14px;
    overflow: hidden;
    position: relative;
    background: #f7e9e9;
    height: 280px;
}

.team-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: transform 0.4s ease;
}

.team-card:hover .team-avatar {
    transform: scale(1.05);
}

.team-avatar-fallback {
    width: 100%;
    height: 280px;
    display: grid;
    place-items: center;
    background: var(--ace-red-bg);
    color: var(--ace-red);
    font-weight: 700;
    font-size: 22px;
}

.team-card-content {
    display: grid;
    gap: 8px;
}

.team-role {
    margin: 0;
    color: var(--ace-red);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: color 0.2s ease;
}

.team-card:hover .team-role {
    color: var(--ace-red-light);
}

.team-name {
    margin: 0;
    color: var(--ink);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    transition: color 0.2s ease;
}

.team-card:hover .team-name {
    color: var(--ace-red);
}

.team-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 4px 0;
}

.team-category-tag {
    display: inline-block;
    font-size: 12px;
    color: #444;
    background: #f6f6f6;
    padding: 4px 10px;
    transition: background 0.2s ease, color 0.2s ease;
}

.team-card:hover .team-category-tag {
    background: var(--ace-red-bg);
    color: var(--ace-red);
}

.team-bio {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.team-social {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: var(--ace-red);
    background: var(--ace-red-bg);
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
    text-decoration: none;
    border-radius: 4px;
}

.social-icon:hover {
    background: var(--ace-red);
    color: #fff;
    transform: translateY(-2px);
}

.social-icon svg {
    width: 18px;
    height: 18px;
}

/* ===============================
   General Listing Cards
   =============================== */

.listing-card {
    background: #fff;
    padding: 18px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.07);
    border: 1px solid #f2dddd;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.listing-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(139, 30, 30, 0.15);
}

.listing-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.listing-card-image {
    margin-bottom: 12px;
}

.listing-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: #f7e9e9;
    display: block;
}

.listing-card-content {
    display: grid;
    gap: 8px;
}

.listing-date {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.listing-title {
    margin: 0;
    color: var(--ink);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
}

.listing-subtitle {
    margin: 0;
    color: var(--ace-red);
    font-size: 13px;
    font-weight: 600;
}

.listing-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 4px 0;
}

.listing-category-tag {
    display: inline-block;
    font-size: 12px;
    color: #444;
    background: #f6f6f6;
    padding: 4px 10px;
}

.listing-excerpt {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.listing-external-link {
    color: var(--ace-red);
    font-size: 13px;
    font-weight: 600;
    margin-top: 4px;
}

/* ===============================
   Pagination
   =============================== */

.showcase-pagination {
    margin-top: 48px;
    text-align: center;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.page-numbers {
    display: inline-block;
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #e3caca;
    color: var(--ink);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease;
}

.page-numbers:hover {
    background: var(--ace-red-bg);
    color: var(--ace-red);
}

.page-numbers.current {
    background: var(--ace-red);
    color: #fff;
    border-color: var(--ace-red);
}

.page-numbers.dots {
    border: none;
    background: transparent;
    cursor: default;
}

/* ===============================
   Single Item Pages
   =============================== */

.single-content {
    max-width: 900px;
    margin: 0 auto;
}

.single-header {
    margin-bottom: 32px;
}

.back-link {
    display: inline-block;
    color: var(--ace-red);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 24px;
    transition: opacity 0.2s ease;
}

.back-link:hover {
    opacity: 0.7;
}

/* Single Team Member - Compact Layout */
.single-team-header-compact {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 800px;
}

@media (min-width: 768px) {
    .single-team-header-compact {
        flex-direction: row;
        gap: 24px;
        align-items: flex-end;
    }
}

.single-team-photo {
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .single-team-photo {
        width: 180px;
    }
}

@media (max-width: 767px) {
    .single-team-photo {
        width: 140px;
        margin: 0 auto;
    }
}

.single-avatar-compact {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    background: #f7e9e9;
    display: block;
}

.single-avatar-fallback-compact {
    width: 100%;
    aspect-ratio: 3 / 4;
    display: grid;
    place-items: center;
    background: var(--ace-red-bg);
    color: var(--ace-red);
    font-weight: 700;
    font-size: 32px;
}

.single-team-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.single-title-compact {
    font-size: 22px;
    font-weight: 800;
    color: var(--ink);
    margin: 0;
    line-height: 1.2;
}

.single-position-compact {
    font-size: 14px;
    font-weight: 600;
    color: var(--ace-red);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.single-categories-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0;
}

.single-category-tag-compact {
    display: inline-block;
    font-size: 11px;
    color: #444;
    background: #f6f6f6;
    padding: 4px 10px;
}

.single-contact-compact {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 8px 0;
}

.contact-link {
    color: var(--ace-red);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    display: inline-block;
}

.contact-link:hover {
    text-decoration: underline;
}

.single-social-compact {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.social-icon-compact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--ace-red);
    background: var(--ace-red-bg);
    transition: background 0.2s ease, color 0.2s ease;
    text-decoration: none;
}

.social-icon-compact:hover {
    background: var(--ace-red);
    color: #fff;
}

.social-icon-compact svg {
    width: 18px;
    height: 18px;
}

/* Single Team Member - Legacy Layout (kept for backwards compatibility) */
.single-team-header {
    display: grid;
    gap: 32px;
}

@media (min-width: 768px) {
    .single-team-header {
        grid-template-columns: 300px 1fr;
    }
}

.single-team-image {
    width: 100%;
}

.single-avatar {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    background: #f7e9e9;
}

.single-avatar-fallback {
    width: 100%;
    aspect-ratio: 3 / 4;
    display: grid;
    place-items: center;
    background: var(--ace-red-bg);
    color: var(--ace-red);
    font-weight: 700;
    font-size: 48px;
}

.single-team-info {
    display: grid;
    gap: 16px;
    align-content: start;
}

.single-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--ink);
    margin: 0;
    line-height: 1.2;
}

.single-position {
    font-size: 18px;
    font-weight: 600;
    color: var(--ace-red);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.single-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.single-category-tag {
    display: inline-block;
    font-size: 13px;
    color: #444;
    background: #f6f6f6;
    padding: 6px 14px;
}

.single-contact-info {
    display: grid;
    gap: 10px;
    margin: 12px 0;
}

.contact-item {
    font-size: 14px;
}

.contact-label {
    color: var(--muted);
    font-weight: 600;
    margin-right: 8px;
}

.contact-item a {
    color: var(--ace-red);
    text-decoration: none;
    font-weight: 600;
}

.contact-item a:hover {
    text-decoration: underline;
}

.single-social {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.social-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
}

.social-links {
    display: flex;
    gap: 10px;
}

.single-social .social-icon {
    width: 40px;
    height: 40px;
}

.single-social .social-icon svg {
    width: 20px;
    height: 20px;
}

/* Single Listing */
.single-listing-header {
    display: grid;
    gap: 24px;
}

.single-listing-image {
    width: 100%;
}

.single-listing-image img {
    width: 100%;
    height: auto;
    display: block;
}

.single-listing-info {
    display: grid;
    gap: 12px;
}

.single-date {
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    margin: 0;
}

.single-subtitle {
    font-size: 18px;
    font-weight: 600;
    color: var(--ace-red);
    margin: 0;
}

.single-external-link {
    margin-top: 8px;
}

.external-link-button {
    display: inline-block;
    padding: 12px 24px;
    background: var(--ace-red);
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.external-link-button:hover {
    background: var(--ace-red-light);
}

/* Single Body Content */
.single-body {
    margin-top: 32px;
    font-size: 16px;
    line-height: 1.7;
    color: var(--ink);
}

.single-body p {
    margin: 0 0 16px;
}

.single-body h2,
.single-body h3,
.single-body h4 {
    color: var(--ink);
    font-weight: 700;
    margin: 24px 0 12px;
}

.single-body h2 {
    font-size: 24px;
}

.single-body h3 {
    font-size: 20px;
}

.single-body h4 {
    font-size: 18px;
}

.single-body a {
    color: var(--ace-red);
    text-decoration: underline;
}

.single-body a:hover {
    color: var(--ace-red-light);
}

.single-body ul,
.single-body ol {
    margin: 16px 0;
    padding-left: 24px;
}

.single-body li {
    margin-bottom: 8px;
}

.single-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 24px 0;
}

/* ===============================
   Category Groups (Shortcode)
   =============================== */

.showcase-category-group {
    margin-bottom: 40px;
}

.showcase-category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.showcase-category-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--ink);
    margin: 0;
}

.showcase-category-count {
    font-size: 11px;
    font-weight: 700;
    color: var(--ace-red);
    background: var(--ace-red-bg);
    padding: 4px 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ===============================
   Search Toolbar (Shortcode)
   =============================== */

.showcase-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin: 0 0 24px;
    padding: 16px;
    background: #fffafa;
    border: 1px solid #f2dddd;
}

.showcase-search-input {
    flex: 1 1 320px;
    max-width: 520px;
    padding: 10px 14px;
    border: 1px solid #e3caca;
    font-size: 14px;
    outline: none;
    background: #fff;
    font-family: inherit;
}

.showcase-search-input:focus {
    border-color: var(--ace-red);
    box-shadow: 0 0 0 3px rgba(139, 30, 30, 0.12);
}

.showcase-category-filter {
    padding: 10px 14px;
    border: 1px solid #e3caca;
    background: #fff;
    font-size: 14px;
    color: var(--ink);
    cursor: pointer;
    min-width: 200px;
    font-family: inherit;
}

.showcase-category-filter:focus {
    outline: none;
    border-color: var(--ace-red);
    box-shadow: 0 0 0 3px rgba(139, 30, 30, 0.12);
}

.showcase-count {
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
    white-space: nowrap;
}

.showcase-empty-message {
    text-align: center;
    padding: 32px 20px;
    color: var(--muted);
    font-size: 14px;
    margin: 24px 0;
}

/* ===============================
   Empty States
   =============================== */

.no-items-found {
    text-align: center;
    padding: 48px 20px;
    color: var(--muted);
    font-size: 16px;
}

/* ===============================
   Responsive Adjustments
   =============================== */

@media (max-width: 768px) {
    .archive-title {
        font-size: 22px;
    }

    .single-title {
        font-size: 26px;
    }

    .single-position {
        font-size: 16px;
    }

    .category-filter {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .category-filter select {
        width: 100%;
    }
}
