/* Web Stories gallery page (public). Loaded globally in the guest layout so
   SPA navigation never misses it. */

.stories-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 24px 72px;
}

.stories-head {
    text-align: center;
    margin-bottom: 40px;
}

.stories-head h1 {
    font-size: 40px;
    font-weight: 800;
    margin: 0 0 10px;
    color: var(--text-primary, #0f172a);
}

.stories-head p {
    font-size: 17px;
    color: var(--text-muted, #64748b);
    max-width: 620px;
    margin: 0 auto;
}

.stories-empty {
    text-align: center;
    color: var(--text-muted, #64748b);
    padding: 48px 0;
}

.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 28px;
}

.story-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.story-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

.story-card-thumb {
    aspect-ratio: 9 / 16;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 20px;
    position: relative;
}

.story-card-logo {
    width: 96px;
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 20px;
    overflow: hidden;
}

.story-card-logo .tool-logo-img,
.story-card-logo .tool-logo-fallback {
    width: 72px;
    height: 72px;
    object-fit: contain;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    font-weight: 800;
    color: #ffffff;
}

.story-card-play {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.92);
    color: #111827;
    font-size: 14px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 999px;
}

.story-card-body {
    padding: 16px 18px 4px;
}

.story-card-name {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--text-primary, #0f172a);
}

.story-card-desc {
    font-size: 14px;
    line-height: 1.45;
    color: var(--text-muted, #64748b);
    margin: 0;
}

.story-card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px 16px;
}

.story-card-cat {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.story-card-go {
    color: var(--text-primary, #0f172a);
}

[data-theme="dark"] .story-card {
    background: var(--bg-card, #1e293b);
    border-color: var(--border, #334155);
}

[data-theme="dark"] .story-card:hover {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

/* Server-rendered pagination (reuses .pagination / .page-btn from tools.css) */
.pagination a.page-btn {
  text-decoration: none;
}
.pagination a.page-btn,
.pagination button.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
