/* --- RESPONSIVE QUERIES --- */
@media (max-width: 992px) {
  .ph-card-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .ph-flow-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .ph-sidebar-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .ph-sidebar-sticky {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
  }
  .ph-sidebar-thumb {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }
  .ph-sidebar-actions,
  .ph-sidebar-meta {
    flex: 1;
    min-width: 250px;
  }
}

@media (max-width: 768px) {
  /* --- Mobile Menu Drawer --- */
  .ph-mobile-toggle {
    display: flex; /* Toggle butonunu görünür yap */
  }

  .ph-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    background: var(--ph-bg-card);
    z-index: 1050;
    padding: 80px 20px 40px;
    flex-direction: column;
    align-items: flex-start !important;
    justify-content: flex-start;
    transform: translateX(100%); /* Varsayılan olarak ekran dışına it */
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
  }

  /* JS ile 'is-active' eklenince içeri kay */
  .ph-nav.is-active {
    transform: translateX(0);
  }

  /* Menü linklerini alt alta diz */
  .ph-nav ul,
  .ph-menu,
  .ph-nav div > ul {
    flex-direction: column !important;
    align-items: flex-start !important;
    width: 100%;
    gap: 20px !important;
  }

  /* Link stilleri */
  .ph-menu a,
  .ph-nav ul a,
  .ph-nav li a,
  .ph-nav > a {
    display: inline-block;
    font-size: 18px;
    color: var(--ph-text-muted);
    text-decoration: none;
    padding: 10px 0;
    border-radius: 0;
    display: block;
    width: 100%;
    border-bottom: 1px solid var(--ph-border-light);
  }

  .ph-menu a:hover,
  .ph-nav ul a:hover,
  .ph-nav li a:hover,
  .ph-nav > a:hover {
    background: none;
    color: var(--ph-accent) !important;
  }
    
  /* --- Mobile Slider Arrows (Top Left & Side-by-Side) --- */
  .ph-slider-arrow {
    top: 20px; /* Timer ile aynı üst boşluk */
    transform: none; /* Dikey ortalamayı iptal et */
    width: 36px; 
    height: 36px; 
    font-size: 16px;
    background: rgba(0, 0, 0, 0.3); /* Mobilde biraz daha belirgin zemin */
    border-color: rgba(255, 255, 255, 0.3);
  }

  .ph-arrow-prev {
    left: 20px; /* Sol kenar boşluğu */
    right: auto; /* Sağdan hizalamayı sıfırla */
  }

  .ph-arrow-next {
    /* Prev butonu (20px sol + 36px genişlik) + 10px boşluk = 66px */
    left: 66px; 
    right: auto; /* Orijinal sağ hizalamayı ez */
  }

  /* --- HEADER ACTIONS ORDER FIX (MOBILE) --- */
  .ph-header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px; /* Elemanlar arası boşluk */
  }

  /* 1. Favori Butonu (En Solda) */
  .ph-fav-header-btn {
    order: 1;
    display: flex; /* Mobilde görünür olduğundan emin ol */
  }

  /* 2. Tema Değiştirme (Ortada) */
  .ph-theme-toggle-wrapper {
    order: 2;
    margin-right: 0; /* Eski marginleri sıfırla */
  }

  /* 3. Hamburger Menü (En Sağda) */
  .ph-mobile-toggle {
    order: 3;
  }
  
  .ph-rating-count-lbl {
      display: none;
  }
  
  .ph-section-title {
      display: grid;
  gap: 5px;
  }
  
  /* --- CONTENT STYLES --- */
  .ph-flow-title,
  .ph-tabs-title {
    font-size: 32px;
  }
  .ph-flow-actions-bar,
  .ph-tabs-actions-bar {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .ph-action-left,
  .ph-action-right {
    justify-content: center;
    width: 100%;
  }
	.ph-action-left {
  flex-wrap: wrap;
		margin-top: 10px;
}
	.ph-share-trigger + .ph-line-icon {
        display: none;
    }
	
	.ph-rating-wrap {
width: 100%;
        margin-top: 10px !important;
        justify-content: center;
	}
	
  .ph-action-right {
    flex-wrap: wrap;
  }
  .ph-btn-large {
    width: 100%;
    justify-content: center;
  }

  .ph-tabs-body {
    padding: 24px;
  }
  .ph-comment-list .children {
    margin-left: 10px;
    border-left-width: 1px;
  }
  .ph-comment-list .children > li {
    padding-left: 10px;
  }
  .comment-form {
    grid-template-columns: 1fr;
  }
  
 .ph-tl-meta {
        display: grid;
        /* 1. Sütun: Versiyon genişliği kadar (max-content)
           2. Sütun: Badge genişliği kadar (max-content)
           3. Sütun: Kalan tüm boşluk (Count'u sağa itmek için 1fr)
        */
        grid-template-columns: max-content max-content 1fr;
        align-items: center;
        gap: 4px 10px; /* Dikey 4px, Yatay 10px boşluk */
    }

    /* 1. Öğeler: Versiyon ve Badge (Yan yana duracaklar) */
    .ph-tl-ver {
        grid-row: 1;
        grid-column: 1;
    }

    .ph-badge-impact {
        grid-row: 1;
        grid-column: 2;
        margin-left: 0; /* Masaüstü marginini sıfırlıyoruz */
    }

    /* 2. Öğe: İndirme Sayısı (Count) */
    /* HTML'de sonda olmasına rağmen grid ile 1. satırın sonuna çekiyoruz */
    .ph-tl-downloads {
        grid-row: 1;
        grid-column: 3; /* 3. sütuna yerleş */
        justify-self: end; /* Kutunun en sağına yaslan */
        margin-left: 0;
    }

    /* 3. Öğe: Tarih (Alt satıra inecek) */
    .ph-tl-date {
        grid-row: 2;
        grid-column: 1 / -1; /* Tüm satır genişliğini kapla */
        margin-top: 2px;
    }
}

@media (max-width: 600px) {
  .ph-container {
    width: 94%;
  }
  .ph-archive-header,
  .ph-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .ph-filter-bar {
    width: 100%;
  }
  .ph-search-wrap,
  .ph-custom-select-wrap {
    width: 100%;
    min-width: 0;
  }
  .ph-card-grid {
    grid-template-columns: 1fr !important;
  }
  .ph-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .ph-list-side {
    width: 100%;
    justify-content: space-between;
    margin-top: 12px;
  }
  .ph-pagination .page-numbers {
    width: 38px;
    height: 38px;
    font-size: 14px;
    border-radius: 10px;
  }

  .ph-flow-gallery-grid {
    grid-template-columns: 1fr;
  }
  .ph-gallery-item img {
    height: auto;
  }
  .ph-flow-card {
    padding: 20px;
  }
  .ph-sidebar-sticky {
    flex-direction: column;
  }
  .ph-sidebar-thumb {
    max-width: 100%;
  }
  .ph-sidebar-title {
    font-size: 28px;
  }

  .ph-footer-quote {
    text-align: center;
  }
  .ph-footer-quote h2 {
    font-size: 24px;
  }
  .ph-footer-actions,
  .ph-footer-bottom {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 30px;
  }

	.ph-footer-socials {
		margin-left: 0;
	}

  .ph-footer-bottom {
    gap: 12px;
  }

  .comment-body {
    flex-direction: column;
  }
  .comment-author .avatar {
    width: 40px;
    height: 40px;
  }
}