/* ============================================================
   AKIRA.MEDIA — Gallery Stylesheet
   Homepage gallery + modal + comments
   ============================================================ */

/* === Banner === */
.title {
    margin-top: auto;
    text-align: center;
    vertical-align: middle;
    color: whitesmoke;
}

.title h1 {
    padding-top: 5vh;
    text-align: center;
    color: whitesmoke;
    font-size: 3rem;
    font-family: var(--akira-font);
    font-weight: var(--akira-weight);
    font-variation-settings: var(--akira-settings);
}

.subtitle {
    text-align: center;
    vertical-align: middle;
    color: whitesmoke;
}

.subtitle h2 {
    text-align: center;
    color: whitesmoke;
    font-size: 2rem;
    font-family: var(--akira-font);
    font-weight: var(--akira-weight);
    font-variation-settings: var(--akira-settings);
}

.description {
    text-align: center;
    vertical-align: middle;
    color: whitesmoke;
}

.description h3 {
    font-size: 1.5rem;
    font-family: var(--akira-font);
    font-weight: var(--akira-weight);
    font-variation-settings: var(--akira-settings);
}

.email {
    text-align: center;
    color: whitesmoke;
    font-size: 1.5rem;
    font-family: var(--akira-font);
    font-weight: var(--akira-weight);
    font-variation-settings: var(--akira-settings);
    text-decoration: none;
}

/* === Gallery Grid === */
.gallery {
    column-count: 4;
    column-gap: 8px;
    padding: 0 10px;
}

.gallery img {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 8px;
    border-radius: 8px;
    break-inside: avoid;
    object-fit: cover;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.gallery img:hover { transform: scale(1.05); }

/* === Responsive Columns === */
@media (max-width: 1200px) { .gallery { column-count: 3; } }
@media (max-width: 768px)  { .gallery { column-count: 2; } }
@media (max-width: 480px)  { .gallery { column-count: 1; } }

/* === GPS Caption === */
.gps-caption {
    text-align: center;
    color: whitesmoke;
    font-size: 1.1rem;
    font-family: var(--akira-font);
    font-weight: var(--akira-weight);
    font-variation-settings: var(--akira-settings);
    margin-top: 8px;
}

/* ============================================================
   MODAL — Fullscreen layout
   ============================================================ */

#imageModal .modal-dialog {
    max-width: 100vw !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    touch-action: auto !important;
}

#imageModal .modal-content {
    height: 100vh !important;
    border-radius: 0 !important;
    background: rgba(0,0,0,0.55) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: none !important;
}

#imageModal .modal-body {
    height: 100%;
    padding: 0 !important;
    display: flex;
    align-items: stretch;
}

/* === Inner layout === */
.modal-inner {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100%;
    height: 100%;
}

/* Image side — fills remaining space, centred */
.modal-image-side {
    flex: 1;
    min-width: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 16px 16px 60px;
}

/* === Image === */
#zoomContainer {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pinch-zoom !important;
    max-height: 80vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#modalImage {
    touch-action: pinch-zoom !important;
    height: auto !important;
    max-height: 78vh !important;
    max-width: 100%;
    margin: auto !important;
    border-radius: 8px;
}

/* === Comment Panel — fixed width, full height === */
.modal-comment-side {
    width: 320px;
    min-width: 320px;
    max-width: 320px;
    height: 100%;
    text-align: left;
    background: rgba(0,0,0,0.3);
    border-left: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-shrink: 0;
}

/* Comment section inner — vertically centred, scrollable list */
#commentSection {
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
    max-height: 100vh;
    overflow: hidden;
}

/* === Mobile: stack vertically === */
@media (max-width: 768px) {
    #imageModal .modal-dialog  { height: auto !important; }
    #imageModal .modal-content { height: auto !important; min-height: 100vh; }

    .modal-inner {
        flex-direction: column;
        height: auto;
    }

    .modal-image-side {
        padding: 16px 16px 8px;
        justify-content: center;
        position: relative;
        min-height: 60vw;
    }

    .modal-comment-side {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        height: auto;
        border-left: none;
        border-top: 1px solid rgba(255,255,255,0.1);
        justify-content: flex-start;
    }

    #commentSection {
        max-height: none;
        overflow: visible;
    }

    #zoomContainer { max-height: 55vh; }
    #modalImage    { max-height: 53vh !important; }
}

/* ============================================================
   COMMENTS
   ============================================================ */

#commentSection h6 {
    font-family: var(--akira-font);
    font-weight: var(--akira-weight);
    font-variation-settings: var(--akira-settings);
    color: whitesmoke;
    font-size: 1rem;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 6px;
    flex-shrink: 0;
}

.comment-empty {
    color: rgba(255,255,255,0.4);
    font-size: 0.85rem;
    text-align: center;
    padding: 12px 0;
    font-family: var(--akira-font);
    font-weight: var(--akira-weight);
    font-variation-settings: var(--akira-settings);
}

#commentList {
    overflow-y: auto;
    margin-bottom: 12px;
    flex: 1;
}

.comment-item {
    background: rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 6px;
}

.comment-reply {
    margin-left: 16px;
    background: rgba(255,255,255,0.05);
    border-left: 2px solid rgba(255,255,255,0.2);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 3px;
    flex-wrap: wrap;
    gap: 2px;
}

.comment-username {
    font-weight: 600;
    color: #7eb3ff;
    font-size: 0.85rem;
    font-family: var(--akira-font);
    font-variation-settings: var(--akira-settings);
}

.comment-meta {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.45);
    font-family: var(--akira-font);
    font-variation-settings: var(--akira-settings);
}

.comment-body {
    color: whitesmoke;
    font-size: 0.85rem;
    word-break: break-word;
    line-height: 1.4;
    font-family: var(--akira-font);
    font-weight: var(--akira-weight);
    font-variation-settings: var(--akira-settings);
}

.comment-actions { margin-top: 4px; }

.btn-reply-link {
    background: none;
    border: none;
    color: rgba(255,255,255,0.35);
    font-size: 0.75rem;
    font-family: var(--akira-font);
    font-variation-settings: var(--akira-settings);
    cursor: pointer;
    padding: 0;
}

.btn-reply-link:hover { color: #7eb3ff; }

/* === Reply Indicator === */
#replyingTo {
    display: none;
    align-items: center;
    gap: 6px;
    background: rgba(126,179,255,0.15);
    border-radius: 6px;
    padding: 5px 8px;
    margin-bottom: 6px;
    font-size: 0.8rem;
    color: #7eb3ff;
    font-family: var(--akira-font);
    font-variation-settings: var(--akira-settings);
    flex-shrink: 0;
}

#replyingTo button {
    background: none;
    border: none;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    padding: 0;
    margin-left: auto;
}

/* === Comment Form === */
#commentForm {
    flex-shrink: 0;
}

#commentForm input,
#commentForm textarea {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.2);
    color: whitesmoke;
    border-radius: 6px;
    width: 100%;
    padding: 6px 8px;
    font-size: 0.85rem;
    font-family: var(--akira-font);
    font-weight: var(--akira-weight);
    font-variation-settings: var(--akira-settings);
    margin-bottom: 6px;
    resize: vertical;
}

#commentForm input::placeholder,
#commentForm textarea::placeholder { color: rgba(255,255,255,0.35); }

#commentForm input:focus,
#commentForm textarea:focus {
    outline: none;
    border-color: #7eb3ff;
    background: rgba(255,255,255,0.12);
}

#commentSubmitBtn {
    background: #7eb3ff;
    color: #0d0d0d;
    border: none;
    border-radius: 6px;
    padding: 6px 16px;
    font-size: 0.85rem;
    font-family: var(--akira-font);
    font-weight: var(--akira-weight);
    font-variation-settings: var(--akira-settings);
    cursor: pointer;
}

#commentSubmitBtn:hover    { background: #5a9fff; }
#commentSubmitBtn:disabled { opacity: 0.5; cursor: not-allowed; }

#commentError {
    color: #f44336;
    font-size: 0.78rem;
    margin-top: 4px;
    font-family: var(--akira-font);
    font-variation-settings: var(--akira-settings);
}

/* === Centre loading spinner === */
#loadingSpinner {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

#loadingSpinner .spinner-text {
    font-family: var(--akira-font);
    font-weight: var(--akira-weight);
    font-variation-settings: var(--akira-settings);
    font-size: 2rem;
    color: whitesmoke;
    animation: loaderPulse 1.5s ease-in-out infinite;
}

#loadingSpinner .spinner-border { display: none !important; }

/* ============================================================
   IMAGE PROTECTION
   ============================================================ */

/* Disable drag on all gallery and modal images */
.gallery img,
#modalImage {
    -webkit-user-drag: none;
    user-drag: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Transparent overlay on modal image — blocks right-click save target */
#imageProtectOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    cursor: default;
}
