/* ==========================================================================
   CancelledEndings — Main Stylesheet
   Design philosophy: sophisticated but simple. Clean typography,
   generous whitespace, minimal visual clutter.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Reset & Base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: Georgia, "Times New Roman", Times, serif;
    color: #1a1a1a;
    background-color: #fafafa;
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: #8b1a1a;
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: #5c1010;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.main-content {
    flex: 1;
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
.site-header {
    border-bottom: 1px solid #e5e5e5;
    background: #fff;
}

.nav-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: bold;
    color: #1a1a1a;
    letter-spacing: -0.02em;
}

.nav-logo:hover {
    color: #8b1a1a;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-size: 0.875rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.user-name {
    font-size: 0.875rem;
    color: #555;
}

.btn-login, .btn-logout {
    padding: 0.4rem 0.9rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.btn-login {
    background: #8b1a1a;
    color: #fff !important;
}

.btn-login:hover {
    background: #5c1010;
}

.btn-logout {
    border: 1px solid #ccc;
    color: #666 !important;
}

.btn-logout:hover {
    background: #f5f5f5;
}

/* --------------------------------------------------------------------------
   Hero Section (Homepage)
   -------------------------------------------------------------------------- */
.hero {
    text-align: center;
    padding: 3rem 0 2rem;
}

.hero h1 {
    font-size: 2.2rem;
    font-weight: normal;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 0.75rem;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: #666;
    max-width: 500px;
    margin: 0 auto;
}

.hero-description {
    font-size: 0.9rem;
    color: #888;
    max-width: 500px;
    margin: 0.75rem auto 0;
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   How It Works (Homepage)
   -------------------------------------------------------------------------- */
.how-it-works {
    display: flex;
    gap: 2rem;
    justify-content: center;
    padding: 2.5rem 0;
    max-width: 700px;
    margin: 0 auto;
}

.hiw-step {
    text-align: center;
    flex: 1;
}

.hiw-number {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #8b1a1a;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.hiw-step h3 {
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
}

.hiw-step p {
    font-size: 0.8rem;
    color: #888;
    line-height: 1.4;
}

/* --------------------------------------------------------------------------
   About Blurb (Homepage)
   -------------------------------------------------------------------------- */
.about-blurb {
    text-align: center;
    padding: 2rem 1rem 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.about-blurb p {
    font-size: 0.85rem;
    color: #888;
    line-height: 1.5;
    font-style: italic;
}

/* --------------------------------------------------------------------------
   Shows Grid (Homepage)
   -------------------------------------------------------------------------- */
.shows-section {
    padding-top: 1rem;
}

.shows-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e5e5;
}

.shows-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.sort-label {
    color: #888;
}

.sort-link {
    color: #888;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
}

.sort-link.active {
    background: #8b1a1a;
    color: #fff;
}

.shows-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.show-card {
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.show-card:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.show-card-link {
    color: inherit;
    display: block;
}

.show-card-image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f0f0f0;
}

.show-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.show-card-content {
    padding: 1rem 1.25rem;
}

.show-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    line-height: 1.3;
}

.show-card-status {
    font-size: 0.75rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #999;
}

.status-published {
    color: #2d7a3a;
}

.status-draft {
    color: #b8860b;
}

/* --------------------------------------------------------------------------
   Show Detail Page
   -------------------------------------------------------------------------- */
.show-header {
    margin-bottom: 2rem;
}

.show-cover {
    margin-bottom: 1.5rem;
    border-radius: 6px;
    overflow: hidden;
    max-height: 400px;
}

.show-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.show-title {
    font-size: 2rem;
    font-weight: normal;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* Season sections */
.season {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.season:last-child {
    border-bottom: none;
}

.season-heading {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Ending divider */
.ending-divider {
    border: none;
    border-top: 2px solid #8b1a1a;
    margin: 2.5rem 0 1.5rem;
    width: 60px;
}

.ending-heading {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ending-content {
    margin-bottom: 2.5rem;
}

.coming-soon {
    color: #888;
    font-style: italic;
}

/* --------------------------------------------------------------------------
   FAQ
   -------------------------------------------------------------------------- */
.show-faq {
    margin: 2rem 0;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e5e5;
}

.faq-heading {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.faq-item {
    border-bottom: 1px solid #eee;
    padding: 0.75rem 0;
}

.faq-question {
    cursor: pointer;
    font-weight: 500;
    padding: 0.5rem 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.95rem;
}

.faq-question:hover {
    color: #8b1a1a;
}

.faq-answer {
    padding: 0.5rem 0 1rem;
    font-size: 0.9rem;
    color: #555;
}

.faq-empty {
    color: #888;
    font-style: italic;
}

/* --------------------------------------------------------------------------
   Comments
   -------------------------------------------------------------------------- */
.show-comments {
    margin: 2rem 0;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e5e5;
}

.comments-heading {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.comments-login-prompt {
    padding: 1.5rem;
    background: #f8f8f8;
    border-radius: 6px;
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

/* Comment form */
.comment-form {
    margin-bottom: 2rem;
}

.comment-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
}

.comment-form textarea:focus {
    outline: none;
    border-color: #8b1a1a;
}

.comment-form .form-group {
    margin-bottom: 0.75rem;
}

.comment-form label {
    display: block;
    font-size: 0.85rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #555;
    margin-bottom: 0.35rem;
}

.comment-form small {
    display: block;
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.25rem;
}

/* Individual comment */
.comment {
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #8b1a1a;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.comment-author {
    font-weight: 600;
    font-size: 0.9rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.comment-time {
    font-size: 0.75rem;
    color: #999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.comment-body {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #333;
}

/* Load more */
.load-more {
    text-align: center;
    padding: 1rem;
    color: #888;
    font-size: 0.85rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.comments-empty {
    text-align: center;
    padding: 2rem;
    color: #888;
    font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   Prose — Markdown rendered content
   -------------------------------------------------------------------------- */
.prose h2 {
    font-size: 1.3rem;
    margin: 1.5rem 0 0.75rem;
}

.prose h3 {
    font-size: 1.1rem;
    margin: 1.25rem 0 0.5rem;
}

.prose p {
    margin-bottom: 0.75rem;
}

.prose ul, .prose ol {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.prose li {
    margin-bottom: 0.25rem;
}

.prose blockquote {
    border-left: 3px solid #8b1a1a;
    padding-left: 1rem;
    margin: 1rem 0;
    color: #555;
    font-style: italic;
}

.prose code {
    background: #f0f0f0;
    padding: 0.15rem 0.35rem;
    border-radius: 3px;
    font-size: 0.85rem;
}

.prose pre {
    background: #f5f5f5;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1rem 0;
}

.prose pre code {
    background: none;
    padding: 0;
}

.prose hr {
    border: none;
    border-top: 1px solid #e5e5e5;
    margin: 1.5rem 0;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn-primary {
    display: inline-block;
    padding: 0.55rem 1.25rem;
    background: #8b1a1a;
    color: #fff !important;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-primary:hover {
    background: #5c1010;
}

.btn-secondary {
    display: inline-block;
    padding: 0.55rem 1.25rem;
    background: #f0f0f0;
    color: #555 !important;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #e5e5e5;
}

.btn-small {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    background: #f5f5f5;
    color: #555 !important;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 0.75rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    cursor: pointer;
}

.btn-small:hover {
    background: #e5e5e5;
}

.btn-danger {
    color: #c0392b !important;
    border-color: #e8b4b0;
}

.btn-danger:hover {
    background: #fdecea;
}

.btn-back {
    display: inline-block;
    margin-top: 1rem;
    color: #8b1a1a;
}

/* --------------------------------------------------------------------------
   Google Sign-In Button
   -------------------------------------------------------------------------- */
.btn-google {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    background: #fff;
    color: #555 !important;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.btn-google:hover {
    border-color: #8b1a1a;
    color: #8b1a1a !important;
}

/* --------------------------------------------------------------------------
   Login page
   -------------------------------------------------------------------------- */
.login-page {
    text-align: center;
    padding: 4rem 0;
}

.login-page h1 {
    margin-bottom: 0.75rem;
}

.login-description {
    color: #666;
    margin-bottom: 2rem;
}

/* --------------------------------------------------------------------------
   Admin Styles
   -------------------------------------------------------------------------- */
.admin-page {
    max-width: 900px;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.admin-page h1 {
    font-size: 1.5rem;
}

.admin-page h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.85rem;
}

.admin-table th {
    text-align: left;
    padding: 0.6rem 0.8rem;
    border-bottom: 2px solid #e5e5e5;
    color: #888;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 0.75rem;
}

.admin-table td {
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid #f0f0f0;
}

.admin-table code {
    background: #f0f0f0;
    padding: 0.1rem 0.3rem;
    border-radius: 2px;
    font-size: 0.8rem;
}

.status-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-draft {
    background: #fff8e1;
    color: #b8860b;
}

.status-published {
    background: #e8f5e9;
    color: #2d7a3a;
}

.actions-cell {
    display: flex;
    gap: 0.4rem;
}

.admin-form {
    max-width: 600px;
}

.admin-form.inline-form {
    max-width: 100%;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #555;
    margin-bottom: 0.3rem;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.9rem;
}

.form-group textarea {
    font-family: Georgia, "Times New Roman", Times, serif;
    line-height: 1.6;
}

.code-textarea {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace !important;
    font-size: 0.8rem !important;
    line-height: 1.5 !important;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #8b1a1a;
}

.form-group small {
    display: block;
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.2rem;
}

.form-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 1rem;
}

.section-divider {
    border: none;
    border-top: 1px solid #ddd;
    margin: 2rem 0;
}

.admin-subsection {
    margin-top: 1.5rem;
}

.card {
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    background: #fff;
}

.card h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.add-form {
    margin: 1rem 0;
}

.add-form summary {
    cursor: pointer;
    display: inline-block;
}

.mini-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    vertical-align: middle;
}

.comment-preview {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #666;
    font-size: 0.8rem;
}

/* --------------------------------------------------------------------------
   Error page
   -------------------------------------------------------------------------- */
.error-page {
    text-align: center;
    padding: 4rem 0;
}

.error-page h1 {
    font-size: 1.8rem;
    margin-bottom: 0.75rem;
}

.error-page p {
    color: #666;
}

/* --------------------------------------------------------------------------
   Flash messages
   -------------------------------------------------------------------------- */
.flash {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.flash-success {
    background: #e8f5e9;
    color: #2d7a3a;
    border: 1px solid #c8e6c9;
}
.flash-error {
    background: #fdecea;
    color: #c0392b;
    border: 1px solid #f5c6cb;
}

/* --------------------------------------------------------------------------
   Empty state
   -------------------------------------------------------------------------- */
.empty-state {
    text-align: center;
    padding: 3rem 0;
    color: #888;
}

.empty-state p {
    margin-bottom: 1rem;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
    border-top: 1px solid #e5e5e5;
    background: #fff;
    margin-top: auto;
}

.footer-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: #888;
}

.footer-container nav {
    margin-top: 0.5rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.footer-container a {
    color: #888;
}

.footer-container a:hover {
    color: #8b1a1a;
}

/* --------------------------------------------------------------------------
   FAQ Page
   -------------------------------------------------------------------------- */
.faq-page {
    padding: 1rem 0;
}

.faq-page h1 {
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
}

/* --------------------------------------------------------------------------
   Donation / Buy me a coffee
   -------------------------------------------------------------------------- */
.donate-link {
    font-size: 0.8rem;
}

.nav-donate {
    font-size: 0.8rem;
    color: #b8860b !important;
    border-right: 1px solid #e5e5e5;
    padding-right: 1rem;
}

.nav-donate:hover {
    color: #8b6914 !important;
}

.donation-cta {
    text-align: center;
    padding: 1.5rem 1rem;
    margin: 2rem 0;
    background: #faf5f0;
    border-radius: 6px;
    border: 1px solid #efe5d8;
}

.donation-message {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.75rem;
    font-style: italic;
}

.btn-donate {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: #fff;
    color: #8b1a1a !important;
    border: 1px solid #8b1a1a;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.btn-donate:hover {
    background: #8b1a1a;
    color: #fff !important;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
    .main-content {
        padding: 1.25rem;
    }

    .hero h1 {
        font-size: 1.6rem;
    }

    .shows-grid {
        grid-template-columns: 1fr;
    }

    .show-title {
        font-size: 1.5rem;
    }

    .nav-container {
        flex-direction: column;
        gap: 0.75rem;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .admin-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .admin-table {
        font-size: 0.75rem;
    }

    .admin-table th,
    .admin-table td {
        padding: 0.4rem 0.5rem;
    }

}
