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

/* ==========================================================================
   Document Card
   ========================================================================== */

.wcrs-doc-card {
    display: block;
    background-color: #FFFFFF;
    border: 1px solid;
    border-radius: 14px;
    box-shadow: 3px 3px 4px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    height: 100%;
}

.wcrs-doc-card:hover {
    box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.15);
}

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

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

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

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

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

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

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

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

.wcrs-doc-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

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

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

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

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

.wcrs-doc-btn {
    flex-shrink: 0;
    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-doc-card:hover .wcrs-doc-btn {
    opacity: 0.9;
}

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

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

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

.wcrs-doc-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-doc-link {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

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

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

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