/* ============================================
   Tukudroid CMS - Public Stylesheet
   ============================================ */

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-dark: #111827;
    --border-color: #e5e7eb;
    --font-family: 'Inter', sans-serif;
    --max-width: 1200px;
    --header-height: 70px;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f9fafb;
        --text-secondary: #9ca3af;
        --bg-primary: #111827;
        --bg-secondary: #1f2937;
        --border-color: #374151;
    }
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    color: var(--text-primary);
    background: var(--bg-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    z-index: 1000;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
}

/* Container */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.site-logo img {
    height: 40px;
    width: auto;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Navigation */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 24px;
}

.nav-menu a {
    color: var(--text-primary);
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--radius);
    transition: background 0.2s;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: var(--bg-secondary);
    text-decoration: none;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: 0.3s;
}

/* Hero */
.hero {
    padding: 80px 0;
    text-align: center;
    background: var(--bg-secondary);
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 32px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
    text-align: center;
}

.btn:hover {
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-outline {
    border-color: var(--border-color);
    color: var(--text-primary);
    background: transparent;
}

.btn-outline:hover {
    background: var(--bg-secondary);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1.1rem;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-danger {
    background: #dc2626;
    color: white;
}

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

/* Sections */
.section {
    padding: 60px 0;
}

.section-alt {
    background: var(--bg-secondary);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.section-header h2 {
    font-size: 2rem;
}

/* Page header */
.page-header {
    padding: 60px 0;
    background: var(--bg-secondary);
    text-align: center;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    transition: box-shadow 0.2s, transform 0.2s;
    color: var(--text-primary);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    text-decoration: none;
}

.card-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.card h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.card time {
    display: block;
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.price {
    display: inline-block;
    margin-top: 12px;
    font-weight: 600;
    color: var(--primary-color);
}

/* Detail pages */
.detail-header {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.detail-icon {
    width: 120px;
    height: 120px;
    border-radius: 24px;
}

.detail-image {
    width: 200px;
    border-radius: var(--radius);
}

.detail-header h1 {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.lead {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.price-large {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 24px;
}

/* Screenshots */
.screenshots {
    margin-bottom: 40px;
}

.screenshots h2 {
    margin-bottom: 20px;
}

.screenshot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.screenshot-grid img {
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

/* Content body */
.content-body {
    max-width: 800px;
}

.content-body h2 {
    margin: 32px 0 16px;
}

.content-body h3 {
    margin: 24px 0 12px;
}

.content-body p {
    margin-bottom: 16px;
}

.content-body ul,
.content-body ol {
    margin: 16px 0 16px 24px;
}

.content-body li {
    margin-bottom: 8px;
}

.content-body pre {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 16px 0;
}

.content-body code {
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
}

.content-body :not(pre) > code {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Post detail */
.post-detail {
    padding: 40px 0;
}

.post-header {
    text-align: center;
    margin-bottom: 32px;
}

.post-header h1 {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.post-meta {
    color: var(--text-secondary);
}

.post-cover {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 32px;
}

.post-nav {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

/* Page detail */
.page-detail {
    padding: 40px 0;
}

.page-header-detail {
    margin-bottom: 32px;
}

.page-header-detail h1 {
    font-size: 2.5rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 40px;
}

.page-info {
    color: var(--text-secondary);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Footer */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-pages-only {
    text-align: center;
    margin-bottom: 24px;
}

.footer-pages-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.footer-page-btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s;
    text-decoration: none;
}

.footer-page-btn:hover {
    background: var(--primary-hover);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--bg-primary);
        flex-direction: column;
        padding: 16px;
        border-bottom: 1px solid var(--border-color);
        box-shadow: var(--shadow-lg);
    }

    .nav-menu.active {
        display: flex;
    }

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

    .hero-subtitle {
        font-size: 1rem;
    }

    .detail-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

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

    .section-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
}
