/**
 * SmoothSheet Ghost Theme Styles
 *
 * Custom styles to match the main SmoothSheet application branding.
 * These styles override/extend the base Casper theme.
 *
 * Brand Colors from Logo (src/components/Logo.tsx):
 * - Light Green: #d2f4e1 (logo background)
 * - Dark Green: #18432f (logo strokes, primary accent)
 */

/* ============================================
   CSS Variables - SmoothSheet Brand Colors
   ============================================ */

:root {
    /* Primary Colors - SmoothSheet Brand Green */
    --ss-primary: #18432f;
    --ss-primary-hover: #0f2d1f;
    --ss-primary-light: #d2f4e1;

    /* Neutral Colors - matches Tailwind/shadcn defaults */
    --ss-background: #ffffff;
    --ss-foreground: #0a0a0a;
    --ss-muted: #737373;
    --ss-muted-foreground: #a3a3a3;
    --ss-border: #e5e5e5;

    /* Spacing */
    --ss-container-max: 1200px;
    --ss-header-height: 64px;

    /* Typography - Inter font family */
    --ss-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Border radius - matches main app (0.625rem) */
    --ss-radius: 0.625rem;
}

/* ============================================
   Base Styles
   ============================================ */

body {
    font-family: var(--ss-font-sans);
    color: var(--ss-foreground);
    background-color: var(--ss-background);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Header Styles - matches src/components/marketing/Header.tsx
   ============================================ */

.ss-header {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    border-bottom: 1px solid var(--ss-border);
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.ss-container {
    max-width: var(--ss-container-max);
    margin: 0 auto;
    padding: 0 1rem;
}

.ss-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--ss-header-height);
}

.ss-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--ss-foreground);
}

.ss-logo:hover {
    color: var(--ss-foreground);
    text-decoration: none;
}

.ss-logo-icon {
    flex-shrink: 0;
}

.ss-logo-text {
    font-weight: 600;
    font-size: 1.125rem;
}

.ss-nav-links {
    display: none;
    align-items: center;
    gap: 2rem;
}

@media (min-width: 768px) {
    .ss-nav-links {
        display: flex;
    }
}

.ss-nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ss-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.ss-nav-link:hover {
    color: var(--ss-foreground);
}

.ss-nav-link--active {
    color: var(--ss-foreground);
}

.ss-nav-cta {
    display: none;
    align-items: center;
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .ss-nav-cta {
        display: flex;
    }
}

/* Buttons - matches shadcn/ui Button component styling */
.ss-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: calc(var(--ss-radius) - 2px);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    white-space: nowrap;
}

.ss-btn--primary {
    background-color: var(--ss-foreground);
    color: var(--ss-background);
}

.ss-btn--primary:hover {
    background-color: var(--ss-foreground);
    opacity: 0.9;
}

.ss-btn--secondary {
    background-color: transparent;
    color: var(--ss-foreground);
    border: 1px solid var(--ss-border);
}

.ss-btn--secondary:hover {
    background-color: #f5f5f5;
}

.ss-btn--large {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.ss-btn--full {
    width: 100%;
}

.ss-btn--with-icon {
    gap: 0.375rem;
}

.ss-btn-icon {
    flex-shrink: 0;
    transition: transform 0.2s;
}

.ss-btn--with-icon:hover .ss-btn-icon {
    transform: translateX(2px);
}

/* Mobile Menu */
.ss-mobile-toggle {
    display: flex;
    padding: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--ss-foreground);
}

@media (min-width: 768px) {
    .ss-mobile-toggle {
        display: none;
    }
}

.ss-mobile-nav {
    display: none;
    flex-direction: column;
    padding: 1rem 0;
    border-top: 1px solid var(--ss-border);
}

.ss-mobile-nav.active {
    display: flex;
}

.ss-mobile-link {
    padding: 0.75rem 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--ss-muted);
    text-decoration: none;
}

.ss-mobile-link:hover {
    color: var(--ss-foreground);
}

.ss-mobile-link--active {
    color: var(--ss-foreground);
}

.ss-mobile-cta {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--ss-border);
}

/* ============================================
   Footer Styles - matches src/components/marketing/Footer.tsx
   md:grid-cols-5 layout (2fr 1fr 1fr 1fr pattern)
   ============================================ */

.ss-footer {
    border-top: 1px solid var(--ss-border);
    background-color: rgba(250, 250, 250, 0.3);
    padding: 3rem 0;
}

.ss-footer-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .ss-footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }
}

.ss-footer-brand {
    max-width: 280px;
}

.ss-footer-description {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--ss-muted);
    line-height: 1.6;
}

.ss-footer-column {
    display: flex;
    flex-direction: column;
}

.ss-footer-title {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--ss-foreground);
}

.ss-footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ss-footer-links li {
    margin-bottom: 0.5rem;
}

.ss-footer-links a {
    font-size: 0.875rem;
    color: var(--ss-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.ss-footer-links a:hover {
    color: var(--ss-foreground);
}

.ss-footer-trust {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--ss-border);
}

.ss-trust-badge {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--ss-muted);
}

.ss-trust-badge svg {
    flex-shrink: 0;
}

.ss-footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--ss-border);
    font-size: 0.875rem;
    color: var(--ss-muted);
}

/* ============================================
   CTA Block Styles - matches main app final CTA
   ============================================ */

.ss-cta-block {
    margin: 3rem 0;
    padding: 3rem 2rem;
    background: linear-gradient(180deg, rgba(10, 10, 10, 0.06) 0%, rgba(10, 10, 10, 0.03) 100%);
    border-radius: var(--ss-radius);
    text-align: center;
}

.ss-cta-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--ss-foreground);
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .ss-cta-title {
        font-size: 2rem;
    }
}

.ss-cta-description {
    font-size: 1.125rem;
    color: var(--ss-muted);
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.ss-cta-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.ss-cta-note {
    font-size: 0.875rem;
    color: var(--ss-muted);
}

/* ============================================
   Koenig Editor Styles (Required by Ghost)
   ============================================ */

.kg-width-wide {
    position: relative;
    width: 85vw;
    min-width: 100%;
    margin: 1.5rem calc(50% - 42.5vw);
}

.kg-width-full {
    position: relative;
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.kg-width-full img {
    width: 100%;
}

.kg-image-card {
    margin: 1.5rem 0;
}

.kg-image-card img {
    margin: 0 auto;
}

.kg-image-card figcaption {
    text-align: center;
    font-size: 0.875rem;
    color: var(--ss-muted);
    margin-top: 0.5rem;
}

.kg-gallery-card {
    margin: 1.5rem 0;
}

.kg-gallery-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.kg-gallery-row {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    width: 100%;
}

.kg-gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kg-bookmark-card {
    margin: 1.5rem 0;
}

.kg-bookmark-container {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--ss-border);
    border-radius: 0.5rem;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

@media (min-width: 640px) {
    .kg-bookmark-container {
        flex-direction: row;
    }
}

.kg-bookmark-content {
    flex: 1;
    padding: 1rem;
}

.kg-bookmark-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.kg-bookmark-description {
    font-size: 0.875rem;
    color: var(--ss-muted);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kg-bookmark-metadata {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--ss-muted);
}

.kg-bookmark-icon {
    width: 16px;
    height: 16px;
}

.kg-bookmark-thumbnail {
    width: 100%;
    max-width: 200px;
}

.kg-bookmark-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kg-embed-card {
    margin: 1.5rem 0;
}

.kg-embed-card iframe {
    width: 100%;
}

/* ============================================
   Post Content Styles
   ============================================ */

.post-content {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 1rem;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
    color: var(--ss-foreground);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.post-content p {
    line-height: 1.75;
    margin-bottom: 1.25rem;
}

.post-content a {
    color: var(--ss-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.post-content a:hover {
    color: var(--ss-primary-hover);
}

.post-content code {
    background-color: #f5f5f5;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
    font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

.post-content pre {
    background-color: #171717;
    color: #e5e5e5;
    padding: 1rem;
    border-radius: var(--ss-radius);
    overflow-x: auto;
    margin: 1.5rem 0;
}

.post-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--ss-radius);
    margin: 1.5rem 0;
}

.post-content blockquote {
    border-left: 4px solid var(--ss-primary);
    padding-left: 1rem;
    margin: 1.5rem 0;
    color: var(--ss-muted);
    font-style: italic;
}

.post-content ul,
.post-content ol {
    margin: 1.25rem 0;
    padding-left: 1.5rem;
}

.post-content li {
    margin-bottom: 0.5rem;
    line-height: 1.75;
}

/* ============================================
   Post Tag Styles
   ============================================ */

.post-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ss-primary);
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: 0.025em;
}

.post-tag:hover {
    color: var(--ss-primary-hover);
}

/* ============================================
   Blog Index Styles
   ============================================ */

.post-card {
    border: 1px solid var(--ss-border);
    border-radius: var(--ss-radius);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    background: var(--ss-background);
}

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

.post-card-image {
    aspect-ratio: 16/9;
    object-fit: cover;
    width: 100%;
}

.post-card-content {
    padding: 1.5rem;
}

.post-card-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ss-primary);
    text-transform: uppercase;
    text-decoration: none;
    margin-bottom: 0.5rem;
    letter-spacing: 0.025em;
}

.post-card-tag:hover {
    color: var(--ss-primary-hover);
}

.post-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ss-foreground);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.post-card-title a {
    color: inherit;
    text-decoration: none;
}

.post-card-title a:hover {
    color: var(--ss-primary);
}

.post-card-excerpt {
    font-size: 0.875rem;
    color: var(--ss-muted);
    line-height: 1.6;
}

/* ============================================
   Newsletter Signup Styles
   ============================================ */

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 400px;
    margin: 0 auto;
}

@media (min-width: 640px) {
    .newsletter-form {
        flex-direction: row;
    }
}

.newsletter-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--ss-border);
    border-radius: calc(var(--ss-radius) - 2px);
    font-size: 1rem;
    font-family: var(--ss-font-sans);
    color: var(--ss-foreground);
    background: var(--ss-background);
}

.newsletter-input::placeholder {
    color: var(--ss-muted-foreground);
}

.newsletter-input:focus {
    outline: none;
    border-color: var(--ss-foreground);
    box-shadow: 0 0 0 2px rgba(10, 10, 10, 0.1);
}
