/*
Theme Name: Mac Journal
Author: Satoko
Description: A Classic Mac OS (Platinum) inspired journal theme.
Version: 1.0
License: GNU General Public License v2 or later
Text Domain: mac-journal
*/

/* =============================================
   RESET
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* =============================================
   BASE
   ============================================= */
html { font-size: 13px; }

body {
    font-family: 'DM Mono', 'Courier New', Courier, monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #000;
    background-color: #888;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='2' height='2'%3E%3Crect width='1' height='1' fill='%23777'/%3E%3C/svg%3E");
    background-size: 2px 2px;
    min-height: 100vh;
}

a { color: #000; text-decoration: underline; }
a:hover { text-decoration: none; background: #000; color: #fff; }

img { max-width: 100%; height: auto; border: 1px solid #000; display: block; }

/* =============================================
   MENU BAR (top, always visible)
   ============================================= */
.mac-menubar {
    position: sticky;
    top: 0;
    z-index: 200;
    height: 22px;
    background: #fff;
    border-bottom: 1px solid #000;
    display: flex;
    align-items: center;
    padding: 0 8px;
    gap: 0;
}

.mac-menubar .apple-menu {
    padding: 0 10px 0 2px;
    border-right: 1px solid #ccc;
    margin-right: 4px;
    text-decoration: none;
    color: #000;
    display: flex;
    align-items: center;
    height: 22px;
}

.mac-menubar a {
    display: inline-block;
    padding: 0 10px;
    line-height: 22px;
    color: #000;
    text-decoration: none;
    font-size: 13px;
    white-space: nowrap;
}

.mac-menubar a:hover,
.mac-menubar a.current {
    background: #000;
    color: #fff;
}

.mac-menubar .menubar-right {
    margin-left: auto;
    font-size: 11px;
    color: #444;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* =============================================
   DESKTOP AREA
   ============================================= */
.mac-desktop {
    padding: 12px;
    min-height: calc(100vh - 22px);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

/* =============================================
   DESKTOP ICONS (front page)
   ============================================= */
.desktop-icons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin: 4px 0;
}

.desktop-right {
    flex: 1;
    min-width: 0;
}

.desktop-icon {
    width: 72px;
    text-align: center;
    padding: 6px 4px;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    color: #fff;
    display: block;
}

.desktop-icon:hover {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.55);
    color: #fff;
    text-decoration: none;
}

.desktop-icon .icon-image {
    display: block;
    margin: 0 auto 4px;
    filter: drop-shadow(0 0 3px rgba(255,255,255,0.95)) drop-shadow(1px 2px 3px rgba(0,0,0,0.5));
}

.desktop-icon .icon-label {
    font-size: 11px;
    line-height: 1.3;
    text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
    word-break: break-word;
}

.desktop-welcome {
    color: #fff;
    font-size: 12px;
    text-shadow: 1px 1px 0 #000;
    padding: 8px 4px;
    max-width: 340px;
    margin-bottom: 10px;
}

/* =============================================
   WINDOW
   ============================================= */
.mac-window {
    background: #fff;
    border: 1px solid #000;
    box-shadow: 2px 2px 0 #000;
    margin-bottom: 12px;
    max-width: 720px;
}

/* Title bar */
.mac-titlebar {
    height: 22px;
    background: repeating-linear-gradient(
        180deg,
        #c8c8c8 0px, #c8c8c8 1px,
        #e4e4e4 1px, #e4e4e4 2px
    );
    border-bottom: 1px solid #000;
    display: flex;
    align-items: center;
    padding: 0 6px;
    gap: 5px;
    user-select: none;
    flex-shrink: 0;
}

.mac-titlebar .tb-btn {
    width: 13px;
    height: 13px;
    border: 1px solid #000;
    background: #fff;
    flex-shrink: 0;
    display: inline-block;
}

.mac-titlebar .tb-btn:first-child { margin-right: 2px; }

.mac-titlebar-label {
    flex: 1;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.01em;
    margin-right: 30px; /* visually balance the buttons */
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Toolbar (category page) */
.mac-toolbar {
    height: 28px;
    background: #e4e4e4;
    border-bottom: 1px solid #ccc;
    display: flex;
    align-items: center;
    padding: 0 8px;
    gap: 6px;
}

.mac-tool-btn {
    padding: 2px 10px;
    font-size: 11px;
    font-family: inherit;
    background: #fff;
    border: 1px solid #888;
    box-shadow: 1px 1px 0 #bbb;
    cursor: pointer;
    color: #000;
}

.mac-tool-btn:hover { background: #e8e8e8; }
.mac-tool-btn.active { background: #000; color: #fff; border-color: #000; box-shadow: none; }

/* Path bar */
.mac-pathbar {
    height: 20px;
    background: #f0f0f0;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    padding: 0 10px;
    font-size: 11px;
    color: #555;
    gap: 4px;
}

/* Window body */
.mac-window-body { padding: 14px 16px; }

/* Status bar */
.mac-statusbar {
    height: 18px;
    background: #d4d0c8;
    border-top: 1px solid #000;
    display: flex;
    align-items: center;
    padding: 0 8px;
    gap: 14px;
    font-size: 11px;
    color: #333;
}

.mac-statusbar .sb-item {
    border-right: 1px solid #aaa;
    padding-right: 10px;
}

.mac-statusbar .sb-right { margin-left: auto; }

/* Scroll hint bar */
.mac-scrollbar {
    height: 16px;
    background: #e0e0e0;
    border-top: 1px solid #ccc;
    display: flex;
    align-items: center;
    padding: 0 4px;
    gap: 0;
}
.mac-scrollbar .sb-arrow { font-size: 9px; padding: 0 5px; color: #000; }
.mac-scrollbar .sb-track { flex: 1; height: 6px; background: #fff; border: 1px solid #999; }

/* =============================================
   POST LIST (Finder list view)
   ============================================= */
.post-list { list-style: none; }

.post-list-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
}

.post-list-item:last-child { border-bottom: none; }

.post-list-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-list-info { flex: 1; min-width: 0; }

.post-list-title {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 2px;
}

.post-list-title a { text-decoration: none; color: #000; }
.post-list-title a:hover { text-decoration: underline; background: none; color: #000; }

.post-list-meta {
    font-size: 11px;
    color: #555;
    margin-bottom: 4px;
}

.post-list-excerpt { font-size: 12px; color: #333; }

/* =============================================
   SINGLE POST
   ============================================= */
.post-header {
    border-bottom: 1px solid #ccc;
    padding-bottom: 10px;
    margin-bottom: 14px;
}

.post-title-main {
    font-size: 17px;
    font-weight: 500;
    margin-bottom: 5px;
    line-height: 1.3;
}

.post-meta-row {
    font-size: 11px;
    color: #555;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.post-content { font-size: 13px; line-height: 1.8; }
.post-content p { margin-bottom: 0.9em; }
.post-content h2 { font-size: 15px; border-bottom: 1px solid #000; margin: 1.2em 0 0.6em; padding-bottom: 3px; }
.post-content h3 { font-size: 14px; margin: 1em 0 0.4em; }
.post-content ul, .post-content ol { margin-left: 1.5em; margin-bottom: 0.9em; }
.post-content blockquote { border-left: 3px solid #000; padding-left: 12px; margin: 1em 0; color: #444; font-style: italic; }
.post-content pre { background: #000; color: #fff; padding: 10px; font-size: 12px; overflow-x: auto; margin-bottom: 0.9em; }
.post-content code { background: #eee; border: 1px solid #ccc; padding: 1px 4px; font-size: 12px; }
.post-content img { margin: 0.8em 0; }

.post-nav {
    border-top: 1px solid #ccc;
    margin-top: 16px;
    padding-top: 12px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

/* =============================================
   BUTTONS
   ============================================= */
.mac-btn {
    display: inline-block;
    padding: 3px 12px;
    font-size: 12px;
    font-family: inherit;
    background: #e8e8e8;
    border: 1px solid #000;
    box-shadow: 1px 1px 0 #000;
    cursor: pointer;
    color: #000;
    text-decoration: none;
}

.mac-btn:hover { background: #d8d8d8; color: #000; text-decoration: none; }
.mac-btn:active { box-shadow: none; transform: translate(1px, 1px); }
.mac-btn.default { background: #000; color: #fff; }
.mac-btn.default:hover { background: #333; color: #fff; }

/* =============================================
   CATEGORY: ICON GRID
   ============================================= */
.finder-icon-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 12px;
}

.finder-icon {
    width: 84px;
    text-align: center;
    padding: 8px 4px;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    color: #000;
    display: block;
}

.finder-icon:hover {
    background: #d8d8d8;
    border-color: #888;
    color: #000;
    text-decoration: none;
}

.finder-icon-img { display: block; margin: 0 auto 6px; filter: drop-shadow(1px 2px 2px rgba(0,0,0,0.2)); }
.finder-icon-label { font-size: 11px; line-height: 1.3; word-break: break-word; }

/* =============================================
   CATEGORY: LIST VIEW
   ============================================= */
.finder-list-header {
    display: flex;
    background: #e8e8e8;
    border-bottom: 1px solid #ccc;
    font-size: 11px;
    font-weight: 500;
}

.finder-list-header div,
.finder-list-row div { padding: 3px 8px; border-right: 1px solid #ccc; }

.finder-list-header div:last-child,
.finder-list-row div:last-child { border-right: none; }

.finder-list-row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #eee;
    font-size: 12px;
    text-decoration: none;
    color: #000;
}

.finder-list-row:hover { background: #d8d8d8; color: #000; }
.finder-list-row:last-child { border-bottom: none; }

.finder-col-name { flex: 1; min-width: 0; }
.finder-col-date { width: 100px; flex-shrink: 0; }
.finder-col-kind { width: 70px; flex-shrink: 0; }

/* =============================================
   PAGINATION
   ============================================= */
.mac-pagination {
    display: flex;
    gap: 4px;
    padding-top: 12px;
    border-top: 1px solid #ccc;
    flex-wrap: wrap;
}

.mac-pagination a,
.mac-pagination span {
    display: inline-block;
    padding: 2px 9px;
    font-size: 12px;
    border: 1px solid #888;
    background: #e8e8e8;
    box-shadow: 1px 1px 0 #bbb;
    color: #000;
    text-decoration: none;
}

.mac-pagination a:hover { background: #d8d8d8; color: #000; text-decoration: none; }
.mac-pagination .current { background: #000; color: #fff; border-color: #000; box-shadow: none; }

/* =============================================
   ABOUT PAGE
   ============================================= */
.about-profile {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.about-avatar {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border: 1px solid #000;
    background: #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    overflow: hidden;
}

.about-avatar img { border: none; width: 100%; height: 100%; object-fit: cover; }

.about-name { font-size: 16px; font-weight: 500; margin-bottom: 3px; }
.about-desc { font-size: 12px; color: #444; margin-bottom: 8px; }

.info-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 12px; }
.info-table td { border: 1px solid #ccc; padding: 4px 8px; }
.info-table td:first-child { background: #e8e8e8; font-weight: 500; width: 90px; }

/* =============================================
   DESKTOP OPEN WINDOWS
   ============================================= */
.desktop-windows {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0;
    margin-top: 8px;
}

.desktop-win {
    flex: 0 0 auto;
    width: 340px;
    max-width: calc(100vw - 24px);
}

/* Recent posts list in desktop window */
.desktop-post-list {
    list-style: none;
}

.desktop-post-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #eee;
}

.desktop-post-item:last-child { border-bottom: none; }

.desktop-post-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.desktop-post-info a {
    font-size: 12px;
    color: #000;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.desktop-post-info a:hover { text-decoration: underline; background: none; color: #000; }

.desktop-post-date {
    font-size: 10px;
    color: #888;
}

/* =============================================
   RESPONSIVE (minimal, just prevent overflow)
   ============================================= */
@media (max-width: 520px) {
    .mac-desktop { padding: 6px; }
    .finder-col-date, .finder-col-kind { display: none; }
    .mac-desktop { flex-direction: column; }
    .desktop-icons { flex-direction: row; flex-wrap: wrap; justify-content: center; margin: 0 0 10px 0; }
    .about-profile { flex-direction: column; }
    .desktop-win { width: 100%; }
}
