/* A5 desk-calendar design thumbnails + picker (a5-designs.js). Wizard step 2 and editor. */

/* ── The sheet: one design at 210:148, children placed in % by JS, type sized in cqw ── */
.pc-a5s {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 210 / 148;
    overflow: hidden;
    background: #fff;
    container-type: inline-size;
    box-shadow: 0 2px 10px rgba(28, 38, 36, 0.14);
    outline: 1px solid rgba(48, 58, 54, 0.08);
    font-family: 'Inter', system-ui, sans-serif;
    color: #364347;
    line-height: 1;
}

.pc-a5s > span {
    position: absolute;
    display: block;
}

.pc-a5s__photo {
    overflow: hidden;
    background: linear-gradient(135deg, #d9dfd8, #b9c4bd);
}

.pc-a5s__photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pc-a5s .pc-a5s__line {
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e3e7e1;
    white-space: nowrap;
}

.pc-a5s__line.is-bold { border-bottom: 2px solid #283d40; }
.pc-a5s__month { font-weight: 700; color: #29373b; }
.pc-a5s__year { color: #88938f; }

.pc-a5s .pc-a5s__editorial {
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4em;
    text-align: center;
}

.pc-a5s__ed-label { font-size: 0.55em; letter-spacing: 0.15em; font-weight: 700; }
.pc-a5s__ed-month { font-family: Georgia, serif; font-size: 2em; letter-spacing: 0.04em; }
.pc-a5s__ed-year { font-size: 0.8em; }

.pc-a5s .pc-a5s__grid {
    z-index: 3;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-template-rows: auto repeat(6, minmax(0, 1fr));
    align-items: center;
    text-align: center;
}

.pc-a5s__wd {
    padding: 0.35em 0;
    font-size: 0.8em;
    font-weight: 700;
    color: #8a958f;
    border-bottom: 1px solid #e6e9e4;
}

.pc-a5s__grid.is-bold .pc-a5s__d { font-weight: 700; }

.pc-a5s .pc-a5s__caption {
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7570;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
}

/* ── Picker: native radios inside labels (arrow keys move the choice) ── */
.pc-a5p {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .pc-a5p { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.pc-a5p__opt {
    position: relative;
    display: block;
    min-width: 0;
    margin: 0;
    cursor: pointer;
}

.pc-a5p__input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.pc-a5p__card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0 0.6rem 0.7rem;
    border: 1px solid #e3e3dc;
    border-radius: 10px;
    background: #fff;
    color: #1f2937;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.pc-a5p__opt:hover .pc-a5p__card {
    border-color: #b8c0c9;
    box-shadow: 0 6px 18px rgba(26, 54, 93, 0.08);
}

.pc-a5p__input:checked + .pc-a5p__card {
    border: 2px solid #1a365d;
    padding: 0 calc(0.6rem - 1px) calc(0.7rem - 1px);
    box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.08);
}

.pc-a5p__input:focus-visible + .pc-a5p__card {
    outline: 3px solid #c5a059;
    outline-offset: 2px;
}

.pc-a5p__top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.25rem;
}

.pc-a5p__num {
    font-size: 0.75rem;
    font-weight: 700;
    color: #9a7a3a;
    letter-spacing: 0.04em;
}

.pc-a5p__tag {
    font-size: 0.75rem;
    color: #5f6b78;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pc-a5p__check {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 1.25rem;
    height: 1.25rem;
    margin-left: auto;
    border-radius: 50%;
    border: 1px solid #cfd5dc;
    background: #fff;
}

.pc-a5p__input:checked + .pc-a5p__card .pc-a5p__check {
    border-color: #1a365d;
    background: #1a365d;
}

.pc-a5p__input:checked + .pc-a5p__card .pc-a5p__check::after {
    content: '';
    width: 0.35rem;
    height: 0.6rem;
    margin-top: -0.12rem;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.pc-a5p__sheet {
    display: block;
}

.pc-a5p__name {
    display: block;
    margin-top: 0.6rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25;
}

.pc-a5p__desc {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: #5f6b78;
}

.pc-a5p.is-busy .pc-a5p__opt {
    cursor: progress;
}

.pc-a5p.is-busy .pc-a5p__card {
    opacity: 0.6;
}

/* Compact (editor panel / dialog row) */
.pc-a5p--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.pc-a5p--compact .pc-a5p__card {
    padding: 0 0.4rem 0.5rem;
}

.pc-a5p--compact .pc-a5p__input:checked + .pc-a5p__card {
    padding: 0 calc(0.4rem - 1px) calc(0.5rem - 1px);
}

.pc-a5p--compact .pc-a5p__top { min-height: 1.9rem; gap: 0.35rem; }
.pc-a5p--compact .pc-a5p__name { margin-top: 0.4rem; font-size: 0.8125rem; }

@media (prefers-reduced-motion: reduce) {
    .pc-a5p__card { transition: none; }
}

/* Wizard design list on phones: one swipeable row under the live preview, not a 10-card column. */
@media (max-width: 639px) {
    #pc-design-list.pc-a5p {
        display: flex;
        gap: 0.6rem;
        overflow-x: auto;
        padding: 4px 4px 10px;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
    }

    #pc-design-list .pc-a5p__opt {
        flex: 0 0 42%;
        scroll-snap-align: start;
    }

    #pc-design-list .pc-a5p__desc {
        display: none; /* the live preview above repeats the chosen design's name and description */
    }
}
