/* ============================================================
   Winifred Blog — style.css
   Literary, warm, characterful
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Source+Sans+3:wght@300;400;600;700&display=swap');

:root {
    /* Core palette */
    --bg:           #101f34;
   /* --bg:           #f7f4ef;*/
    --bg-card:      #ffffff;
    --bg-dark:      #1a1410;
    --bg-dark-2:    #251e17;
    --text:         #211c17;
    --text-muted:   #7a6e65;
    --text-light:   #a89e95;
    --border:       #e4ddd4;
    --border-light: #ede8e1;

    /* Brand */
    --accent:       #9b6b3a;
    --accent-deep:  #7a5029;
    --accent-light: #f2e8db;
    --gold:         #c49a3c;

    /* Post type colours */
    --diary-color:    #b5652d;
    --diary-bg:       #fdf3ec;
    --music-color:    #6b4d9b;
    --music-bg:       #f3eefc;
    --book-color:     #3d7a52;
    --book-bg:        #ecf6f0;
    --dream-color:    #3d6b9b;
    --dream-bg:       #edf3fc;
    --reading-color:  #2a7a8a;
    --reading-bg:     #e9f5f7;
    --watching-color: #9b3a3a;
    --watching-bg:    #fceaea;

    /* Type */
    --font-serif: 'Lora', Georgia, 'Times New Roman', serif;
    --font-sans:  'Source Sans 3', system-ui, -apple-system, sans-serif;

    /* Layout */
    --radius:     8px;
    --radius-lg:  14px;
    --max-width:  820px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow:    0 4px 16px rgba(0,0,0,0.07), 0 1px 4px rgba(0,0,0,0.05);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.06);
}

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

html { font-size: 18px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.75;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Site Header ─────────────────────────────────────────── */

.site-header {
    background: var(--bg-dark);
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 64px;
}

.site-identity { display: flex; flex-direction: column; gap: 0; }

.site-name {
    font-family: var(--font-serif);
    font-size: 1.45rem;
    font-weight: 700;
    color: #f5ede2;
    text-decoration: none;
    letter-spacing: -0.02em;
    line-height: 1.2;
    transition: color 0.2s;
}

.site-name:hover { color: var(--gold); }

.site-tagline {
    font-size: 0.68rem;
    color: #7a6a5a;
    font-style: italic;
    letter-spacing: 0.02em;
}

.site-nav { display: flex; gap: 0.2rem; }

.site-nav a {
    font-size: 0.78rem;
    color: #9a8878;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    font-weight: 600;
    padding: 0.4rem 0.7rem;
    border-radius: var(--radius);
    transition: color 0.18s, background 0.18s;
}

.site-nav a:hover {
    color: #f5ede2;
    background: rgba(255,255,255,0.07);
}

.site-nav a.active {
    color: var(--gold);
    background: rgba(196,154,60,0.1);
}

/* ── Hero Banner (below header, above content) ───────────── */

.site-banner {
    background: var(--bg-dark-2);
    padding: 2.5rem 1.5rem;
    border-bottom: 1px solid #2e2418;
}

.site-banner-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.banner-title {
    font-family: var(--font-serif);
    font-size: 2.8rem;
    font-weight: 700;
    color: #f0e4d0;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 0.6rem;
}

.banner-desc {
    font-size: 0.95rem;
    color: #7a6a5a;
    font-style: italic;
    line-height: 1.7;
    max-width: 520px;
}

/* ── Main ────────────────────────────────────────────────── */

.site-main {
    flex: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
    width: 100%;
}

/* ── Home Hero ───────────────────────────────────────────── */

.home-hero {
    margin-bottom: 2.5rem;
    padding: 1.8rem 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 5px solid var(--accent);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.hero-intro {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-muted);
    font-style: italic;
}

/* ── Post Feed ───────────────────────────────────────────── */

.post-feed { display: flex; flex-direction: column; gap: 1.2rem; }

.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.6rem 1.8rem;
    border-left: 4px solid var(--border);
    transition: box-shadow 0.2s, transform 0.2s;
    box-shadow: var(--shadow-sm);
}

.post-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.post-type-diary  { border-left-color: var(--diary-color); }
.post-type-music  { border-left-color: var(--music-color); }
.post-type-book   { border-left-color: var(--book-color);  }
.post-type-dream  { border-left-color: var(--dream-color); }

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
    flex-wrap: wrap;
}

.post-type-badge {
    font-size: 0.63rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 3px 9px;
    border-radius: 20px;
}

.post-type-diary  .post-type-badge { background: var(--diary-bg);  color: var(--diary-color);  }
.post-type-music  .post-type-badge { background: var(--music-bg);  color: var(--music-color);  }
.post-type-book   .post-type-badge { background: var(--book-bg);   color: var(--book-color);   }
.post-type-dream  .post-type-badge { background: var(--dream-bg);  color: var(--dream-color);  }

.post-time, .post-date {
    font-size: 0.75rem;
    color: var(--text-light);
}

.post-emotion {
    font-size: 0.72rem;
    color: var(--text-light);
    font-style: italic;
}
.post-emotion::before { content: '· '; }

.post-card-title {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.post-card-title a { color: var(--text); text-decoration: none; transition: color 0.18s; }
.post-card-title a:hover { color: var(--accent); }

.post-excerpt {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.65;
    margin-bottom: 0.9rem;
}

.read-more {
    font-size: 0.78rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: color 0.18s;
}

.read-more:hover { color: var(--accent-deep); text-decoration: underline; }

/* ── Music embed ─────────────────────────────────────────── */

.music-embed { margin: 0.9rem 0; border-radius: var(--radius); overflow: hidden; line-height: 0; }
.music-embed iframe { display: block; width: 100%; }
.music-embed-full { margin: 1.4rem 0; border-radius: var(--radius); overflow: hidden; line-height: 0; }
.music-embed-full iframe { display: block; width: 100%; }

/* ── Full post ───────────────────────────────────────────── */

.post-full {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.8rem 3rem;
    border-top: 5px solid var(--border);
    box-shadow: var(--shadow);
}

.post-full.post-type-diary  { border-top-color: var(--diary-color); }
.post-full.post-type-music  { border-top-color: var(--music-color); }
.post-full.post-type-book   { border-top-color: var(--book-color);  }
.post-full.post-type-dream  { border-top-color: var(--dream-color); }

.post-full-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
}

.post-full-title {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1.8rem;
    color: var(--text);
    letter-spacing: -0.02em;
}

.post-full-content {
    font-size: 1rem;
    line-height: 1.9;
    color: var(--text);
}

.post-full-content p { margin-bottom: 1.2rem; }
.post-full-content p:last-child { margin-bottom: 0; }

.post-full-footer {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.back-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    transition: color 0.18s;
}
.back-link:hover { color: var(--accent-deep); text-decoration: underline; }

/* ── Page header ─────────────────────────────────────────── */

.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-light);
}

.page-header h1 {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    letter-spacing: -0.02em;
}

.page-header p { color: var(--text-muted); font-style: italic; font-size: 0.95rem; }

/* ── Post list (diary, dreams) ───────────────────────────── */

.post-list { display: flex; flex-direction: column; gap: 0.9rem; }

.post-list-item {
    padding: 1.2rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--border);
    border-radius: 0 var(--radius) var(--radius) 0;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, transform 0.2s;
}

.post-list-item:hover {
    box-shadow: var(--shadow);
    transform: translateX(2px);
}

.post-type-diary.post-list-item { border-left-color: var(--diary-color); }
.post-type-dream.post-list-item { border-left-color: var(--dream-color); }

.post-list-meta { display: flex; gap: 0.6rem; margin-bottom: 0.35rem; flex-wrap: wrap; align-items: center; }
.post-list-meta time { font-size: 0.76rem; color: var(--text-light); }

.post-list-item h2 { font-family: var(--font-serif); font-size: 1.05rem; font-weight: 600; margin-bottom: 0.3rem; line-height: 1.35; }
.post-list-item h2 a { color: var(--text); text-decoration: none; transition: color 0.18s; }
.post-list-item h2 a:hover { color: var(--accent); }
.post-list-item p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.55; }

/* ── Music grid ──────────────────────────────────────────── */

.music-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.2rem;
}

.music-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, transform 0.2s;
}

.music-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.music-thumb { line-height: 0; }
.music-thumb img { width: 100%; display: block; aspect-ratio: 16/9; object-fit: cover; }

.music-card-body { padding: 0.9rem 1rem; }
.music-card-body h3 { font-family: var(--font-serif); font-size: 0.92rem; font-weight: 600; margin-bottom: 0.25rem; line-height: 1.35; }
.music-card-body h3 a { color: var(--text); text-decoration: none; transition: color 0.18s; }
.music-card-body h3 a:hover { color: var(--music-color); }
.music-artist { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.2rem; font-style: italic; }
.music-card-body time { font-size: 0.72rem; color: var(--text-light); }

/* ── Books ───────────────────────────────────────────────── */

.book-list { display: flex; flex-direction: column; gap: 0.9rem; }

.book-card {
    display: flex;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, transform 0.2s;
}

.book-card:hover {
    box-shadow: var(--shadow);
    transform: translateX(2px);
}

.book-spine {
    width: 6px;
    background: var(--book-color);
    flex-shrink: 0;
}

.book-card-body { padding: 1rem 1.3rem; }
.book-card-body h3 { font-family: var(--font-serif); font-size: 1rem; font-weight: 600; margin-bottom: 0.2rem; }
.book-card-body h3 a { color: var(--text); text-decoration: none; transition: color 0.18s; }
.book-card-body h3 a:hover { color: var(--book-color); }
.book-author { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.25rem; font-style: italic; }
.book-card-body time { font-size: 0.72rem; color: var(--text-light); }

/* ── Reading ─────────────────────────────────────────────── */

.reading-list { display: flex; flex-direction: column; gap: 0.9rem; }

.reading-card {
    display: flex;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, transform 0.2s;
    border-left: 4px solid var(--reading-color);
}

.reading-card:hover { box-shadow: var(--shadow); transform: translateX(2px); }

.reading-card-body { padding: 1rem 1.3rem; width: 100%; }

.reading-title { font-family: var(--font-serif); font-size: 1rem; font-weight: 600; margin-bottom: 0.25rem; }
.reading-title a { color: var(--text); text-decoration: none; transition: color 0.18s; }
.reading-title a:hover { color: var(--reading-color); }

.reading-source { font-size: 0.78rem; margin-bottom: 0.4rem; }
.reading-source a { color: var(--reading-color); text-decoration: none; }
.reading-source a:hover { text-decoration: underline; }

.reading-excerpt { font-size: 0.88rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 0.5rem; }

.reading-footer { display: flex; align-items: center; gap: 0.75rem; font-size: 0.72rem; color: var(--text-light); }

/* ── Watching ────────────────────────────────────────────── */

.watching-list { display: flex; flex-direction: column; gap: 0.9rem; }

.watching-card {
    display: flex;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s, transform 0.2s;
    border-left: 4px solid var(--watching-color);
}

.watching-card:hover { box-shadow: var(--shadow); transform: translateX(2px); }

.watching-card-body { padding: 1rem 1.3rem; width: 100%; }

.watching-title { font-family: var(--font-serif); font-size: 1rem; font-weight: 600; margin-bottom: 0.25rem; }
.watching-title a { color: var(--text); text-decoration: none; transition: color 0.18s; }
.watching-title a:hover { color: var(--watching-color); }

.watching-channel { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.4rem; font-style: italic; }

.watching-excerpt { font-size: 0.88rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 0.5rem; }

.watching-footer { display: flex; align-items: center; gap: 0.75rem; font-size: 0.72rem; color: var(--text-light); }

/* ── Post-card inline metadata (reading/watching on feed) ── */

.post-card-channel { font-size: 0.78rem; color: var(--text-muted); font-style: italic; margin: 0.1rem 0 0.4rem; }
.post-card-source  { font-size: 0.78rem; margin: 0.1rem 0 0.4rem; }
.post-card-source a { color: var(--reading-color); text-decoration: none; }
.post-card-source a:hover { text-decoration: underline; }

/* ── Post-full metadata (reading/watching single view) ────── */

.post-full-channel { font-size: 0.85rem; color: var(--text-muted); font-style: italic; margin: -0.5rem 0 1.25rem; }
.post-full-source  { font-size: 0.85rem; margin: -0.5rem 0 1.25rem; }
.post-full-source a { color: var(--reading-color); font-weight: 600; text-decoration: none; }
.post-full-source a:hover { text-decoration: underline; }

/* ── Post-type badge colours (reading / watching) ────────── */

.post-type-reading  .post-type-badge { background: var(--reading-bg);  color: var(--reading-color); }
.post-type-watching .post-type-badge { background: var(--watching-bg); color: var(--watching-color); }

/* ── Toast notification ──────────────────────────────────── */

.new-post-notice {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--bg-dark);
    color: #f5ede2;
    padding: 0.85rem 1.3rem;
    border-radius: var(--radius);
    font-size: 0.83rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 999;
    transition: opacity 0.3s, transform 0.3s;
    border-left: 3px solid var(--gold);
}

.new-post-notice:hover { opacity: 0.9; transform: translateY(-1px); }

/* ── Misc ────────────────────────────────────────────────── */

.empty, .not-found, .empty-state {
    color: var(--text-muted);
    font-style: italic;
    padding: 3rem 0;
    text-align: center;
    font-family: var(--font-serif);
    font-size: 1.05rem;
}

.pagination { display: flex; gap: 0.8rem; margin-top: 2rem; align-items: center; }

.btn {
    display: inline-block;
    padding: 0.5rem 1.1rem;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: background 0.18s, color 0.18s;
}

.btn:hover { background: var(--accent); color: #fff; }

/* ── Footer ──────────────────────────────────────────────── */

.site-footer {
    background: var(--bg-dark);
    border-top: 1px solid #2e2418;
    padding: 2rem 1.5rem;
    margin-top: auto;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    text-align: center;
    color: #5a4e44;
    font-size: 0.82rem;
    line-height: 1.6;
}

.footer-meta { margin-top: 0.3rem; font-style: italic; color: #3e3428; }

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 640px) {
    html { font-size: 16px; }
    .site-header { padding: 0 1rem; }
    .header-inner { flex-direction: column; align-items: flex-start; min-height: unset; padding: 1rem 0; }
    .site-nav { gap: 0; flex-wrap: wrap; }
    .banner-title { font-size: 2rem; }
    .site-main { padding: 1.5rem 1rem 3rem; }
    .post-full { padding: 1.5rem 1.2rem; }
    .post-full-title { font-size: 1.5rem; }
    .music-grid { grid-template-columns: 1fr 1fr; }
    .home-hero { padding: 1.2rem 1.4rem; }
}

@media (max-width: 400px) {
    .music-grid { grid-template-columns: 1fr; }
}

/* ── Post Reactions ──────────────────────────────────────── */
.post-reactions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card, #f8f8f6);
    border-radius: 0.6rem;
    border: 1px solid var(--border-light, #e0ddd6);
}

.reactions-label {
    font-size: 0.85rem;
    color: var(--text-muted, #888);
    margin-right: 0.25rem;
}

.react-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    border: 1.5px solid var(--border-light, #ddd);
    border-radius: 2rem;
    background: transparent;
    color: var(--text-muted, #666);
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.18s;
}

.react-btn:hover {
    border-color: var(--accent, #7a6e5f);
    color: var(--accent, #7a6e5f);
    background: var(--bg-hover, #f3f0eb);
}

.react-btn.active.react-up {
    border-color: #4a7c59;
    color: #4a7c59;
    background: #eaf3ed;
}

.react-btn.active.react-down {
    border-color: #8b4a4a;
    color: #8b4a4a;
    background: #f3eaea;
}

.react-count {
    font-weight: 600;
    min-width: 1.2ch;
    text-align: center;
}

.reaction-thanks {
    font-size: 0.8rem;
    color: var(--text-muted, #999);
    font-style: italic;
    margin-left: 0.25rem;
}
