/* Photos */
.photos-body {
    background: #0f1012;
}

.photos-page {
    --photos-accent: #ffc107;
    width: min(980px, 100%);
    margin: 0 auto;
    padding: 40px 20px 72px;
    color: #f4f4f5;
}

.photos-profile {
    display: flex;
    align-items: center;
    gap: clamp(20px, 6vw, 72px);
    padding: 12px clamp(0px, 4vw, 48px) 36px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.photos-profile-avatar {
    width: clamp(84px, 18vw, 150px);
    height: clamp(84px, 18vw, 150px);
    flex: 0 0 auto;
    object-fit: cover;
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(135deg, var(--photos-accent), #ff7a18);
}

.photos-profile-copy h1 {
    margin: 0 0 10px;
    font-size: clamp(1.5rem, 3vw, 1.9rem);
    font-weight: 700;
}

.photos-profile-copy p {
    max-width: 520px;
    margin: 0;
    color: #c9c9ce;
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.55;
}

.photos-profile-copy .photos-profile-stats {
    margin-bottom: 10px;
    color: #f4f4f5;
}

.photos-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin-top: 4px;
    padding-top: 28px;
}

.photos-tile {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 1;
    background: #1a1b1e;
}

.photos-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 240ms ease;
}

.photos-tile-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    padding: 14px;
    color: #fff;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.85rem;
    line-height: 1.4;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0) 60%);
    opacity: 0;
    transition: opacity 200ms ease;
}

.photos-tile:hover img,
.photos-tile:focus-visible img {
    transform: scale(1.03);
}

.photos-tile:hover .photos-tile-overlay,
.photos-tile:focus-visible .photos-tile-overlay {
    opacity: 1;
}

.photos-tile-multiple {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6));
}

html[dir="rtl"] .photos-tile-multiple {
    right: auto;
    left: 10px;
}

.photos-tile-ai {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 2px 7px;
    color: #111;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
}

html[dir="rtl"] .photos-tile-ai {
    right: 10px;
    left: auto;
}

.photos-tile-multiple svg {
    width: 20px;
    fill: #fff;
}

.photos-empty {
    padding: 80px 20px;
    text-align: center;
    color: #c9c9ce;
}

.photos-empty svg {
    width: 56px;
    margin-bottom: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.4;
}

.photos-empty h2 {
    color: #f4f4f5;
    font-size: 1.4rem;
}

.photos-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 32px;
}

.photos-primary-button,
.photos-secondary-button {
    padding: 11px 22px;
    font-weight: 700;
    border-radius: 8px;
}

.photos-primary-button {
    color: #111;
    background: var(--photos-accent);
}

.photos-primary-button:hover,
.photos-primary-button:focus {
    color: #111;
    background: #ffd145;
}

.photos-secondary-button {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.photos-secondary-button:hover,
.photos-secondary-button:focus {
    color: #111;
    background: #fff;
}

/* Single post */
.photos-back-link {
    display: inline-flex;
    gap: 8px;
    margin-bottom: 18px;
    color: #c9c9ce;
    font-weight: 600;
    text-decoration: none;
}

.photos-back-link:hover {
    color: #fff;
}

.photo-feed {
    display: flex;
    flex-direction: column;
    gap: 28px;
    width: min(620px, 100%);
    margin: 0 auto;
}

.photo-feed-item {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: #16171a;
}

.photo-feed-sentinel {
    height: 1px;
}

.photo-carousel {
    position: relative;
    background: #000;
}

/* Hides the sub-pixel sliver of the neighbouring photo at fractional widths. */
.photo-carousel::after {
    position: absolute;
    inset: 0;
    content: "";
    pointer-events: none;
    box-shadow: inset 1px 0 #000, inset -1px 0 #000;
}

.photo-carousel-track {
    display: flex;
    height: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.photo-carousel-track::-webkit-scrollbar {
    display: none;
}

.photo-carousel-slide {
    display: flex;
    flex: 0 0 100%;
    align-items: center;
    justify-content: center;
    margin: 0;
    scroll-snap-align: center;
}

.photo-carousel-slide img {
    width: 100%;
    height: auto;
    max-height: min(78vh, 760px);
    object-fit: contain;
}

.photo-carousel-button {
    position: absolute;
    top: 50%;
    display: grid;
    width: 34px;
    height: 34px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.88);
    transform: translateY(-50%);
}

.photo-carousel-button[hidden] {
    display: none;
}

.photo-carousel-button svg {
    width: 18px;
    fill: none;
    stroke: #111;
    stroke-width: 2.4;
}

.photo-carousel-button.is-previous {
    left: 12px;
}

.photo-carousel-button.is-next {
    right: 12px;
}

html[dir="rtl"] .photo-carousel-button svg {
    transform: scaleX(-1);
}

html[dir="rtl"] .photo-carousel-button.is-previous {
    right: 12px;
    left: auto;
}

html[dir="rtl"] .photo-carousel-button.is-next {
    right: auto;
    left: 12px;
}

.photo-carousel-dots {
    position: absolute;
    bottom: 14px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 5px;
}

.photo-carousel-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    transition: background 160ms ease;
}

.photo-carousel-dots span.is-active {
    background: #fff;
}

.photo-feed-author {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
}

.photo-feed-author img {
    width: 38px;
    height: 38px;
    object-fit: cover;
    border-radius: 50%;
}

.photo-feed-author strong,
.photo-feed-author small {
    display: block;
}

.photo-feed-author small {
    color: #a1a2a8;
    font-family: system-ui, -apple-system, sans-serif;
}

.photo-feed-ai {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 5px;
    margin-inline-start: auto;
    padding: 4px 10px;
    color: #e4e4e7;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.74rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
}

.photo-feed-ai:hover,
.photo-feed-ai:focus {
    color: #111;
    background: #fff;
}

.photo-feed-ai svg {
    width: 14px;
    fill: currentColor;
}

.photo-feed-body {
    display: grid;
    gap: 12px;
    padding: 16px 18px 20px;
}

.photo-post-caption {
    margin: 0;
    color: #e4e4e7;
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.photo-post-date {
    color: #a1a2a8;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

@media (max-width: 767.98px) {
    .photos-page {
        padding: 24px 0 56px;
    }

    .photos-profile {
        gap: 20px;
        padding: 0 16px 24px;
    }

    .photos-grid {
        gap: 2px;
        padding-top: 2px;
    }

    .photos-tile-overlay {
        display: none;
    }

    .photos-back-link {
        margin-inline-start: 16px;
    }

    .photo-feed {
        gap: 12px;
    }

    .photo-feed-item {
        border-radius: 0;
        border-inline: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .photos-tile img,
    .photos-tile-overlay {
        transition: none;
    }
}

/* Admin photo posts */
.admin-photo-form {
    display: grid;
    gap: 16px;
}

.admin-photo-dropzone {
    position: relative;
    display: grid;
    gap: 6px;
    justify-items: center;
    padding: 28px 20px;
    text-align: center;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    cursor: pointer;
}

.admin-photo-dropzone:hover {
    border-color: #ffc107;
}

.admin-photo-dropzone svg {
    width: 34px;
    fill: #ffc107;
}

.admin-photo-dropzone small {
    color: #a1a2a8;
}

.admin-photo-dropzone input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.admin-photo-previews,
.admin-photo-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-photo-strip {
    margin-bottom: 18px;
}

.admin-photo-previews figure {
    position: relative;
    margin: 0;
}

.admin-photo-previews img,
.admin-photo-strip img {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 8px;
}

.admin-photo-previews figure span {
    position: absolute;
    left: 6px;
    bottom: 6px;
    padding: 1px 6px;
    color: #111;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 4px;
    background: #ffc107;
}

.admin-photo-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    display: grid;
    width: 24px;
    height: 24px;
    padding: 0;
    place-items: center;
    color: #fff;
    font-size: 1rem;
    line-height: 1;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.72);
}

.admin-photo-remove:hover,
.admin-photo-remove:focus {
    background: #dc3545;
}

.admin-photo-dropzone .admin-photo-counter {
    color: #ffc107;
    font-weight: 700;
}

.admin-photo-form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.admin-photo-form-actions small {
    color: #a1a2a8;
}

.admin-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
}

.admin-photo-tile {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 1;
    border-radius: 8px;
    background: #1a1b1e;
}

.admin-photo-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-photo-badge,
.admin-photo-count {
    position: absolute;
    padding: 2px 8px;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.7);
}

.admin-photo-badge {
    top: 8px;
    left: 8px;
    color: #111;
    background: #ffc107;
}

.admin-photo-count {
    right: 8px;
    bottom: 8px;
}

.admin-photo-ai {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 8px;
    color: #111;
    font-size: 0.72rem;
    font-weight: 800;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
}

.admin-photo-delete {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    border: 1px solid rgba(220, 53, 69, 0.45);
    border-radius: 12px;
}

.admin-photo-delete strong,
.admin-photo-delete small {
    display: block;
}

.admin-photo-delete small {
    color: #a1a2a8;
}
