/* ===========================================
   Risos RSS Reader - Main Stylesheet
   =========================================== */

/* -------------------------------------------
   1. Base / Reset
   ------------------------------------------- */

/* Alpine.js cloak - hide until initialized */
[x-cloak] {
    display: none !important;
}

/* Fix flex children overflow */
.flex-1 {
    min-width: 0;
}

/* -------------------------------------------
   2. Content Blocks (post, summary, prose)
   ------------------------------------------- */

/* Prose - inline content from feeds */
.prose img {
    max-width: 100%;
    height: auto;
}

.prose a {
    color: #3b82f6;
    text-decoration: underline;
}

/* Post content - original article */
.post-content {
    line-height: 1.7;
    overflow-x: auto;
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
    max-width: 100%;
}

.post-content * {
    max-width: 100%;
}

.post-content pre {
    background: #f3f4f6;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.post-content pre code {
    font-family: ui-monospace, monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

.post-content pre code .line {
    display: block;
}

.post-content code {
    word-break: break-all;
}

.post-content table {
    display: block;
    overflow-x: auto;
}

/* Summary content - AI-generated markdown */
.summary-content {
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
}

.summary-content ul {
    list-style-type: disc;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.summary-content li {
    margin-bottom: 0.5rem;
}

.summary-content strong {
    font-weight: 600;
}

.summary-content em {
    font-style: italic;
}

/* Shared styles for content blocks */
.post-content p,
.summary-content p {
    margin-bottom: 1rem;
}

/* -------------------------------------------
   3. UI Components
   ------------------------------------------- */

/* Scrollbar - webkit browsers */
.scrollbar-thin::-webkit-scrollbar {
    width: 6px;
}

.scrollbar-thin::-webkit-scrollbar-track {
    background: #e5e7eb;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
    background: #9ca3af;
    border-radius: 3px;
}

/* -------------------------------------------
   4. Dark Mode
   ------------------------------------------- */

.dark .prose a {
    color: #60a5fa;
}

.dark .post-content pre {
    background: #1a1a2e;
}

.dark .scrollbar-thin::-webkit-scrollbar-track {
    background: #1f2937;
}

.dark .scrollbar-thin::-webkit-scrollbar-thumb {
    background: #4b5563;
}

/* -------------------------------------------
   5. Mobile / Responsive
   ------------------------------------------- */

/* Safe area for devices with notches */
@supports (padding: max(0px)) {
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

@media (max-width: 768px) {
    /* Disable tap highlight */
    button, a {
        -webkit-tap-highlight-color: transparent;
    }

    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
    }

    /* Momentum scrolling on iOS */
    .overflow-y-auto {
        -webkit-overflow-scrolling: touch;
    }

    /* Responsive images */
    .post-content img {
        max-width: 100%;
        height: auto;
    }
}
