/*
Theme Name: Jav
Theme URI: https://example.com/jav
Author: JavTeam
Author URI: https://example.com
Description: Hızlı, hafif ve %100 responsive WordPress teması. Sayfa tabanlı kullanım için optimize edilmiştir. Google PageSpeed kurallarına uygun.
Version: 1.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: jav
Requires at least: 5.0
Tested up to: 6.7
Requires PHP: 7.4
*/

/* ========================================
   CSS CUSTOM PROPERTIES
   ======================================== */
:root {
    --color-bg: #f8f9fa;
    --color-surface: #ffffff;
    --color-text: #2d3748;
    --color-text-light: #718096;
    --color-header-bg: #1e293b;
    --color-header-text: #f1f5f9;
    --color-accent: #3b82f6;
    --color-accent-hover: #2563eb;
    --color-border: #e2e8f0;
    --color-footer-bg: #f1f5f9;
    --color-footer-text: #64748b;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --max-width: 1200px;
    --header-height: 60px;
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --transition: 0.2s ease;
}

/* ========================================
   RESET & BASE
   ======================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-stack);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeSpeed;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--color-accent-hover);
}

/* PageSpeed: explicit width/height prevents CLS */
img {
    max-width: 100%;
    height: auto;
    display: block;
    content-visibility: auto;
}

ul,
ol {
    list-style: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    line-height: 1.3;
    font-weight: 700;
    color: var(--color-text);
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.625rem;
}

h3 {
    font-size: 1.375rem;
}

h4 {
    font-size: 1.125rem;
}

p {
    margin-bottom: 1rem;
}

/* ========================================
   SKIP TO CONTENT (Accessibility + Lighthouse)
   ======================================== */
a.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    word-wrap: normal !important;
    background: var(--color-accent);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    z-index: 100000;
    text-decoration: none;
    border-radius: 0 0 var(--radius) var(--radius);
}

a.screen-reader-text:focus {
    clip: auto !important;
    display: block;
    height: auto;
    width: auto;
    left: 0.5rem;
    top: 0;
}

/* ========================================
   HEADER
   ======================================== */
.site-header {
    background-color: var(--color-header-bg);
    color: var(--color-header-text);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    contain: layout style;
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

.site-branding a {
    color: var(--color-header-text);
    font-size: 1.375rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.site-branding a:hover {
    color: #fff;
}

/* ========================================
   NAVIGATION - Desktop
   ======================================== */
.main-navigation ul {
    display: flex;
    gap: 0;
}

.main-navigation li {
    position: relative;
}

.main-navigation a {
    display: block;
    padding: 0 1rem;
    color: var(--color-header-text);
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: var(--header-height);
    transition: background-color var(--transition), color var(--transition);
    white-space: nowrap;
}

.main-navigation a:hover,
.main-navigation .current-menu-item>a,
.main-navigation .current-menu-ancestor>a {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Dropdown */
.main-navigation ul ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background-color: var(--color-header-bg);
    box-shadow: var(--shadow-lg);
    flex-direction: column;
    border-radius: 0 0 var(--radius) var(--radius);
    z-index: 999;
}

.main-navigation li:hover>ul {
    display: flex;
}

.main-navigation ul ul a {
    line-height: 1.5;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.main-navigation ul ul a:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

/* 3rd level */
.main-navigation ul ul ul {
    top: 0;
    left: 100%;
    border-radius: 0 var(--radius) var(--radius) 0;
}

/* ========================================
   HAMBURGER MENU (Pure CSS)
   ======================================== */
.menu-toggle-checkbox {
    display: none;
}

.menu-toggle-label {
    display: none;
    width: 28px;
    height: 22px;
    cursor: pointer;
    position: relative;
    z-index: 1001;
}

.menu-toggle-label span,
.menu-toggle-label span::before,
.menu-toggle-label span::after {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--color-header-text);
    border-radius: 2px;
    transition: var(--transition);
    position: absolute;
}

.menu-toggle-label span {
    top: 10px;
}

.menu-toggle-label span::before {
    content: '';
    top: -8px;
}

.menu-toggle-label span::after {
    content: '';
    top: 8px;
}

/* Hamburger Animation */
.menu-toggle-checkbox:checked+.menu-toggle-label span {
    background-color: transparent;
}

.menu-toggle-checkbox:checked+.menu-toggle-label span::before {
    top: 0;
    transform: rotate(45deg);
}

.menu-toggle-checkbox:checked+.menu-toggle-label span::after {
    top: 0;
    transform: rotate(-45deg);
}

/* ========================================
   SUBMENU TOGGLE (for mobile, pure CSS)
   ======================================== */
.submenu-toggle-checkbox {
    display: none !important;
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* On desktop, the wrap is transparent - no layout changes */
.menu-item-wrap {
    display: contents;
}

.submenu-toggle-label {
    display: none;
    align-items: center;
    justify-content: center;
    width: 48px;
    min-height: 48px;
    cursor: pointer;
    color: var(--color-header-text);
    transition: background-color var(--transition);
    flex-shrink: 0;
}

.submenu-toggle-label:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.submenu-toggle-label svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform var(--transition);
}

/* Rotate chevron when submenu is open */
.submenu-toggle-checkbox:checked~ul~.submenu-toggle-label svg,
.menu-item-has-children:has(.submenu-toggle-checkbox:checked) .submenu-toggle-label svg {
    transform: rotate(180deg);
}

/* ========================================
   LAYOUT
   ======================================== */
.site-content {
    flex: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.25rem;
    width: 100%;
}

.content-area {
    display: flex;
    gap: 2.5rem;
}

.main-content {
    flex: 1;
    min-width: 0;
}

/* ========================================
   ENTRIES / POSTS
   ======================================== */
.entry {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition);
}

.entry:hover {
    box-shadow: var(--shadow-md);
}

.entry-title {
    margin-bottom: 1rem;
}

.entry-title a {
    color: var(--color-text);
}

.entry-title a:hover {
    color: var(--color-accent);
}

.entry-content {
    line-height: 1.8;
}

.entry-content p {
    margin-bottom: 1.25rem;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
    margin: 1.5rem 0 0.75rem;
}

.entry-content ul,
.entry-content ol {
    margin: 0.75rem 0 1.25rem 1.5rem;
    list-style: disc;
}

.entry-content ol {
    list-style: decimal;
}

.entry-content li {
    margin-bottom: 0.35rem;
}

.entry-content img {
    border-radius: var(--radius);
    margin: 1rem 0;
}

.entry-content blockquote {
    border-left: 4px solid var(--color-accent);
    padding: 0.75rem 1.25rem;
    margin: 1rem 0;
    background: var(--color-bg);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-style: italic;
    color: var(--color-text-light);
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.entry-content th,
.entry-content td {
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--color-border);
    text-align: left;
}

.entry-content th {
    background: var(--color-bg);
    font-weight: 600;
}

.entry-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 1rem 0;
    font-size: 0.875rem;
    line-height: 1.6;
}

.entry-content code {
    background: var(--color-bg);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.875em;
}

.entry-content pre code {
    background: transparent;
    padding: 0;
}

/* ========================================
   BREADCRUMB
   ======================================== */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    padding: 0.875rem 0;
    margin-bottom: 1rem;
    font-size: 0.8125rem;
    color: var(--color-text-light);
}

.breadcrumb a {
    color: var(--color-accent);
    font-weight: 500;
}

.breadcrumb a:hover {
    color: var(--color-accent-hover);
    text-decoration: underline;
}

.breadcrumb-separator {
    display: inline-flex;
    align-items: center;
    color: var(--color-border);
    font-size: 0.75rem;
    user-select: none;
}

.breadcrumb-separator svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.breadcrumb-current {
    color: var(--color-text);
    font-weight: 600;
}

/* ========================================
   POST NAVIGATION (Prev/Next)
   ======================================== */
.post-navigation {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    content-visibility: auto;
    contain-intrinsic-size: 0 120px;
}

.post-navigation .nav-prev,
.post-navigation .nav-next {
    flex: 1;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: box-shadow var(--transition), border-color var(--transition);
}

.post-navigation .nav-prev:hover,
.post-navigation .nav-next:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--color-accent);
}

.post-navigation .nav-next {
    text-align: right;
}

.post-navigation .nav-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-light);
    font-weight: 600;
    margin-bottom: 0.375rem;
}

.post-navigation .nav-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.4;
}

.post-navigation a {
    display: block;
    color: inherit;
}

.post-navigation a:hover .nav-title {
    color: var(--color-accent);
}

/* ========================================
   SIDEBAR
   ======================================== */
.site-sidebar {
    width: 300px;
    flex-shrink: 0;
    content-visibility: auto;
    contain-intrinsic-size: 300px 500px;
}

.site-sidebar .widget {
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.site-sidebar .widget-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.875rem;
    padding-bottom: 0.625rem;
    border-bottom: 2px solid var(--color-accent);
    color: var(--color-text);
}

.site-sidebar .widget ul {
    list-style: none;
}

.site-sidebar .widget li {
    padding: 0.375rem 0;
    border-bottom: 1px solid var(--color-border);
}

.site-sidebar .widget li:last-child {
    border-bottom: none;
}

.site-sidebar .widget a {
    color: var(--color-text);
    font-size: 0.875rem;
    display: block;
    transition: color var(--transition), padding-left var(--transition);
}

.site-sidebar .widget a:hover {
    color: var(--color-accent);
    padding-left: 0.25rem;
}

/* ========================================
   FOOTER
   ======================================== */
.site-footer {
    background-color: var(--color-footer-bg);
    border-top: 1px solid var(--color-border);
    padding: 1.5rem 1.25rem;
    text-align: center;
    color: var(--color-footer-text);
    font-size: 0.875rem;
    contain: layout style;
}

.site-footer a {
    color: #1e293b;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color var(--transition);
}

.site-footer a:hover {
    color: var(--color-accent);
}

/* ========================================
   PAGINATION (for archive/index)
   ======================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.375rem;
    margin-top: 2rem;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.5rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    transition: all var(--transition);
}

.pagination .page-numbers:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.pagination .page-numbers.current {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
}

/* ========================================
   SEARCH FORM
   ======================================== */
.search-form {
    display: flex;
    gap: 0.5rem;
}

.search-form .search-field {
    flex: 1;
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: var(--font-stack);
    color: var(--color-text);
    background: var(--color-surface);
    transition: border-color var(--transition);
}

.search-form .search-field:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-form .search-submit {
    padding: 0.5rem 1rem;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
    font-family: var(--font-stack);
}

.search-form .search-submit:hover {
    background: var(--color-accent-hover);
}

/* ========================================
   404 PAGE
   ======================================== */
.error-404 {
    text-align: center;
    padding: 4rem 1rem;
}

.error-404 h1 {
    font-size: 5rem;
    font-weight: 900;
    color: var(--color-accent);
    margin-bottom: 0.5rem;
}

.error-404 p {
    font-size: 1.125rem;
    color: var(--color-text-light);
    margin-bottom: 1.5rem;
}

.error-404 .back-home {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--color-accent);
    color: #fff;
    border-radius: var(--radius);
    font-weight: 600;
    transition: background var(--transition);
}

.error-404 .back-home:hover {
    background: var(--color-accent-hover);
    color: #fff;
}

/* ========================================
   READ MORE LINK
   ======================================== */
.read-more {
    display: inline-block;
    margin-top: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--color-accent);
    transition: color var(--transition);
}

.read-more:hover {
    color: var(--color-accent-hover);
}

/* ========================================
   ARCHIVE HEADER
   ======================================== */
.archive-header {
    margin-bottom: 1.5rem;
}

.archive-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.archive-description {
    margin-top: 0.5rem;
    color: var(--color-text-light);
    font-size: 0.9375rem;
}

/* ========================================
   RESPONSIVE — MOBILE (max-width: 768px)
   ======================================== */
@media (max-width: 768px) {

    /* Hamburger visible */
    .menu-toggle-label {
        display: block;
    }

    /* Nav hidden by default on mobile */
    .main-navigation {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background-color: var(--color-header-bg);
        box-shadow: var(--shadow-lg);
        max-height: 80vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .menu-toggle-checkbox:checked~.main-navigation {
        display: block;
    }

    .main-navigation ul {
        flex-direction: column;
    }

    .main-navigation a {
        line-height: 1.5;
        padding: 0.875rem 1.25rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    /* Menu item wrap becomes flex container on mobile */
    .menu-item-wrap {
        display: flex;
        align-items: center;
        position: relative;
    }

    /* Disable parent link navigation on mobile - tap toggles submenu instead */
    .menu-item-has-children>.menu-item-wrap>a {
        pointer-events: none;
        flex: 1;
    }

    /* Toggle label covers entire row on mobile */
    .submenu-toggle-label {
        display: flex;
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        justify-content: flex-end;
        padding-right: 1rem;
    }

    /* Mobile dropdowns — hidden by default */
    .main-navigation ul ul {
        position: static;
        box-shadow: none;
        border-radius: 0;
        display: none;
    }

    /* Disable hover-based dropdown on mobile */
    .main-navigation li:hover>ul {
        display: none;
    }

    /* Show submenu when checkbox is checked */
    .submenu-toggle-checkbox:checked~ul {
        display: flex !important;
    }

    .main-navigation ul ul a {
        padding-left: 2.5rem;
    }

    .main-navigation ul ul ul a {
        padding-left: 3.75rem;
    }

    /* Layout */
    .content-area {
        flex-direction: column;
    }

    .site-sidebar {
        width: 100%;
        contain-intrinsic-size: auto 400px;
    }

    .entry {
        padding: 1.25rem;
    }

    /* Post navigation mobile */
    .post-navigation {
        flex-direction: column;
        gap: 0.75rem;
    }

    .post-navigation .nav-next {
        text-align: left;
    }

    h1 {
        font-size: 1.625rem;
    }

    h2 {
        font-size: 1.375rem;
    }

    h3 {
        font-size: 1.125rem;
    }
}

/* ========================================
   RESPONSIVE — TABLET (max-width: 1024px)
   ======================================== */
@media (max-width: 1024px) and (min-width: 769px) {
    .site-sidebar {
        width: 250px;
    }

    .main-navigation a {
        padding: 0 0.75rem;
        font-size: 0.875rem;
    }
}

/* ========================================
   WP ALIGNMENTS
   ======================================== */
.aligncenter {
    display: block;
    margin: 1rem auto;
}

.alignleft {
    float: left;
    margin: 0.5rem 1rem 0.5rem 0;
}

.alignright {
    float: right;
    margin: 0.5rem 0 0.5rem 1rem;
}

.wp-caption {
    max-width: 100%;
    margin: 1rem 0;
}

.wp-caption-text {
    font-size: 0.8125rem;
    color: var(--color-text-light);
    text-align: center;
    padding-top: 0.375rem;
}

/* ========================================
   REDUCED MOTION (Accessibility)
   ======================================== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}