/* ═══════════════════════════════════════════════
   WP Event Calendar v2 – Stylesheet
   Usato SOLO dentro l'iframe isolato.
   Nessun conflitto possibile con il tema.
   ═══════════════════════════════════════════════ */

:root {
    --wpec-bg:        #faf9f7;
    --wpec-surface:   #ffffff;
    --wpec-border:    #e8e4df;
    --wpec-text:      #1a1714;
    --wpec-muted:     #8a8480;
    --wpec-accent:    #e63946;
    --wpec-today-bg:  #1a1714;
    --wpec-hover:     #f2ede8;
    --wpec-radius:    12px;
    --wpec-shadow:    0 4px 32px rgba(26,23,20,.10);
    --wpec-head:      'Playfair Display', Georgia, serif;
    --wpec-body:      'DM Sans', system-ui, sans-serif;
    --wpec-trans:     .22s ease;
}

/* ── Wrap ── */
.wpec-wrap {
    font-family: var(--wpec-body);
    background: var(--wpec-bg);
    border: 1px solid var(--wpec-border);
    border-radius: var(--wpec-radius);
    padding: 24px;
    max-width: 100%;
    box-shadow: var(--wpec-shadow);
}

/* ── Header ── */
.wpec-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}
.wpec-nav { display:flex; align-items:center; gap:12px; }
.wpec-btn {
    background: var(--wpec-surface);
    border: 1px solid var(--wpec-border);
    border-radius: 8px;
    width:36px; height:36px;
    display:flex; align-items:center; justify-content:center;
    cursor:pointer; font-size:15px; color:var(--wpec-text);
    transition: background var(--wpec-trans);
}
.wpec-btn:hover { background:var(--wpec-hover); }

.wpec-title-block {
    display:flex; align-items:baseline; gap:8px;
    min-width:200px; justify-content:center;
}
.wpec-month-label {
    font-family: var(--wpec-head);
    font-size:22px; font-weight:700; color:var(--wpec-text);
}
.wpec-year-label { font-size:15px; color:var(--wpec-muted); font-weight:300; }

.wpec-view-switcher {
    display:flex; gap:3px;
    background:var(--wpec-surface);
    border:1px solid var(--wpec-border);
    border-radius:8px; padding:3px;
}
.wpec-view-btn {
    background:none; border:none; border-radius:6px;
    padding:5px 13px; font-size:12px; font-weight:500;
    color:var(--wpec-muted); cursor:pointer;
    transition: background var(--wpec-trans), color var(--wpec-trans);
    font-family: var(--wpec-body);
}
.wpec-view-btn.active,
.wpec-view-btn:hover { background:var(--wpec-text); color:#fff; }

/* ── Loading ── */
.wpec-loading { display:flex; justify-content:center; padding:48px 0; }
.wpec-spinner {
    width:28px; height:28px;
    border:3px solid var(--wpec-border);
    border-top-color:var(--wpec-text);
    border-radius:50%;
    animation: wpec-spin .7s linear infinite;
}
@keyframes wpec-spin { to { transform: rotate(360deg); } }

/* ── MONTH VIEW ── */
.wpec-month-grid {
    display:grid; grid-template-columns:repeat(7,1fr);
    gap:1px; background:var(--wpec-border);
    border:1px solid var(--wpec-border);
    border-radius:var(--wpec-radius); overflow:hidden;
}
.wpec-dow-header {
    background:var(--wpec-surface); text-align:center;
    padding:9px 0; font-size:10px; font-weight:600;
    letter-spacing:1px; text-transform:uppercase; color:var(--wpec-muted);
}
.wpec-day-cell {
    background:var(--wpec-surface);
    min-height:85px; padding:7px 5px;
    transition:background var(--wpec-trans);
}
.wpec-day-cell:hover { background:var(--wpec-hover); }
.wpec-day-cell.other-month { opacity:.4; }
.wpec-day-cell.has-events { cursor:pointer; }
.wpec-day-cell.today .wpec-day-num {
    background:var(--wpec-today-bg); color:#fff;
}
.wpec-day-num {
    font-size:12px; font-weight:600;
    width:24px; height:24px;
    display:flex; align-items:center; justify-content:center;
    border-radius:50%; color:var(--wpec-text); margin-bottom:3px;
}
.wpec-event-pill {
    display:flex; align-items:center; gap:3px;
    border-radius:4px; padding:2px 5px;
    font-size:10px; font-weight:500; color:#fff;
    margin-bottom:2px; cursor:pointer;
    overflow:hidden; white-space:nowrap; text-overflow:ellipsis;
    transition: filter var(--wpec-trans), transform var(--wpec-trans);
    max-width:100%; line-height:1.4;
}
.wpec-event-pill:hover { filter:brightness(1.1); transform:translateY(-1px); }
.wpec-event-pill .pill-icon { flex-shrink:0; font-size:9px; }
.wpec-event-pill .pill-title { overflow:hidden; text-overflow:ellipsis; }
.wpec-more-link {
    font-size:9px; color:var(--wpec-muted);
    cursor:pointer; text-decoration:underline; padding:1px 5px;
}

/* ── Puntini (calendario bloccato) ── */
.wpec-dots { display:flex; flex-wrap:wrap; gap:3px; margin-top:2px; }
.wpec-dot { width:7px; height:7px; border-radius:50%; flex-shrink:0; }
.wpec-dots-more { font-size:9px; color:var(--wpec-muted); margin-left:3px; }
.wpec-day-cell.is-locked,
.wpec-week-day.is-locked { cursor:pointer; }
.wpec-list-item.is-locked .wpec-list-title { color:var(--wpec-muted); font-weight:500; }

/* ── Lucchetto ── */
.wpec-lock-toggle { font-size:15px; }

/* ── WEEK VIEW ── */
.wpec-week-view {
    display:grid; grid-template-columns:repeat(7,1fr); gap:6px;
}
.wpec-week-day {
    background:var(--wpec-surface);
    border:1px solid var(--wpec-border);
    border-radius:10px; padding:10px 6px; min-height:110px;
}
.wpec-week-day-header {
    font-size:10px; font-weight:600;
    text-transform:uppercase; letter-spacing:.7px;
    color:var(--wpec-muted); margin-bottom:3px;
}
.wpec-week-day-num {
    font-size:18px; font-family:var(--wpec-head);
    font-weight:700; color:var(--wpec-text); margin-bottom:6px;
}
.wpec-week-day.today { border-color:var(--wpec-text); background:var(--wpec-hover); }
.wpec-week-day.today .wpec-week-day-num { color:var(--wpec-accent); }

/* ── LIST VIEW ── */
.wpec-list-view { display:flex; flex-direction:column; gap:0; }
.wpec-list-item {
    display:flex; align-items:flex-start; gap:12px;
    padding:10px 8px; border-bottom:1px solid var(--wpec-border);
    cursor:pointer; border-radius:6px;
    transition:background var(--wpec-trans);
}
.wpec-list-item:hover { background:var(--wpec-hover); }
.wpec-list-date {
    min-width:44px; text-align:center;
    background:var(--wpec-surface); border:1px solid var(--wpec-border);
    border-radius:8px; padding:5px 4px;
}
.wpec-list-date-day {
    font-family:var(--wpec-head); font-size:20px;
    font-weight:700; line-height:1; color:var(--wpec-text);
}
.wpec-list-date-dow {
    font-size:9px; text-transform:uppercase;
    letter-spacing:.5px; color:var(--wpec-muted);
}
.wpec-list-stripe {
    width:4px; border-radius:4px;
    align-self:stretch; min-height:36px; flex-shrink:0;
}
.wpec-list-info { flex:1; }
.wpec-list-title { font-weight:600; font-size:14px; color:var(--wpec-text); margin-bottom:2px; }
.wpec-list-meta { font-size:11px; color:var(--wpec-muted); display:flex; gap:8px; flex-wrap:wrap; }
.wpec-empty { text-align:center; color:var(--wpec-muted); padding:40px; font-size:14px; }

/* ── Detail Panel ── */
.wpec-detail-panel {
    margin-top:20px;
    background:var(--wpec-surface);
    border:1px solid var(--wpec-border);
    border-radius:var(--wpec-radius);
    padding:24px 28px; position:relative;
    animation: wpec-slide-up .25s ease;
}
@keyframes wpec-slide-up {
    from { opacity:0; transform:translateY(12px); }
    to   { opacity:1; transform:translateY(0); }
}
.wpec-detail-close {
    position:absolute; top:14px; right:14px;
    background:none; border:1px solid var(--wpec-border);
    border-radius:50%; width:28px; height:28px;
    cursor:pointer; font-size:13px; color:var(--wpec-muted);
    display:flex; align-items:center; justify-content:center;
}
.wpec-detail-close:hover { background:var(--wpec-hover); }

/* ── Modal ── */
.wpec-modal-overlay {
    position:fixed; inset:0;
    background:rgba(26,23,20,.55);
    backdrop-filter:blur(4px);
    display:flex; align-items:center; justify-content:center;
    z-index:99999; padding:20px;
    animation:wpec-fade-in .2s ease;
}
@keyframes wpec-fade-in { from{opacity:0} to{opacity:1} }
.wpec-modal-box {
    background:var(--wpec-surface);
    border-radius:16px; width:100%; max-width:540px;
    max-height:90vh; overflow-y:auto; position:relative;
    box-shadow:0 24px 64px rgba(26,23,20,.25);
    animation:wpec-pop-in .25s cubic-bezier(.34,1.56,.64,1);
}
@keyframes wpec-pop-in {
    from { opacity:0; transform:scale(.92) translateY(20px); }
    to   { opacity:1; transform:scale(1)   translateY(0); }
}
.wpec-modal-close {
    position:absolute; top:14px; right:14px;
    background:rgba(26,23,20,.08); border:none; border-radius:50%;
    width:30px; height:30px; display:flex; align-items:center; justify-content:center;
    cursor:pointer; font-size:13px; color:var(--wpec-text); z-index:1;
}
.wpec-modal-close:hover { background:rgba(26,23,20,.16); }

/* ── Event Card ── */
.wpec-event-card { padding:0; }
.wpec-card-hero {
    border-radius:16px 16px 0 0; overflow:hidden;
    height:190px; background:var(--wpec-hover); position:relative;
}
.wpec-card-hero img { width:100%; height:100%; object-fit:cover; }
.wpec-card-hero-placeholder {
    width:100%; height:100%;
    display:flex; align-items:center; justify-content:center; font-size:60px;
}
.wpec-card-body { padding:22px 26px 26px; }
.wpec-card-badge {
    display:inline-flex; align-items:center; gap:5px;
    padding:3px 11px; border-radius:20px;
    font-size:11px; font-weight:600; color:#fff; margin-bottom:10px;
}
.wpec-card-title {
    font-family:var(--wpec-head); font-size:22px; font-weight:700;
    color:var(--wpec-text); line-height:1.25; margin:0 0 12px;
}
.wpec-card-meta { display:flex; flex-direction:column; gap:6px; margin-bottom:16px; }
.wpec-card-meta-row {
    display:flex; align-items:flex-start; gap:7px;
    font-size:12px; color:var(--wpec-muted);
}
.wpec-card-meta-row strong { color:var(--wpec-text); font-weight:500; }
.wpec-meta-icon { font-size:14px; flex-shrink:0; }
.wpec-card-excerpt {
    font-size:13px; line-height:1.7; color:#4a4642;
    margin-bottom:18px;
    border-top:1px solid var(--wpec-border); padding-top:14px;
}
.wpec-card-actions { display:flex; gap:8px; flex-wrap:wrap; }
.wpec-card-btn {
    display:inline-flex; align-items:center; gap:5px;
    padding:9px 18px; border-radius:8px; font-size:12px;
    font-weight:600; font-family:var(--wpec-body);
    text-decoration:none; cursor:pointer; border:none;
    transition:filter var(--wpec-trans), transform var(--wpec-trans);
}
.wpec-card-btn:hover { filter:brightness(1.1); transform:translateY(-1px); }
.wpec-card-btn-primary { background:var(--wpec-text); color:#fff; }
.wpec-card-btn-outline {
    background:transparent; color:var(--wpec-text);
    border:1.5px solid var(--wpec-border);
}

/* ── Password modal ── */
.wpec-password-box { max-width:380px; }
.wpec-password-input {
    width:100%; box-sizing:border-box;
    padding:10px 12px; border:1.5px solid var(--wpec-border);
    border-radius:8px; font-size:14px; font-family:var(--wpec-body);
    color:var(--wpec-text); background:var(--wpec-surface);
}
.wpec-password-input:focus { outline:none; border-color:var(--wpec-text); }
.wpec-password-error {
    color:var(--wpec-accent); font-size:12px; margin:8px 0 0;
}

/* ── Responsive ── */
@media (max-width:560px) {
    .wpec-wrap { padding:12px; }
    .wpec-month-grid { gap:0; }
    .wpec-day-cell { min-height:54px; padding:3px 2px; }
    .wpec-day-num { font-size:10px; width:18px; height:18px; }
    .wpec-event-pill { font-size:8px; }
    .wpec-pill-title { display:none; }
    .wpec-header { flex-direction:column; }
    .wpec-week-view { grid-template-columns:1fr; }
}
