/* Scope everything to the shortcode wrapper to protect against theme overrides */
.plm-shortcode-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1d1d1f;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 0;
}

/* --- Highlighted Latest Letter --- */
.plm-highlight-card {
    background: #f5f5f7 !important;
    border: 1px solid #e5e5ea !important;
    border-radius: 16px !important;
    padding: 50px 40px !important;
    text-align: center !important;
    margin-bottom: 60px !important;
}

.plm-badge {
    display: inline-block !important;
    background: #0071e3 !important;
    color: #ffffff !important;
    padding: 6px 14px !important;
    border-radius: 999px !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    margin-bottom: 20px !important;
}

.plm-headline {
    font-size: 2.2rem !important;
    font-weight: 700 !important;
    margin: 0 0 8px 0 !important;
    line-height: 1.2 !important;
    color: #1d1d1f !important;
}

.plm-subheadline {
    font-size: 1.1rem !important;
    color: #86868b !important;
    margin-bottom: 32px !important;
}

/* --- Highlight Buttons --- */
.plm-shortcode-wrapper .plm-actions {
    display: flex !important;
    flex-direction: row !important;
    gap: 16px !important;
    justify-content: center !important;
}

/* Target both button and a tags strictly */
.plm-shortcode-wrapper button.plm-btn,
.plm-shortcode-wrapper a.plm-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 14px 28px !important;
    border-radius: 999px !important;
    font-weight: 500 !important;
    font-size: 1rem !important;
    text-decoration: none !important;
    cursor: pointer !important;
    border: none !important;
    transition: all 0.2s ease !important;
    line-height: 1 !important;
    box-sizing: border-box !important;
    min-width: 140px !important;
}

.plm-shortcode-wrapper .plm-btn-primary { background: #0071e3 !important; color: #ffffff !important; }
.plm-shortcode-wrapper .plm-btn-primary:hover { background: #0077ed !important; color: #ffffff !important; }

.plm-shortcode-wrapper .plm-btn-secondary { background: #ffffff !important; color: #1d1d1f !important; border: 1px solid #d2d2d7 !important; }
.plm-shortcode-wrapper .plm-btn-secondary:hover { background: #f5f5f7 !important; color: #1d1d1f !important;}

/* --- Clean Archive List --- */
.plm-archive-section {
    padding-top: 20px !important;
}

.plm-archive-title {
    font-size: 1.2rem !important;
    font-weight: 600 !important;
    margin-bottom: 16px !important;
    border-bottom: 2px solid #1d1d1f !important;
    padding-bottom: 12px !important;
    text-align: left !important;
    color: #1d1d1f !important;
}

.plm-archive-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
}

.plm-list-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 16px 8px !important;
    border-bottom: 1px solid #e5e5ea !important;
    transition: background 0.2s ease !important;
}

.plm-list-row:hover {
    background: #fcfcfc !important;
}

.plm-list-info {
    display: flex !important;
    align-items: baseline !important;
    gap: 12px !important;
}

.plm-letter-title {
    font-size: 1.05rem !important;
    font-weight: 500 !important;
    color: #1d1d1f !important;
}

.plm-letter-date {
    font-size: 0.9rem !important;
    color: #86868b !important;
}

.plm-list-actions {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
}

.plm-shortcode-wrapper button.plm-btn-text,
.plm-shortcode-wrapper a.plm-btn-text {
    background: none !important;
    border: none !important;
    color: #0071e3 !important;
    cursor: pointer !important;
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    padding: 0 !important;
}

.plm-shortcode-wrapper .plm-btn-text:hover {
    text-decoration: underline !important;
}

.plm-divider {
    color: #d2d2d7 !important;
    font-size: 0.9rem !important;
}

/* --- Centered Lightbox --- */
.plm-modal { display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 999999; }
.plm-modal.active { display: block; }
.plm-modal-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.plm-lightbox-close { position: absolute; top: 24px; right: 24px; width: 48px; height: 48px; border-radius: 50%; background: #ffffff; color: #1d1d1f; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 1000000; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); transition: transform 0.2s ease, background 0.2s ease; padding: 0; }
.plm-lightbox-close:hover { transform: scale(1.08); background: #f5f5f7; }
.plm-modal-content { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 96%; max-width: 1000px; height: 90vh; background: #ffffff; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 25px 50px rgba(0,0,0,0.4); animation: plmFadeInCenter 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) forwards; z-index: 10; }
@keyframes plmFadeInCenter { from { opacity: 0; transform: translate(-50%, -45%); } to { opacity: 1; transform: translate(-50%, -50%); } }
#plm-modal-iframe { width: 100%; flex-grow: 1; border: none; background: #f5f5f7; }

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    .plm-headline { font-size: 1.8rem !important; }
    .plm-highlight-card { padding: 40px 20px !important; }
    .plm-actions { flex-direction: column !important; }
    .plm-btn { width: 100% !important; justify-content: center !important; }
    .plm-list-row { flex-direction: column !important; align-items: flex-start !important; gap: 12px !important; }
    .plm-list-info { flex-direction: column !important; gap: 4px !important; }
    .plm-modal-content { width: 100%; height: 100vh; border-radius: 0; animation: none !important; }
    .plm-lightbox-close { top: 12px; right: 12px; width: 40px; height: 40px; }
}
