
.journal-item {
    position: absolute;  /* remove from grid flow */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    box-sizing: border-box;
}

/* ================= Drawings on Journal Page =============== */
.drawing-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    box-sizing: border-box;
    cursor: pointer;
    transition: transform 0.2s;
}

.drawing-item:hover {
    transform: scale(1.02);
}

.drawing-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    box-shadow: 0 2px 15px rgba(0,0,0,0.25);
    border: 1px solid #ccc;
    border-radius: 4px;
    position: relative;
}


.drawing-caption {
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 0 rgba(255,255,255,0.4);
    user-select: none;
    white-space: nowrap;
}


.transparent {
    border: none;
}


.little-sqaure {
    width: 80%;
    height: 80%;
}

.medium-sqaure {
    width: 140%;
    height: 140%;
}



.medium-tall {
    width: 170%;
    height:60%;
}

.skinny-tall {
    width: 140%;
    height:80%;
}

.medium-wide {
    width: 110%;
    height:100%;
}


/* Styles / decorations */
.drawing-taped .drawing-tape {
    background: linear-gradient(45deg, #c4eeff, #8cd5ff);
}

.drawing-sticker .drawing-img::after {
    content: "🌟";
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 24px;
}

.drawing-tape {
    position: absolute;
    top: -10px;
    left: 50%;
    width: 60px;
    height: 15px;
    background: linear-gradient(45deg, #c4eeff, #8cd5ff);
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 2;
}


/* Caption under image */
.drawing-caption {
    margin-top: 0.5rem;
    font-size: clamp(10px, 1vw, 14px);
    text-align: center;
    font-family: 'Overpass Mono', monospace;
}

/* ================= Modal for Expanded Drawing =============== */
#drawing-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

#drawing-modal .modal-overlay {
    position: absolute;
    top:0; left:0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

#drawing-modal .modal-content {
    position: relative;
    z-index: 10;
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#drawing-modal .modal-content img {
    max-width: 80vw;
    max-height: 70vh;
    object-fit: contain;
    margin-bottom: 1rem;
}

#drawing-modal .modal-caption {
    font-family: 'Overpass Mono', monospace;
    font-size: 1rem;
    text-align: center;
}

#drawing-modal .modal-close {
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 1.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
}



/* journal entries */
.entry-item {
    background: #fffbea;
    border-left: 4px solid #ffcc66;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 1rem;
}

/* ===========================
   Wrapper
   =========================== */
.journal-wrapper {
    width: 100%;
    overflow-x: visible; 
    overflow-y: visible;
    position: relative;
    top: -6vh;
}

/* ===========================
   Layout
   =========================== */
.about-journal-layout {
    display: flex;
    width: 100%;
    height: calc(100vh - 120px);
    padding: 1rem;
    box-sizing: border-box;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: visible;
}

/* ===========================
   Journal Book
   =========================== */
.journal-book {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background: url("/assets/journal/journal-cover.png") center / 100% auto no-repeat;
    width: 80%;
    right: 30vh;
    top: 1rem;
    max-height: none;
    height: auto;
    max-width: none;
    margin: 0 auto;
    padding-bottom: 5rem;
    overflow: visible;
    z-index: 0;
    gap: 0.5rem;
}

/* ===========================
   Journal Pages (kept aspect ratio)
   =========================== */
.journal-page-left,
.journal-page-right {
    margin-top: 4.5rem;
    width: 45%;
    aspect-ratio: 3 / 4;      /* fixed aspect ratio for pages */
    background:
        linear-gradient(rgba(255, 255, 255, 0.507), rgba(255, 255, 255, 0.301)),
        url("/assets/journal/journal-paper.png");
    background-size: cover;
    border-radius: 4px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.05);
    padding-right: .2rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: .2rem;
    justify-items: center;
    align-items: center;
    overflow-y: fixed;
}

/* subtle tilt for realism */
.journal-page-left { transform: rotate(-0.5deg); }
.journal-page-right { transform: rotate(0.5deg); background: none }

/* ===========================
   Polaroids
   =========================== */
.journal-page-left .polaroid,
.journal-page-right .polaroid {
    position: relative;
    width: clamp(120px, 12vw, 160px);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    transform: rotate(calc(var(--r, 0) * 1deg));
}

/* Caption inside polaroid */
.journal-page-left .polaroid .caption,
.journal-page-right .polaroid .caption {
    font-family: 'schoolbell', cursive;
    font-size: clamp(10px, 1vw, 14px);
    line-height: 1.0;
}

/* ===========================
   Right-side Menu
   =========================== */
.journal-menu {
    position: absolute;
    top: 30%;
    left: calc(50% + 20%);
    transform: translateY(-50%);
    width: 18vw;
    background: #fff;
    border: 2px solid #ccc;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 10;
}

.journal-menu button {
    font-family: Schoolbell, cursive;
    background: #fff;
    border: 2px solid #aaa;
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    text-align: left;
    transition: all 0.2s ease;
}

.journal-menu button:hover {
    background: #ffeef6;
    border-color: #ff9acb;
}

.journal-menu button.active {
    background: #ffeef6;
    border-color: #ff9acb;
}

/* Desktop / default */
.page-toggle {
    display: block;            /* show buttons on desktop */
    position: absolute;        /* relative to book or page wrapper */
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.8);
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    cursor: pointer;
    z-index: 20;
}

.page-toggle.left { left: 0.5rem; }
.page-toggle.right { right: 0.5rem; }

.recent-btn {
    font-style: italic;
    opacity: 0.85;
}
.recent-btn.active {
    opacity: 1;
}

.journal-menu .menu-row {
    display: flex;
    align-items: center;   /* vertically center */
    gap: 0.5rem;           /* space between items */
}

.journal-menu .tags {
    display: flex;
    gap: 0.5rem;           /* space between tag buttons */
}



/* About journal pages */
#about-journal-pages-left,
#about-journal-pages-right {
    position: relative;     /* stacking context reference for children */
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 10px;
    overflow: visible;      /* IMPORTANT: allow absolute children to escape */
}

/* ===========================
   Responsive
   =========================== */

/* Mobile: stack vertically */
@media (max-width: 767px) {
    .about-journal-layout { flex-direction: column; justify-content: flex-start; padding: 1rem 0.5rem; }
    .journal-book { width: 90%; margin-bottom: 1.5rem; }
    .journal-page-left, .journal-page-right { width: 90%; height: auto; padding: 1rem; }
    .journal-menu { width: 90%; position: relative; left: 0; top: 0; transform: none; margin: 0 auto; }
}

/* Extra small / iPhone: overfill & left page mostly visible with right side peeking */
@media (max-width: 480px) {
    .journal-book {
        position: fixed;
        top: 12vh;
        width: 260%;                 /* book overfills horizontally */
        max-width: none;
        left: 0;                     /* anchor left side to viewport */
        transform: none;
        aspect-ratio: auto;
        height: auto;
        padding-bottom: 2rem;
        background-size: auto 100%;
        background-position: left;
        display: flex;
        justify-content: flex-start; /* pages start at left */
        z-index: 5;
    }

    .journal-page-left,
    .journal-page-right {
        width: 70vw;                 /* slightly smaller than full screen */
        max-height: 80vh;            /* keep page reasonable height */
        aspect-ratio: 3 / 4;         /* maintain correct page ratio */
        padding: 1rem;
        margin-top: 2rem;
        margin-left: 2rem;
    }
       /* Shrink menu for iPhone */
    .journal-menu {
        width: 80%;        /* smaller width */
        height: 220px;
        padding: 0.6rem;     /* smaller padding */
        font-size: 0.65rem;  /* reduce text size */
        left: 4vh;          /* remove desktop offset */
        right: 1rem;         /* position menu to right edge */
        top: 1rem;           /* move menu a bit down from top */
        transform: none;     /* remove translate */
        margin-top: 57vh;
        overflow-y: scroll;
    }


    .journal-page-right { display: none; } /* hide right page by default */
    .page-toggle {
        position: fixed;      /* fixed to viewport, not book */
        top: 40%;
        transform: translateY(-50%);
        background: rgba(255,255,255,0.9);
        border: 1px solid #ccc;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        font-size: 24px;
        cursor: pointer;
        z-index: 9999;        /* on top of everything */
    }
     #about-journal-pages-left {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        grid-template-rows: repeat(2, 1fr) !important;
        gap: 10px;
    }

    .page-toggle.left { left: 1rem; }
    .page-toggle.right { right: 1rem; }
}


.tags {
  font-style: system-ui;
  display: flex;
  flex-wrap: wrap;      /* allow tags to go to next line if needed */
  gap: 4px;             /* small space between tags */
}

.tags span {
  font-size: 0.7rem;    /* smaller text */
  text-decoration: underline;
  background: #f0f0f0;  /* optional: subtle background for visibility */
  padding: 1px 4px;      /* tiny padding for compactness */
  border-radius: 3px;    /* slightly rounded corners */
  white-space: nowrap;    /* keep tag text on one line */
  cursor: default;
}

/* Individual tags */
.tag-btn {
  font-size: 0.7rem;
  text-decoration: underline;
  padding: 1px 4px;
  border-radius: 3px;
  white-space: nowrap;
  cursor: pointer;
  background: #f0f0f0; /* optional subtle background */
  transition: all 0.2s ease;
  display: inline-block;
}

/* Hover effect */
.tag-btn:hover {
  background: #ffeef6;
}

/* Active / selected tag */
.tag-btn.active {
  background: #ff9acb;
  color: #111;
  text-decoration: underline;
}