/*
 * The press kit editor (templates/views/tools/press_kit_editor.html).
 *
 * The panes and the phone's sheets are the design frame's shell
 * (static/css/design_frame.css); this is the editor inside them: folding
 * groups in the rail, the kit in a frame on the stage, the checklist and the
 * sending in the right-hand column. Class prefix `ek-`.
 */

.ek-page { max-width: 1560px; margin: 0 auto; padding: 0 1.25rem 3rem; color: #ccc; }
.ek-head { margin: .5rem 0 1rem; }
.ek-head h1 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0 0 .35rem; }
.ek-lede { color: #9a9a9a; max-width: 760px; line-height: 1.6; margin: 0; }
.ek-lede a { color: #ff5555; }

.ek-welcome, .ek-errors, .ek-draft {
    margin: 0 0 1rem; padding: .8rem 1rem; border-radius: 6px; font-size: .92rem; line-height: 1.55;
}
.ek-welcome { background: #10251a; border: 1px solid #1d5c38; color: #cfe9d9; }
.ek-errors { background: #2a1212; border: 1px solid #6b2424; color: #ffc9c9; }
.ek-errors p { margin: 0; }
.ek-draft { background: #241f10; border: 1px solid #5c4d1d; color: #eadfbf; }
.ek-draft p { margin: 0 0 .5rem; }

/* --- the panes ------------------------------------------------------------ */

@media (min-width: 1200px) {
    .ek-editor .df-shell-body { grid-template-columns: 380px minmax(0, 1fr) 300px; }
}
@media (min-width: 900px) {
    .ek-stage-box {
        aspect-ratio: auto; height: calc(100vh - var(--df-header) - 132px); min-height: 460px;
        max-height: none;
    }
}
.ek-stage-box { background: #0a0a0a; border: 1px solid #222; border-radius: 10px; }
.ek-frame { display: block; width: 100%; height: 100%; border: 0; background: #0a0a0a; }
.ek-stage-box.is-phone .ek-frame { width: 390px; max-width: 100%; margin: 0 auto; border-left: 1px solid #2a2a2a; border-right: 1px solid #2a2a2a; }
.ek-stage-empty {
    position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: .5rem; color: #666; text-align: center; padding: 1rem; pointer-events: none;
}
.ek-stage-empty i { font-size: 2rem; }
.ek-stage-note { margin: 0; color: #777; font-size: .8rem; }

.ek-stage-bar { gap: .5rem .75rem; }
.ek-widths { display: inline-flex; border: 1px solid #333; border-radius: 6px; overflow: hidden; }
.ek-widths button { background: none; border: 0; color: #999; padding: .35rem .65rem; cursor: pointer; font: inherit; font-size: .8rem; display: inline-flex; gap: .35rem; align-items: center; }
.ek-widths button.is-on { background: #222; color: #fff; }
.ek-dirty { color: #f2c14e; font-size: .82rem; margin-left: auto; display: inline-flex; align-items: center; gap: .35rem; }
.ek-dirty i { font-size: .5rem; }
.ek-dirty[hidden] { display: none; }
.ek-save {
    margin-left: auto; background: #ff0000; color: #fff; border: 0; border-radius: 6px; padding: .55rem 1rem;
    font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; display: inline-flex; gap: .45rem; align-items: center;
}
.ek-dirty:not([hidden]) + .ek-save { margin-left: 0; }
.ek-save:hover { background: #d51007; }
.ek-save.is-busy { opacity: .7; cursor: progress; }

/* --- the groups ------------------------------------------------------------ */

.ek-panel { background: #111; border: 1px solid #262626; border-radius: 8px; margin-bottom: 10px; }
.ek-panel-title { margin: 0; font-size: 1rem; }
.ek-panel-head {
    width: 100%; display: grid; grid-template-columns: 1.4rem minmax(0, 1fr) auto; grid-template-rows: auto auto;
    column-gap: .6rem; align-items: center; text-align: left; background: none; border: 0; color: #fff;
    padding: .8rem 1rem; cursor: pointer; font: inherit;
}
.ek-panel-head > i:first-child { grid-row: span 2; color: #ff4d4d; font-size: 1rem; }
.ek-panel-name { font-weight: 800; letter-spacing: .02em; }
.ek-panel-blurb { grid-column: 2; color: #8a8a8a; font-size: .78rem; font-weight: 400; }
.ek-chevron { grid-column: 3; grid-row: 1 / span 2; color: #777; transition: transform .15s; }
.ek-panel-head:focus-visible { outline: 2px solid #ff0000; outline-offset: -2px; border-radius: 8px; }
.ek-panel-body { padding: 0 1rem 1rem; }
@media (min-width: 900px) {
    .ek-panel.is-collapsed .ek-panel-body { display: none; }
    .ek-panel.is-collapsed .ek-chevron { transform: rotate(-90deg); }
}
/* On a phone each group is a sheet: its head is a title, not a fold. */
@media (max-width: 899px) {
    .ek-page { padding: 0 1rem 2rem; }
    .ek-panel { background: none; border: 0; margin: 0; }
    .ek-panel-head { cursor: default; padding: .2rem 2.5rem .8rem 0; }
    .ek-chevron { display: none; }
    .ek-panel-body { padding: 0; }
    .ek-dirty span, .ek-widths span { display: none; }
}

/* --- fields ------------------------------------------------------------ */

.ek-editor .form-control {
    width: 100%; box-sizing: border-box; background: #000; border: 1px solid #333; color: #eee;
    padding: .55rem .7rem; border-radius: 5px; font: inherit; font-size: .9rem;
}
.ek-editor textarea.form-control { resize: vertical; line-height: 1.5; }
.ek-editor .form-control:focus { outline: none; border-color: #ff0000; }
.ek-editor select.form-control { appearance: auto; }
.ek-field { margin-bottom: .9rem; min-width: 0; }
.ek-field > label, .ek-label { display: block; color: #ddd; font-size: .82rem; font-weight: 700; margin-bottom: .3rem; }
.ek-help { display: block; color: #8a8a8a; font-size: .76rem; line-height: 1.5; margin-top: .3rem; }
.ek-label + .ek-help { margin: -.15rem 0 .5rem; }
.ek-error { display: block; color: #ff7a7a; font-size: .8rem; margin-top: .3rem; }
.ek-field.has-error .form-control { border-color: #ff6b6b; }
.ek-count { display: block; text-align: right; color: #6f6f6f; font-size: .72rem; margin-top: .2rem; }
.ek-row, .ek-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .7rem; }
.ek-note { background: #101b24; border: 1px solid #1f3a52; color: #c7dcef; border-radius: 6px; padding: .6rem .75rem; font-size: .85rem; line-height: 1.5; }
.ek-check { display: flex; gap: .5rem; align-items: flex-start; color: #bbb; font-size: .84rem; line-height: 1.45; margin: .3rem 0 .5rem; cursor: pointer; }
.ek-check input { margin-top: .2rem; }
.ek-more { margin: .6rem 0 .4rem; }
.ek-more > summary { cursor: pointer; color: #ddd; font-weight: 700; font-size: .85rem; padding: .4rem 0; }
.ek-more[open] > summary { margin-bottom: .6rem; }
.is-flash { animation: ek-flash 1.2s ease-out; }
@keyframes ek-flash { 0% { box-shadow: 0 0 0 3px rgba(29, 185, 84, .8); } 100% { box-shadow: 0 0 0 0 rgba(29, 185, 84, 0); } }
.ek-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ek-paste { background: #0d0d0d; border: 1px dashed #3a3a3a; border-radius: 6px; padding: .7rem; margin-bottom: 1rem; }
.ek-paste > label { display: block; color: #fff; font-weight: 700; font-size: .85rem; margin-bottom: .35rem; }
.ek-paste[hidden] { display: none; }

.ek-photo { border-top: 1px solid #222; padding-top: .9rem; margin-top: .3rem; }

/* --- rows ------------------------------------------------------------ */

.ek-rows { margin: .4rem 0 1rem; }
.ek-rowset { position: relative; padding-right: 2.1rem; margin-bottom: .5rem; display: grid; gap: .4rem; }
.ek-rowset .ek-row { gap: .4rem; }
.ek-rowset--inline { grid-template-columns: minmax(0, 1fr); }
.ek-rowset--pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ek-rowset--gig { grid-template-columns: 7.5rem minmax(0, 1.4fr) minmax(0, 1fr); }
.ek-rowset--input { grid-template-columns: minmax(0, 1fr) minmax(0, .8fr) minmax(0, 1fr); }
.ek-gig-head { display: grid; grid-template-columns: 7.5rem minmax(0, 1.4fr) minmax(0, 1fr); gap: .4rem; padding-right: 2.1rem; color: #777; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .3rem; }
.ek-remove {
    position: absolute; right: 0; top: .3rem; width: 1.8rem; height: 1.8rem; border-radius: 50%;
    border: 1px solid #333; background: #161616; color: #999; cursor: pointer; display: inline-flex;
    align-items: center; justify-content: center;
}
.ek-remove:hover { color: #fff; border-color: #ff4d4d; }
.ek-remove[hidden] { display: none; }
.ek-add {
    background: none; border: 1px dashed #444; color: #ccc; border-radius: 5px; padding: .45rem .8rem;
    font: inherit; font-size: .82rem; cursor: pointer; display: inline-flex; gap: .4rem; align-items: center;
}
.ek-add:hover { border-color: #ff4d4d; color: #fff; }
.ek-add[hidden] { display: none; }
@media (max-width: 520px) {
    .ek-rowset--gig, .ek-gig-head { grid-template-columns: 5.5rem minmax(0, 1fr) minmax(0, .8fr); }
    .ek-row, .ek-grid, .ek-rowset--pair, .ek-rowset--input { grid-template-columns: minmax(0, 1fr); }
}

/* --- look: themes and the order ------------------------------------------- */

.ek-themes { border: 0; padding: 0; margin: 0 0 1rem; display: grid; gap: .45rem; }
.ek-theme { display: block; cursor: pointer; }
.ek-theme input { position: absolute; opacity: 0; }
.ek-theme-card { display: flex; gap: .7rem; align-items: center; padding: .5rem; border: 1px solid #2a2a2a; border-radius: 6px; }
.ek-theme input:checked + .ek-theme-card { border-color: #ff0000; background: #1a0d0d; }
.ek-theme input:focus-visible + .ek-theme-card { outline: 2px solid #ff0000; outline-offset: 2px; }
.ek-theme-swatch { flex: 0 0 2.6rem; height: 2.6rem; display: flex; align-items: center; justify-content: center; border-radius: 4px; border: 1px solid #333; font-weight: 800; }
.ek-theme-text strong { display: block; color: #fff; font-size: .88rem; }
.ek-theme-text span { color: #8a8a8a; font-size: .76rem; }
.ek-field--colour input[type="color"] { width: 100%; height: 40px; padding: .15rem; background: #000; border: 1px solid #333; border-radius: 5px; cursor: pointer; }

.ek-sections { list-style: none; margin: .5rem 0 .7rem; padding: 0; display: grid; gap: .4rem; }
.ek-section {
    display: grid; grid-template-columns: 1.2rem 1.4rem minmax(0, 1fr) auto; gap: .45rem; align-items: start;
    background: #151515; border: 1px solid #262626; border-radius: 6px; padding: .45rem .5rem;
}
.ek-section.is-off .ek-section-main { opacity: .45; }
.ek-section.is-dragging { border-color: #ff0000; box-shadow: 0 6px 18px rgba(0, 0, 0, .5); }
.ek-grip { color: #666; cursor: grab; touch-action: none; padding-top: .35rem; text-align: center; }
.ek-switch { padding-top: .3rem; }
.ek-section-main { display: grid; gap: .35rem; min-width: 0; }
.ek-section-label { color: #ddd; font-size: .84rem; font-weight: 600; padding-top: .3rem; }
.ek-section-label i { color: #777; width: 1.1rem; }
.ek-section .form-control { padding: .4rem .55rem; font-size: .82rem; }
.ek-move { display: inline-flex; gap: .2rem; }
.ek-move button { width: 1.8rem; height: 1.8rem; border: 1px solid #333; background: #101010; color: #aaa; border-radius: 4px; cursor: pointer; font-size: .75rem; }
.ek-move button:hover { color: #fff; border-color: #ff4d4d; }

/* --- the right-hand column -------------------------------------------------- */

@media (min-width: 900px) {
    .ek-inspector .ek-panel--share { background: none; border: 0; }
}
/* Eight tabs on a phone: tighter type so every label fits. */
@media (max-width: 899px) {
    .ek-editor .df-tab { letter-spacing: 0; font-size: .54rem; padding: 0 1px; }
    .ek-editor .df-tab i { font-size: 1rem; }
}
.ek-card { background: #111; border: 1px solid #262626; border-radius: 8px; padding: .9rem 1rem; margin-bottom: 10px; }
.ek-card h3 { color: #fff; font-size: .95rem; margin: 0 0 .5rem; }
.ek-card p { font-size: .85rem; line-height: 1.55; margin: 0 0 .6rem; }

.ek-progress { height: 6px; background: #262626; border-radius: 99px; overflow: hidden; }
.ek-progress span { display: block; height: 100%; width: 0; background: #1db954; transition: width .3s; }
.ek-progress-label { color: #aaa; font-size: .8rem !important; margin: .45rem 0 .5rem !important; }
.ek-checklist ol { list-style: none; margin: 0; padding: 0; }
.ek-checklist li a { display: flex; gap: .5rem; align-items: center; color: #bbb; text-decoration: none; font-size: .85rem; padding: .3rem 0; }
.ek-checklist li a:hover { color: #fff; }
.ek-checklist li i { color: #3a3a3a; }
.ek-checklist li.is-done i { color: #1db954; }
.ek-checklist li.is-done a { color: #8a8a8a; }
.ek-checklist li.is-first:not(.is-done) a { color: #fff; font-weight: 600; }

.ek-btn {
    display: inline-flex; align-items: center; gap: .4rem; background: #1b1b1b; border: 1px solid #333; color: #ddd;
    border-radius: 5px; padding: .42rem .75rem; font: inherit; font-size: .82rem; text-decoration: none; cursor: pointer;
}
.ek-btn:hover { border-color: #ff4d4d; color: #fff; }
.ek-btn--primary { background: #ff0000; border-color: #ff0000; color: #fff; font-weight: 700; }
.ek-btn--primary:hover { background: #d51007; }
.ek-link { display: flex; gap: .4rem; }
.ek-link input { flex: 1; min-width: 0; background: #000; border: 1px solid #333; color: #7fe0a7; padding: .42rem .55rem; border-radius: 5px; font-family: monospace; font-size: .78rem; }
.ek-send-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin: .2rem 0 .8rem; }
.ek-qr { display: flex; gap: .7rem; align-items: center; margin-bottom: .8rem; }
.ek-qr img { background: #fff; padding: 4px; border-radius: 4px; }
.ek-qr p { font-size: .78rem !important; color: #999; }
.ek-unfurl-label { display: block; color: #777; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .35rem; }
.ek-unfurl-card { display: flex; border: 1px solid #2a2a2a; border-radius: 6px; overflow: hidden; background: #0c0c0c; }
.ek-unfurl-card img { width: 84px; height: 84px; object-fit: cover; flex: 0 0 84px; }
.ek-unfurl-card div { padding: .45rem .6rem; display: grid; gap: .15rem; min-width: 0; }
.ek-unfurl-card strong { color: #fff; font-size: .82rem; }
.ek-unfurl-card span { color: #888; font-size: .72rem; overflow: hidden; text-overflow: ellipsis; }
.ek-unfurl-site { text-transform: uppercase; letter-spacing: .05em; }
.ek-benefits { margin: 0 0 .7rem; padding-left: 1.1rem; font-size: .83rem; line-height: 1.6; color: #bbb; }
.ek-claim { border-color: #3a2a12; background: #15110a; }
.ek-claim a:not(.ek-btn) { color: #ff5555; }
.ek-keep .ek-btn + .ek-btn { margin-left: .3rem; }

.ek-prose { max-width: 820px; margin-top: 2.5rem; }
