/* ======================================
   ART EVERYDAY
   Original design preserved; additions are marked "NEW".
====================================== */

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

body {
    max-width: 1200px;
    margin: 0 auto;
    padding: 35px 40px 70px;
    background: #f7f5f1;
    color: #222;
    font-family: Georgia, serif;
}

img {
    max-width: 100%;
}

[hidden] {
    display: none !important;
}

/* ======================================
   HEADER
====================================== */

.branding {
    display: flex;
    gap: 20px;
    margin-bottom: 45px;
}

.site-logo {
    width: 90px;
    height: 90px;
    object-fit: contain;
    flex-shrink: 0;
}

.brand-text h1 {
    margin: 0;
    font-size: 4rem;
    font-weight: 500;
    line-height: 1;
}

.brand-text {
    min-width: 0;
}

/* ======================================
   NAVIGATION
====================================== */

.main-nav {
    display: flex;
    gap: 28px;
    margin-top: 18px;
}

.main-nav a {
    text-decoration: none;
    color: #666;
    font-size: 1.05rem;
}

.main-nav a:hover {
    color: #000;
}

/* ======================================
   ARTWORK
====================================== */

.todays-work {
    text-align: center;
    margin-bottom: 70px;
}

.art-date {
    color: #888;
    font-size: 1.05rem;
    margin: 0 0 12px;
}

/* Optional artwork title */
.art-title {
    margin: -4px 0 14px;
    color: #444;
    font-size: 1.3rem;
    font-style: italic;
}

.main-art {
    display: block;
    max-width: 100%;
    max-height: 500px;
    width: auto;
    height: auto;
    margin: 0 auto;

    /* subtle shadow around the main artwork (unchanged) */
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.30);
}

/* NEW: holds the painting. While changing paintings, two layers sit on top
   of each other and slide past one another (see app.js). */
.art-stage {
    position: relative;
}

.art-layer {
    display: flex;
    justify-content: center;
    will-change: auto;
}

.art-stage.is-moving {
    overflow-x: clip;
}

.art-stage.is-moving .art-layer {
    position: absolute;
    inset: 0;
    align-items: center;
    will-change: transform;
}

.art-stage.is-loading .art-layer {
    opacity: .55;
    transition: opacity .2s;
}

.status-block {
    text-align: center;
}

.status-block button {
    margin-top: 4px;
}

.status-link {
    color: #555;
}

/* NEW: Share button */
.share-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 14px auto 0;
    min-height: 44px;
}

.share-btn {
    width: auto;
    height: 40px;
    padding: 0 22px;
    color: #555;
    border-color: #999;
    font-size: .95rem;
}

.share-msg {
    color: #666;
    font-size: .95rem;
    overflow-wrap: anywhere;
    text-align: left;
}

.empty-note {
    color: #888;
    padding: 60px 0;
    font-size: 1.1rem;
}

/* Earlier / later navigation */
.art-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin: 22px auto 0;
    max-width: 520px;
}

.art-nav .nav-btn {
    width: auto;
    height: 44px;
    padding: 0 18px;
    border: 1px solid transparent;
    color: #555;
    font-size: 1.05rem;
}

.art-nav .nav-btn:hover:not(:disabled) {
    background: none;
    color: #222;
    border-color: #555;
}

.art-nav .nav-btn:disabled {
    opacity: .3;
    cursor: default;
}

.art-count {
    flex: 1;
    color: #999;
    font-size: .95rem;
    min-width: 90px;
}

/* Recent artwork strip.
   NEW: rounded corners. Change --thumb-radius to make them rounder or squarer
   (0px = square corners). Only the small thumbnails are rounded. */
.recent-strip {
    --thumb-radius: 14px;
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    margin: 30px auto 0;
    padding: 6px 3px 10px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}

.recent-strip.fits {
    justify-content: center;
}

.strip-item {
    flex: 0 0 auto;
    display: block;
    scroll-snap-align: center;
    padding: 2px;
    border: 2px solid transparent;
    border-radius: calc(var(--thumb-radius) + 4px);
    line-height: 0;
}

.strip-item img {
    display: block;
    height: 84px;
    width: auto;
    max-width: none;
    border-radius: var(--thumb-radius);
    transition: opacity .25s;
}

.strip-item:hover img {
    opacity: .85;
}

/* Selected thumbnail: a quiet outline, not a heavy frame */
.strip-item.active {
    border-color: rgba(34, 34, 34, .45);
}

/* ======================================
   THOUGHT FORM
====================================== */

.thought-form-section {
    max-width: 700px;
    margin: 0 auto 70px;
}

.thought-form-section h2 {
    font-size: 2rem;
    font-weight: 500;
    margin-bottom: 10px;
}

.thought-intro {
    color: #777;
    margin-bottom: 25px;
    font-size: 1.05rem;
}

.thought-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.thought-form input,
.thought-form textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    background: #faf9f6;
    font-family: inherit;
    font-size: 1rem;
    box-sizing: border-box;
}

.thought-form textarea {
    min-height: 120px;
    resize: vertical;
}

.thought-form input:focus,
.thought-form textarea:focus {
    outline: none;
    border-color: #999;
}

.thought-form button {
    width: 140px;
}

/* Hidden spam-trap field */
.hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Form status message */
.form-msg {
    margin: 0;
    min-height: 1.4em;
    color: #555;
    font-size: 1rem;
}

.form-msg.error {
    color: #8a2b1c;
}

/* ======================================
   SHARED THOUGHTS
====================================== */

.thoughts-section {
    max-width: 700px;
    margin: 0 auto 80px;
}

.thoughts-section h2 {
    font-size: 2rem;
    font-weight: 500;
    margin-bottom: 25px;
}

.thought-note {
    color: #444;
}

.thought {
    padding: 22px 0;
    border-bottom: 1px solid #e4e4e4;
}

.thought-author {
    font-size: .95rem;
    color: #777;
    margin-bottom: 10px;
}

.thought p {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.thought-empty {
    color: #888;
    padding: 22px 0;
}

/* ======================================
   SUPPORT
====================================== */

.support {
    text-align: center;
    padding: 45px 0;
    border-top: 1px solid #e2e2e2;
    border-bottom: 1px solid #e2e2e2;
    margin-bottom: 70px;
}

.support p {
    font-size: 1.5rem;
    color: #777;
    margin-top: 0;
    margin-bottom: 20px;
}

button,
.button {
    width: 140px;
    height: 52px;
    border: 1px solid #555;
    background: none;
    color: inherit;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

button:hover,
.button:hover {
    background: #222;
    color: #fff;
}

button:disabled {
    cursor: default;
}

:focus-visible {
    outline: 2px solid #222;
    outline-offset: 2px;
}

/* ======================================
   ABOUT
====================================== */

.about-section {
    max-width: 700px;
    margin: 0 auto 80px;
}

.about-section h2 {
    font-size: 2rem;
    font-weight: 500;
    margin-bottom: 20px;
}

.about-section p {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
    white-space: pre-line;
}

/* ======================================
   ARCHIVE
====================================== */

.archive-preview {
    margin-bottom: 50px;
}

.archive-preview h2 {
    font-size: 2rem;
    font-weight: 500;
    margin-bottom: 25px;
}

/* Archive grouped by month */
.archive-month {
    margin: 34px 0 14px;
    color: #888;
    font-size: 1.05rem;
    font-weight: 400;
}

.archive-month:first-of-type {
    margin-top: 0;
}

.archive-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.archive-row::after {
    content: "";
    flex-grow: 1000000;
}

.archive-item {
    display: block;
    flex-grow: calc(var(--ar) * 100);
    flex-shrink: 1;
    flex-basis: calc(var(--ar) * 190px);
    min-width: 0;
    line-height: 0;
    border: 3px solid transparent;
    cursor: pointer;
}

.archive-item img {
    display: block;
    width: 100%;
    height: auto;
    transition: .25s;
}

.archive-item:hover img {
    opacity: .85;
}

.archive-item.active {
    border-color: #222;
}

.archive-more {
    display: block;
    margin: 40px auto 0;
}

/* ======================================
   FOOTER
====================================== */

.site-footer {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #e2e2e2;
    text-align: center;
    color: #999;
    font-size: .9rem;
}

/* ======================================
   MOBILE
====================================== */

@media (max-width: 768px) {
    body {
        padding: 20px;
    }

    .branding {
        gap: 15px;
        margin-bottom: 30px;
    }

    .site-logo {
        width: 70px;
        height: 70px;
    }

    .brand-text h1 {
        font-size: 2.2rem;
    }

    .main-nav {
        gap: 18px;
        flex-wrap: wrap;
    }

    .main-art {
        max-height: min(500px, 60vh);
    }

    .strip-item img {
        height: 64px;
    }

    .recent-strip {
        --thumb-radius: 12px;
    }

    .archive-row {
        gap: 10px;
    }

    .archive-item {
        flex-basis: calc(var(--ar) * 120px);
    }

    .thought-form button,
    .support .button,
    .archive-more {
        width: 100%;
    }

    .art-nav {
        gap: 6px;
    }

    .art-nav .nav-btn {
        padding: 0 10px;
    }
}

@media (max-width: 380px) {
    .brand-text h1 {
        font-size: 1.8rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* ======================================
   SEPARATE ARCHIVE VIEW
====================================== */

body.archive-view main > section:not(.archive-preview) {
    display: none !important;
}

body.archive-view .archive-preview {
    display: block !important;
    margin-top: 10px;
    min-height: 55vh;
}

body.archive-view .archive-preview h2 {
    margin-top: 0;
}

@media (max-width: 768px) {
    body.archive-view .archive-preview {
        margin-top: 0;
    }
}
