/**
 * Category / Archive - Document Registry Style
 * Layout professionale per pagine di categoria e archivio
 */

/* ===== HERO HEADER ===== */

.arch-hero {
    background: linear-gradient(135deg, #003d7a 0%, #005ea2 100%);
    padding: 28px 20px 24px;
    margin-bottom: 0;
}

.arch-hero .arch-title {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.3;
}

.arch-hero .arch-desc {
    margin: 0;
    font-size: 15px;
    color: rgba(255,255,255,.82);
    line-height: 1.5;
}

/* ===== LAYOUT WRAPPER ===== */

.arch-wrapper {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    margin-top: 20px;
}

.arch-doc-list {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.arch-sidebar {
    flex: 0 0 260px;
    max-width: 260px;
    background: #f7f9fc;
    border: 1px solid #dde3ed;
    border-radius: 6px;
    padding: 20px;
    font-size: .88em;
}

.arch-sidebar .widget-title {
    font-size: 1em;
    font-weight: 700;
    color: #003d7a;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #003d7a;
}

.arch-sidebar ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.arch-sidebar li {
    padding: 6px 0;
    border-bottom: 1px solid #eef0f4;
    line-height: 1.4;
}

.arch-sidebar li:last-child {
    border-bottom: none;
}

.arch-sidebar a {
    color: #005ea2;
    text-decoration: none;
    font-size: .85em;
}

.arch-sidebar a:hover {
    color: #003d7a;
    text-decoration: underline;
}

/* ===== DOCUMENT CARD ===== */

.doc-card {
    background: #fff;
    border: 1px solid #dde3ed;
    border-left: 4px solid #005ea2;
    border-radius: 4px;
    padding: 18px 20px;
    transition: box-shadow .15s, border-left-color .15s;
    margin: 0 !important;
}

.doc-card:hover {
    box-shadow: 0 3px 10px rgba(0,62,122,.1);
    border-left-color: #003d7a;
}

/* ===== CARD HEADER ===== */

.doc-card-header {
    margin-bottom: 12px;
}

.doc-title {
    margin: 0 0 6px !important;
    font-size: 1em !important;
    font-weight: 600 !important;
    line-height: 1.45 !important;
    text-transform: none !important;
}

.doc-title a {
    color: #005ea2;
    text-decoration: none;
}

.doc-title a:hover {
    color: #003d7a;
    text-decoration: underline;
}

.doc-meta {
    font-size: .82em;
    color: #666;
    line-height: 1.4;
}

.doc-pub,
.doc-mod {
    white-space: nowrap;
}

.doc-meta time {
    font-variant-numeric: tabular-nums;
}

/* ===== ATTACHMENTS IN CARD ===== */

.doc-card-files .post-attachments {
    margin-top: 10px;
    background: #f7f9fc;
    border: 1px solid #e5eaf2;
    border-radius: 4px;
    padding: 10px 14px;
}

.doc-card-files .post-attachments-title {
    font-size: .78em !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: .05em !important;
    color: #555 !important;
    margin: 0 0 8px !important;
    padding: 0 !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.doc-card-files .post-attachments-title::before {
    content: none !important;
}

.doc-card-files .attachments-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #005ea2;
    color: #fff;
    font-size: .85em;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
    min-width: 20px;
}

.doc-card-files .attachments-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.doc-card-files .attachment-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    background: #fff;
    border: 1px solid #e5eaf2;
    border-radius: 4px;
    min-height: 0;
}

.doc-card-files .attachment-icon {
    flex-shrink: 0;
    font-size: .9em;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef2f8;
    border-radius: 4px;
    font-style: normal;
    font-weight: 700;
    font-size: .65em;
    color: #fff;
}

.doc-card-files .attachment-icon.pdf   { background: #c0392b; }
.doc-card-files .attachment-icon.docx,
.doc-card-files .attachment-icon.doc   { background: #2563ab; }
.doc-card-files .attachment-icon.xlsx,
.doc-card-files .attachment-icon.xls   { background: #1a7a3a; }
.doc-card-files .attachment-icon.pptx,
.doc-card-files .attachment-icon.ppt   { background: #d35400; }
.doc-card-files .attachment-icon.zip,
.doc-card-files .attachment-icon.rar   { background: #7d3c98; }

.doc-card-files .attachment-info {
    flex: 1;
    min-width: 0;
}

.doc-card-files .attachment-name {
    margin: 0 0 2px;
    font-size: .82em;
    font-weight: 600;
    color: #222;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc-card-files .attachment-meta {
    display: flex;
    gap: 8px;
    font-size: .75em;
    color: #777;
}

.doc-card-files .attachment-type {
    font-weight: 700;
    color: #555;
}

.doc-card-files .attachment-download {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #005ea2;
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    font-size: 1em;
    transition: background .15s;
}

.doc-card-files .attachment-download::before {
    content: "\2193";
    font-weight: 700;
}

.doc-card-files .attachment-download:hover {
    background: #003d7a;
}

.doc-card-files .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* ===== PAGINAZIONE ===== */

.arch-doc-list .navigation.pagination {
    margin-top: 28px;
}

.arch-doc-list .nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.arch-doc-list .nav-links a,
.arch-doc-list .nav-links .current {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 6px 12px;
    border: 1px solid #dde3ed;
    border-radius: 4px;
    font-size: .88em;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s, color .15s;
}

.arch-doc-list .nav-links a {
    background: #fff;
    color: #005ea2;
}

.arch-doc-list .nav-links a:hover {
    background: #005ea2;
    color: #fff;
    border-color: #005ea2;
}

.arch-doc-list .nav-links .current {
    background: #003d7a;
    color: #fff;
    border-color: #003d7a;
}

/* ===== NO RESULTS ===== */

.arch-doc-list .no-results {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 860px) {
    .arch-wrapper {
        flex-direction: column;
    }
    .arch-sidebar {
        flex: none;
        max-width: 100%;
        width: 100%;
    }
    .arch-hero .arch-title {
        font-size: 22px;
    }
}

@media (max-width: 560px) {
    .doc-card {
        padding: 14px 14px 14px 16px;
    }
    .doc-card-files .attachment-name {
        white-space: normal;
    }
}

@media print {
    .doc-card {
        border: 1px solid #999;
        box-shadow: none;
        page-break-inside: avoid;
    }
    .arch-sidebar,
    .doc-card-files .attachment-download {
        display: none;
    }
}
