/* Colours: override in your theme on .ns-epk-front */
.ns-epk-front {
    --ns-epk-gap: 14px;
    --ns-epk-text: #fff;
    --ns-epk-accent: #fcc701;
    --ns-epk-btn-bg: #222;
    --ns-epk-btn-text: #fff;
    --ns-epk-line: rgba(127,127,127,.28);
    --ns-epk-surface: rgba(127,127,127,.08);
    container-type: inline-size;
    margin-block: 1.5rem;
    color: var(--ns-epk-text);
}
.ns-epk-front * { box-sizing: border-box; }
.ns-epk-front .ns-epk-title { margin: 0 0 .3em; color: var(--ns-epk-text); }
.ns-epk-front .ns-epk-description { margin: 0 0 1.25em; color: var(--ns-epk-text); }
.ns-epk-icon { flex: 0 0 auto; }

/* ---------- Action bar ---------- */
.ns-epk-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 1.5rem; padding: 0 0 1rem; border-bottom: 1px solid var(--ns-epk-line); }
.ns-epk-front .ns-epk-all-button,
.ns-epk-front .ns-epk-zip-button {
    display: inline-flex; align-items: center; gap: .5em; cursor: pointer;
    border: 1px solid transparent; border-radius: 4px; padding: .7em 1.1em;
    font: inherit; font-weight: 600; line-height: 1.2; box-shadow: none; text-transform: none;
}
.ns-epk-front .ns-epk-all-button { background: var(--ns-epk-btn-bg); color: var(--ns-epk-btn-text); border-color: var(--ns-epk-btn-bg); }
.ns-epk-front .ns-epk-zip-button { background: transparent; color: var(--ns-epk-text); border-color: var(--ns-epk-line); }
.ns-epk-front .ns-epk-all-button:hover,
.ns-epk-front .ns-epk-zip-button:hover:not(:disabled) { opacity: .86; }
.ns-epk-front .ns-epk-zip-button:disabled { opacity: .45; cursor: not-allowed; }
.ns-epk-front .ns-epk-selection-count { font-size: .9em; color: var(--ns-epk-text); }

/* ---------- Groups ---------- */
.ns-epk-group { margin: 0 0 1.75rem; }
.ns-epk-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 .75rem; padding: 0 0 .4rem; border-bottom: 1px solid var(--ns-epk-line); }
.ns-epk-front .ns-epk-group-title { margin: 0; font-size: .85rem; font-weight: 700; line-height: 1.3; letter-spacing: .12em; text-transform: uppercase; color: var(--ns-epk-text); }
.ns-epk-group-count { margin-left: .4em; font-weight: 400; letter-spacing: 0; color: var(--ns-epk-accent); }
.ns-epk-front .ns-epk-toggle {
    background: transparent; border: 0; box-shadow: none; padding: 0; min-height: 0;
    font: inherit; font-size: .85em; color: var(--ns-epk-accent); cursor: pointer;
    text-decoration: underline; text-underline-offset: 3px; text-transform: none;
}

/* ---------- Cards (shared) ---------- */
.ns-epk-card { position: relative; display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--ns-epk-line); border-radius: 5px; overflow: hidden; transition: border-color .15s, background-color .15s; }
.ns-epk-card.is-selected { border-color: var(--ns-epk-accent); }
.ns-epk-select { position: absolute; z-index: 2; top: 8px; left: 8px; display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 4px; background: rgba(255,255,255,.95); cursor: pointer; }
.ns-epk-select input { margin: 0; width: 16px; height: 16px; cursor: pointer; }
.ns-epk-front .ns-epk-preview { display: block; overflow: hidden; background: var(--ns-epk-surface); text-decoration: none; }
.ns-epk-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ns-epk-preview.is-doc img { object-position: top; }
.ns-epk-file-mark { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: .8em; font-weight: 700; letter-spacing: .08em; color: var(--ns-epk-accent); }
.ns-epk-card-content { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ns-epk-front .ns-epk-file-title { font-weight: 600; font-size: .92em; line-height: 1.3; overflow-wrap: anywhere; color: var(--ns-epk-text); }
.ns-epk-file-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ns-epk-front .ns-epk-file-meta { font-size: .78em; letter-spacing: .03em; white-space: nowrap; color: var(--ns-epk-text); }
.ns-epk-front a.ns-epk-individual {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 32px;
    width: 32px; height: 32px; border: 1px solid var(--ns-epk-accent); border-radius: 4px;
    color: var(--ns-epk-accent); background: transparent; text-decoration: none;
}
.ns-epk-front a.ns-epk-individual:hover,
.ns-epk-front a.ns-epk-individual:focus-visible { background: var(--ns-epk-accent); color: var(--ns-epk-btn-bg); }

/* ---------- Grid groups (photos) ---------- */
.ns-epk-group--grid .ns-epk-items { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--ns-epk-gap); }
.ns-epk-group--grid .ns-epk-preview { aspect-ratio: 16 / 10; }
.ns-epk-group--grid .ns-epk-card-content { margin-top: auto; padding: 9px 11px 10px; }
@container (min-width: 1200px) { .ns-epk-group--grid .ns-epk-items { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@container (max-width: 900px) { .ns-epk-group--grid .ns-epk-items { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container (max-width: 620px) { .ns-epk-group--grid .ns-epk-items { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- List groups (documents) ---------- */
.ns-epk-group--list .ns-epk-items { display: flex; flex-direction: column; }
.ns-epk-group--list .ns-epk-card { flex-direction: row; align-items: center; gap: 12px; padding: 8px 6px; border-width: 0 0 1px; border-radius: 0; }
.ns-epk-group--list .ns-epk-card.is-selected { border-color: var(--ns-epk-line); background: var(--ns-epk-surface); }
.ns-epk-group--list .ns-epk-select { position: static; flex: 0 0 26px; }
.ns-epk-group--list .ns-epk-preview { flex: 0 0 44px; width: 44px; height: 56px; border: 1px solid var(--ns-epk-line); border-radius: 3px; }
.ns-epk-group--list .ns-epk-card-content { flex: 1; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.ns-epk-group--list .ns-epk-file-title { flex: 1 1 14em; }
.ns-epk-group--list .ns-epk-file-row { flex: 0 0 auto; gap: 16px; }

/* ---------- Small screens ---------- */
@container (max-width: 520px) {
    .ns-epk-actions { flex-direction: column; align-items: stretch; }
    .ns-epk-front .ns-epk-all-button,
    .ns-epk-front .ns-epk-zip-button { justify-content: center; width: 100%; }
    .ns-epk-group--list .ns-epk-file-row { flex: 1 0 100%; }
}
