/**
 * WCRS Publication Card Widget Styles
 *
 * Card design with file icon, title, meta and download button.
 * WCAG 2.1 AA compliant.
 */

/* ==========================================================================
   Publication Card
   ========================================================================== */

.wcrs-pub-card {
    display: block;
    background-color: #FFFFFF;
    border: 1px solid;
    border-radius: 14px;
    /* box-shadow intentionally NOT set here — controlled by the Elementor
       Box Shadow control (hardcoding it made the control's reset a no-op) */
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    height: 100%;
}

/* ==========================================================================
   Link (entire card is clickable)
   ========================================================================== */

.wcrs-pub-link {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    padding: 16px;
    text-decoration: none;
    color: inherit;
    height: 100%;
    min-height: 44px; /* WCAG 2.5.5 touch target */
}

/* Focus styles for accessibility */
.wcrs-pub-link:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    border-radius: 12px;
}

.wcrs-pub-link:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    border-radius: 12px;
}

/* ==========================================================================
   Cover image (featured image)
   ========================================================================== */

.wcrs-pub-cover {
    flex-shrink: 0;
    width: 168px;
    display: block;
}

.wcrs-pub-cover .wcrs-pub-cover-img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 8px;
}

/* ==========================================================================
   File Icon
   ========================================================================== */

.wcrs-pub-icon {
    flex-shrink: 0;
    width: 86px;
    height: 86px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wcrs-pub-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* ==========================================================================
   Content (Title + Meta)
   ========================================================================== */

.wcrs-pub-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 8px;
}

.wcrs-pub-title {
    margin: 0;
    padding: 0;
    font-size: 18px;
    font-weight: 500;
    line-height: 28px;
    word-break: break-word;
}

.wcrs-pub-description {
    font-size: 12px;
    font-weight: 300;
    line-height: 18px;
}

.wcrs-pub-size {
    font-size: 12px;
    font-weight: 300;
    line-height: 18px;
    color: #6b7280;
}

/* ==========================================================================
   Download Button
   ========================================================================== */

.wcrs-pub-btn {
    flex-shrink: 0;
    margin-top: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px 12px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    white-space: nowrap;
    min-height: 44px; /* WCAG 2.5.5 touch target */
    transition: opacity 0.2s ease;
}

.wcrs-pub-card:hover .wcrs-pub-btn {
    opacity: 0.9;
}

.wcrs-pub-btn-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wcrs-pub-btn-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* ==========================================================================
   Placeholder (Editor only)
   ========================================================================== */

.wcrs-pub-placeholder {
    position: relative;
}

.wcrs-placeholder-note {
    position: absolute;
    bottom: -24px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 11px;
    color: #9ca3af;
    font-style: italic;
    margin: 0;
    padding: 0;
}

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

@media (max-width: 600px) {
    .wcrs-pub-link {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .wcrs-pub-icon {
        width: 60px;
        height: 60px;
    }

    .wcrs-pub-content {
        width: 100%;
    }

    .wcrs-pub-btn {
        width: 100%;
        justify-content: center;
    }
}
