/* ============================================================
   AMS — public.css
   The reader-facing blog (wwwroot/public/blog.html + blog-detail.html).
   Loaded alongside css/shared.css for the reset + design tokens;
   everything here is this mini-site's own look, deliberately
   plainer/more readable than the admin app.
   ============================================================ */

.pub-body {
    background: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.pub-header {
    border-bottom: 1px solid var(--ams-border);
    padding: 18px 0;
}

.pub-header-inner {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 24px;
}

.pub-brand {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-decoration: none;
    color: var(--ams-ink);
}

.pub-main {
    flex: 1;
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 40px 24px 60px;
}

/* Article reading width stays capped — long lines of body text are hard
   to read edge-to-edge on a wide embed, even though the list page (plain
   .pub-main, no this modifier) should fill whatever width the client's
   iframe gives it. See blog-detail.html's <main class="pub-main
   pub-main-narrow">. */
.pub-main-narrow { max-width: 680px; }

.pub-loading, .pub-empty {
    text-align: center;
    padding: 70px 20px;
    color: var(--ams-muted);
}
.pub-loading i, .pub-empty i { font-size: 1.8rem; color: #c4b5fd; margin-bottom: 12px; }
.pub-loading p, .pub-empty p { font-size: 0.9rem; }

/* ── Post list ── */
.pub-post-list { display: flex; flex-direction: column; gap: 14px; }

.pub-post-card {
    display: flex;
    align-items: center;
    gap: 20px;
    text-decoration: none;
    color: inherit;
    padding: 20px 24px;
    background: #fff;
    border: 1px solid var(--ams-border);
    border-radius: 14px;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.pub-post-card:hover {
    border-color: #ddd6fe;
    box-shadow: 0 12px 28px -14px rgba(139,92,246,0.25);
    transform: translateY(-1px);
}

.pub-post-thumb {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
    background: var(--ams-bg);
}

.pub-post-card-body { min-width: 0; }

.pub-post-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--ams-ink);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.pub-post-excerpt {
    font-size: 0.9rem;
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 14px;
}

@media (max-width: 560px) {
    .pub-post-card { flex-direction: column; align-items: flex-start; }
    .pub-post-thumb { width: 100%; height: 160px; }
}

.pub-post-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--ams-muted);
}
.pub-post-date::before {
    content: "\f073";
    font-family: "Font Awesome 5 Free";
    font-weight: 400;
    color: #c4b5fd;
}

/* ── Article ── */
.pub-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ams-violet-dark);
    text-decoration: none;
    margin-bottom: 24px;
}
.pub-back-link:hover { text-decoration: underline; }

.pub-article-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--ams-ink);
    line-height: 1.2;
    margin-bottom: 10px;
}

.pub-article-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ams-muted);
    margin-bottom: 30px;
}
.pub-article-date::before {
    content: "\f073";
    font-family: "Font Awesome 5 Free";
    font-weight: 400;
    color: #c4b5fd;
}

.pub-article-image {
    display: block;
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: 14px;
    margin-bottom: 30px;
}

.pub-article-body {
    font-size: 1.02rem;
    line-height: 1.8;
    color: #1f2937;
    white-space: pre-wrap;
}

.pub-article-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 30px;
}
.pub-article-gallery img {
    display: block;
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 10px;
}

.pub-footer {
    text-align: center;
    padding: 24px;
    font-size: 0.78rem;
    color: #9ca3af;
    border-top: 1px solid var(--ams-border);
}
