* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Georgia, 'Times New Roman', serif;
    color: #111;
    background: #fff;
}

a { color: inherit; }

/* ---------- Post list page ---------- */

.list-wrap {
    max-width: 640px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 6rem;
}

.list-header.diary-post {
    position: relative;
    text-align: center;
    padding-right: 110px;
    margin-bottom: 3rem;
}

.list-header h1 {
    font-size: 30px;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin: 0 0 0.75rem;
}

.list-header p {
    font-size: 18px;
    font-weight: normal;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

.header-fern {
    position: absolute;
    right: 2rem;
    top: 1.75rem;
    height: 56px;
    width: 56px;
    flex-shrink: 0;
    object-fit: contain;
}

.empty-state {
    text-align: center;
    color: #888;
    font-size: 14px;
    padding: 3rem 0;
}

/* ---------- Continuous diary layout ---------- */

.split-bg {
    position: fixed;
    inset: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    z-index: 0;
}

.split-bg .side-2007 {
    background: #ffffff;
    border-right: 3px solid #000;
}

.split-bg .side-2027 {
    background: #0a0a0a;
}

@media (max-width: 640px) {
    .split-bg { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
    .split-bg .side-2007 { border-right: none; border-bottom: 3px solid #000; }
}

.sticky-date-bar {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 8px 24px;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
}

.lang-toggle {
    display: inline-flex;
    gap: 10px;
}

.lang-toggle a {
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border: 1px solid #000;
    border-radius: 4px;
    background: #fff;
    color: #000;
}

.lang-toggle a.active {
    background: #000;
    color: #fff;
}

.back-to-admin-pill {
    position: absolute;
    left: 24px;
    background: #f5c518;
    color: #111;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.diary-wrap {
    position: relative;
    z-index: 1;
    max-width: 960px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem 6rem;
}

.diary-post {
    position: relative;
    width: min(94%, 900px);
    margin: 0 auto 2.5rem;
    background: #fdfdfd;
    border-radius: 12px;
    padding: 1.75rem 2rem;
    box-shadow:
        -14px 8px 28px rgba(0, 0, 0, 0.35),
        -14px 8px 28px rgba(255, 255, 255, 0.5);
}

.post-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.post-head .diary-title {
    flex: 1;
    text-align: center;
    margin: 0;
}

.post-date {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #888;
    white-space: nowrap;
    padding-top: 4px;
    min-width: 70px;
}

.post-date.right {
    text-align: right;
}

@media (max-width: 560px) {
    .post-date { display: none; }
}

.countdown-box.diary-post {
    text-align: center;
    margin-bottom: 3rem;
}

.countdown-label {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    color: #666;
    margin: 0 0 14px;
}

.countdown-grid {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.countdown-grid > div {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.countdown-grid span {
    font-size: 36px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.countdown-grid small {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 6px;
}

.countdown-done {
    font-size: 24px;
    margin: 0;
}

.diary-title {
    font-size: 20px;
    font-weight: normal;
    margin: 0 0 16px;
}

.diary-content {
    font-size: 16px;
    line-height: 1.75;
    color: #333;
    margin: 0;
}

.preview-banner {
    background: #f5c518;
    color: #111;
    text-align: center;
    padding: 8px;
    border-radius: 8px;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 14px;
}

.tab-nav {
    display: flex;
    gap: 6px;
    margin-bottom: 1.5rem;
}

.tab-nav a {
    padding: 8px 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-decoration: none;
    color: #111;
    font-size: 14px;
}

.tab-nav a.active {
    background: #111;
    color: #fff;
    border-color: #111;
}

.media-carousel {
    position: relative;
    width: 100%;
    margin: 1.5rem auto 0;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

.media-track {
    display: flex;
    transition: transform 0.3s ease;
}

.media-track img,
.media-track video {
    width: 100%;
    flex-shrink: 0;
    height: 320px;
    object-fit: cover;
    display: block;
}

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s, background 0.2s;
}

.nav-arrow:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.45);
}

.nav-arrow.left { left: 10px; }
.nav-arrow.right { right: 10px; }

.dots {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 6px;
}

.dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
}

.media-track img[data-lightbox-item] {
    cursor: zoom-in;
}

.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-content {
    max-width: 92vw;
    max-height: 88vh;
}

.lightbox-content img {
    max-width: 92vw;
    max-height: 88vh;
    object-fit: contain;
    display: block;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
}

.lightbox-nav {
    opacity: 0.7;
    background: rgba(255, 255, 255, 0.15);
}

.lightbox-nav.left { left: 24px; }
.lightbox-nav.right { right: 24px; }

.back-link {
    display: block;
    text-align: center;
    margin-top: 2.5rem;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    font-size: 13px;
}

.back-link a { color: #888; text-decoration: none; }

/* ---------- Hidden admin entrance ---------- */

.version-tag {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 70px;
    height: 44px;
    display: block;
    z-index: 5;
}

.version-tag span {
    position: absolute;
    left: 10px;
    bottom: 10px;
    font-size: 11px;
    color: #999;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    pointer-events: none;
}

/* ---------- Admin ---------- */

.admin-wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 6rem;
    font-family: 'Helvetica Neue', Arial, sans-serif;
    color: #111;
}

.admin-wrap h1 { font-size: 20px; font-weight: 600; }

.admin-wrap label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin: 1rem 0 4px;
}

.admin-wrap input[type="text"],
.admin-wrap input[type="date"],
.admin-wrap input[type="number"],
.admin-wrap input[type="password"],
.admin-wrap textarea,
.admin-wrap select {
    width: 100%;
    padding: 8px 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
}

.admin-wrap textarea { min-height: 120px; }

.admin-wrap .btn {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 10px 18px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 1.5rem;
}

.admin-table th, .admin-table td {
    text-align: left;
    padding: 8px;
    border-bottom: 1px solid #eee;
}

.status-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

.status-pill.published { background: #e6f3e6; color: #1a6b1a; }
.status-pill.scheduled { background: #f2f2f2; color: #666; }

.error-msg {
    background: #fdecea;
    color: #a32d2d;
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 13px;
    margin-top: 1rem;
}

.admin-deco-hook {
    display: none;
}

@media (min-width: 1024px) {
    .admin-deco-hook {
        display: block;
        position: fixed;
        top: 40px;
        left: 12px;
        height: 160px;
        width: auto;
        opacity: 0.9;
        pointer-events: none;
        z-index: 0;
    }
}

.row-actions {
    display: flex;
    gap: 6px;
    white-space: nowrap;
}

.row-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    color: #111;
    text-decoration: none;
}

.row-actions a:hover { background: #f0f0f0; }
.row-actions a.danger:hover { background: #fdecea; }
.row-actions svg { width: 15px; height: 15px; }
