/* 
 * Norman World - Global Styles 
 */

:root {
    /* Base light mode */
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --accent-color: #e65100;
    --secondary-text: #666666;
    --card-bg: #f5f5f7;
    --border-color: #eaeaea;
    --hero-shadow: rgba(0,0,0,0.1);
    --sketch-bg: #f5f5f5;
    --radius: 8px;
}

[data-theme="dark"] {
    --bg-color: #141414;
    --text-color: #e8e6e3;
    --accent-color: #c9a86c;
    --secondary-text: #888888;
    --card-bg: #1e1e1e;
    --border-color: #2a2a2a;
    --hero-shadow: rgba(0,0,0,0.5);
    --sketch-bg: #1a1a1a;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-color: #141414;
        --text-color: #e8e6e3;
        --accent-color: #c9a86c;
        --secondary-text: #888888;
        --card-bg: #1e1e1e;
        --border-color: #2a2a2a;
        --hero-shadow: rgba(0,0,0,0.5);
        --sketch-bg: #1a1a1a;
    }
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Courier New', monospace;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    padding: 3rem 1rem;
    transition: background-color 0.3s, color 0.3s;
}

/* Theme Toggle (Bottom Full Width) */
.theme-toggle-container {
    width: 100%;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.theme-toggle {
    display: flex;
    width: 100%;
    background: var(--card-bg);
    padding: 0.4rem;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    gap: 0.4rem;
}

.theme-toggle button {
    flex: 1;
    background: transparent;
    border: 1px solid transparent;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    padding: 0.6rem;
    border-radius: 6px;
    opacity: 0.6;
    transition: all 0.2s ease;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.theme-toggle button:hover {
    opacity: 0.9;
    background: var(--bg-color);
}

.theme-toggle button.active {
    opacity: 1;
    background: var(--bg-color);
    box-shadow: 0 2px 8px var(--hero-shadow);
    font-weight: 500;
    border: 1px solid var(--border-color);
}

/* Index specific */
.index-main {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

h1.index-title {
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    text-align: center;
    align-self: center;
}

.hero {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
    width: 100%;
    margin-bottom: 3rem;
}

.hero img, .hero picture {
    max-width: 350px;
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 20px var(--hero-shadow);
}

.hero-content {
    flex: 1;
}

.month {
    font-size: 1.1rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-weight: 500;
}

.index-main ul { list-style: none; }
.index-main li { margin: 0.75rem 0; }
.index-main a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.2s;
}
.index-main a:hover {
    color: var(--accent-color);
}

footer.index-footer {
    padding-top: 3rem;
    color: var(--secondary-text);
    font-size: 0.8rem;
    text-align: center;
    width: 100%;
}

.index-main .theme-toggle-container {
    max-width: 680px;
}

@media (max-width: 700px) {
    .hero {
        flex-direction: column;
        align-items: center;
    }
}

/* Entry Template specific */
.entry {
    max-width: 680px;
    margin: 0 auto;
}

.entry header {
    margin-bottom: 3rem;
}

.entry h1 {
    font-size: 2.2rem;
    font-weight: 300;
    letter-spacing: 0.05em;
    color: var(--text-color);
}

.date {
    color: var(--secondary-text);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.sentiment {
    font-size: 1.2rem;
    font-style: italic;
    color: var(--accent-color);
    margin-bottom: 2.5rem;
    padding-left: 1rem;
    border-left: 2px solid var(--accent-color);
}

.portrait {
    margin-bottom: 2.5rem;
    width: 100%;
    display: flex;
    justify-content: center;
}

.portrait img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 20px var(--hero-shadow);
}

.sketch {
    margin-bottom: 3rem;
    width: 100%;
    display: flex;
    justify-content: center;
    background: var(--sketch-bg);
    padding: 1rem;
    border-radius: 8px;
    overflow: hidden;
}

#canvas-container,
#sketch-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

#canvas-container canvas,
#sketch-container canvas {
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain;
}

.entry h2 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--secondary-text);
    margin: 2.5rem 0 1.5rem;
    font-weight: 400;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.hn-story {
    margin-bottom: 3rem;
}

.hn-story h3 {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-color);
    margin-bottom: 0.3rem;
}

.hn-story h3 a {
    color: inherit;
    text-decoration: none;
}

.hn-story h3 a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.hn-story .meta {
    font-size: 0.85rem;
    color: var(--secondary-text);
    margin-bottom: 0.8rem;
}

.hn-story .meta a {
    color: var(--secondary-text);
    text-decoration: none;
}

.hn-story .meta a:hover {
    color: var(--accent-color);
}

.hn-story p {
    font-size: 0.95rem;
    color: var(--text-color);
    opacity: 0.85;
}

.back-link {
    display: inline-block;
    margin-top: 3rem;
    color: var(--secondary-text);
    text-decoration: none;
    font-size: 0.9rem;
}

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

footer.entry-footer {
    margin-top: 4rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    color: var(--secondary-text);
    font-size: 0.8rem;
    text-align: center;
}

footer.entry-footer .byline code {
    background: var(--card-bg);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

/* Site nav (index) */
.site-nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 3rem;
    font-size: 0.9rem;
}

.site-nav a {
    color: var(--secondary-text);
    text-decoration: none;
    transition: color 0.2s;
}

.site-nav a:hover {
    color: var(--accent-color);
}

/* About page bio */
.about-bio {
    margin-bottom: 3rem;
}

.about-bio p {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.about-bio a {
    color: var(--accent-color);
    text-decoration: none;
}

.about-bio a:hover {
    text-decoration: underline;
}

/* Grid layout for index thumbnails */
ul.entry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 1.5rem;
    list-style: none;
    padding: 0;
    margin-top: 1rem;
}
ul.entry-grid li {
    margin: 0;
}
ul.entry-grid a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.6rem;
    text-decoration: none;
}
.index-thumb {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--hero-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
ul.entry-grid a:hover .index-thumb {
    transform: scale(1.05);
    box-shadow: 0 6px 16px var(--hero-shadow);
}
.index-date {
    font-size: 0.85rem;
    color: var(--text-color);
}
ul.entry-grid a:hover .index-date {
    color: var(--accent-color);
}


/* Breadcrumb nav */
.breadcrumb {
    margin-bottom: 3rem;
    padding-top: 1rem;
}
.breadcrumb a {
    color: var(--secondary-text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}
.breadcrumb a:hover {
    color: var(--accent-color);
}
@media (max-width: 500px) {
    .site-nav {
        gap: 1rem;
        font-size: 0.8rem;
    }
}

/* Theme Image Switching */
.dark-img { display: none; }
.light-img { display: block; }

html[data-theme="dark"] .light-img { display: none; }
html[data-theme="dark"] .dark-img { display: block; }

@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) .light-img { display: none; }
    html:not([data-theme="light"]) .dark-img { display: block; }
}

/* ── Art Section ──────────────────────────────────────────────── */

.art-entries {
    list-style: none;
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.art-entry {
    border-bottom: 1px solid var(--border-color);
}

.art-entry a {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    column-gap: 2rem;
    padding: 1.2rem 0;
    text-decoration: none;
    color: var(--text-color);
    transition: color 0.15s;
}

.art-entry a:hover .art-title {
    color: var(--accent-color);
}

.art-title {
    grid-column: 1;
    grid-row: 1;
    font-size: 1.05rem;
    font-weight: 500;
    transition: color 0.15s;
}

.art-date {
    grid-column: 2;
    grid-row: 1;
    font-size: 0.8rem;
    color: var(--secondary-text);
    white-space: nowrap;
    align-self: center;
}

.art-desc {
    grid-column: 1 / -1;
    grid-row: 2;
    font-size: 0.85rem;
    color: var(--secondary-text);
    margin-top: 0.2rem;
}
