/* ========================================
   Safety Plan Section Styling
   ======================================== */

.safety-plan-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Safety Document Card */
.safety-document-card {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border-radius: 15px;
    padding: 30px;
    color: white;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    margin-bottom: 40px;
}

.safety-document-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.safety-document-card .document-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.safety-document-card .document-icon.safety-icon {
    font-size: 3rem;
    color: #ffffff;
    opacity: 0.9;
}

.safety-document-card .document-info h3 {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
}

.safety-document-card .document-info p {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
}

.safety-document-card .document-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.safety-document-card .btn-download,
.safety-document-card .btn-view {
    padding: 12px 25px;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.safety-document-card .btn-download:hover,
.safety-document-card .btn-view:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    transform: translateY(-2px);
}

/* Safety Information Grid */
.safety-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.safety-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.safety-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.safety-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.safety-card-icon {
    font-size: 2rem;
    color: #28a745;
}

.safety-card-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.safety-card-content {
    color: #5a6c7d;
}

/* Emergency Contacts Card */
.emergency-contacts .safety-card-icon {
    color: #dc3545;
}

.emergency-contact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.emergency-contact:hover {
    background: #e9ecef;
}

.contact-type {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #2c3e50;
}

.contact-type i {
    font-size: 1.2rem;
    color: #28a745;
}

.btn-emergency {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-emergency:hover {
    background: #c82333;
    color: white;
    transform: translateY(-2px);
}

.btn-event-contact {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-event-contact:hover {
    background: #0056b3;
    color: white;
    transform: translateY(-2px);
}

/* Medical Assistance Card */
.medical-assistance .safety-card-icon {
    color: #fd7e14;
}

.medical-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.medical-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.medical-item:hover {
    background: #e9ecef;
}

.medical-item i {
    color: #28a745;
    font-size: 1.2rem;
}

.medical-item span {
    color: #2c3e50;
    font-weight: 500;
}

/* Evacuation Procedures Card */
.evacuation-procedures .safety-card-icon {
    color: #ffc107;
}

.evacuation-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.evacuation-step {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.evacuation-step:hover {
    background: #e9ecef;
}

.step-number {
    background: #ffc107;
    color: #212529;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content strong {
    color: #2c3e50;
    font-size: 1.1rem;
    display: block;
    margin-bottom: 5px;
}

.step-content p {
    color: #5a6c7d;
    margin: 0;
    line-height: 1.5;
}

/* Safety Equipment Card */
.safety-equipment .safety-card-icon {
    color: #6f42c1;
}

.equipment-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.equipment-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.equipment-item:hover {
    background: #e9ecef;
}

.equipment-item i {
    color: #6f42c1;
    font-size: 1.2rem;
}

.equipment-item span {
    color: #2c3e50;
    font-weight: 500;
}

/* Safety Notice */
.safety-notice {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    color: white;
}

.safety-notice .notice-content {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.safety-notice .notice-icon {
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.9);
    flex-shrink: 0;
}

.safety-notice .notice-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: white;
}

.safety-notice .notice-description {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .safety-plan-container {
        padding: 0 15px;
    }
    
    .safety-document-card {
        padding: 20px;
    }
    
    .safety-document-card .document-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .safety-document-card .document-actions {
        justify-content: center;
    }
    
    .safety-info-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .safety-card {
        padding: 20px;
    }
    
    .safety-card-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .emergency-contact {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .evacuation-step {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .safety-notice .notice-content {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .safety-card-title {
        font-size: 1.1rem;
    }
    
    .safety-document-card .document-actions {
        flex-direction: column;
    }
    
    .safety-document-card .btn-download,
    .safety-document-card .btn-view {
        width: 100%;
        justify-content: center;
    }
    
    .emergency-contact {
        padding: 12px;
    }
    
    .medical-item,
    .equipment-item {
        padding: 10px;
    }
    
    .evacuation-step {
        padding: 12px;
    }
    
    .step-number {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }
}

/* Print Styles */
@media print {
    .safety-plan-container {
        max-width: none;
        margin: 0;
    }
    
    .safety-document-card {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        border: 2px solid #28a745 !important;
    }
    
    .safety-document-card .document-info h3,
    .safety-document-card .document-info p {
        color: black !important;
    }
    
    .safety-document-card .document-actions {
        display: none !important;
    }
    
    .safety-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    .safety-notice {
        background: white !important;
        color: black !important;
        border: 2px solid #dc3545 !important;
    }
    
    .safety-notice .notice-title,
    .safety-notice .notice-description {
        color: black !important;
    }
}

/* ========================================
   Modular Safety Plan Enhancements
   ======================================== */

/* Dynamic section styling */
.safety-content {
    line-height: 1.6;
}

.safety-content p {
    margin-bottom: 15px;
}

.safety-content ul, .safety-content ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.safety-content li {
    margin-bottom: 8px;
}

/* Emergency contacts wrapper for modular system */
.emergency-contacts-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.emergency-contacts-wrapper > p {
    margin-bottom: 20px;
    color: #6c757d;
}

/* Generic contact styling for any contact type */
.emergency-contact .contact-type small {
    font-size: 0.85rem;
    margin-top: 2px;
}

/* Additional button styles for different contact types */
.btn-outline-primary {
    border-color: #007bff;
    color: #007bff;
}

.btn-outline-primary:hover {
    background-color: #007bff;
    color: white;
}

/* Responsive improvements for modular content */
@media (max-width: 768px) {
    .safety-content {
        font-size: 14px;
    }
    
    .emergency-contacts-wrapper > p {
        font-size: 14px;
    }
}

/* =====================================================================
   TASK-284 — PIANO DI SICUREZZA, EDITORIAL REDESIGN (rr-kit aligned)
   ---------------------------------------------------------------------
   Replaces the multicolour "AI" look (green PDF gradient, red/pink notice,
   per-type rainbow icons, 15px radii + heavy shadows) with the brand
   language: squared 10px cards, hairline rules, ONE teal accent + a gold
   callout, Space Grotesk titles, flat fills. Scoped to #safety-plan;
   loads after the base rules so it wins. Tokens from rr-kit.css.
   ===================================================================== */
.events-page #safety-plan { background: #f6f8f7; }
.events-page #safety-plan .safety-plan-container { max-width: 1100px; margin: 0 auto; }

/* PDF document card — white hairline + teal spine (was green gradient) */
.events-page #safety-plan .safety-document-card {
    background: var(--rr-paper, #fff) !important;
    border: 1px solid #e4e8e6;
    border-left: 4px solid var(--rr-accent, #138577);
    border-radius: var(--rr-radius-card, 10px);
    box-shadow: none !important;
    color: var(--rr-ink, #1e3a5f);
}
.events-page #safety-plan .safety-document-card:hover { transform: none; box-shadow: none !important; }
.events-page #safety-plan .document-icon.safety-icon {
    background: var(--rr-accent-soft, #e8f5f3) !important;
    color: var(--rr-accent, #138577) !important;
    border-radius: var(--rr-radius-btn, 6px);
}
.events-page #safety-plan .document-info h3 {
    font-family: var(--rr-display, 'Space Grotesk', sans-serif) !important;
    color: var(--rr-ink, #1e3a5f) !important;
}
.events-page #safety-plan .document-info p { color: #5d6b66 !important; }
.events-page #safety-plan .safety-document-card .btn-download {
    background: var(--rr-accent, #138577) !important;
    color: #fff !important;
    border: 1.5px solid var(--rr-accent, #138577) !important;
    border-radius: var(--rr-radius-btn, 6px) !important;
    box-shadow: var(--rr-btn-shadow);
}
.events-page #safety-plan .safety-document-card .btn-download:hover {
    background: var(--rr-accent-deep, #0f6f64) !important;
    border-color: var(--rr-accent-deep, #0f6f64) !important;
}
.events-page #safety-plan .safety-document-card .btn-view {
    background: transparent !important;
    color: var(--rr-accent, #138577) !important;
    border: 1.5px solid var(--rr-accent, #138577) !important;
    border-radius: var(--rr-radius-btn, 6px) !important;
}
.events-page #safety-plan .safety-document-card .btn-view:hover {
    background: var(--rr-accent, #138577) !important;
    color: #fff !important;
}

/* Info cards — squared hairline tiles, single teal icons */
.events-page #safety-plan .safety-info-grid { gap: 18px; }
.events-page #safety-plan .safety-card {
    border-radius: var(--rr-radius-card, 10px) !important;
    border: 1px solid #e4e8e6;
    box-shadow: none !important;
    padding: 22px;
}
.events-page #safety-plan .safety-card:hover {
    transform: translateY(-3px);
    box-shadow: none !important;
    border-color: rgba(19, 133, 119, .35);
}
.events-page #safety-plan .safety-card-header { border-bottom: 1px solid #e4e8e6; }
.events-page #safety-plan .safety-card-icon,
.events-page #safety-plan .emergency-contacts .safety-card-icon,
.events-page #safety-plan .medical-assistance .safety-card-icon,
.events-page #safety-plan .evacuation-procedures .safety-card-icon,
.events-page #safety-plan .safety-equipment .safety-card-icon { color: var(--rr-accent, #138577) !important; }
.events-page #safety-plan .safety-card-title {
    font-family: var(--rr-display, 'Space Grotesk', sans-serif) !important;
    color: var(--rr-ink, #1e3a5f) !important;
}
.events-page #safety-plan .contact-type i,
.events-page #safety-plan .medical-item i { color: var(--rr-accent, #138577) !important; }

/* Inner rows — squared hairline, paper-grey fills */
.events-page #safety-plan .emergency-contact,
.events-page #safety-plan .medical-item,
.events-page #safety-plan .evacuation-step {
    border-radius: var(--rr-radius-btn, 6px) !important;
    background: #f6f8f7 !important;
    border: 1px solid #e4e8e6;
}
.events-page #safety-plan .emergency-contact:hover,
.events-page #safety-plan .medical-item:hover { background: #eef3f1 !important; }

/* Contact buttons — squared, one navy/teal voice (no red/blue) */
.events-page #safety-plan .btn-emergency,
.events-page #safety-plan .btn-event-contact,
.events-page #safety-plan .contact-number .btn,
.events-page #safety-plan .btn-outline-primary {
    border-radius: var(--rr-radius-btn, 6px) !important;
    box-shadow: none !important;
}
.events-page #safety-plan .btn-emergency {
    background: var(--rr-ink, #1e3a5f) !important;
    color: #fff !important;
    border: 1.5px solid var(--rr-ink, #1e3a5f) !important;
}
.events-page #safety-plan .btn-emergency:hover { background: var(--rr-ink-deep, #0f2744) !important; }
.events-page #safety-plan .btn-event-contact {
    background: var(--rr-accent, #138577) !important;
    color: #fff !important;
    border: 1.5px solid var(--rr-accent, #138577) !important;
}
.events-page #safety-plan .btn-event-contact:hover { background: var(--rr-accent-deep, #0f6f64) !important; }
.events-page #safety-plan .btn-outline-primary {
    color: var(--rr-accent, #138577) !important;
    border: 1.5px solid var(--rr-accent, #138577) !important;
    background: transparent !important;
}
.events-page #safety-plan .btn-outline-primary:hover {
    background: var(--rr-accent, #138577) !important;
    color: #fff !important;
}

/* Important notice — gold editorial callout (was red/pink gradient) */
.events-page #safety-plan .safety-notice {
    background: var(--rr-gold-soft, #f6edda) !important;
    border: 1px solid rgba(212, 162, 76, .4) !important;
    border-left: 4px solid var(--rr-gold, #d4a24c) !important;
    border-radius: var(--rr-radius-card, 10px) !important;
    box-shadow: none !important;
    color: var(--rr-ink, #1e3a5f) !important;
}
.events-page #safety-plan .safety-notice .notice-icon {
    color: var(--rr-gold-deep, #c08f33) !important;
    background: transparent !important;
}
.events-page #safety-plan .safety-notice .notice-title {
    font-family: var(--rr-display, 'Space Grotesk', sans-serif) !important;
    color: var(--rr-ink, #1e3a5f) !important;
}
.events-page #safety-plan .safety-notice .notice-description { color: #4a4031 !important; }

/* Static-fallback extras: evacuation step number + equipment rows */
.events-page #safety-plan .evacuation-step .step-number {
    background: var(--rr-accent, #138577) !important;
    color: #fff !important;
    border-radius: var(--rr-radius-btn, 6px) !important;
    box-shadow: none !important;
}
.events-page #safety-plan .equipment-item {
    border-radius: var(--rr-radius-btn, 6px) !important;
    background: #f6f8f7 !important;
    border: 1px solid #e4e8e6;
}
.events-page #safety-plan .equipment-item i { color: var(--rr-accent, #138577) !important; }

/* =====================================================================
   TASK-285 — Piano di sicurezza, mobile: stack everything cleanly
   ===================================================================== */
@media (max-width: 600px) {
    .events-page #safety-plan .safety-info-grid { grid-template-columns: 1fr !important; gap: 14px; }
    .events-page #safety-plan .safety-card { padding: 18px !important; }
    .events-page #safety-plan .safety-document-card .document-header { flex-direction: column; text-align: center; gap: 12px; }
    .events-page #safety-plan .safety-document-card .document-actions { flex-direction: column; }
    .events-page #safety-plan .safety-document-card .document-actions .btn { width: 100%; justify-content: center; }
    .events-page #safety-plan .emergency-contact { flex-direction: column; align-items: flex-start; gap: 10px; }
    .events-page #safety-plan .emergency-contact .contact-number,
    .events-page #safety-plan .emergency-contact .contact-number .btn { width: 100%; justify-content: center; }
}

/* =====================================================================
   TASK-287 — Piano di sicurezza: compact, professional, appealing
   Slim PDF bar + denser hairline card grid + slim notice; tighter rhythm.
   ===================================================================== */
.events-page #safety-plan.section-padding {
    padding-top: clamp(40px, 6vw, 72px) !important;
    padding-bottom: clamp(40px, 6vw, 72px) !important;
}
.events-page #safety-plan .safety-plan-container { max-width: 1040px; }

/* PDF download → slim horizontal bar (was a tall card) */
.events-page #safety-plan .safety-document-card {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 14px 18px !important;
    margin-bottom: 22px !important;
    border-radius: var(--rr-radius-card, 10px) !important;
}
.events-page #safety-plan .safety-document-card .document-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 240px;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}
.events-page #safety-plan .document-icon.safety-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    font-size: 1.2rem;
}
.events-page #safety-plan .document-info h3 { font-size: 1rem !important; margin: 0 !important; }
.events-page #safety-plan .document-info .document-description { display: none; }
.events-page #safety-plan .safety-document-card .document-actions {
    display: flex;
    gap: 8px;
    margin: 0 !important;
    flex-wrap: wrap;
}
.events-page #safety-plan .safety-document-card .document-actions .btn {
    padding: .5rem .9rem !important;
    font-size: .85rem !important;
}

/* Info grid → denser, tighter cards */
.events-page #safety-plan .safety-info-grid {
    grid-template-columns: repeat(auto-fit, minmax(258px, 1fr)) !important;
    gap: 14px !important;
    margin-bottom: 22px !important;
}
.events-page #safety-plan .safety-card { padding: 18px 18px 16px !important; }
.events-page #safety-plan .safety-card-header {
    gap: 10px !important;
    margin-bottom: 12px !important;
    padding-bottom: 10px !important;
}
.events-page #safety-plan .safety-card-icon { font-size: 1.3rem !important; }
.events-page #safety-plan .safety-card-title { font-size: 1.04rem !important; line-height: 1.2; }
.events-page #safety-plan .safety-card-content { font-size: .9rem; line-height: 1.5; color: #3a4742; }
.events-page #safety-plan .safety-card-content p { margin: 0 0 .5rem; }
.events-page #safety-plan .safety-card-content p:last-child { margin-bottom: 0; }
.events-page #safety-plan .safety-card-content ul,
.events-page #safety-plan .safety-card-content ol { margin: 0; padding-left: 1.1rem; }
.events-page #safety-plan .safety-card-content li { margin-bottom: .3rem; }
.events-page #safety-plan .medical-info,
.events-page #safety-plan .evacuation-info,
.events-page #safety-plan .equipment-info { gap: 8px !important; }

/* Emergency contact rows → compact */
.events-page #safety-plan .emergency-contact { padding: 10px 12px !important; margin-bottom: 8px !important; }
.events-page #safety-plan .emergency-contact:last-child { margin-bottom: 0 !important; }
.events-page #safety-plan .contact-type { font-size: .9rem; gap: 8px; }
.events-page #safety-plan .contact-type small { font-size: .76rem; margin-top: 1px; }
.events-page #safety-plan .contact-number .btn { padding: .42rem .8rem !important; font-size: .82rem !important; }

/* Notice → slim inline callout */
.events-page #safety-plan .safety-notice { padding: 14px 18px !important; margin-top: 4px !important; }
.events-page #safety-plan .safety-notice .notice-content { gap: 12px; align-items: center; }
.events-page #safety-plan .safety-notice .notice-icon { font-size: 1.3rem; flex-shrink: 0; }
.events-page #safety-plan .safety-notice .notice-title { font-size: .95rem !important; margin: 0 0 2px !important; }
.events-page #safety-plan .safety-notice .notice-description { font-size: .85rem !important; line-height: 1.45 !important; margin: 0 !important; }

/* ── Collapsible safety cards (task-288): compact by default, tap a header to expand ── */
.events-page #safety-plan details.safety-card { padding: 0 !important; overflow: hidden; }
.events-page #safety-plan .safety-card > summary.safety-card-header {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 15px 18px;
    border-bottom: 1px solid transparent;
    -webkit-user-select: none;
    user-select: none;
}
.events-page #safety-plan .safety-card > summary.safety-card-header::-webkit-details-marker { display: none; }
.events-page #safety-plan .safety-card > summary.safety-card-header:hover { background: #f6faf9; }
.events-page #safety-plan details.safety-card[open] > summary.safety-card-header { border-bottom-color: #e4e8e6; }
.events-page #safety-plan .safety-card > summary .safety-card-title { margin: 0 !important; flex: 1; }
.events-page #safety-plan .safety-card-chevron {
    margin-left: auto;
    color: var(--rr-accent, #138577);
    font-size: 1rem;
    transition: transform .2s ease;
    flex-shrink: 0;
}
.events-page #safety-plan details.safety-card[open] > summary .safety-card-chevron { transform: rotate(180deg); }
.events-page #safety-plan .safety-card-content { padding: 6px 18px 18px; }
@media (prefers-reduced-motion: reduce) { .events-page #safety-plan .safety-card-chevron { transition: none; } }