/* ==========================================
   ANNOUNCEMENTS MODULE - STYLES
   ========================================== */

/* .material-grid / .material-grid-2 / .material-card już zdefiniowane globalnie w assets/app.css */
@media(min-width: 900px) {
    .material-grid-2 {
        grid-template-columns: 2fr 1fr;
    }
}

/* Announcement Cards */
.announcement-card { 
    border: 1px solid #eee; 
    margin-bottom: 20px; 
    padding: 15px; 
    border-radius: 6px; 
    position: relative;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

@media (max-width: 768px) {
    .announcement-card {
        padding: 12px;
        margin-bottom: 16px;
    }
}

.announcement-title {
    margin-top: 0;
    color: var(--md-primary);
    font-size: 1.25rem;
    font-weight: 500;
}

.announcement-title a { 
    text-decoration: none; 
    color: inherit; 
    word-break: break-word; 
}

.announcement-date { 
    font-size: 0.85rem; 
    color: #666; 
    margin-bottom: 10px; 
}

/* Body content - prevent overflow.
   max-height/overflow MUSZĄ być na bazowej klasie (nie tylko .js-has-overflow) — inaczej
   scrollHeight==clientHeight zawsze (nic nie jest jeszcze przycięte) i JS nigdy nie wykryje
   przepełnienia, więc "czytaj więcej" nigdy się nie pokaże (2026-07-10, zgłoszone przez usera:
   "ogloszenie pojawia sie cale"). */
.announcement-body {
    font-size: 1rem;
    line-height: 1.6;
    /* Fix 2026-07-11 (zgłoszenie usera: "w darkmode tekst zlewa się z tłem kafla") —
       hardkodowane #333 (ciemnoszary) nigdy nie miało nadpisania na dark mode w tym pliku,
       więc na ciemnym tle kafla ogłoszenia tekst treści był prawie niewidoczny. */
    color: var(--md-text-primary, #333);
    overflow: hidden;
    max-width: 100%;
    max-height: 350px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.announcement-body img {
    max-width: 100% !important;
    height: auto !important;
}

.announcement-body table {
    max-width: 100%;
    overflow-x: auto;
    display: block;
}

.js-has-overflow { 
    max-height: 350px; 
    mask-image: linear-gradient(to bottom, black 80%, transparent 100%); 
}

.announcement-read-more {
    display: none;
    margin-top: 10px;
    color: var(--md-primary);
    text-decoration: none;
    font-weight: 500; 
    cursor: pointer;
    word-break: break-word;
}

/* Attachments */
.attachments-grid { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 10px; 
    margin-top: 15px;
    max-width: 100%;
}

.attachment-item { 
    display: inline-flex; 
    align-items: center; 
    padding: 5px 10px; 
    background: #f8f9fa; 
    border: 1px solid #dee2e6; 
    border-radius: 6px; 
    text-decoration: none; 
    color: #333; 
    font-size: 0.9rem;
    word-break: break-word;
    max-width: 100%;
}

.attachment-item:hover { 
    background: #e9ecef; 
}

/* Empty State */
.empty-state { 
    text-align: center; 
    padding: 40px; 
    color: #adb5bd; 
}

.empty-state-icon { 
    font-size: 48px; 
    margin-bottom: 10px; 
}

/* Archive styles */
.archive-card h4 { 
    margin: 0 0 5px 0; 
    font-size: 1rem; 
}

.archive-card small { 
    color: #888; 
}

/* Admin actions */
.announcement-actions { 
    margin-top: 15px; 
    border-top: 1px solid #eee; 
    padding-top: 10px; 
    display: flex; 
    gap: 10px;
    flex-wrap: wrap;
}

/* .btn / .btn-primary / .btn-danger / .btn-secondary / .btn-add / .modal-overlay / .modal-window /
   .modal-header / .modal-close / .form-group / .form-control już zdefiniowane globalnie w
   assets/app.css (wzorzec: Ogłoszenia, 2026-07-07) — usunięte stąd duplikaty, żeby nie rozjeżdżały
   się z inną stroną (patrz Kontakty). */

.ql-container {
    height: 200px;
    max-width: 100%;
}

.ql-editor {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.file-list { 
    margin-top: 10px; 
    font-size: 0.9rem; 
    max-width: 100%; 
}

.file-item {
    display: flex;
    justify-content: space-between;
    background: var(--md-surface-variant);
    padding: 5px;
    margin-bottom: 5px; 
    border-radius: 6px;
    flex-wrap: wrap;
    word-break: break-word;
}

/* Announcement Detail View */
.announcement-full-header { 
    border-bottom: 2px solid #eee; 
    padding-bottom: 1rem; 
    margin-bottom: 1.5rem;
}

.announcement-full-title { 
    margin: 0; 
    font-size: 2rem; 
    color: #1a1a1a;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

@media (max-width: 768px) {
    .announcement-full-title {
        font-size: 1.5rem;
    }
}

.announcement-full-date { 
    color: #666; 
    margin-top: 5px; 
    display: block;
    font-size: 0.9rem;
}

.announcement-full-body { 
    line-height: 1.6; 
    font-size: 1.1rem; 
    overflow-wrap: break-word;
    word-wrap: break-word;
    max-width: 100%;
}

.announcement-full-body img { 
    max-width: 100% !important; 
    height: auto !important; 
}

.announcement-full-body table {
    max-width: 100%;
    overflow-x: auto;
    display: block;
}

@media (max-width: 768px) {
    .announcement-full-body {
        font-size: 1rem;
    }
}

.attachments-section { 
    margin-top: 2rem; 
    padding-top: 1rem; 
    border-top: 1px solid #eee;
}

.attachments-section .attachment-item {
    background: #f0f4ff; 
    border: 1px solid #cce5ff; 
    color: #004085;
}

.attachments-section .attachment-item:hover { 
    background: #cce5ff; 
}
