/* ============================================
   KORGAN MECMUASI - Frontend CSS
   Minimal, Modern, Mobil Uyumlu
   ============================================ */

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #1a56db;
    --primary-dark: #1e40af;
    --accent: #dc2626;
    --text: #1f2937;
    --text-light: #6b7280;
    --text-lighter: #9ca3af;
    --bg: #ffffff;
    --bg-light: #f9fafb;
    --bg-dark: #f3f4f6;
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
    --radius: 8px;
    --radius-lg: 12px;
    --font: 'Cairo', sans-serif;
    --font-heading: 'Big Shoulders Display', sans-serif;
    --max-width: 1200px;
    --header-height: 64px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.section-title,
.widget-title,
.logo-text,
.slide-content h2 {
    font-family: var(--font-heading);
}

a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; display: block; }

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ---- HEADER ---- */
.site-header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    gap: 20px;
}

.logo a {
    display: flex;
    align-items: center;
    color: var(--text);
}

.logo img { height: 36px; }

.logo-text {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 4px;
}

.main-nav a {
    display: block;
    padding: 8px 14px;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary);
    background: var(--bg-light);
}

.header-actions { display: flex; align-items: center; gap: 8px; }

.search-toggle,
.mobile-menu-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.search-toggle:hover,
.mobile-menu-toggle:hover {
    background: var(--bg-light);
    border-color: var(--text-lighter);
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    width: 38px;
    height: 38px;
}

.mobile-menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: 0.3s;
}

/* Search Bar */
.search-bar {
    display: none;
    padding: 12px 0;
    border-top: 1px solid var(--border);
    position: relative;
}

.search-bar.active { display: block; }

.search-form {
    display: flex;
    gap: 8px;
}

.search-form input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.2s;
}

.search-form input:focus { border-color: var(--primary); }

.search-form button {
    padding: 10px 24px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    transition: background 0.2s;
}

.search-form button:hover { background: var(--primary-dark); }

.search-results-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 50;
    max-height: 400px;
    overflow-y: auto;
}

.search-results-dropdown.active { display: block; }

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.2s;
}

.search-result-item:hover { background: var(--bg-light); }
.search-result-item img { width: 50px; height: 35px; object-fit: cover; border-radius: 4px; }
.search-result-item strong { font-size: 0.9rem; }
.search-result-item small { color: var(--text-light); }

/* ---- HERO SLIDER ---- */
.hero-slider {
    padding: 24px 0;
}

.slider {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #000;
}

.slider-track { position: relative; }

.slide {
    display: none;
    position: relative;
}

.slide.active { display: block; }

.slide-image {
    width: 100%;
    aspect-ratio: 16/7;
    overflow: hidden;
}

.slide-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.slide:hover .slide-image img { transform: scale(1.02); }

.slide-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 60px 30px 30px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: #fff;
}

.slide-category {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.slide-content h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.3;
}

.slide-content time {
    font-size: 0.85rem;
    opacity: 0.8;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--text);
}

.slider-btn:hover { background: #fff; box-shadow: var(--shadow-md); }
.slider-prev { left: 16px; }
.slider-next { right: 16px; }

.slider-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.dot.active { background: #fff; transform: scale(1.2); }

/* ---- HOME GRID ---- */
.home-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 40px;
    padding: 20px 0 60px;
}

/* ---- SECTION ---- */
.section { margin-bottom: 40px; }

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--text);
}

.section-title {
    font-size: 1.3rem;
    font-weight: 700;
    position: relative;
}

/* ---- POST CARD GRID ---- */
.post-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.post-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.post-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s;
}

.post-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.post-card-image {
    display: block;
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.post-card:hover .post-card-image img { transform: scale(1.05); }

.post-card-category {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--primary);
    color: #fff;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
}

.post-card-body {
    padding: 16px;
}

.post-card-body h3 {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 6px;
}

.post-card-body h3 a { color: var(--text); }
.post-card-body h3 a:hover { color: var(--primary); }

.post-card-body p {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 10px;
    line-height: 1.5;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-lighter);
}

.views-count {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ---- SIDEBAR ---- */
.sidebar { display: flex; flex-direction: column; gap: 24px; }

.sidebar-widget {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.widget-title {
    font-size: 1rem;
    font-weight: 700;
    padding: 16px 20px;
    border-bottom: 2px solid var(--text);
    margin: 0;
}

/* Announcement List */
.announcement-list {
    list-style: none;
    padding: 0;
}

.announcement-list li a {
    display: flex;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
    align-items: flex-start;
    transition: background 0.2s;
}

.announcement-list li:last-child a { border-bottom: none; }
.announcement-list li a:hover { background: var(--bg-light); }

.ann-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.ann-content strong {
    display: block;
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 2px;
}

.ann-content time {
    font-size: 0.75rem;
    color: var(--text-lighter);
}

/* Popular List */
.popular-list {
    list-style: none;
    padding: 0;
}

.popular-list li a {
    display: flex;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
    align-items: center;
    transition: background 0.2s;
}

.popular-list li:last-child a { border-bottom: none; }
.popular-list li a:hover { background: var(--bg-light); }

.pop-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: var(--bg-dark);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-light);
}

.pop-content strong {
    display: block;
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.3;
}

.pop-meta {
    font-size: 0.75rem;
    color: var(--text-lighter);
}

/* Category List */
.category-list {
    list-style: none;
    padding: 8px 0;
}

.category-list li a {
    display: block;
    padding: 8px 20px;
    color: var(--text);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.category-list li a:hover {
    color: var(--primary);
    padding-left: 24px;
}

/* ---- POST DETAIL ---- */
.post-detail {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px 0 50px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 0;
    font-size: 0.85rem;
    color: var(--text-lighter);
    flex-wrap: wrap;
}

.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--primary); }

.post-header { margin-bottom: 24px; }

.post-category-badge {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 4px 14px;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.post-header h1 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 16px;
    font-family: var(--font-heading);
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    color: var(--text-light);
    font-size: 0.88rem;
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-featured-image {
    margin-bottom: 24px;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.post-featured-image img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.post-summary {
    padding: 16px 20px;
    background: var(--bg-light);
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius) var(--radius) 0;
    margin-bottom: 24px;
    font-size: 1.05rem;
    color: var(--text-light);
    line-height: 1.7;
}

.post-content {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text);
}

.post-content p { margin-bottom: 1.2em; }
.post-content h2, .post-content h3 { margin: 1.5em 0 0.6em; font-weight: 700; }
.post-content img { border-radius: var(--radius); margin: 1em 0; }
.post-content ul, .post-content ol { margin: 1em 0; padding-left: 1.5em; }
.post-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 12px 20px;
    margin: 1.2em 0;
    background: var(--bg-light);
    font-style: italic;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 30px 0;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.tag-badge {
    display: inline-block;
    padding: 5px 14px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.82rem;
    color: var(--text-light);
    font-weight: 500;
    transition: all 0.2s;
}

.tag-badge:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Share Buttons */
.share-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 0;
    flex-wrap: wrap;
}

.share-buttons span {
    font-weight: 600;
    font-size: 0.9rem;
}

.share-btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #fff;
    transition: opacity 0.2s;
}

.share-btn:hover { opacity: 0.85; color: #fff; }

.share-facebook { background: #1877f2; }
.share-twitter { background: #1da1f2; }
.share-whatsapp { background: #25d366; }
.share-telegram { background: #0088cc; }

/* Related Posts */
.related-posts {
    padding: 40px 0;
    border-top: 1px solid var(--border);
    max-width: 800px;
    margin: 0 auto;
}

.related-posts .section-title { margin-bottom: 20px; }

/* ---- CATEGORY / SEARCH PAGE ---- */
.category-header {
    padding: 20px 0 30px;
}

.category-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.category-header p {
    color: var(--text-light);
    margin-bottom: 4px;
}

.post-count {
    font-size: 0.85rem;
    color: var(--text-lighter);
}

/* Search Page */
.search-page-header {
    padding: 24px 0;
}

.search-page-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.search-page-form {
    display: flex;
    gap: 8px;
    max-width: 600px;
    margin-bottom: 16px;
}

.search-page-form input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: var(--font);
    outline: none;
}

.search-page-form input:focus { border-color: var(--primary); }

.search-page-form button {
    padding: 12px 28px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
}

.search-info {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Post List (Search Results) */
.post-list-item {
    display: flex;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-light);
}

.post-list-image {
    flex-shrink: 0;
    width: 200px;
    aspect-ratio: 16/10;
    border-radius: var(--radius);
    overflow: hidden;
}

.post-list-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-list-body h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.post-list-body h2 a { color: var(--text); }
.post-list-body h2 a:hover { color: var(--primary); }

.post-list-category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.post-list-body p {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.5;
    margin-bottom: 8px;
}

/* ---- PAGINATION ---- */
.pagination {
    padding: 30px 0;
    display: flex;
    justify-content: center;
}

.pagination ul {
    display: flex;
    list-style: none;
    gap: 4px;
}

.pagination li a,
.pagination li span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text);
    transition: all 0.2s;
}

.pagination li a:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pagination li.active a {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ---- ERROR PAGE ---- */
.error-page {
    text-align: center;
    padding: 80px 0;
}

.error-page h1 {
    font-size: 6rem;
    font-weight: 800;
    color: var(--border);
    line-height: 1;
}

.error-page h2 {
    font-size: 1.5rem;
    margin: 10px 0;
}

.error-page p {
    color: var(--text-light);
    margin-bottom: 24px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 0;
    color: var(--text-light);
}

.empty-state p { margin-bottom: 16px; font-size: 1.1rem; }

/* ---- BUTTONS ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }

/* ---- FOOTER ---- */
.site-footer {
    background: var(--text);
    color: #d1d5db;
    padding: 50px 0 0;
    margin-top: 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}

.footer-grid h3 {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 16px;
}

.footer-about p {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 10px;
}

.footer-email {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
}

.footer-categories ul {
    list-style: none;
}

.footer-categories li {
    margin-bottom: 6px;
}

.footer-categories a {
    color: #d1d5db;
    font-size: 0.88rem;
    transition: color 0.2s;
}

.footer-categories a:hover { color: #fff; }

.social-links {
    display: ruby;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}
.footer-social .social-links {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    transition: background 0.2s, transform 0.2s, opacity 0.2s;
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-2px);
}

.social-link img {
    display: block;
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 20px 0;
    text-align: center;
    font-size: 0.82rem;
    color: #9ca3af;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
    .home-grid {
        grid-template-columns: 1fr;
    }

    .post-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .main-nav { display: none; }
    .mobile-menu-toggle { display: flex; }

    .main-nav.active {
        display: block;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
        z-index: 99;
        padding: 12px;
    }

    .main-nav.active ul {
        flex-direction: column;
        gap: 0;
    }

    .main-nav.active a {
        padding: 12px 16px;
        border-bottom: 1px solid var(--border-light);
    }

    .post-grid,
    .post-grid-4 {
        grid-template-columns: 1fr;
    }

    .slide-content h2 { font-size: 1.1rem; }
    .slide-image { aspect-ratio: 16/9; }

    .post-header h1 { font-size: 1.5rem; }
    .post-content { font-size: 1rem; }

    .post-list-item {
        flex-direction: column;
        gap: 12px;
    }

    .post-list-image { width: 100%; }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .related-posts .post-grid { grid-template-columns: 1fr 1fr; }

    .share-buttons { flex-wrap: wrap; }
}

@media (max-width: 480px) {
    .container { padding: 0 16px; }

    .search-page-form {
        flex-direction: column;
    }

    .related-posts .post-grid { grid-template-columns: 1fr; }
}
