﻿/* ==========================================================================
   Root Variables & Base
   ========================================================================== */
:root {
    --bg: #0d0d12;
    --surface: #16161d;
    --surface-2: #1e1e28;
    --text: #f0f0f5;
    --muted: #9b9bac;
    --accent: #7a5cff;
    --accent-dim: #5a3fd1;
}

* {
    box-sizing: border-box;
}

body.unsaid-body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, sans-serif;
    min-height: 100vh;
    line-height: 1.6;
    margin: 0;
}

/* ==========================================================================
   Modern Header – minimal, no nav clutter
   ========================================================================== */
.unsaid-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    z-index: 1000;
    background: rgba(13,13,18,0.78);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(122,92,255,0.08);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
}

.brand {
    font-family: 'Playfair Display', serif;
    font-size: 2.1rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
    transition: color 0.3s ease;
}

    .brand:hover {
        color: var(--accent);
    }

/* ==========================================================================
   Main content area
   ========================================================================== */
.unsaid-main {
    min-height: calc(100vh - 80px - 100px); /* header + footer approx */
}

/* On larger screens – gentle constraint */
@media (min-width: 992px) {
    .unsaid-main {
        max-width: 1200px;
        margin-left: auto;
        margin-right: auto;
        padding-left: 4rem;
        padding-right: 4rem;
    }
}

/* ==========================================================================
   Modern minimal footer
   ========================================================================== */
.unsaid-footer {
    background: rgba(13,13,18,0.9);
    border-top: 1px solid rgba(122,92,255,0.06);
    padding: 2.5rem 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    text-align: center;
}

/* Very subtle hover effect on brand in header */
.brand::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.4s ease;
}

.brand:hover::after {
    width: 60%;
}

/* ==========================================================================
   Month Header & Navigation
   ========================================================================== */
.month-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 12px;
    touch-action: pan-y;
    transition: transform 0.28s ease, opacity 0.28s ease;
}

.month-header {
    text-align: center;
    margin: 2.2rem 0 1.6rem;
}

.month-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.month-name {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.2rem, 6.8vw, 3.4rem);
    margin: 0;
    line-height: 1.05;
}

.month-arrow {
    background: none;
    border: none;
    font-size: clamp(1.8rem, 5.5vw, 2.4rem);
    color: var(--muted);
    cursor: pointer;
    padding: 0.4rem;
    transition: all 0.25s ease;
}

    .month-arrow:hover,
    .month-arrow:focus {
        color: var(--accent);
        transform: scale(1.18);
    }

.month-subtitle {
    color: var(--muted);
    font-size: clamp(1rem, 3.2vw, 1.15rem);
    margin: 0.4rem 0 0.8rem;
    font-style: italic;
}

.month-meta {
    font-size: 0.95rem;
    color: var(--muted);
}

    .month-meta .year {
        display: block;
        font-size: 1.45rem;
        color: var(--text);
        font-weight: 500;
    }

    .month-meta .thought-count {
        font-style: italic;
        opacity: 0.85;
    }

/* ==========================================================================
   Calendar Grid & Cards
   ========================================================================== */
.thought-calendar {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 12px;
    margin: 0 auto 2.8rem;
    padding: 0 4px;
}

@media (min-width: 480px) {
    .thought-calendar {
        grid-template-columns: repeat(auto-fill, minmax(162px, 1fr));
        gap: 14px;
    }
}

@media (min-width: 768px) {
    .thought-calendar {
        grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
        gap: 16px;
    }
}

@media (min-width: 1024px) {
    .thought-calendar {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 18px;
    }
}

.thought-cell {
    background: var(--surface);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(122,92,255,0.07);
    min-height: 132px;
    display: flex;
    flex-direction: column;
    transition: all 0.28s ease;
}

.thought-cell.has-thought {
    background: var(--surface);
    border: 1px solid rgb(7 86 165 / 86%);
    transition: all 0.28s ease;
}

        .thought-cell.has-thought:hover {
            transform: translateY(-7px);
            background: var(--surface-2);
            box-shadow: 0 14px 32px rgba(0,0,0,0.36);
            border-color: rgba(122,92,255,0.35);
        }

    .thought-cell.empty {
        background: rgba(22,22,29,0.38);
        border: 1px solid rgba(122,92,255,0.18);
        box-shadow: 0 0 0 1px rgba(122,92,255,0.08), inset 0 0 12px rgba(122,92,255,0.06);
        cursor: default;
        opacity: 0.72;
        transition: all 0.4s ease;
    }

        .thought-cell.empty:hover {
            opacity: 0.82;
            box-shadow: 0 0 0 1px rgba(122,92,255,0.14), inset 0 0 18px rgba(122,92,255,0.09);
            transform: scale(1.01);
        }

/* Clickable content wrapper */
.cell-link {
    display: block;
    height: 100%;
    padding: 0.9rem 1rem;
    text-decoration: none;
    color: inherit;
}

    .cell-link:hover {
        transform: translateY(-4px);
    }

/* Card content */
.day-number {
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.thought-preview {
    font-size: 0.94rem;
    line-height: 1.43;
    color: #d5d5e2;
    font-style: italic;
    flex-grow: 1;
}
.thought-cell.empty .day-number {
    display: none;
}

/* Center the ellipsis vertically & horizontally in silent days */
.thought-cell.empty .thought-preview {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

    .thought-cell.empty .thought-preview::after {
        font-size: 3.6rem;
        opacity: 0.13;
        color: var(--muted);
        letter-spacing: -0.15em;
    }

    /* Optional: even sadder/more poetic version (choose one) */
    .thought-cell.empty .thought-preview.sad::after {
        content: "…";
        font-size: 4.2rem;
        opacity: 0.09;
        letter-spacing: -0.3em;
    }



/* Optional accent line for days with content */
.thought-preview:not(:empty) {
    position: relative;
    padding-left: 1rem;
}

    .thought-preview:not(:empty)::before {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 3px;
        background: var(--accent);
        opacity: 0.55;
        border-radius: 2px;
    }

/* Swipe visual feedback */
.month-container.swiping {
    opacity: 0.93;
    transform: scale(0.992);
}

@media (hover: none) and (pointer: coarse) {
    .month-container:active {
        transform: scale(0.995);
    }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.unsaid-footer {
    border-top: 1px solid #1e1e28;
    color: var(--muted);
    font-size: 0.9rem;
    padding: 2.5rem 0;
    margin-top: 5rem;
    text-align: center;
}


/* ==========================================================================
   Thought Detail – non-card, literary style
   ========================================================================== */
.thought-detail-page {
    max-width: 760px;
    margin: 1rem auto 1rem;
    padding: 0 1.5rem;
    position: relative;
}

.thought-header {
    text-align: center;
    margin-bottom: 4rem;
}

.thought-date {
    display: block;
    color: var(--muted);
    font-size: 0.92rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 1.2rem;
}

.thought-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.6rem, 7vw, 4.2rem);
    font-weight: 700;
    line-height: 1.1;
    margin: 0;
    color: var(--text);
    letter-spacing: -0.02em;
}

.thought-body {
    font-size: 1.12rem;
    line-height: 1.92;
    color: #d8d8e3;
    font-style: italic;
    margin-bottom: 4rem;
}

    .thought-body p {
        margin: 0 0 2.4rem;
    }

        .thought-body p:last-child {
            margin-bottom: 0;
        }

.thought-signature {
    font-size: 1rem;
    color: var(--muted);
    text-align: right;
    font-style: normal;
    margin-top: 3rem;
    opacity: 0.85;
}

/* Back link – subtle & elegant */
.back-to-calendar {
    display: inline-block;
    color: var(--accent);
    font-size: 1.1rem;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

    .back-to-calendar:hover {
        color: #a08fff;
        transform: translateX(-6px);
    }

/* Very subtle decorative line under title (optional poetic touch) */
.thought-title::after {
    content: "";
    display: block;
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    margin: 1.2rem auto 0;
    opacity: 0.4;
}

/* Mobile adjustments */
@media (max-width: 640px) {
    .thought-detail-page {
        margin: 4rem auto 6rem;
        padding: 0 1.2rem;
    }

    .thought-title {
        font-size: 2.8rem;
    }

    .thought-body {
        font-size: 1.05rem;
        line-height: 1.85;
    }
}