/* public/css/archive.css — QDQ archivio abbonati
   UIkit fa il layout, qui solo brand + griglia calendario */

/* ── Variabili brand ─────────────────────────────────────────────── */
.qdq-archive {
    --qdq-brand:      #c8a87a;
    --qdq-brand-dk:   #ff0000;
    --qdq-brand-bg:   #fdf5eb;
    --qdq-brand-mid:  #e8d8c0;
    --qdq-issued-bg:  #ffffff;
    --qdq-issued-border:  red;
    --qdq-notyetissued-bg:  #eaeaea;
    --qdq-notyetissued-border:  #ccc;
    max-width: 400px;
    margin: 0 auto;
}

/* ── Header ──────────────────────────────────────────────────────── */
.qdq-header {
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--qdq-brand-mid);
}
.qdq-logo { height: 48px; width: auto; }

/* ── Status bar ──────────────────────────────────────────────────── */
.qdq-status-bar { font-size: .88rem; font-weight: 500; }

/* ── Bottone preferenze ──────────────────────────────────────────── */
.qdq-prefs-btn {
    background: var(--qdq-brand-bg) !important;
    border: 1px solid var(--qdq-brand-mid) !important;
    border-radius: 20px !important;
    color: #7a4a18 !important;
    font-size: .78rem !important;
    font-weight: 600 !important;
    white-space: nowrap;
    transition: background .15s, border-color .15s;
}
.qdq-prefs-btn:hover {
    background: #f0e0c8 !important;
    border-color: var(--qdq-brand) !important;
}

/* ── Griglia calendario 7 colonne ────────────────────────────────── */
.qdq-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

/* ── Cella base: box "documento" elegante ────────────────────────── */
.qdq-day {
    position: relative;
    aspect-ratio: 1;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: #ffffff;
    border: 1px solid #e2e2e2;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
    /* reset per il <button> usato dai giorni disponibili */
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    -webkit-appearance: none;
    appearance: none;
}

/* Icona PDF centrata */
.qdq-d-ico {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}
.qdq-d-ico svg { display: block; }

/* Disponibile: cliccabile */
.qdq-day-issued {
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.qdq-day-issued:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, .12);
    border-color: var(--qdq-brand);
    text-decoration: none;
}

/* In arrivo (oggi, lingua non ancora pubblicata) */
.qdq-day-notyet {
    border-style: dashed;
    border-color: #d2d2d2;
    background: #fafafa;
}
.qdq-day-notyet .qdq-d-ico { opacity: .35; }

/* Giorno senza numero (domenica, festivo, buco) */
.qdq-day-missing {
    background: #fafafa;
    border-color: #ececec;
    box-shadow: none;
}
.qdq-day-missing .qdq-d-ico { opacity: .16; }
.qdq-day-missing .qdq-d-num { color: #c4c4c4; }

/* Fuori range / futuro: cella vuota, nessun box */
.qdq-day-out {
    background: transparent;
    border: none;
    box-shadow: none;
}

/* ── Badge conteggio lingue ──────────────────────────────────────────────── */
.qdq-d-count {
    position: absolute;
    top: -5px; right: -5px;
    background: var(--qdq-brand-dk);
    color: #fff;
    font-size: .52rem;
    font-weight: 700;
    min-width: 14px; height: 14px;
    padding: 2px;
    border-radius: 999px;
    border: 1px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .5);
}

/* ── Bottoni download nel modal ──────────────────────────────────────────── */
.qdq-dl-btn {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 10px 14px !important;
    border-radius: 8px !important;
    font-size: .88rem !important;
    font-weight: 600 !important;
    border: 1px solid var(--qdq-brand-mid) !important;
    background: var(--qdq-brand-bg) !important;
    transition: background .15s, border-color .15s;
    text-decoration: none !important;
    color: #5a3010 !important;
}
.qdq-dl-btn:hover {
    background: #f0e0c8 !important;
    border-color: var(--qdq-brand) !important;
}
.qdq-dl-flag  { font-size: 1.3rem; flex-shrink: 0; }
.qdq-dl-label { flex: 1; }
.qdq-dl-icon  { margin-left: auto; color: var(--qdq-brand); }

/* ── Numero del giorno (angolo alto-sinistra, discreto) ──────────── */
.qdq-d-num {
    position: absolute;
    top: 4px;
    left: 5px;
    font-size: .62rem;
    font-weight: 700;
    line-height: 1;
    color: var(--qdq-brand-dk);
    opacity: .75;
}
.qdq-day-missing .qdq-d-num { color: #c4c4c4; }

/* ── Modal: lingua e Telegram ────────────────────────────────────── */
.qdq-lang-option.qdq-lang-selected {
    border-color: var(--qdq-brand) !important;
    background:   var(--qdq-brand-bg) !important;
    font-weight: 700 !important;
    color: #7a4a18 !important;
}
.qdq-lang-soon { opacity: .4; cursor: not-allowed !important; }
.qdq-soon-badge {
    font-size: .55rem; font-weight: 800; letter-spacing: .05em;
    background: #e8e0d6; color: #888;
    padding: 1px 4px; border-radius: 3px; margin-left: 4px;
}
.qdq-msg-ok { color: #1a7a3a; }
.qdq-msg-err { color: #c0392b; }
.qdq-tg-ok { color: #1a7a3a; }
.qdq-tg-ko { color: #9a4d10; }
.qdq-btn-telegram {
    background: #229ED9 !important;
    color: #fff !important;
    border: none !important;
    font-weight: 600 !important;
    transition: background .2s;
}
.qdq-btn-telegram:hover    { background: #1a7fb5 !important; }
.qdq-btn-telegram:disabled { background: #8ab8d8 !important; }
#qdq-tg-link-result a { color: #1a6ab5; text-decoration: underline; }