/*
Theme Name: Rehber Teması
Theme URI: https://umut.app/
Author: Antigravity
Author URI: https://umut.app/
Description: Minimalist, fast, and text-focused WordPress theme for guides and documentation.
Version: 1.0.1
Text Domain: rehber-theme
*/

:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --bg-color: #f8fafc;
    --text-color: #1e293b;
    --text-muted: #475569;
    --code-bg: #1e1e1e;
    --warning-bg: #fff7ed;
    --warning-border: #ea580c;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --border-dashed: #cbd5e1;
    --muted-bg: #f1f5f9;
    --hero-gradient-start: #f8fafc;
    --hero-gradient-end: #e0e7ff;
    --link-hover: #1e40af;
}

html.dark {
    --primary-color: #3b82f6; 
    --secondary-color: #60a5fa;
    --bg-color: #121212;
    --text-color: #f1f5f9;
    --text-muted: #a3a3a3;
    --code-bg: #000000;
    --warning-bg: rgba(234, 88, 12, 0.1);
    --warning-border: #ea580c;
    --card-bg: #1e1e1e;
    --border-color: #2d2d2d;
    --border-dashed: #404040;
    --muted-bg: #1a1a1a;
    --hero-gradient-start: #121212;
    --hero-gradient-end: #1e1e1e;
    --link-hover: #93c5fd;
}

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

html {
    overflow-y: scroll;
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-wrap: break-word;
    word-wrap: break-word;
    overflow-x: hidden;
    max-width: 100vw;
}

img, video {
    max-width: 100%;
    height: auto;
}

.site-wrapper {
    display: flex;
    justify-content: center;
    gap: 30px;
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 20px;
    align-items: flex-start;
    flex: 1;
    width: 100%;
}

.container {
    width: 100%;
    max-width: 1000px;
    flex: 1;
    min-width: 0;
    margin: 40px 0;
    padding: 30px;
    background: var(--card-bg);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    border-radius: 8px;
}

/* Header & Navigation */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 15px;
    margin-bottom: 30px;
}

.site-branding a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 24px;
    font-weight: 700;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.main-navigation a {
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.main-navigation a:hover {
    color: var(--primary-color);
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    padding: 5px;
    border-radius: 5px;
    color: var(--text-color);
    transition: background 0.2s;
}

.theme-toggle:hover {
    background: var(--muted-bg);
}

/* Typography & Content Layout */
h1 {
    color: var(--primary-color);
    margin-top: 0;
}

.single-post h1.entry-title {
    text-align: center;
    padding-bottom: 10px;
}

h2 {
    color: var(--secondary-color);
    border-left: 5px solid var(--secondary-color);
    padding-left: 15px;
    margin-top: 30px;
}

h3 {
    color: var(--text-color);
}

/* Warning Blocks */
.warning {
    background-color: var(--warning-bg);
    border: 1px solid var(--warning-border);
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
    font-weight: bold;
}

/* Code Blocks */
pre {
    background-color: var(--code-bg);
    color: #dcdcdc;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.4;
}

code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* Steps and Links */
.step {
    margin-bottom: 20px;
}

.link-box {
    background: var(--muted-bg);
    padding: 10px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    margin-bottom: 15px;
}

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

a:hover {
    text-decoration: underline;
    color: var(--link-hover);
}

/* Index / Archive Styles */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post-item {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.post-item:last-child {
    border-bottom: none;
}

.post-item h2 {
    margin: 0 0 10px 0;
    font-size: 22px;
}

.post-item h2 a {
    color: var(--text-color);
    text-decoration: none;
    border-left: none; /* override h2 border if it leaks */
}

.post-item h2 a:hover {
    color: var(--primary-color);
}

.post-excerpt {
    color: var(--text-muted);
    font-size: 15px;
}

/* Pagination */
.pagination {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.pagination .nav-links {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pagination .page-numbers {
    display: inline-block;
    padding: 6px 14px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-color);
    font-weight: 600;
    transition: all 0.2s;
    text-decoration: none;
}

.pagination .page-numbers:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination .page-numbers.current {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination .screen-reader-text {
    display: none;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    color: var(--text-color);
}

th, td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: var(--muted-bg);
}

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

/* Hero Section (Anasayfa) */
.hero-section {
    background: linear-gradient(135deg, var(--hero-gradient-start) 0%, var(--hero-gradient-end) 100%);
    border-radius: 12px;
    padding: 50px 30px;
    text-align: center;
    margin-bottom: 40px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 15px -3px rgb(37 99 235 / 0.1);
}

.hero-section h1 {
    font-size: 36px;
    color: var(--secondary-color);
    margin-bottom: 15px;
    border: none;
    padding: 0;
}

.hero-description {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 650px;
    margin: 0 auto 25px auto;
    line-height: 1.7;
}

.hero-tags {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-tag {
    background: var(--card-bg);
    color: var(--primary-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.05);
}

/* External Sidebar Layout */
.outer-sidebar {
    width: 300px;
    flex-shrink: 0;
    margin-top: 40px;
    position: sticky;
    top: 40px;
}

.sidebar-card {
    background: var(--card-bg);
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.sidebar-title {
    font-size: 16px;
    color: var(--secondary-color);
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-list li {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--border-dashed);
}

.sidebar-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.sidebar-list a {
    color: var(--text-muted);
    font-size: 14px;
    display: block;
    line-height: 1.4;
}

.sidebar-list a:hover {
    color: var(--primary-color);
}

/* Sidebar Search */
.search-form {
    display: flex;
    gap: 8px;
    margin-bottom: 25px;
}
.search-field {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.search-field:focus {
    border-color: var(--primary-color);
}
.search-submit {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}
.search-submit:hover {
    background: var(--secondary-color);
}

/* Responsive */
@media (max-width: 800px) {
    .site-wrapper {
        flex-direction: column;
        padding: 0 15px;
    }
    .outer-sidebar {
        width: 100%;
        margin-top: 0;
        margin-bottom: 40px;
    }
    .container {
        margin: 20px 0;
        padding: 20px;
        width: 100%;
        max-width: 100%;
    }
}

/* Ensure code blocks don't break layout */
pre, table {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    display: block; /* Requires display block for tables to scroll horizontally */
}

@media (max-width: 600px) {
    .site-header {
        flex-direction: column;
        gap: 15px;
        position: relative;
    }
    .main-navigation ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    .theme-toggle {
        position: absolute;
        top: 0;
        right: 0;
    }
    h1 {
        font-size: 26px;
    }
    .single-post h1.entry-title {
        font-size: 24px;
    }
}
