/* =========================================================
   YOUR LOCAL IT GIRL
   5 MINUTE JOURNAL — HISTORY POPUP
   ========================================================= */

.ylig-history,
.ylig-history * {
    box-sizing: border-box;
}

/* =========================================================
   POPUP OVERLAY
   ========================================================= */

.ylig-history {
    --pink: #ffa7c7;
    --light-pink: #ffecf3;
    --text: #151827;
    --muted: #666875;
    --border: #eadfe5;
    --white: #ffffff;

    position: fixed;
    inset: 0;
    z-index: 999999;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 20px;

    font-family: inherit;
}

.ylig-history.is-open {
    display: flex;
}

/* Darkened background */
.ylig-history-backdrop {
    position: absolute;
    inset: 0;

    background: rgba(21, 24, 39, 0.42);

    opacity: 0;
    transition: opacity .2s ease;
}

.ylig-history.is-open .ylig-history-backdrop {
    opacity: 1;
}

/* =========================================================
   MAIN POPUP
   ========================================================= */

.ylig-history-modal {
    position: relative;
    z-index: 2;

    width: min(640px, 100%);

    /*
     * IMPORTANT:
     * The popup itself does NOT scroll.
     */
    max-height: none;
    overflow: hidden;

    background: #ffffff;

    border-radius: 20px;

    box-shadow:
        0 25px 70px rgba(21, 24, 39, 0.20);

    opacity: 0;

    transform: translateY(10px) scale(.985);

    transition:
        opacity .2s ease,
        transform .2s ease;
}

.ylig-history.is-open .ylig-history-modal {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.ylig-history-modal:focus {
    outline: none !important;
}

/* =========================================================
   INNER CONTENT
   ========================================================= */

.ylig-history-modal-inner {
    padding: 31px 38px 30px;
}

/* =========================================================
   HEADER
   ========================================================= */

.ylig-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px;
}

.ylig-history-header h2 {
    margin: 0;
}

.ylig-history-close {
    position: static;

    flex: 0 0 auto;

    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-left: 20px;
}

/* =========================================================
   CLOSE
   ========================================================= */

.ylig-history-close {
    position: absolute;

    top: 19px;
    right: 20px;

    z-index: 5;

    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: 0 !important;
    border-radius: 50%;

    background: transparent !important;

    color: var(--text) !important;

    font-family: Arial, sans-serif;
    font-size: 29px;
    font-weight: 300;

    line-height: 1;

    cursor: pointer;

    outline: none !important;
    box-shadow: none !important;
}

.ylig-history-close:hover {
    background: var(--light-pink) !important;
}

.ylig-history-close:focus,
.ylig-history-close:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

/* =========================================================
   ENTRY AREA
   ========================================================= */

.ylig-history-entry-card {
    width: 100%;

    padding: 15px 18px 17px;

    border-radius: 14px;

    background: #ffffff;
}

/* =========================================================
   DATE
   ========================================================= */

.ylig-history-date {
    margin-bottom: 11px;

    color: var(--muted);

    font-size: 14px;

    line-height: 1.3;
}

/* =========================================================
   TAGS
   ========================================================= */

.ylig-history-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 8px;

    margin-bottom: 20px;
}

.ylig-history-tag {
    min-height: 34px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 6px;

    padding: 7px 14px;

    border-radius: 999px;

    background: var(--light-pink);

    color: #22242d;

    font-size: 13px;

    line-height: 1;
}

.ylig-history-tag-feeling {
    background: var(--pink);
    color: #ffffff;
}

.ylig-history-feeling-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 17px;
    height: 17px;

    font-size: 16px;
}

/* =========================================================
   SECTION LABELS
   ========================================================= */

.ylig-history-label {
    display: block;

    margin-bottom: 7px;

    color: var(--text);

    font-family: "Instrument Sans", sans-serif;

    font-size: 11px;
    font-weight: 600;

    letter-spacing: .16em;

    line-height: 1.2;
}

/* =========================================================
   PROMPT
   ========================================================= */

.ylig-history-prompt {
    padding: 14px 17px;

    border: 1px solid var(--border);

    border-radius: 12px;

    background: var(--light-pink);

    color: var(--text);

    font-family: Georgia, "Times New Roman", serif;

    font-size: 20px;

    line-height: 1.3;

    letter-spacing: -0.015em;
}

/* =========================================================
   JOURNAL ENTRY
   ========================================================= */

.ylig-history-entry-section {
    margin-top: 15px;
}

.ylig-history-writing {
    min-height: 135px;
    max-height: 135px;

    padding: 14px 17px;

    border: 1px solid var(--border);

    border-radius: 12px;

    background: #ffffff;

    color: var(--text);

    font-family: Georgia, "Times New Roman", serif;

    font-size: 16px;

    line-height: 1.45;

    white-space: pre-wrap;

    overflow: hidden;

    overflow-wrap: anywhere;
}

/* =========================================================
   NAVIGATION
   ========================================================= */

.ylig-history-navigation {
    display: grid;

    grid-template-columns: 1fr auto 1fr;

    align-items: center;

    gap: 12px;

    padding: 17px 0 15px;
}

.ylig-history-nav {
    display: inline-flex !important;

    align-items: center !important;

    gap: 7px !important;

    width: fit-content !important;

    min-height: 32px !important;

    padding: 3px 0 !important;

    border: 0 !important;
    border-radius: 0 !important;

    background: transparent !important;

    color: #606270 !important;

    font-family: inherit !important;

    font-size: 13px !important;

    line-height: 1.2 !important;

    cursor: pointer;

    outline: none !important;

    box-shadow: none !important;
}

.ylig-history-nav-prev {
    justify-self: start;
}

.ylig-history-nav-next {
    justify-self: end;

    color: var(--pink) !important;
}

.ylig-history-nav:hover {
    color: var(--pink) !important;
    background: transparent !important;
}

.ylig-history-nav:focus,
.ylig-history-nav:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

.ylig-history-nav:disabled {
    opacity: .35;
    cursor: default;
}

.ylig-history-nav:disabled:hover {
    color: #606270 !important;
}

.ylig-history-nav-arrow {
    font-family: Arial, sans-serif;

    font-size: 25px;
    font-weight: 300;

    line-height: .7;
}

.ylig-history-counter {
    color: var(--muted);

    font-size: 13px;

    text-align: center;

    white-space: nowrap;
}

/* =========================================================
   FOOTER ACTIONS
   ========================================================= */

.ylig-history-footer {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding-top: 13px;

    border-top: 1px solid var(--border);
}

.ylig-history-action {
    display: inline-flex !important;

    align-items: center !important;

    gap: 7px !important;

    min-height: 31px !important;

    padding: 3px 0 !important;

    border: 0 !important;
    border-radius: 0 !important;

    background: transparent !important;

    color: var(--pink) !important;

    font-family: inherit !important;

    font-size: 13px !important;

    line-height: 1.2 !important;

    cursor: pointer;

    outline: none !important;

    box-shadow: none !important;
}

.ylig-history-action:hover {
    color: #ed78a7 !important;

    background: transparent !important;
}

.ylig-history-action:focus,
.ylig-history-action:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

.ylig-history-action:disabled {
    opacity: .4;
    cursor: default;
}

.ylig-history-action-icon {
    display: inline-flex;

    width: 17px;
    height: 17px;
}

.ylig-history-action-icon svg {
    width: 17px;
    height: 17px;
}

/* =========================================================
   DEMO BUTTON
   ========================================================= */

.ylig-history-demo-launcher {
    position: fixed;

    right: 22px;
    bottom: 22px;

    z-index: 999990;

    min-height: 44px;

    padding: 0 18px;

    border: 1px solid var(--pink) !important;

    border-radius: 999px;

    background: var(--pink) !important;

    color: #ffffff !important;

    font: inherit;

    font-size: 13px;

    cursor: pointer;

    outline: none !important;

    box-shadow: 0 8px 24px rgba(21, 24, 39, .12);
}

.ylig-history-demo-launcher:hover {
    background: #ffffff !important;
    color: var(--pink) !important;
}

/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 700px) {

    .ylig-history {
        padding: 14px;
    }

    .ylig-history-modal {
        width: 100%;
    }

    .ylig-history-modal-inner {
        padding: 27px 25px 25px;
    }

    .ylig-history-header h2 {
        font-size: 34px;
    }

    .ylig-history-writing {
        min-height: 125px;
        max-height: 125px;
    }
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 480px) {

    .ylig-history {
        padding: 8px;
    }

    .ylig-history-modal {
        border-radius: 17px;
    }

    .ylig-history-modal-inner {
        padding: 23px 15px 19px;
    }

    .ylig-history-header {
        padding-bottom: 13px;
        padding-right: 35px;
    }

    .ylig-history-header h2 {
        font-size: 29px;
    }

    .ylig-history-close {
        top: 13px;
        right: 10px;

        width: 31px;
        height: 31px;

        font-size: 27px;
    }

    .ylig-history-entry-card {
        padding: 11px 10px 13px;
    }

    .ylig-history-tags {
        margin-bottom: 17px;
    }

    .ylig-history-tag {
        min-height: 31px;
        padding: 6px 11px;
        font-size: 12px;
    }

    .ylig-history-label {
        font-size: 9px;
        letter-spacing: .15em;
    }

    .ylig-history-prompt {
        padding: 12px 13px;
        font-size: 18px;
        line-height: 1.3;
    }

    .ylig-history-entry-section {
        margin-top: 12px;
    }

    .ylig-history-writing {
        min-height: 105px;
        max-height: 105px;

        padding: 12px 13px;

        font-size: 14px;
        line-height: 1.42;
    }

    .ylig-history-navigation {
        gap: 5px;
        padding: 13px 0 11px;
    }

    .ylig-history-nav {
        font-size: 11px !important;
    }

    .ylig-history-nav-arrow {
        font-size: 22px;
    }

    .ylig-history-counter {
        font-size: 11px;
    }

    .ylig-history-footer {
        padding-top: 10px;
    }

    .ylig-history-action {
        font-size: 11px !important;
    }

    .ylig-history-action-icon,
    .ylig-history-action-icon svg {
        width: 15px;
        height: 15px;
    }
}

/* =========================================================
   ACCESSIBILITY
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .ylig-history-backdrop,
    .ylig-history-modal {
        transition: none;
    }
}