/**
 * IXIR Theme'e Image Optimizer Entegrasyonu
 * 
 * Bu dosya IXIR Admin Theme'de resimleri optimize etmek için
 * IXIR Image Optimizer plugin'i ile uyumlu hale getirir.
 */

/* Responsive Picture Element */
picture {
    display: block;
    width: 100%;
}

picture img,
picture source {
    display: block;
}

/* Lazy Loading Animation */
img[loading="lazy"],
img.ixir-lazy-loading {
    opacity: 0.7;
    background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: ixir-loading-shimmer 2s infinite;
    min-height: 50px;
}

@keyframes ixir-loading-shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

img.ixir-loaded {
    opacity: 1;
    animation: ixir-fade-in 0.3s ease;
    background: none;
}

@keyframes ixir-fade-in {
    from {
        opacity: 0.8;
    }
    to {
        opacity: 1;
    }
}

/* Responsive Resim Container */
.responsive-image-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
}

.responsive-image-container picture {
    width: 100%;
    height: 100%;
}

.responsive-image-container img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Hero Resim */
.ixir-hero-image {
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ixir-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Featured Image (Yazı thumbnail'i) */
.featured-image,
.post-thumbnail {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    overflow: hidden;
}

/* Galeri */
.ixir-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.ixir-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    aspect-ratio: 1;
    background: #f0f0f0;
}

.ixir-gallery-item picture {
    width: 100%;
    height: 100%;
}

.ixir-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ixir-gallery-item:hover img {
    transform: scale(1.05);
}

/* Kart Resimi */
.ixir-card-image {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
    background: #f0f0f0;
}

.ixir-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Avatar / Profile Image */
.ixir-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--primary, #048642);
}

.ixir-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ixir-avatar.small {
    width: 50px;
    height: 50px;
}

.ixir-avatar.large {
    width: 150px;
    height: 150px;
}

/* Thumbnail List */
.ixir-thumbnail-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0;
}

.ixir-thumbnail-list-item {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.ixir-thumbnail-list-item:hover,
.ixir-thumbnail-list-item.active {
    border-color: var(--primary, #048642);
    transform: scale(1.05);
}

.ixir-thumbnail-list-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Responsive Breakpoints */

/* Tablet */
@media (max-width: 768px) {
    .ixir-hero-image {
        height: 250px;
    }

    .ixir-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .ixir-gallery-item {
        aspect-ratio: 1;
    }

    .ixir-card-image {
        height: 200px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .ixir-hero-image {
        height: 200px;
        border-radius: 8px;
    }

    .ixir-gallery {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .ixir-gallery-item {
        aspect-ratio: 16 / 9;
    }

    .ixir-card-image {
        height: 180px;
    }

    .ixir-avatar {
        width: 80px;
        height: 80px;
    }

    .ixir-thumbnail-list-item {
        width: 80px;
        height: 80px;
    }
}

/* Print Styles */
@media print {
    img[loading="lazy"] {
        loading: auto;
    }

    .ixir-gallery {
        display: flex;
        flex-direction: column;
    }

    .ixir-gallery-item {
        page-break-inside: avoid;
    }
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    img[loading="lazy"],
    img.ixir-lazy-loading {
        background: linear-gradient(90deg, #333 25%, #444 50%, #333 75%);
    }

    .ixir-card-image,
    .ixir-gallery-item {
        background: #2a2a2a;
    }

    .ixir-avatar {
        border-color: var(--accent, #00d97e);
    }

    .ixir-thumbnail-list-item:hover,
    .ixir-thumbnail-list-item.active {
        border-color: var(--accent, #00d97e);
    }
}

/* Reduce Motion */
@media (prefers-reduced-motion: reduce) {
    img[loading="lazy"],
    img.ixir-lazy-loading,
    img.ixir-loaded,
    .ixir-gallery-item img,
    .ixir-thumbnail-list-item {
        animation: none !important;
        transition: none !important;
    }
}

/* Focus States (Accessibility) */
img:focus,
img[tabindex]:focus {
    outline: 2px solid var(--primary, #048642);
    outline-offset: 2px;
    border-radius: 4px;
}

/* High Contrast */
@media (prefers-contrast: more) {
    .ixir-gallery-item,
    .ixir-card-image,
    .featured-image {
        border: 2px solid currentColor;
    }

    img[loading="lazy"],
    img.ixir-lazy-loading {
        border: 1px solid currentColor;
    }
}

/* Utility Classes */

.image-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-cover {
    object-fit: cover;
}

.image-contain {
    object-fit: contain;
}

.image-fill {
    object-fit: fill;
}

.image-scale-down {
    object-fit: scale-down;
}

/* Aspect Ratio Helpers */
.aspect-1-1 {
    aspect-ratio: 1 / 1;
}

.aspect-16-9 {
    aspect-ratio: 16 / 9;
}

.aspect-4-3 {
    aspect-ratio: 4 / 3;
}

.aspect-3-2 {
    aspect-ratio: 3 / 2;
}

.aspect-21-9 {
    aspect-ratio: 21 / 9;
}

/* Shadow Variations */
.image-shadow-sm {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.image-shadow-md {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.image-shadow-lg {
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.image-shadow-xl {
    box-shadow: 0 20px 25px rgba(0, 0, 0, 0.1);
}

/* Border Radius Variations */
.image-rounded-none {
    border-radius: 0;
}

.image-rounded-sm {
    border-radius: 4px;
}

.image-rounded-md {
    border-radius: 8px;
}

.image-rounded-lg {
    border-radius: 12px;
}

.image-rounded-full {
    border-radius: 50%;
}

/* Filters */
.image-grayscale {
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.image-grayscale:hover {
    filter: grayscale(0%);
}

.image-sepia {
    filter: sepia(100%);
}

.image-brightness-increase {
    filter: brightness(1.2);
}

.image-brightness-decrease {
    filter: brightness(0.8);
}

.image-contrast-increase {
    filter: contrast(1.3);
}

.image-contrast-decrease {
    filter: contrast(0.8);
}
