/**
 * ERPAMA CMS - Merkezi Template Stilleri
 * ========================================
 * Tüm template dosyaları için tek CSS kaynağı.
 * templates/css/templates.css
 *
 * Bölümler:
 *   1. Global / Utility
 *   2. Prose (İçerik Tipografi)
 *   3. Single Post  (sp-*)
 *   4. Category Page (cat-*)
 *   5. Layout / Sidebar
 */

/* ==========================================================================
   1. GLOBAL / UTILITY
   ========================================================================== */

html {
    scroll-behavior: smooth;
}

.gradient-bg {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
}

.gradient-text {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card-hover {
    transition: all 0.3s ease;
}
.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.hero-pattern {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* ==========================================================================
   2. PROSE (İçerik Tipografi)
   ========================================================================== */

.prose {
    max-width: none;
}
.prose h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
}
.prose h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}
.prose p {
    margin-bottom: 1rem;
    line-height: 1.75;
}
.prose ul {
    list-style-type: disc;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}
.prose li {
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   3. SINGLE POST  (sp-*)
   ========================================================================== */

/* --- Hero Cover --- */
.sp-hero-cover {
    position: relative;
    width: 100%;
    height: 65vh;
    min-height: 400px;
    background-size: cover;
    background-position: center;
}
.sp-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 30%, rgba(0, 0, 0, 0.75));
    display: flex;
    align-items: flex-end;
}
.sp-hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 24px 48px;
    color: #fff;
    width: 100%;
}
.sp-hero-cats {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.sp-cat-badge {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    color: #fff;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s;
}
.sp-cat-badge:hover {
    background: rgba(255, 255, 255, 0.35);
}
.sp-hero-title {
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 16px;
}
.sp-hero-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 14px;
    opacity: 0.9;
}
.sp-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* --- Layout --- */
.sp-wrapper {
    background: #f8fafc;
    min-height: 100vh;
    padding: 40px 0 60px;
}
.sp-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
.sp-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
}
@media (max-width: 1024px) {
    .sp-layout {
        grid-template-columns: 1fr;
    }
    .sp-sidebar {
        display: none;
    }
}

/* --- Article --- */
.sp-article {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

/* --- Header --- */
.sp-header {
    padding: 32px 32px 24px;
    border-bottom: 1px solid #f1f5f9;
}
.sp-categories {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.sp-cat-link {
    color: #2563eb;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.sp-cat-link:hover {
    text-decoration: underline;
}
.sp-title {
    font-size: clamp(1.5rem, 3.5vw, 2.5rem);
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
    margin: 0 0 12px;
}
.sp-excerpt {
    font-size: 18px;
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 20px;
}

/* --- Meta / Author --- */
.sp-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.sp-author-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.sp-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}
.sp-avatar-sm { width: 32px; height: 32px; font-size: 13px; }
.sp-avatar-lg { width: 56px; height: 56px; font-size: 22px; }
.sp-author-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 15px;
}
.sp-meta-secondary {
    font-size: 13px;
    color: #94a3b8;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 2px;
}
.sp-dot { color: #cbd5e1; }

/* --- Share --- */
.sp-share-actions {
    display: flex;
    gap: 8px;
}
.sp-share-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s;
    text-decoration: none;
}
.sp-share-btn:hover {
    background: #f1f5f9;
    color: #2563eb;
    border-color: #2563eb;
}

/* --- Featured Image --- */
.sp-featured-image { margin: 0; }
.sp-featured-image img { width: 100%; height: auto; display: block; }
.sp-fi-content { padding: 0 32px; }
.sp-fi-content img { border-radius: 12px; }
.sp-fi-float-left { float: left; width: 45%; margin: 0 24px 16px 0; }
.sp-fi-float-left img { border-radius: 12px; width: 100%; }
.sp-fi-float-right { float: right; width: 45%; margin: 0 0 16px 24px; }
.sp-fi-float-right img { border-radius: 12px; width: 100%; }

/* --- Content --- */
.sp-content {
    padding: 32px;
    font-size: 17px;
    line-height: 1.8;
    color: #334155;
}
.sp-content::after { content: ''; display: table; clear: both; }
.sp-content h2 { font-size: 1.6em; font-weight: 700; color: #0f172a; margin: 1.5em 0 0.5em; }
.sp-content h3 { font-size: 1.3em; font-weight: 700; color: #0f172a; margin: 1.3em 0 0.5em; }
.sp-content p { margin: 0 0 1.2em; }
.sp-content img { max-width: 100%; height: auto; border-radius: 8px; margin: 1em 0; }
.sp-content blockquote {
    border-left: 4px solid #2563eb;
    padding: 16px 24px;
    margin: 1.5em 0;
    background: #f8fafc;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #475569;
}
.sp-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 12px;
    overflow-x: auto;
    font-size: 14px;
    margin: 1.5em 0;
}
.sp-content code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-size: 0.9em; color: #e11d48; }
.sp-content pre code { background: none; padding: 0; color: inherit; }
.sp-content a { color: #2563eb; text-decoration: underline; }
.sp-content ul,
.sp-content ol { padding-left: 1.5em; margin: 0 0 1.2em; }
.sp-content li { margin: 0.3em 0; }

/* --- Tags --- */
.sp-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 32px 24px;
    color: #94a3b8;
}
.sp-tag {
    color: #2563eb;
    background: #eff6ff;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s;
}
.sp-tag:hover { background: #dbeafe; }

/* --- Post Footer --- */
.sp-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-top: 1px solid #f1f5f9;
    flex-wrap: wrap;
    gap: 16px;
}
.sp-footer-author { display: flex; align-items: center; gap: 12px; }
.sp-footer-author-label {
    font-size: 12px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.sp-footer-author-name { font-size: 16px; font-weight: 700; color: #1e293b; }
.sp-last-updated { font-size: 13px; color: #94a3b8; }

/* --- Comments --- */
.sp-comments {
    padding: 32px;
    border-top: 1px solid #f1f5f9;
}
.sp-comments-title { font-size: 22px; font-weight: 700; color: #0f172a; margin: 0 0 24px; }
.sp-comments-count { color: #94a3b8; font-weight: 400; }

.sp-comment-form-wrap {
    background: #f8fafc;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
}
.sp-cf-title { font-size: 16px; font-weight: 600; color: #1e293b; margin: 0 0 16px; }
.sp-comment-form label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    margin-bottom: 4px;
}
.sp-comment-form input[type="text"],
.sp-comment-form input[type="email"],
.sp-comment-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    transition: border 0.2s;
    box-sizing: border-box;
}
.sp-comment-form input:focus,
.sp-comment-form textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.sp-cf-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
@media (max-width: 640px) {
    .sp-cf-row { grid-template-columns: 1fr; }
}
.sp-cf-field { margin-bottom: 16px; }
.sp-cf-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sp-btn-primary {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.sp-btn-primary:hover { background: #1d4ed8; }
.sp-btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.sp-cf-note { font-size: 12px; color: #94a3b8; }
.sp-cf-message { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-top: 16px; }
.sp-cf-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.sp-cf-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.sp-reply-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #eff6ff;
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #2563eb;
}
.sp-reply-cancel {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #64748b;
    padding: 0 4px;
}

.sp-comment { padding: 16px 0; border-bottom: 1px solid #f1f5f9; }
.sp-comment:last-child { border-bottom: none; }
.sp-comment-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sp-comment-author { font-weight: 600; color: #1e293b; font-size: 14px; margin-right: 8px; }
.sp-comment-date { font-size: 12px; color: #94a3b8; }
.sp-comment-body { font-size: 15px; color: #475569; line-height: 1.6; padding-left: 42px; }
.sp-reply-btn {
    background: none;
    border: none;
    color: #2563eb;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 0;
    margin-left: 42px;
    margin-top: 4px;
}
.sp-reply-btn:hover { text-decoration: underline; }
.sp-no-comments { text-align: center; padding: 32px; color: #94a3b8; font-size: 15px; }

/* --- Related Posts --- */
.sp-related { margin-top: 48px; }
.sp-related-title { font-size: 22px; font-weight: 700; color: #0f172a; margin: 0 0 24px; }
.sp-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}
.sp-related-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}
.sp-related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}
.sp-rc-image { aspect-ratio: 16/10; overflow: hidden; background: #f1f5f9; }
.sp-rc-image img { width: 100%; height: 100%; object-fit: cover; }
.sp-rc-placeholder { display: flex; align-items: center; justify-content: center; color: #cbd5e1; }
.sp-rc-body { padding: 16px; }
.sp-rc-title {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.sp-rc-date { font-size: 12px; color: #94a3b8; }

/* --- Sidebar (Single Post) --- */
.sp-sidebar {
    position: sticky;
    top: 20px;
    align-self: start;
}

/* ==========================================================================
   4. CATEGORY PAGE  (cat-*)
   ========================================================================== */

.cat-slider-track {
    display: flex;
    transition: transform 0.5s ease;
}
.cat-slider-slide {
    flex-shrink: 0;
}

/* ==========================================================================
   5. LAYOUT / SIDEBAR (Ortak)
   ========================================================================== */

/* Sayfa yüklenme geçişi */
.page-transition {
    animation: pageIn 0.4s ease-out;
}
@keyframes pageIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ==========================================================================
   6. NAVBAR FIX - Non-hero sayfalarda navbar her zaman koyu kalmalı
   ========================================================================== */

/*
 * PHP non-hero sayfalara bg-gray-900 verir, hero sayfalara bg-transparent.
 * JS scroll handler hatalı bg-transparent ekleyebilir ama bg-gray-900'ı
 * hiç kaldırmaz. Bu kural bg-gray-900 varken koyu arka planı zorlar.
 */
#navbar.bg-gray-900 {
    background-color: rgb(17 24 39) !important;
}

/* data-hero-page attribute (cache güncellendiğinde aktif olur) */
body[data-hero-page="false"] #navbar {
    background-color: rgb(17 24 39 / 0.95) !important;
    backdrop-filter: blur(12px);
}
