@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Playfair+Display:ital,wght@0,400..900;1,400..900&display=swap');


:root {
    --bg-color: #ffffff;
    --text-main: #222222;
    --text-muted: #666666;
    --accent: #faaf50;
    --border: #eaeaea;
    --text-highlight: #896b30;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-title: 'Playfair Display', system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #111111;
        --text-main: #eeeeee;
        --text-muted: #a0a0a0;
        --border: #333333;
        --text-highlight: #dfcca6;
    }
}

/* Theme Logic: Invert system preference when checked */
@media (prefers-color-scheme: light) {
    :root:has(#theme-toggle-checkbox:checked) {
        --bg-color: #111111;
        --text-main: #eeeeee;
        --text-muted: #a0a0a0;
        --border: #333333;
        --text-highlight: #dfcca6;
    }
}

@media (prefers-color-scheme: dark) {
    :root:has(#theme-toggle-checkbox:checked) {
        --bg-color: #ffffff;
        --text-main: #222222;
        --text-muted: #666666;
        --border: #eaeaea;
        --text-highlight: #896b30;
    }
}

* {
    box-sizing: border-box;
}

html {
    scrollbar-gutter: stable;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    max-width: 680px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Header & Nav */
header {
    margin-bottom: 3rem;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    font-weight: 500;
    ul {
        list-style: none;
        display: flex;
        gap: 1.5rem;
        align-items: center;
        padding: 0;
        margin: 0;
    }
}

#theme-toggle-checkbox {
    display: none;
}

.theme-toggle-label {
    cursor: pointer;
    display: inline-block;
    width: 44px;
    height: 24px;
    background-color: var(--text-muted);
    border-radius: 12px;
    position: relative;
    transition: background-color 0.3s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='5'/%3E%3Cpath d='M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 6px center, right 6px center;
    &::after {
        content: '';
        position: absolute;
        top: 2px;
        left: 2px;
        width: 20px;
        height: 20px;
        background-color: var(--bg-color);
        border-radius: 50%;
        transition: transform 0.3s ease;
    }
}

#theme-toggle-checkbox:checked + .theme-toggle-label::after {
    transform: translateX(20px);
}

/* Swap icons for Dark Mode preference so the visual logic stays consistent */
@media (prefers-color-scheme: dark) {
    .theme-toggle-label {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='5'/%3E%3Cpath d='M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z'/%3E%3C/svg%3E");
    }
}

a {
    color: inherit;
    text-decoration: none;
    &:hover {
        color: var(--accent);
        text-decoration: underline;
    }
}

h1, h2, h3 {
    font-family: var(--font-title);
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

/* Welcome */
.profile-image {
    float: left;
    margin-right: 1.5rem;
}

/* Review */
.book-title {
    color: var(--text-muted);
    margin-bottom: 0;
}
.book-title-below {
    color: var(--text-muted);
    margin-top: 0;
}

.publish-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-top: 0.5rem;
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.2;
    &::before {
        content: '';
        width: 3rem;
        height: 1px;
        background-color: var(--border);
        margin-bottom: 0.5rem;
    }
}

.review-title {
    margin-block-start: 0;
}

.review-body {
    i {
        color: var(--text-highlight);
    }
}

.view-all {
    color: var(--text-muted);
    white-space: nowrap;
}

/* Share Section */
.share-container {
    margin-top: 2rem;
    margin-bottom: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.share-actions {
    display: flex;
    align-items: center;
}

.share-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    cursor: pointer;
    border-radius: 4px;
    white-space: nowrap;
    transition: all 0.2s ease;
    &:hover {
        border-color: var(--accent);
        color: var(--accent);
    }
}

.share-feedback {
    font-size: 0.875rem;
    color: var(--text-highlight);
    opacity: 0;
    transition: opacity 0.3s ease;
}

article {
    margin-left: 1rem;
    margin-bottom: 2.5rem;

    h3 {
    margin-bottom: 0.25rem;
    }
    .subtitle {
        color: var(--text-muted);
        margin-top: 0;
        margin-bottom: 0;
    
    }
    time {
        font-size: 0.875rem;
    }   
}



/* Footer & Aside */
aside {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

footer {
    margin-top: 3rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* functional */
.secondary {
    color: var(--text-muted);
    
}

.inline-rosette {
    height: 1.2em;
    width: 1.2em;
    vertical-align: -0.2em;
}

/* Theme Logic: Invert system preference when checked */
@media (prefers-color-scheme: light) {