/* style.css — Daily Quote
   Colours/fonts match still-feeling.com index page ("Breathing Space" palette). */
:root {
    --bg-base: #f0e8dc;
    --bg-warm: #ebe2d4;
    --bg-card: #fffcf8;
    --text-main: #382a31;
    --text-muted: #5a4a50;
    --text-soft: #7a6b70;
    --accent: #a85075;
    --accent-light: #c97a9a;
    --accent-faint: rgba(168, 80, 117, 0.08);
    --accent-glow: rgba(168, 80, 117, 0.12);
    --border-soft: rgba(168, 80, 117, 0.22);
    --shadow-card: 0 2px 12px rgba(56, 42, 49, 0.08);
    --shadow-hover: 0 6px 24px rgba(56, 42, 49, 0.14);
    --like: #a85075;
    --fav: #a85075;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --radius-pill: 999px;
    --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-base);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Container */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 16px 40px;
    position: relative;
}

/* Header */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0 16px;
    position: sticky;
    top: 0;
    background: var(--bg-base);
    z-index: 10;
}

.site-logo {
    display: block;
    text-decoration: none;
    line-height: 0;
}

.site-logo-img {
    display: block;
    width: clamp(120px, 30vw, 160px);
    height: auto;
}

.date-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}
.quote-id-tag {
    display: inline-block;
    margin-left: 6px;
    font-size: 0.6rem;
    font-weight: 400;
    color: var(--text-soft);
    opacity: 0.5;
    letter-spacing: 0;
    text-transform: none;
    vertical-align: middle;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Hamburger navigation (matches still-feeling.com home page) */
.nav-pills {
    position: relative;
}

.menu-toggle {
    list-style: none;
    appearance: none;
    border: none;
    background: var(--accent-faint);
    border-radius: var(--radius-pill);
    color: var(--text-main);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 8px 14px;
    line-height: 1;
    transition: background 0.2s ease;
}

.menu-toggle:hover {
    background: var(--accent-glow);
}

.menu-toggle::-webkit-details-marker {
    display: none;
}

.nav-menu-panel {
    position: fixed;
    top: 52px;
    right: 12px;
    display: none;
    flex-direction: column;
    gap: 6px;
    width: min(280px, calc(100vw - 24px));
    max-height: calc(100vh - 68px);
    overflow-y: auto;
    padding: 14px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    box-shadow: var(--shadow-hover);
    z-index: 200;
    overscroll-behavior: contain;
}

.nav-pills[open] .nav-menu-panel {
    display: flex;
}

.nav-menu-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-bottom: 12px;
}

.nav-menu-section + .nav-menu-section {
    border-top: 1px solid var(--border-soft);
    padding-top: 12px;
    margin-top: 2px;
}

.nav-menu-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--accent);
    font-weight: 700;
    padding: 3px 4px 2px;
}

.nav-pill-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    font-size: 0.75rem;
    background: transparent;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    transition: background 0.15s ease;
}

.nav-pill-item:hover {
    background: var(--accent-faint);
}

.nav-pill-item.active {
    background: var(--accent-glow);
    color: var(--accent);
}

/* Site navigation */
.site-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 0 0 14px;
    margin-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.site-nav::-webkit-scrollbar {
    display: none;
}

.site-nav-link {
    flex: 0 0 auto;
    padding: 7px 14px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-soft);
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.site-nav-link:hover {
    background: var(--accent-faint);
    color: var(--accent);
}

.site-nav-link.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* Quote Card — the image fills the card; only the action bar sits below it */
.quote-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    margin-bottom: 20px;
}

.image-wrapper {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: calc(100vh - 200px);
    min-height: calc(100svh - 200px);
    overflow: hidden;
    background: var(--bg-warm);
}

.quote-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    transform: scale(1.02);
}

.quote-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
    z-index: 1;
    cursor: zoom-in;
}

/* Floating Actions */
.floating-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: flex;
    gap: 8px;
}

.merch-btn {
    color: var(--accent);
}

.action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 252, 248, 0.92);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-card);
}

.action-btn:active {
    transform: scale(0.92);
}

.action-btn.active {
    color: var(--fav);
    background: var(--bg-card);
}

.action-btn.active svg {
    fill: var(--fav);
    stroke: var(--fav);
}

/* Visually-hidden quote text (screen readers + TTS only) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Action Bar — directly below the image, inside the card */
.action-bar {
    display: flex;
    gap: 8px;
    padding: 16px 16px;
}

.action-pill {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.action-pill i {
    font-size: 1rem;
    line-height: 1;
}

.action-pill:active {
    transform: scale(0.96);
    background: var(--accent-faint);
}

.action-pill.active {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-glow);
}

.action-pill.liked {
    color: var(--like);
    border-color: var(--border-soft);
    background: var(--accent-glow);
}

.action-pill.liked i {
    color: var(--like);
}

/* Comments Section */
.comments-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.comments-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-count {
    background: var(--bg-base);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: auto;
    margin-right: 8px;
}

.toggle-arrow {
    transition: transform 0.3s ease;
    color: var(--text-soft);
}

.comments-toggle.open .toggle-arrow {
    transform: rotate(180deg);
}

.comments-dropdown {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.comments-dropdown.open {
    max-height: 600px;
    overflow-y: auto;
}

.comments-list {
    padding: 0 20px;
    max-height: 320px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.comment-item {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-soft);
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    flex-shrink: 0;
}

.comment-body {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.comment-header strong {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
}

.comment-header time {
    font-size: 0.75rem;
    color: var(--text-soft);
}

.comment-body p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
    word-wrap: break-word;
}

/* Comment Form */
.comment-form {
    padding: 16px 20px 20px;
    border-top: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.875rem;
    background: var(--bg-base);
    color: var(--text-main);
    resize: none;
    -webkit-appearance: none;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-card);
}

.submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: #fff;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.submit-btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 32px 0 16px;
}

.site-footer p {
    font-size: 0.75rem;
    color: var(--text-soft);
    letter-spacing: 1px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(56, 42, 49, 0.5);
    backdrop-filter: blur(4px);
    z-index: 100;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: var(--bg-card);
    width: 100%;
    max-width: 480px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 24px 20px 32px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    position: relative;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-base);
    border-radius: 50%;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content h3 {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.modal-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.modal-content input,
.modal-content textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.875rem;
    margin-bottom: 10px;
    background: var(--bg-base);
    -webkit-appearance: none;
}

.modal-content input:focus,
.modal-content textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-card);
}

/* Merch grid */
.merch-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.merch-item {
    background: var(--bg-base);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    overflow: hidden;
    text-align: center;
}

.merch-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
    background: var(--bg-warm);
    cursor: zoom-in;
}

.merch-label {
    display: block;
    padding: 8px 6px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-main);
}

.merch-shop-link {
    display: block;
    margin-top: 16px;
    text-align: center;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: var(--bg-card);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
}

/* Prev / Next navigation arrows */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 252, 248, 0.25);
    backdrop-filter: blur(6px);
    color: rgba(56, 42, 49, 0.4);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    padding: 0;
}

.nav-arrow:hover,
.nav-arrow:active {
    background: rgba(255, 252, 248, 0.75);
    color: var(--accent);
}

.nav-arrow:active {
    transform: translateY(-50%) scale(0.92);
}

.nav-arrow-left {
    left: 8px;
}

.nav-arrow-right {
    right: 8px;
}

/* Fullscreen Image Viewer (Lightbox) */
.image-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(56, 42, 49, 0.88);
    backdrop-filter: blur(8px);
    z-index: 300;
}

.image-modal.open {
    display: flex;
}

.image-modal-panel {
    position: relative;
    width: min(92vw, 800px);
    max-height: 88vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal-panel img {
    display: block;
    max-width: 100%;
    max-height: 88vh;
    object-fit: contain;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-hover);
}

.image-modal-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--accent);
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-main);
    color: var(--bg-card);
    padding: 12px 24px;
    border-radius: var(--radius-pill);
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 200;
    white-space: nowrap;
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Scrollbar styling */
.comments-list::-webkit-scrollbar {
    width: 4px;
}

.comments-list::-webkit-scrollbar-track {
    background: transparent;
}

.comments-list::-webkit-scrollbar-thumb {
    background: var(--border-soft);
    border-radius: 2px;
}

/* Tablet & Desktop */
@media (min-width: 640px) {
    .app-container {
        max-width: 520px;
        padding: 0 24px 60px;
    }

    .image-wrapper {
        min-height: calc(100vh - 230px);
        min-height: calc(100svh - 230px);
    }

    .modal {
        align-items: center;
    }

    .modal-content {
        border-radius: var(--radius-lg);
        transform: scale(0.9);
        padding: 28px 28px 32px;
    }

    .modal.show .modal-content {
        transform: scale(1);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
