/**
 * Frontend Styles for SDP Publications Grid and Pagination
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Prompt:wght@300;400;500;600;700&display=swap');

.sdp-publications-container {
    font-family: 'Prompt', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 30px 0;
    width: 100%;
    box-sizing: border-box;
}

.sdp-publications-container * {
    box-sizing: border-box;
}

/* Responsive Grid Base */
.sdp-publications-grid {
    display: grid;
    gap: 30px;
    margin-bottom: 40px;
    width: 100%;
}

/* Grid Columns on Large Desktop */
@media (min-width: 1025px) {
    .sdp-grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
    .sdp-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .sdp-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .sdp-grid-cols-1 { grid-template-columns: 1fr; }
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
    .sdp-publications-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .sdp-publications-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .sdp-publications-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
}

/* Card Styling */
.sdp-publication-card {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    display: flex;
    flex-direction: column;
}

.sdp-publication-card a.sdp-publication-card-link,
.sdp-publication-card a.sdp-publication-link {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
}

/* Cover Image Wrapper with Aspect Ratio */
.sdp-publication-cover-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4; /* Portrait book cover shape */
    background-color: #f7f9fa;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.sdp-publication-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Fallback Cover Styles */
.sdp-publication-cover-fallback {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2b5876 0%, #4e4376 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    color: #ffffff;
}

.sdp-fallback-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.sdp-fallback-inner .dashicons {
    font-size: 40px;
    width: 40px;
    height: 40px;
    opacity: 0.8;
}

.sdp-fallback-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    word-break: break-word;
}

/* Category Badge (Glassmorphism Effect) */
.sdp-publication-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(42, 157, 143, 0.9);
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Overlay Cover Hover Effect */
.sdp-publication-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(38, 70, 83, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    will-change: opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    z-index: 1;
}

.sdp-overlay-content {
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transform: translateY(15px);
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    will-change: transform;
}

.sdp-overlay-content .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.sdp-overlay-content span {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Information Container (Centered) */
.sdp-publication-info {
    padding: 15px 5px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
}

/* Title Split Layouts */
.sdp-publication-title {
    font-size: 14px;
    font-weight: 600;
    color: #264653;
    margin: 0 0 6px 0;
    line-height: 1.4;
    transition: color 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sdp-publication-subtitle {
    font-size: 13px;
    color: #555d66;
    margin: 0;
    line-height: 1.4;
    font-weight: 400;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Card Hover States */
.sdp-publication-card:hover .sdp-publication-cover-wrapper {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(38, 70, 83, 0.15);
}

.sdp-publication-card:hover .sdp-publication-cover-img {
    transform: scale(1.05);
}

.sdp-publication-card:hover .sdp-publication-overlay {
    opacity: 1;
}

.sdp-publication-card:hover .sdp-overlay-content {
    transform: translateY(0);
}

.sdp-publication-card:hover .sdp-publication-title {
    color: #2a9d8f;
}

/* Modern Pagination Style */
.sdp-publications-pagination {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    width: 100%;
}

.sdp-pagination-list {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 8px;
    align-items: center;
}

.sdp-pagination-item a, 
.sdp-pagination-item span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 14px;
    border-radius: 20px;
    border: 1px solid #d0d7de;
    background: #ffffff;
    color: #264653;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.sdp-pagination-item a:hover {
    background: #eef2f5;
    border-color: #264653;
    color: #264653;
}

.sdp-pagination-item.sdp-page-active span,
.sdp-pagination-item span.current {
    background: #264653;
    border-color: #264653;
    color: #ffffff;
    cursor: default;
}

.sdp-pagination-item .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    vertical-align: middle;
}

/* No Publications Found Style */
.sdp-no-publications {
    background: #f7f9fa;
    border-radius: 6px;
    padding: 40px 20px;
    text-align: center;
    color: #555d66;
    border: 1px dashed #d0d7de;
}

.sdp-no-publications p {
    margin: 0;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.sdp-no-publications .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #2a9d8f;
}

/* ==========================================================================
   Single Publication Details View (Premium Glassmorphic Layout)
   ========================================================================== */

.sdp-single-wrap {
    font-family: 'Prompt', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f7f9fa;
    padding: 60px 0;
    min-height: 50vh;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.sdp-single-container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.sdp-single-back {
    margin-bottom: 25px;
}

.sdp-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #555d66;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.sdp-back-btn:hover {
    color: #2a9d8f;
}

.sdp-back-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.sdp-back-btn:hover .dashicons {
    transform: translateX(-4px);
}

.sdp-single-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 50px;
    background: #ffffff;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* Left Column - Cover image Card */
.sdp-single-cover-col {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sdp-single-cover-card {
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(38, 70, 83, 0.2);
    background: #f7f9fa;
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.sdp-single-cover-card:hover {
    transform: scale(1.02) translateY(-4px);
}

.sdp-single-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sdp-single-cover-fallback {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2b5876 0%, #4e4376 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}

.sdp-single-cover-fallback .dashicons {
    font-size: 60px;
    width: 60px;
    height: 60px;
    opacity: 0.8;
}

/* Right Column - Info */
.sdp-single-info-col {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    text-align: left;
}

.sdp-single-badge {
    background: #2a9d8f;
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    box-shadow: 0 4px 10px rgba(42, 157, 143, 0.2);
    margin-bottom: 20px;
    display: inline-block;
}

.sdp-single-title {
    font-size: 28px;
    font-weight: 700;
    color: #264653;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.sdp-single-subtitle {
    font-size: 18px;
    color: #555d66;
    margin: 0 0 25px 0;
    line-height: 1.5;
    font-weight: 400;
}

/* Stats Row */
.sdp-single-stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
}

.sdp-stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f7;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    color: #264653;
}

.sdp-stat-item .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #2a9d8f;
}

.sdp-stat-val {
    font-weight: 700;
}

.sdp-stat-lbl {
    color: #555d66;
}

.sdp-single-divider {
    border: 0;
    border-top: 1px solid #eef2f5;
    width: 100%;
    margin: 0 0 30px 0;
}

/* Button & Actions */
.sdp-single-actions {
    width: 100%;
    margin-bottom: 35px;
}

.sdp-single-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 36px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    border: none;
}

.sdp-btn-file {
    background: linear-gradient(135deg, #2a9d8f 0%, #207e73 100%);
    color: #ffffff !important;
}

.sdp-btn-file:hover {
    background: linear-gradient(135deg, #207e73 0%, #175d55 100%);
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(42, 157, 143, 0.3);
}

.sdp-btn-link {
    background: linear-gradient(135deg, #2b5876 0%, #4e4376 100%);
    color: #ffffff !important;
}

.sdp-btn-link:hover {
    background: linear-gradient(135deg, #1f3f54 0%, #383055 100%);
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(43, 88, 118, 0.3);
}

.sdp-single-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.sdp-single-warning {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #fff8eb;
    border-left: 4px solid #f0b53c;
    padding: 14px 20px;
    border-radius: 4px;
    color: #b07c13;
    font-size: 14px;
    width: 100%;
}

/* User Guides */
.sdp-single-notes {
    background: #f7f9fa;
    border-radius: 10px;
    padding: 24px;
    width: 100%;
}

.sdp-single-notes h3 {
    font-size: 15px;
    font-weight: 600;
    color: #264653;
    margin: 0 0 10px 0;
}

.sdp-single-notes ul {
    margin: 0;
    padding-left: 20px;
    list-style-type: disc;
}

.sdp-single-notes li {
    font-size: 13px;
    color: #555d66;
    line-height: 1.6;
    margin-bottom: 8px;
}

.sdp-single-notes li:last-child {
    margin-bottom: 0;
}

/* Responsive details page */
@media (max-width: 768px) {
    .sdp-single-wrap {
        padding: 30px 0;
    }
    
    .sdp-single-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 30px 20px;
    }
    
    .sdp-single-cover-col {
        max-width: 260px;
        margin: 0 auto;
    }
    
    .sdp-single-info-col {
        align-items: center;
        text-align: center;
    }
    
    .sdp-single-title {
        font-size: 22px;
    }
    
    .sdp-single-subtitle {
        font-size: 15px;
        margin-bottom: 20px;
    }
    
    .sdp-single-stats-row {
        justify-content: center;
    }
    
    .sdp-single-btn {
        width: 100%;
        box-sizing: border-box;
    }
}

/* ==========================================================================
   Taxonomy Archive View Styles
   ========================================================================== */

.sdp-archive-wrap {
    font-family: 'Prompt', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f7f9fa;
    padding: 60px 0;
    min-height: 70vh;
    width: 100%;
    box-sizing: border-box;
}

.sdp-archive-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}
