/* Ana konteyner: uc sutunu yan yana tutar ve yuksekligi esitler */
.pGaleri {
    display: flex;
    flex-direction: row;
    align-items: stretch; 
    justify-content: center;
    gap: 15px;
    margin: 20px auto;
    width: 100%;
    max-width: 1020px; /* Genislik: 250_thumb + 15_gap + 440_main + 15_gap + 250_info */
    box-sizing: border-box;
    min-height: 100%; 
}
/* Sol Wrapper (A+D): Thumbnail'ler ve Sol Ok */
.pGaleri-images-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end; /* Ok saga yaslansin */
    width: 250px;
    flex-shrink: 0; /* Kuculmesin */
    min-height: 100%;
}
/* Kucuk resimler (thumbs) - A */
.pGaleri-images {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 50px;   
  box-sizing: border-box;
  overflow-y: auto; /* cok fazla thumb varsa scroll */
  max-height: 470px; /* thumblarda 470px/58px = 9dan itibaren scroll cikar */ 
  scrollbar-width: thin;                    
  scrollbar-color: #a1a1a1  #e0e0e0;  /* thumb (tutamac), track (bg) */
}
/* webkit sacmaligi */
.pGaleri-images::-webkit-scrollbar {
  width: 5px;  /* Dikey scrollbar */
  height: 5px; /* Yatay scrollbar (mobil) */
}
.pGaleri-images::-webkit-scrollbar-track {
  background: #e0e0e0; 
  border-radius: 3px; 
}
.pGaleri-images::-webkit-scrollbar-thumb {
  background-color: #c4161c;  
  border-radius: 3px;   
}
.pGaleri-images::-webkit-scrollbar-button:hover {background-color: #a01015;}
.pGaleri-images::-webkit-scrollbar-thumb:hover {background-color: #a01015;}
/* webkit sacmaligi bitti */

.pGaleri-images .pGaleri-thumb {
    display: block;
    width: 100%; 
    height: auto; 
    max-height: 50px; 
    object-fit: cover; /* Tasanlari kirp */
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}
.pGaleri-images .pGaleri-thumb.active { border-color: #c4161c; }
/* Sol Ok - D */
.pGaleri-solok {
    width: 100%;
    text-align: right;
    margin-top: auto;
    padding-top: 10px; 
}
/* Orta Sutun Wrapper (B+E): Ana Fotograf ve Alt Metin */
.pGaleri-center-column {
    display: flex;
    flex-direction: column;
    width: 440px; /* Sabit genislik icin */
    flex-shrink: 0;
    gap: 10px;
    box-sizing: border-box;
    min-height: 100%;
}
/* Ana fotograf alani - B */
.pGaleri-main {
    display: flex;
    width: 100%;
    min-height: 300px; 
    align-items: flex-start; 
    justify-content: center; 
    cursor: pointer;
    overflow: hidden;
    box-sizing: border-box;
    flex-grow: 1; /* Bos alani doldur */
}
.pGaleri-main img {
    display: block;
    max-width: 100%;
    max-height: 700px; /* Ana resim icin max yukseklik */
    width: auto;
    height: auto;
    object-fit: contain; 
}
/* Fotograf Alt Metin Alani - E */
.pGaleri-main-alt {
    width: 100%;
    padding: 10px;
    background-color: #e7e7e7;
    border: 1px solid #ddd;
    box-sizing: border-box;
    font-size: 0.9em;
    line-height: 1.4;
    word-wrap: break-word; 
}
/* Sag Wrapper (C+F): Bilgi Alani ve Sag Ok */
.pGaleri-info-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start; 
    width: 250px; 
    flex-shrink: 0;
    min-height: 100%;
}
/* Bilgi alani - C */
.pGaleri-info {
    width: 100%;
    height: auto;  
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto; 
    padding: 10px;
    border: 1px solid #ddd;
    background-color: #e7e7e7;
    box-sizing: border-box;
    font-size: 0.95em;
    line-height: 1.4;
}
/* Sag Ok - F */
.pGaleri-sagok {
    width: 100%;
    text-align: left;
    margin-top: auto; 
    padding-top: 10px; 
}
/* Gorsel Aciklamasi */
.pGaleri-description {
    word-wrap: break-word;  
    padding-bottom: 10px;  
}
.pGaleri-description:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.pGaleri-description img { 
    max-width: 100%;
    height: auto;
    margin-top: 5px;
}
/* Statik Meta Bilgiler */
.pGaleri-meta-static p {
    margin: 0 0 8px 0;
    font-size: 0.95em;
    word-wrap: break-word;     
}
.pGaleri-meta-static p:last-child { margin-bottom: 0;}
.pGaleri-meta-static p strong {
    display: inline-block;
    min-width: 60px; 
    margin-right: 3px;
    font-weight: bold;
}
.pGaleri-meta-static a {
    color: #c4161c; 
    text-decoration: underline;
    display: inline-block;
    white-space: nowrap; /* keyword kirilmasin */
}
.pGaleri-meta-static a:hover {text-decoration: none;}
/* Navigasyon Oklari (Shortcode'dan gelen) */
.piraye-nav-link {
    font-size: 0.9em;
    color: #c4161c; 
    text-decoration: none;
    line-height: 1.3;
    padding: 5px 8px;
    border-radius: 3px;
    transition: background-color 0.2s ease;
    display: inline-block;
    border: 1px solid transparent;
}
.piraye-nav-link:hover {
    background-color: rgba(200, 200, 200, 0.2);
    border-color: #ccc;
}
/* Lightbox Stilleri
----------------------------------------------------- */
#acilGan {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9); 
    display: none; /* JS ile acilacak */
    align-items: center;
    justify-content: center;
    z-index: 99999; 
    opacity: 0; 
    transition: opacity 0.3s ease; 
}
#acilGan.visible { 
   display: flex;
   opacity: 1;
}
#acilGan img {
    position: absolute; 
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 92%; 
    max-height: 92%;
    display: block;
    border: 3px solid white;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}
#acilGan .close {
    position: absolute;
    top: 15px;
    right: 25px;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 100000;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
#acilGan .prev,
#acilGan .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 100000;
    padding: 15px 20px;
    user-select: none; 
    transition: background-color 0.2s ease;
    background: rgba(0,0,0,0.3); 
    border-radius: 10px;
}
#acilGan .prev:hover,
#acilGan .next:hover {
    background-color: rgba(255, 255, 255, 0.2);
}
#acilGan .prev {left: 15px;}
#acilGan .next {right: 15px;}

/* Mobil Gorunum (pGaleri 1020px oldugu icin 1024px (767px)
_______________________________________________________________ */
@media (max-width: 1024px) {
    .pGaleri {
        flex-direction: column; 
        max-width: 100%;
        gap: 10px;
        align-items: stretch; 
        min-height: auto;
        margin: 10px auto;
    }
    /* 1. Orta Sutun (Ana Resim + Alt Metin) */
    .pGaleri-center-column {
        order: 1; 
        width: 100%;
        gap: 8px;
        min-height: auto;
    }
    .pGaleri-main {
        min-height: 200px; 
        max-height: 70vh; 
        border: none;
        background-color: transparent;
    }
    .pGaleri-main img {max-height: 65vh; }
    .pGaleri-main-alt {
        font-size: 0.85em;
        padding: 8px;
        border: none;
        background-color: #e7e7e7;
        width: calc(100% - 16px); /* Padding'i dus */
        margin: 0 auto; 
    }
    /* 2. Thumbnail Alani */
    .pGaleri-images-wrapper {
        order: 2; 
        width: 100%;
        flex-direction: column; 
        align-items: stretch; 
        gap: 10px;
        padding: 10px 0;
    }
    .pGaleri-images {
        display: flex;
        flex-direction: row; 
        overflow-x: auto; 
        overflow-y: hidden; 
        white-space: nowrap;
        gap: 8px; 
        width: 100%; 
        max-height: 100px; 
        padding: 5px 10px; 
        box-sizing: border-box;        
    }        
    .pGaleri-images .pGaleri-thumb {
        display: inline-block; 
        width: auto; 
        height: 70px; 
        max-width: none; 
        max-height: 70px; 
        object-fit: cover;
        vertical-align: top; 
        border: 2px solid transparent;
    }
    .pGaleri-images .pGaleri-thumb.active {border-color: #c4161c; }
    .pGaleri-solok,
    .pGaleri-sagok {display: none; }
    /* 3. Bilgi Alani */
    .pGaleri-info-wrapper {
        order: 3; /* ucuncu siraya */
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        min-height: auto;
        padding: 0; 
    }
    .pGaleri-info {
        width: calc(100% - 16px); 
        margin: 10px auto 0 auto; 
        max-height: none; 
        font-size: 0.85em;
        padding: 8px;
        border: none;
        background-color: #e7e7e7;
        overflow-y: visible; /* Scroll yok */
    }
    .pGaleri-meta-static p strong { min-width: 70px; } /* Mobilde etiket genisligi */
    /* Lightbox mobil */
    #acilGan img { max-width: 95%; max-height: 95%; }
    #acilGan .close { font-size: 30px; top: 10px; right: 15px;}
    #acilGan .prev, #acilGan .next { font-size: 30px; padding: 10px 15px;}
    #acilGan .prev {left: 10px;} #acilGan .next {right: 10px;}
}