/*
Theme Name: ErdemliCam
Theme URI: https://erdemlicam.com
Author: ErdemliCam
Author URI: https://erdemlicam.com
Description: Erdemli Cam Balkon, Çelik Kapı, Duşakabin ve Alüminyum Korkuluk firmasına özel olarak geliştirilmiş hızlı, temiz ve modern WordPress teması.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: erdemlicam
Tags: custom-menu, featured-images, threaded-comments, translation-ready, responsive-layout, blog
*/

/* ==========================================================================
   CSS Variables - Kolay özelleştirme
   ========================================================================== */
:root {
  --primary: #e85d04;
  --primary-dark: #d00000;
  --primary-light: #f48c06;
  --secondary: #1a1a2e;
  --text: #1f2937;
  --text-light: #4b5563;
  --text-muted: #9ca3af;
  --bg: #f8fafc;
  --white: #ffffff;
  --border: #e5e7eb;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-hover: 0 8px 28px rgba(0,0,0,0.1);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --container: 1140px;
  --header-h: 72px;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary); }
ul, ol { list-style: none; }
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.3; color: var(--secondary); }

/* ==========================================================================
   Container
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
}

/* ==========================================================================
   HEADER - Logo sabitleme kritik
   ========================================================================== */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-h);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 20px;
}

/* Logo - Kesinlikle taşmayacak */
.site-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  max-height: 52px;
}

.site-logo img,
.custom-logo-link img,
.custom-logo {
  max-height: 48px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain;
}

.site-logo .logo-text {
  font-size: 22px;
  font-weight: 800;
  color: var(--secondary);
  letter-spacing: -0.5px;
}
.site-logo .logo-text span { color: var(--primary); }

/* Navigation */
.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  justify-content: center;
}

.main-nav ul {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
}

.main-nav li { margin: 0; }

.main-nav a {
  display: block;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  border-radius: 6px;
  white-space: nowrap;
}
.main-nav a:hover,
.main-nav .current-menu-item > a {
  color: var(--primary);
  background: rgba(232, 93, 4, 0.07);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-follow {
  background: var(--primary);
  color: #fff !important;
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.btn-follow:hover { background: var(--primary-dark); color: #fff !important; }

.search-toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
}
.search-toggle:hover { border-color: var(--primary); color: var(--primary); }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--secondary);
  padding: 4px;
}

/* ==========================================================================
   Featured Section
   ========================================================================== */
.featured-section {
  padding: 28px 0 16px;
  background: linear-gradient(180deg, #f1f5f9 0%, var(--bg) 100%);
}

.featured-slider {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
}

.featured-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #1e293b;
  box-shadow: var(--shadow);
  height: 320px;          /* Sabit yükseklik */
  transition: transform .25s, box-shadow .25s;
}
.featured-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}
.featured-card.large { height: 320px; }

.featured-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}

.featured-card .card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.78) 0%, rgba(0,0,0,.15) 55%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  color: #fff;
}

.featured-card .category {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 3px 9px;
  border-radius: 4px;
  margin-bottom: 8px;
  width: fit-content;
}

.featured-card h2,
.featured-card h3 {
  color: #fff;
  font-size: 18px;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 3px rgba(0,0,0,.35);
}
.featured-card.large h2 { font-size: 22px; }

.featured-card .meta {
  font-size: 12px;
  opacity: .85;
  display: flex;
  gap: 8px;
}

/* ==========================================================================
   Category Circles - Düzenli ve kontrollü
   ========================================================================== */
.category-circles {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 0 24px;
}

.cat-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 92px;
  text-align: center;
  transition: transform .2s;
}
.cat-circle:hover { transform: translateY(-2px); }

.cat-circle .icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border: 2px solid transparent;
  transition: border-color .2s, box-shadow .2s;
  overflow: hidden;
}
.cat-circle:hover .icon {
  border-color: var(--primary);
  box-shadow: 0 6px 18px rgba(232, 93, 4, 0.15);
}

.cat-circle .icon img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.cat-circle span {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 90px;
}

/* ==========================================================================
   Main Content
   ========================================================================== */
.main-content { padding: 16px 0 50px; }

.content-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
}

.section-block {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}
.section-header h2 {
  font-size: 18px;
  position: relative;
  padding-left: 12px;
}
.section-header h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 3px;
  width: 3px;
  background: var(--primary);
  border-radius: 2px;
}
.section-header .view-all {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

/* Post Cards - Sabit yükseklik */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.post-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: transform .2s;
  height: 100%;
}
.post-card:hover { transform: translateY(-2px); }

.post-card .thumb {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  overflow: hidden;
  aspect-ratio: 16/10;
  background: #e5e7eb;
  position: relative;
}
.post-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s;
}
.post-card:hover .thumb img { transform: scale(1.04); }

.post-card .thumb .cat-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
}

.post-card .card-body {
  padding: 12px 4px 4px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-card .card-body h3 {
  font-size: 15px;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
}

.post-card .card-body .excerpt {
  font-size: 13px;
  color: var(--text-light);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
  flex: 1;
}

.post-card .meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  margin-top: auto;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */
.sidebar .widget {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.sidebar .widget-title {
  font-size: 15px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
  position: relative;
}
.sidebar .widget-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 36px;
  height: 2px;
  background: var(--primary);
}

.popular-post {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  align-items: flex-start;
}
.popular-post:last-child { margin-bottom: 0; }
.popular-post .num {
  font-size: 18px;
  font-weight: 800;
  color: #d1d5db;
  line-height: 1;
  min-width: 24px;
}
.popular-post h4 {
  font-size: 13px;
  margin-bottom: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.popular-post .meta { font-size: 11px; color: var(--text-muted); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--secondary);
  color: #94a3b8;
  padding: 40px 0 16px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
.footer-brand .logo {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 10px;
}
.footer-brand p { font-size: 13px; line-height: 1.6; max-width: 280px; }
.footer-col h4 { color: #fff; font-size: 14px; margin-bottom: 12px; }
.footer-col ul li { margin-bottom: 6px; }
.footer-col a { font-size: 13px; color: #94a3b8; }
.footer-col a:hover { color: var(--primary); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding-top: 16px;
  text-align: center;
  font-size: 12px;
  color: #64748b;
}

/* ==========================================================================
   Single Post
   ========================================================================== */
.single-post {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}
.single-post .post-header { margin-bottom: 24px; }
.single-post .post-header .category {
  display: inline-block;
  background: rgba(232, 93, 4, 0.1);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 10px;
}
.single-post .post-header h1 { font-size: 28px; margin-bottom: 12px; }
.single-post .post-meta {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}
.single-post .featured-image { margin: 0 -32px 24px; }
.single-post .featured-image img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}
.single-post .entry-content {
  font-size: 16px;
  line-height: 1.75;
  color: #334155;
}
.single-post .entry-content p { margin-bottom: 1.2em; }
.single-post .entry-content h2 { margin: 1.6em 0 0.7em; font-size: 22px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  .featured-slider { grid-template-columns: 1fr 1fr; }
  .featured-card.large { grid-column: span 2; }
  .content-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .main-nav { display: none; }
  .main-nav.is-open {
    display: flex !important;
    flex-direction: column;
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: #fff;
    padding: 16px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.1);
    z-index: 999;
  }
  .main-nav.is-open ul { flex-direction: column; width: 100%; }
  .main-nav.is-open a { padding: 12px 16px; width: 100%; }
  .menu-toggle { display: block; }
  .featured-slider { grid-template-columns: 1fr; }
  .featured-card,
  .featured-card.large { height: 260px; grid-column: span 1; }
  .posts-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .single-post { padding: 20px 16px; }
  .single-post .featured-image { margin: 0 -16px 20px; }
  .single-post .post-header h1 { font-size: 22px; }
  .btn-follow { display: none; }
}

/* Utility */
.screen-reader-text {
  clip: rect(1px,1px,1px,1px);
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden;
}


/* ==========================================================================
   Featured Slider with arrows
   ========================================================================== */
.featured-wrapper {
  position: relative;
  margin-bottom: 24px;
}

.featured-slider {
  display: flex;
  gap: 14px;
  overflow: hidden;
  scroll-behavior: smooth;
}

.featured-card {
  flex: 0 0 calc(33.333% - 10px);
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #1e293b;
  height: 300px;
  transition: transform .25s, box-shadow .25s;
}

.featured-slider[data-count="4"] .featured-card {
  flex: 0 0 calc(25% - 11px);
}

.featured-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.featured-card img,
.featured-card .no-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}
.featured-card .no-thumb {
  background: linear-gradient(135deg, #334155, #1e293b);
}

.featured-card .card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.8) 0%, rgba(0,0,0,.2) 50%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px;
  color: #fff;
}

.featured-card .category {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 4px;
  margin-bottom: 8px;
  width: fit-content;
}

.featured-card h2 {
  color: #fff;
  font-size: 17px;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 3px rgba(0,0,0,.4);
}
.featured-card h2 a { color: inherit; }

.featured-card .meta {
  font-size: 12px;
  opacity: .85;
  display: flex;
  gap: 8px;
}


/* ==========================================================================
   Mobile - %100 uyumlu
   ========================================================================== */
@media (max-width: 1024px) {
  .featured-card {
    flex: 0 0 calc(50% - 8px) !important;
  }
  .slider-prev { left: 4px; }
  .slider-next { right: 4px; }
}

@media (max-width: 768px) {
  :root { --header-h: 64px; }

  .site-header { height: var(--header-h); }

  .main-nav { display: none; }
  .main-nav.is-open {
    display: block !important;
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: #fff;
    padding: 12px 16px 20px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.1);
    z-index: 999;
  }
  .main-nav.is-open ul {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .main-nav.is-open a {
    padding: 12px 14px;
    width: 100%;
    border-radius: 8px;
  }

  .menu-toggle { display: block; }
  .btn-follow { display: none; }

  .featured-card {
    flex: 0 0 85% !important;
    height: 240px;
  }

  .slider-btn {
    width: 36px;
    height: 36px;
    font-size: 20px;
  }
  .slider-prev { left: 6px; }
  .slider-next { right: 6px; }

  .category-circles {
    gap: 10px;
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }
  .cat-circle { flex-shrink: 0; width: 78px; }
  .cat-circle .icon { width: 56px; height: 56px; font-size: 20px; }
  .cat-circle span { font-size: 10px; }

  .posts-grid { grid-template-columns: 1fr; }
  .content-grid { grid-template-columns: 1fr; gap: 20px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }

  .single-post { padding: 20px 16px; }
  .single-post .post-header h1 { font-size: 22px; }
  .single-post .featured-image { margin: 0 -16px 20px; }
}

@media (max-width: 480px) {
  .featured-card {
    flex: 0 0 92% !important;
    height: 220px;
  }
  .header-actions .search-toggle { width: 34px; height: 34px; }
}

/* ===== FIX: Header Actions sağa hizalı + WhatsApp butonu ===== */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

.btn-whatsapp {
  background: #25D366;
  color: #fff !important;
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-whatsapp:hover {
  background: #1ebe57;
  color: #fff !important;
}

.search-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  flex-shrink: 0;
}
.search-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ===== FIX: Slider tek sıra, net ===== */
.featured-wrapper {
  position: relative;
  margin-bottom: 28px;
}

.featured-slider {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  /* scrollbar gizle */
  scrollbar-width: none;
}
.featured-slider::-webkit-scrollbar {
  display: none;
}

.featured-card {
  flex: 0 0 calc(33.333% - 10px);
  scroll-snap-align: start;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #1e293b;
  height: 290px;
  min-width: 0;
}

.featured-card img,
.featured-card .no-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}
.featured-card .no-thumb {
  background: linear-gradient(135deg, #334155, #1e293b);
}

.featured-card .card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.82) 0%, rgba(0,0,0,.25) 55%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
  color: #fff;
}

.featured-card .category {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
  width: fit-content;
}

.featured-card h2 {
  color: #fff;
  font-size: 16px;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}
.featured-card h2 a { color: inherit; }

.featured-card .meta {
  font-size: 11px;
  opacity: .85;
  display: flex;
  gap: 6px;
}

.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 3px 12px rgba(0,0,0,0.12);
  font-size: 22px;
  cursor: pointer;
  z-index: 5;
  color: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}
.slider-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.slider-prev { left: -12px; }
.slider-next { right: -12px; }

/* Mobile */
@media (max-width: 900px) {
  .featured-card {
    flex: 0 0 calc(50% - 8px);
    height: 250px;
  }
}

@media (max-width: 768px) {
  .btn-whatsapp {
    padding: 7px 12px;
    font-size: 12px;
  }
  .featured-card {
    flex: 0 0 82%;
    height: 230px;
  }
  .slider-prev { left: 4px; }
  .slider-next { right: 4px; }
  .slider-btn {
    width: 34px;
    height: 34px;
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .featured-card {
    flex: 0 0 88%;
    height: 210px;
  }
}
