/* =========================================================
   HPA VARIANT REGISTRY — DATE CODES / CLOCK FRONTEND V1
========================================================= */


/* =========================================================
   CLOCK ICONS
========================================================= */

.hpc-vrd-clock,
.hpc-vrd-show-all {
    color: var(--vr-muted, #5f5a54);
}

.hpc-vrd-clock svg,
.hpc-vrd-show-all svg {
    display: block;

    width: 20px;
    height: 20px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/*
 * Row Clock OPEN state.
 *
 * Exact same UX as Info and Camera:
 * dark icon + dark border + very light dark background.
 */

.hpc-vrd-clock.is-active,
.hpc-vrd-clock.is-active:hover,
.hpc-vrd-clock.is-active:focus,
.hpc-vrd-clock.is-active:focus-visible,
.hpc-vrd-clock[aria-expanded="true"],
.hpc-vrd-clock[aria-expanded="true"]:hover,
.hpc-vrd-clock[aria-expanded="true"]:focus-visible {
    color: var(--vr-text, #171411);
    border-color: var(--vr-text, #171411);
    background: rgba(23,20,17,.06);
    outline: none;
}


/*
 * Mouse focus cleanup after Clock closes.
 */

.hpc-vrd-clock:not(.is-active):not([aria-expanded="true"]):focus:not(:focus-visible) {
    border-color: transparent;
    background: transparent;
    color: var(--vr-muted, #5f5a54);
    outline: none;
}


/* =========================================================
   VIEW ALL DATES — TOOLBAR CLOCK
========================================================= */

.hpc-vrd-show-all {
    width: 35px;
    min-width: 35px;
    padding: 0 !important;
}

.hpc-vrd-show-all.is-active {
    background: var(--vr-text, #171411) !important;
    border-color: var(--vr-text, #171411) !important;
    color: #fff !important;
}


/* =========================================================
   COLLECTOR VIEW VISIBILITY
========================================================= */

.hpc-vrx:not(.is-collector-view)
.hpc-vrd-show-all,
.hpc-vrx:not(.is-collector-view)
.hpc-vrd-clock {
    display: none !important;
}


/* =========================================================
   DATE PANEL
========================================================= */

.hpc-vrd-panel {
    padding: 13px 12px 15px;
    border-top: 1px solid var(--vr-border, #dfd6ca);
    background: #fffdf9;
}

.hpc-vrd-panel[hidden] {
    display: none !important;
}

.hpc-vrd-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.hpc-vrd-panel-title {
    color: var(--vr-text, #171411);
    font-family: "Libre Baskerville", Georgia, serif;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
}

.hpc-vrd-panel-scheme {
    color: var(--vr-muted, #5f5a54);
    font-size: 10.5px;
    line-height: 1.3;
    text-align: right;
}

.hpc-vrd-years {
    display: grid;
    grid-template-columns:
        repeat(auto-fill, minmax(108px, 1fr));

    column-gap: 0;
    row-gap: 12px;
}

.hpc-vrd-year {
    position: relative;
    min-width: 0;

    padding: 0 6px;

    border: 0;
    border-radius: 0;
    background: transparent;
}

.hpc-vrd-year + .hpc-vrd-year {
    border-left: 1px solid var(--vr-border, #dfd6ca);
}

.hpc-vrd-year:first-child {
    padding-left: 0;
}

.hpc-vrd-year:last-child {
    padding-right: 0;
}

.hpc-vrd-year.is-unconfigured {
    background: transparent;
}

.hpc-vrd-year-title {
    margin-bottom: 7px;
    color: var(--vr-text, #171411);
    font-family: "Libre Baskerville", Georgia, serif;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
}

.hpc-vrd-codes,
.hpc-vrd-squares,
.hpc-vrd-labels {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    align-items: center;
    gap: 3px;
}

.hpc-vrd-codes {
    min-height: 15px;
    margin-bottom: 5px;
}

.hpc-vrd-code {
    position: relative;

    color: var(--vr-text, #171411);
    font-size: 9.5px;
    font-weight: 600;
    line-height: 1.1;
    text-align: center;
    white-space: nowrap;

    cursor: default;
}

.hpc-vrd-code[data-tooltip]:hover::after {
    content: attr(data-tooltip);

    position: absolute;
    left: 50%;
    bottom: calc(100% + 6px);
    z-index: 100;

    min-width: max-content;
    padding: 6px 9px;

    color: #171411;
    background: #fffdf9;
    border: 1px solid #dfd6ca;
    border-radius: 3px;

    box-shadow: 0 5px 14px rgba(23, 20, 17, .12);

    font-size: 24px;
    font-weight: 700;
    line-height: 1;

    white-space: nowrap;

    transform: translateX(-50%);
    pointer-events: none;
}

.hpc-vrd-squares {
    margin-bottom: 4px;
}

.hpc-vrd-square {
    width: 17px;
    height: 17px;
    margin: 0 auto;
    padding: 0;
    border: 1px solid #cfc6bb;
    border-radius: 2px;
    background: transparent;
    cursor: pointer;
    box-sizing: border-box;
    transition:
        background-color .14s ease,
        border-color .14s ease,
        transform .14s ease;
}

.hpc-vrd-square:hover,
.hpc-vrd-square:focus-visible {
    border-color: var(--vr-gold, #b08a52);
    outline: none;
    transform: translateY(-1px);
}

.hpc-vrd-square[data-state="owned"] {
    border-color: #397054;
    background: #397054;
}

.hpc-vrd-square[data-state="wanted"] {
    border-color: #d5a600;
    background: #d5a600;
}

.hpc-vrd-square:disabled {
    border-color: #d8d3cc;
    background: #e7e3dd;
    cursor: default;
    opacity: .72;
    transform: none;
}

.hpc-vrd-square.is-saving {
    opacity: .48;
    cursor: wait;
}

.hpc-vrd-label {
    color: var(--vr-muted, #5f5a54);
    font-size: 8.5px;
    font-weight: 500;
    line-height: 1.1;
    text-align: center;
}

.hpc-vrd-unconfigured-note {
    margin-top: 5px;
    color: var(--vr-muted, #5f5a54);
    font-size: 8.5px;
    line-height: 1.25;
    text-align: center;
}

.hpc-vrd-panel-status {
    min-height: 14px;
    margin-top: 8px;
    color: var(--vr-muted, #5f5a54);
    font-size: 10px;
    line-height: 1.3;
}


/* =========================================================
   LOADING / ERROR
========================================================= */

.hpc-vrd-panel.is-loading
.hpc-vrd-years {
    min-height: 42px;
}

.hpc-vrd-loading,
.hpc-vrd-error {
    padding: 9px 0;
    color: var(--vr-muted, #5f5a54);
    font-size: 11px;
}

.hpc-vrd-error {
    color: #8f3b32;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 760px) {

    .hpc-vrd-panel {
        padding: 11px 9px 13px;
    }

    .hpc-vrd-panel-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }

    .hpc-vrd-panel-scheme {
        text-align: left;
    }

    .hpc-vrd-years {
        grid-template-columns:
            repeat(auto-fill, minmax(105px, 1fr));
        gap: 7px;
    }
}