body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: url("images/pink2.jpg") center center / cover no-repeat fixed;
    background-color: #1c1b2b;
    color: black;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

.wrapper {
    width: min(95%, 1500px);
    min-height: 100vh;
    margin: 0 auto;
    padding: 10px 0;
}

/* PAGE LAYOUT */
.page-layout {
    min-height: calc(100vh - 20px);
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 20px;
    align-items: stretch;
}

/* LEFT SIDEBAR */
.sidebar-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.side-panel {
    border: 2px solid #fdc0cb;
    background: rgba(24, 20, 40, 0.82);
    box-shadow: 0 0 10px rgba(253, 192, 203, 0.22);
    min-width: 0;
    overflow: visible;
}

.nav-panel {
    margin: 0;
}

.panel-title {
    padding: 16px;
    font-size: clamp(18px, 2vw, 22px);
    font-weight: bold;
    text-align: center;
    color: #fdc0cb;
    border-bottom: 2px solid #fdc0cb;
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
}

.side-link {
    display: block;
    width: 100%;
    padding: 18px 12px;
    text-align: center;
    text-decoration: none;
    color: #fdc0cb;
    font-size: clamp(16px, 1.4vw, 18px);
    font-weight: bold;
    border-top: 2px solid #fdc0cb;
    background: rgba(253, 192, 203, 0.12);
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.35);
    transition: 0.2s ease;
}

.side-link:hover {
    background: rgba(253, 192, 203, 0.22);
}

.side-dropdown {
    position: relative;
}

.dropdown-toggle {
    width: 100%;
    border: none;
    cursor: pointer;
    font: inherit;
    appearance: none;
    -webkit-appearance: none;
}

.dropdown-toggle.side-link {
    display: block;
    width: 100%;
    padding: 18px 12px;
    font-size: clamp(16px, 1.4vw, 18px);
    font-weight: bold;
    text-align: center;
    color: #fdc0cb;
    text-decoration: none;
    border-top: 2px solid #fdc0cb;
    background: rgba(253, 192, 203, 0.12);
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    transition: 0.2s ease;
}

.dropdown-toggle.side-link:hover {
    background: rgba(253, 192, 203, 0.22);
}

.dropdown-menu {
    position: absolute;
    top: 50%;
    left: calc(100% + 6px);
    transform: translateY(-18px);
    min-width: 260px;
    max-height: min(70vh, 520px);
    overflow-y: auto;
    background: rgba(24, 20, 40, 0.96);
    border: 2px solid #fdc0cb;
    box-shadow: 0 0 14px rgba(253, 192, 203, 0.25);
    border-radius: 10px;
    padding: 8px;
    display: none;
    z-index: 1000;
}

.side-dropdown.open .dropdown-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.side-dropdown.open::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 100%;
    transform: translateY(-50%);
    width: 8px;
    height: 2px;
    background: #fdc0cb;
    box-shadow: 0 0 6px rgba(253, 192, 203, 0.45);
    z-index: 1001;
    pointer-events: none;
}

.dropdown-item {
    display: block;
    padding: 14px 16px;
    text-decoration: none;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: black;
    background: rgba(255, 241, 246, 0.88);
    border: 2px solid #fdc0cb;
    border-radius: 8px;
    transition: 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(253, 192, 203, 0.45);
    transform: translateY(-2px);
}

/* ICON PANEL */
.icon-panel {
    padding: 12px;
    background: rgba(24, 20, 40, 0.82);
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.icon-button {
    aspect-ratio: 1 / 1;
    background: rgba(253, 192, 203, 0.12);
    border: 2px solid #fdc0cb;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: 0.2s ease;
    color: #fdc0cb;
    font-weight: bold;
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.35);
    text-align: center;
    padding: 8px;
    overflow: hidden;
}

.icon-button:hover {
    background: rgba(253, 192, 203, 0.22);
    box-shadow: 0 0 10px rgba(253, 192, 203, 0.28);
    transform: translateY(-2px);
}

.icon-button img {
    width: 60%;
    height: auto;
    display: block;
}

.corner-sticker {
    position: fixed;
    bottom: 15px;
    left: 15px;
    width: clamp(50px, 7vw, 70px);
    height: auto;
    z-index: 999;
}

/* CENTER BOX */
.content-box {
    position: relative;
    width: 100%;
    min-height: 0;
    padding: 14px 18px 16px;
    border: 2px solid #fdc0cb;
    background: rgba(24, 20, 40, 0.78);
    border-radius: 8px;
    box-shadow: 0 0 12px rgba(253, 192, 203, 0.18);
    display: flex;
    flex-direction: column;
}

.header {
    text-align: center;
    margin-bottom: 10px;
    padding-left: 60px;
    flex: 0 0 auto;
}

.header img {
    display: block;
    width: min(58%, 430px);
    max-height: 110px;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
}

/* HOME BUTTON */
.home-button {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 52px;
    height: 52px;
    background: rgba(24, 20, 40, 0.92);
    border: 2px solid #fdc0cb;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(253, 192, 203, 0.45);
    z-index: 20;
    transition: 0.2s ease;
}

.home-button:hover {
    background: rgba(40, 30, 60, 0.96);
    box-shadow: 0 0 14px rgba(253, 192, 203, 0.38);
    transform: translateY(-2px);
}

.home-button img {
    width: 70%;
    height: auto;
    display: block;
}

/* JOURNAL */
.journal-page {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    min-height: 0;
    flex: 1 1 auto;
}

.featured-journal {
    border: 2px solid #fdc0cb;
    background: rgba(255, 241, 246, 0.9);
    color: black;
    min-width: 0;
    min-height: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.journal-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    border-bottom: 2px solid #fdc0cb;
    padding: 10px 16px;
    flex: 0 0 auto;
}

.journal-title {
    font-size: 24px;
    color: black;
}

.journal-date {
    font-size: 18px;
    text-align: right;
    color: black;
}

.journal-body {
    padding: 18px 22px;
    font-size: 17px;
    line-height: 1.5;
    white-space: pre-wrap;
    color: black;
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
}

.journal-controls {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(220px, 2fr);
    gap: 8px;
    align-items: stretch;
    flex: 0 0 auto;
}

.recent-dropdown-box,
.archive-button-box {
    border: 2px solid #fdc0cb;
    background: rgba(255, 241, 246, 0.9);
    min-width: 0;
}

.recent-dropdown {
    width: 100%;
}

.recent-dropdown summary {
    list-style: none;
    cursor: pointer;
    padding: 12px 16px;
    font-size: 18px;
    color: black;
}

.recent-dropdown summary::-webkit-details-marker {
    display: none;
}

.recent-list {
    border-top: 2px solid #fdc0cb;
    display: flex;
    flex-direction: column;
    max-height: 220px;
    overflow-y: auto;
}

.recent-entry-button {
    border: none;
    border-top: 1px solid #fdc0cb;
    background: rgba(255, 241, 246, 0.95);
    text-align: left;
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font: inherit;
    color: black;
}

.recent-entry-button:hover {
    background: rgba(253, 192, 203, 0.35);
}

.recent-entry-title {
    font-size: 18px;
}

.recent-entry-date {
    font-size: 14px;
}

.archive-button-box {
    padding: 12px 16px;
    text-decoration: none;
    color: black;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    text-align: center;
    transition: 0.2s ease;
}

.archive-button-box:hover {
    background: rgba(253, 192, 203, 0.35);
}

.archive-subtext {
    font-size: 14px;
    margin-top: 6px;
}

@media (max-width: 1100px) {
    .wrapper {
        min-height: auto;
        padding: 20px 0;
    }

    .page-layout {
        min-height: auto;
        grid-template-columns: 1fr;
    }

    .content-box {
        min-height: auto;
    }

    .header {
        padding-left: 0;
        padding-top: 60px;
    }

    .header img {
        width: min(85%, 520px);
        max-height: none;
    }

    .home-button {
        top: 10px;
        left: 10px;
    }

    .dropdown-menu {
        top: calc(100% + 8px);
        left: 0;
        transform: none;
        min-width: 100%;
        max-height: none;
    }

    .side-dropdown.open::after {
        display: none;
    }

    .journal-controls {
        grid-template-columns: 1fr;
    }

    .featured-journal {
        flex: 0 0 auto;
    }

    .journal-body {
        overflow: visible;
    }
}

@media (max-width: 700px) {
    .journal-topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .journal-date {
        text-align: left;
    }

    .journal-body {
        padding: 18px 20px;
        font-size: 18px;
    }
}

@media (max-width: 600px) {
    .corner-sticker {
        width: 48px;
        bottom: 10px;
        left: 10px;
    }
}