/*
 * Talione Ghost Theme Styles
 * Uses Tailwind CSS via CDN (loaded in default.hbs) + custom Ghost content styles.
 * Brand accent: purple (matches talione.com).
 */

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   Ghost Content Styles (gh-content class)
   ============================================================ */
.gh-content { font-size: 1.125rem; line-height: 1.8; color: #374151; }

.gh-content h1 { font-size: 2.25rem; font-weight: 800; color: #111827; margin-top: 3rem; margin-bottom: 1rem; letter-spacing: -0.025em; }
.gh-content h2 { font-size: 1.75rem; font-weight: 700; color: #111827; margin-top: 2.5rem; margin-bottom: 1rem; letter-spacing: -0.025em; }
.gh-content h3 { font-size: 1.375rem; font-weight: 700; color: #111827; margin-top: 2rem; margin-bottom: 0.75rem; }
.gh-content h4 { font-size: 1.125rem; font-weight: 600; color: #111827; margin-top: 1.5rem; margin-bottom: 0.5rem; }

.gh-content p { margin-bottom: 1.5rem; }
.gh-content p + p { margin-top: 0; }

.gh-content a { color: #9333ea; text-decoration: none; transition: color 0.15s; }
.gh-content a:hover { color: #7e22ce; text-decoration: underline; }

.gh-content ul, .gh-content ol { margin-bottom: 1.5rem; padding-left: 1.5rem; }
.gh-content ul { list-style-type: disc; }
.gh-content ol { list-style-type: decimal; }
.gh-content li { margin-bottom: 0.5rem; padding-left: 0.25rem; }
.gh-content li > ul, .gh-content li > ol { margin-top: 0.5rem; margin-bottom: 0; }

.gh-content blockquote {
    border-left: 4px solid #9333ea;
    background-color: #faf5ff;
    border-radius: 0 0.5rem 0.5rem 0;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #6b21a8;
}
.gh-content blockquote p:last-child { margin-bottom: 0; }

.gh-content img { max-width: 100%; height: auto; border-radius: 0.75rem; box-shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1); margin: 2rem 0; }
.gh-content figure { margin: 2rem 0; }
.gh-content figcaption { text-align: center; font-size: 0.875rem; color: #6b7280; margin-top: 0.75rem; }

.gh-content code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.875em;
    background-color: #faf5ff;
    color: #7e22ce;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}
.gh-content pre { background-color: #111827; color: #e5e7eb; border-radius: 0.75rem; padding: 1.25rem; overflow-x: auto; margin: 1.5rem 0; font-size: 0.875rem; line-height: 1.7; }
.gh-content pre code { background: none; color: inherit; padding: 0; border-radius: 0; font-size: inherit; }

.gh-content table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.9375rem; }
.gh-content thead th { background-color: #f9fafb; font-weight: 600; text-align: left; padding: 0.75rem 1rem; border-bottom: 2px solid #e5e7eb; color: #111827; }
.gh-content tbody td { padding: 0.75rem 1rem; border-bottom: 1px solid #f3f4f6; color: #374151; }
.gh-content tbody tr:hover { background-color: #f9fafb; }

.gh-content hr { border: none; border-top: 1px solid #e5e7eb; margin: 3rem 0; }

/* Ghost editor cards */
.gh-content .kg-card { margin: 2rem 0; }
.gh-content .kg-image-card img { margin: 0 auto; }
.gh-content .kg-width-wide { max-width: 1000px; margin-left: auto; margin-right: auto; }
.gh-content .kg-width-full { max-width: none; margin-left: calc(-50vw + 50%); margin-right: calc(-50vw + 50%); }
.gh-content .kg-width-full img { border-radius: 0; }

.gh-content .kg-bookmark-card { border: 1px solid #e5e7eb; border-radius: 0.75rem; overflow: hidden; transition: box-shadow 0.2s; }
.gh-content .kg-bookmark-card:hover { box-shadow: 0 4px 6px -1px rgba(0,0,0,.1); }
.gh-content .kg-bookmark-container { display: flex; text-decoration: none; color: inherit; }
.gh-content .kg-bookmark-content { flex: 1; padding: 1.25rem; }
.gh-content .kg-bookmark-title { font-size: 1rem; font-weight: 600; color: #111827; line-height: 1.4; }
.gh-content .kg-bookmark-description { font-size: 0.875rem; color: #6b7280; margin-top: 0.5rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gh-content .kg-bookmark-metadata { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.75rem; font-size: 0.8125rem; color: #6b7280; }
.gh-content .kg-bookmark-icon { width: 1.25rem; height: 1.25rem; }
.gh-content .kg-bookmark-thumbnail { width: 200px; flex-shrink: 0; }
.gh-content .kg-bookmark-thumbnail img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; box-shadow: none; margin: 0; }

.gh-content .kg-gallery-card { margin: 2rem 0; }
.gh-content .kg-gallery-container { display: flex; flex-direction: column; gap: 0.75rem; }
.gh-content .kg-gallery-row { display: flex; gap: 0.75rem; }
.gh-content .kg-gallery-image img { display: block; width: 100%; height: 100%; object-fit: cover; margin: 0; }

.gh-content .kg-callout-card { display: flex; gap: 1rem; padding: 1.25rem; border-radius: 0.75rem; }
.gh-content .kg-callout-card-grey { background-color: #f3f4f6; }
.gh-content .kg-callout-card-white { background-color: #fff; border: 1px solid #e5e7eb; }
.gh-content .kg-callout-card-blue { background-color: #eff6ff; }
.gh-content .kg-callout-card-green { background-color: #f0fdf4; }
.gh-content .kg-callout-card-yellow { background-color: #fefce8; }
.gh-content .kg-callout-card-red { background-color: #fef2f2; }
.gh-content .kg-callout-card-pink { background-color: #fdf2f8; }
.gh-content .kg-callout-card-purple { background-color: #faf5ff; }
.gh-content .kg-callout-emoji { font-size: 1.25rem; line-height: 1; }
.gh-content .kg-callout-text { font-size: 0.9375rem; color: #374151; }

.gh-content .kg-toggle-card { border: 1px solid #e5e7eb; border-radius: 0.75rem; padding: 1.25rem; }
.gh-content .kg-toggle-heading { display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.gh-content .kg-toggle-heading h4 { margin: 0; font-size: 1rem; font-weight: 600; }

.gh-content .kg-button-card { display: flex; justify-content: center; margin: 2rem 0; }
.gh-content .kg-btn { display: inline-flex; align-items: center; padding: 0.75rem 2rem; font-size: 1rem; font-weight: 600; border-radius: 0.5rem; text-decoration: none; transition: all 0.2s; }
.gh-content .kg-btn-accent { background-color: #9333ea; color: #fff; }
.gh-content .kg-btn-accent:hover { background-color: #7e22ce; color: #fff; text-decoration: none; }

/* Utilities */
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

@media (max-width: 768px) {
    .gh-content h1 { font-size: 1.75rem; }
    .gh-content h2 { font-size: 1.5rem; }
    .gh-content h3 { font-size: 1.25rem; }
    .gh-content { font-size: 1rem; }
    .gh-content .kg-width-wide { max-width: 100%; }
    .gh-content .kg-bookmark-container { flex-direction: column; }
    .gh-content .kg-bookmark-thumbnail { width: 100%; height: 200px; }
}

@media print {
    header, footer, nav, .pagination { display: none; }
    body { font-size: 12pt; color: #000; }
    .gh-content a { color: #000; text-decoration: underline; }
    .gh-content a::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #666; }
}
