/*
Theme Name: Psikanaliz Dynamic Core
Theme URI: https://psikanalitikterapi.com
Description: n8n entegrasyonlu, güvenliği sıkılaştırılmış dinamik kütüphane teması. REST API, rate limiting ve profesyonel güvenlik önlemleri içerir.
Author: Serkan Dinç
Author URI: https://psikanalitikterapi.com
Version: 1.1.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: psikanaliz
Tags: blog, portfolio, custom-logo, custom-menu, featured-images, translation-ready
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
*/

/* ==========================================================================
   CSS Custom Properties (Design Tokens)
   ========================================================================== */
:root {
    /* Colors */
    --psi-primary: #8A1538;
    --psi-primary-hover: #6B0F2A;
    --psi-primary-light: rgba(138, 21, 56, 0.1);
    --psi-secondary: #C46838;
    --psi-secondary-hover: #A85830;
    
    /* Backgrounds */
    --psi-bg-body: #FAF7F2;
    --psi-bg-card: #FFFFFF;
    --psi-bg-muted: #F5F1EB;
    
    /* Text */
    --psi-text-main: #2B1F27;
    --psi-text-muted: #645C5F;
    --psi-text-light: #8A8486;
    
    /* Borders & Shadows */
    --psi-border: #E8E2D9;
    --psi-border-focus: #8A1538;
    --psi-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --psi-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --psi-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    
    /* Layout */
    --psi-container: 1200px;
    --psi-content: 800px;
    --psi-gap: 1.5rem;
    
    /* Radius */
    --psi-radius-sm: 6px;
    --psi-radius-md: 12px;
    --psi-radius-lg: 16px;
    --psi-radius-full: 9999px;
    
    /* Transitions */
    --psi-transition: 200ms ease-in-out;
    --psi-transition-slow: 300ms ease-in-out;
    
    /* Typography */
    --psi-font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --psi-font-serif: Georgia, "Times New Roman", serif;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--psi-font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--psi-text-main);
    background-color: var(--psi-bg-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Focus states for accessibility */
:focus-visible {
    outline: 2px solid var(--psi-primary);
    outline-offset: 2px;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--psi-text-main);
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

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

a:hover {
    color: var(--psi-secondary);
}

ul, ol {
    list-style: none;
}

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

/* ==========================================================================
   Utilities
   ========================================================================== */
.container {
    width: 100%;
    max-width: var(--psi-container);
    margin-inline: auto;
    padding-inline: 1.25rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(250, 247, 242, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--psi-border);
    padding-block: 1rem;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.site-logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--psi-primary);
    letter-spacing: -0.02em;
}

.site-logo:hover {
    color: var(--psi-primary-hover);
}

/* Navigation */
.main-nav ul {
    display: flex;
    gap: 2rem;
}

.main-nav a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--psi-text-main);
    padding-block: 0.5rem;
    position: relative;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--psi-secondary);
    transition: width var(--psi-transition);
}

.main-nav a:hover::after,
.main-nav .current-menu-item a::after {
    width: 100%;
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--psi-border);
    border-radius: var(--psi-radius-sm);
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    color: var(--psi-primary);
    font-size: 1.25rem;
    line-height: 1;
}

.mobile-toggle:hover {
    background: var(--psi-primary-light);
}

/* Admin Notice (Menu not set) */
.menu-notice {
    background: #FEF3C7;
    border: 1px solid #F59E0B;
    border-radius: var(--psi-radius-sm);
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    color: #92400E;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    padding: 4rem 0 2rem;
    text-align: center;
}

.hero h1 {
    color: var(--psi-primary);
    margin-bottom: 1rem;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--psi-text-muted);
    max-width: 600px;
    margin-inline: auto;
}

/* Live Indicator */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--psi-bg-card);
    padding: 0.375rem 1rem;
    border-radius: var(--psi-radius-full);
    border: 1px solid var(--psi-border);
    font-size: 0.85rem;
    color: var(--psi-secondary);
    margin-bottom: 1.5rem;
}

.pulse {
    width: 8px;
    height: 8px;
    background: var(--psi-secondary);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(196, 104, 56, 0.4); 
    }
    50% { 
        box-shadow: 0 0 0 8px rgba(196, 104, 56, 0); 
    }
}

/* ==========================================================================
   Content Layout
   ========================================================================== */
.content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    padding-block: 3rem;
}

@media (min-width: 900px) {
    .content-grid {
        grid-template-columns: 2fr 1fr;
    }
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--psi-border);
}

.section-title {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--psi-primary);
}

.section-link {
    font-size: 0.875rem;
    font-weight: 500;
}

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
    background: var(--psi-bg-card);
    border: 1px solid var(--psi-border);
    border-radius: var(--psi-radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: transform var(--psi-transition), border-color var(--psi-transition), box-shadow var(--psi-transition);
}

.card:hover {
    transform: translateY(-2px);
    border-color: var(--psi-secondary);
    box-shadow: var(--psi-shadow-md);
}

.card:last-child {
    margin-bottom: 0;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--psi-text-muted);
    margin-bottom: 0.75rem;
}

.card-tag {
    color: var(--psi-secondary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
}

.card h3 {
    margin-bottom: 0.5rem;
}

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

/* ==========================================================================
   PDF / Library Items
   ========================================================================== */
.pdf-item {
    background: var(--psi-bg-card);
    padding: 1.25rem;
    border-radius: var(--psi-radius-sm);
    border: 1px solid var(--psi-border);
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
    transition: border-color var(--psi-transition), box-shadow var(--psi-transition);
}

.pdf-item:hover {
    border-color: var(--psi-primary);
    box-shadow: var(--psi-shadow-sm);
}

.pdf-item:last-child {
    margin-bottom: 0;
}

.file-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    line-height: 1;
}

.pdf-item h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.pdf-author {
    font-size: 0.85rem;
    color: var(--psi-text-muted);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--psi-radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all var(--psi-transition);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--psi-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--psi-primary-hover);
    color: #fff;
}

.btn-text {
    font-weight: 600;
    color: var(--psi-primary);
    font-size: 0.9rem;
}

.btn-text:hover {
    color: var(--psi-secondary);
}

/* ==========================================================================
   Download Box
   ========================================================================== */
.download-box {
    margin-top: 3rem;
    padding: 2rem;
    background: var(--psi-bg-muted);
    border-radius: var(--psi-radius-md);
    text-align: center;
}

.download-box h3 {
    margin-bottom: 1rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    margin-top: auto;
    padding: 2rem 0;
    background: var(--psi-bg-card);
    border-top: 1px solid var(--psi-border);
    text-align: center;
    color: var(--psi-text-muted);
    font-size: 0.9rem;
}

/* ==========================================================================
   Single Post / Page
   ========================================================================== */
.single-content {
    max-width: var(--psi-content);
    margin-inline: auto;
    padding: 4rem 1.25rem;
}

.single-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.single-header h1 {
    color: var(--psi-primary);
    margin-top: 1rem;
}

.entry-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

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

.entry-content ul {
    list-style: disc;
}

.entry-content ol {
    list-style: decimal;
}

.entry-content li {
    margin-bottom: 0.5rem;
}

.entry-content blockquote {
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    background: var(--psi-bg-muted);
    border-left: 4px solid var(--psi-primary);
    border-radius: 0 var(--psi-radius-sm) var(--psi-radius-sm) 0;
    font-style: italic;
}

/* ==========================================================================
   Archive Pages
   ========================================================================== */
.archive-header {
    text-align: center;
    margin-bottom: 3rem;
}

.archive-header h1 {
    color: var(--psi-primary);
}

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

/* ==========================================================================
   404 Page
   ========================================================================== */
.error-404 {
    text-align: center;
    padding: 6rem 1.25rem;
}

.error-404 h1 {
    font-size: 6rem;
    color: var(--psi-primary);
    line-height: 1;
    margin-bottom: 1rem;
}

/* ==========================================================================
   Navigation (Pagination)
   ========================================================================== */
.posts-navigation {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--psi-border);
}

.nav-links {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
    .mobile-toggle {
        display: block;
    }
    
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--psi-bg-card);
        padding: 1rem;
        border-bottom: 1px solid var(--psi-border);
        box-shadow: var(--psi-shadow-lg);
    }
    
    .main-nav.is-active {
        display: block;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 0;
    }
    
    .main-nav li {
        border-bottom: 1px solid var(--psi-border);
    }
    
    .main-nav li:last-child {
        border-bottom: none;
    }
    
    .main-nav a {
        display: block;
        padding: 0.75rem 0;
    }
    
    .main-nav a::after {
        display: none;
    }
    
    .hero {
        padding: 3rem 0 1.5rem;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    .site-header,
    .site-footer,
    .mobile-toggle {
        display: none;
    }
    
    body {
        background: #fff;
        color: #000;
    }
    
    a {
        text-decoration: underline;
    }
}

.hero {
    padding: 6rem 0;
    background: linear-gradient(135deg, var(--psi-bg-body) 0%, #F5EEE6 100%);
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-grid--single {
    grid-template-columns: 1fr;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 4rem;
}

.stat-card {
    background: var(--psi-bg-card);
    padding: 1.5rem;
    border-radius: var(--psi-radius-md);
    text-align: center;
    box-shadow: var(--psi-shadow-sm);
    border: 1px solid var(--psi-border);
}

.stat-card strong { display: block; font-size: 1.25rem; color: var(--psi-primary); margin-bottom: 0.5rem; }

.news-strip {
    padding: 4rem 0;
    background: linear-gradient(to bottom, var(--psi-bg-card), var(--psi-bg-muted));
    border-top: 1px solid var(--psi-border);
    border-bottom: 1px solid var(--psi-border);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.features-section { padding: 4rem 0; }

/* --- Secondary Button --- */
