/* ========================================
   Photo System CSS
   Upload form, gallery grid, photo view,
   and post-card embedded image block.
   ======================================== */

/* ── Post card embedded image ─────────────────────── */
.post-card-image-wrap {
    margin: 8px 0 6px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    background: #f5f5f5;
}
.post-card-photo {
    display: block;
    width: 100%;
    max-height: 480px;
    object-fit: cover;
    object-position: center;
    cursor: pointer;
    transition: opacity 0.15s ease;
}
.post-card-photo:hover { opacity: 0.93; }
.post-card-image-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    background: #fafafa;
    border-top: 1px solid #e8e8e8;
    font-size: 12px;
    color: #555;
    flex-wrap: wrap;
}
.post-card-image-device { font-weight: 500; color: #333; }
.post-card-image-date   { color: #777; }
.post-card-image-link {
    margin-left: auto;
    color: #5a9a3c;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}
.post-card-image-link:hover { text-decoration: underline; }

/* ── Upload form ──────────────────────────────────── */
.photo-upload-container {
    max-width: 620px;
    margin: 24px auto;
    padding: 0 12px;
}
.photo-upload-header { margin-bottom: 20px; }
.photo-upload-title {
    font-size: 20px;
    font-weight: 700;
    color: #1f3f2b;
    margin: 6px 0 0;
}
.back-link { color: #5a9a3c; text-decoration: none; font-size: 14px; }
.back-link:hover { text-decoration: underline; }

.photo-upload-errors {
    background: #fff3f3;
    border: 1px solid #e0a0a0;
    border-radius: 4px;
    padding: 12px 14px;
    margin-bottom: 16px;
}
.photo-error-msg   { margin: 0 0 4px; color: #c0392b; font-size: 14px; }
.photo-error-msg:last-child { margin-bottom: 0; }
.photo-success-msg { color: #27ae60; font-size: 13px; margin: 4px 0 0; }

.photo-upload-form {
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    padding: 20px;
}
.photo-upload-dropzone {
    border: 2px dashed #b0d0a0;
    border-radius: 6px;
    padding: 28px 16px;
    text-align: center;
    background: #f8fdf5;
    margin-bottom: 18px;
    transition: border-color 0.2s;
}
.photo-upload-dropzone:hover { border-color: #5a9a3c; }
.photo-dropzone-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.photo-dropzone-icon  { font-size: 32px; }
.photo-dropzone-text  { font-size: 15px; font-weight: 600; color: #1f3f2b; }
.photo-dropzone-hint  { font-weight: 400; font-size: 13px; color: #666; }
.photo-file-input     { display: none; }
.photo-upload-note    { font-size: 12px; color: #777; margin: 10px 0 0; line-h
eight: 1.5; }

.photo-caption-section, .photo-tags-section { margin-bottom: 14px; }
.photo-field-label    { display: block; font-size: 13px; font-weight: 600; col
or: #333; margin-bottom: 5px; }
.photo-field-optional { font-weight: 400; color: #888; }

.photo-caption-input {
    width: 100%;
    min-height: 80px;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
    resize: vertical;
    box-sizing: border-box;
    font-family: inherit;
    line-height: 1.5;
}
.photo-caption-input:focus, .photo-tags-input:focus {
    outline: none;
    border-color: #5a9a3c;
}
.photo-tags-input {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
    box-sizing: border-box;
}
.photo-licence-row {
    font-size: 13px;
    color: #555;
    margin-bottom: 14px;
    padding: 8px 10px;
    background: #f5f5f5;
    border-radius: 3px;
}
.photo-licence-label  { font-weight: 600; margin-right: 4px; }
.photo-limit-indicator { font-size: 12px; color: #777; margin-bottom: 14px; }
.photo-limit-indicator a { color: #5a9a3c; }
.photo-upload-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
}
.photo-limit-notice {
    background: #fffbea;
    border: 1px solid #f0c040;
    border-radius: 4px;
    padding: 14px 16px;
    font-size: 14px;
    color: #555;
    margin-bottom: 16px;
}
.photo-limit-notice a { color: #5a9a3c; text-decoration: underline; }

/* ── Gallery page ─────────────────────────────────── */
.gallery-container { max-width: 900px; margin: 24px auto; padding: 0 12px; }
.gallery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}
.gallery-header-left {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}
.gallery-title { font-size: 20px; font-weight: 700; color: #1f3f2b; margin: 0;
 }
.gallery-count { font-size: 13px; color: #777; }
.gallery-header-right { display: flex; align-items: center; gap: 10px; }
.gallery-empty { text-align: center; padding: 40px 20px; color: #666; }

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}
.gallery-tile {
    position: relative;
    overflow: hidden;
    border-radius: 3px;
    background: #f0f0f0;
    aspect-ratio: 1 / 1;
    display: block;
    text-decoration: none;
}
.gallery-tile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: opacity 0.15s ease, transform 0.2s ease;
}
.gallery-tile:hover .gallery-tile-img { opacity: 0.88; transform: scale(1.03);
 }
.gallery-tile-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.55));
    padding: 20px 8px 7px;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.gallery-tile:hover .gallery-tile-overlay { opacity: 1; }
.gallery-tile-device { font-size: 11px; color: #fff; text-shadow: 0 1px 2px rg
ba(0,0,0,0.5); }

/* ── Photo view page ──────────────────────────────── */
.photo-view-container { max-width: 820px; margin: 24px auto; padding: 0 12px; 
}
.photo-view-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.photo-view-image-wrap {
    text-align: center;
    background: #1a1a1a;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 16px;
}
.photo-view-img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}
.photo-meta-card {
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    padding: 16px 18px;
}
.photo-meta-title {
    font-size: 16px;
    font-weight: 700;
    color: #1f3f2b;
    margin: 0 0 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}
.photo-meta-table { width: 100%; border-collapse: collapse; font-size: 14px; m
argin-bottom: 14px; }
.photo-meta-table th {
    text-align: left;
    padding: 5px 10px 5px 0;
    color: #555;
    font-weight: 600;
    white-space: nowrap;
    width: 120px;
}
.photo-meta-table td { padding: 5px 0; color: #222; }
.photo-meta-table td a { color: #5a9a3c; text-decoration: none; }
.photo-meta-table td a:hover { text-decoration: underline; }

.photo-meta-tags-section { border-top: 1px solid #eee; padding-top: 12px; }
.photo-meta-label { font-size: 13px; font-weight: 600; color: #555; display: b
lock; margin-bottom: 6px; }
.photo-tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10p
x; }
.photo-tag {
    background: #edf7e6;
    color: #2a6a1a;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 12px;
    border: 1px solid #c8e8b8;
}
.photo-no-tags { color: #aaa; font-size: 13px; }
.photo-tag-edit-form { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wr
ap; }
.photo-tag-edit-input {
    flex: 1;
    min-width: 180px;
    padding: 6px 9px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 13px;
}
.photo-tag-edit-input:focus { outline: none; border-color: #5a9a3c; }
.photo-delete-form { display: inline; }
.btn-danger-small {
    background: none;
    border: 1px solid #e0a0a0;
    color: #c0392b;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-danger-small:hover { background: #fff3f3; }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 480px) {
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr
)); gap: 5px; }
    .photo-upload-form { padding: 14px; }
    .photo-upload-actions { flex-direction: column; }
    .photo-upload-actions .btn-outline,
    .photo-upload-actions .btn-post { width: 100%; text-align: center; }
}

/* ── 2-Step flow: Step indicator ─────────────────── */
.photo-step-indicator {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 18px 0 22px;
    padding: 0 4px;
}
.photo-step {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #aaa;
    font-size: 13px;
}
.photo-step.active { color: #3a7a20; font-weight: 600; }
.photo-step-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #ccc;
    background: #fff;
    flex-shrink: 0;
    display: inline-block;
}
.photo-step.active .photo-step-dot {
    border-color: #3a7a20;
    background: #3a7a20;
}
.photo-step-line {
    flex: 1;
    height: 2px;
    background: #ddd;
    margin: 0 10px;
    min-width: 30px;
}
.photo-step-line.active { background: #3a7a20; }

/* ── Preview image ───────────────────────────────── */
.photo-preview-wrap {
    text-align: center;
    margin-bottom: 16px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    max-height: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.photo-preview-img {
    max-width: 100%;
    max-height: 480px;
    object-fit: contain;
    display: block;
}

/* ── EXIF info card ──────────────────────────────── */
.photo-exif-card {
    background: #f8f9fa;
    border: 1px solid #e4e8eb;
    border-radius: 5px;
    padding: 11px 14px;
    margin-bottom: 16px;
    font-size: 13px;
}
.photo-exif-title {
    font-weight: 600;
    color: #555;
    margin-bottom: 7px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.photo-exif-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 3px 0;
    color: #333;
    line-height: 1.4;
}
.photo-exif-icon { flex-shrink: 0; }

/* ── Trending tag chips ──────────────────────────── */
.photo-trending-label {
    font-size: 12px;
    color: #777;
    margin: 8px 0 6px;
    font-weight: 500;
}
.photo-tag-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.photo-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}
.photo-tag-chip input[type=checkbox] {
    margin: 0;
    accent-color: #3a7a20;
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}
.photo-tag-chip span {
    display: inline-block;
    background: #eef5e9;
    border: 1px solid #b5d49a;
    color: #3a7a20;
    border-radius: 20px;
    padding: 3px 9px;
    font-size: 12px;
    line-height: 1.4;
    transition: background 0.12s;
}
.photo-tag-chip:has(input:checked) span {
    background: #3a7a20;
    color: #fff;
    border-color: #3a7a20;
}

/* ── Field label small variant ───────────────────── */
.photo-field-label-small {
    font-size: 12px;
    color: #555;
    font-weight: 500;
    display: block;
    margin-bottom: 4px;
}

/* ── Restart form (back button row) ─────────────── */
.photo-restart-form { margin-bottom: 14px; }
.btn-sm { font-size: 12px; padding: 5px 12px; }

/* ── Publish form spacing ────────────────────────── */
.photo-publish-form { margin-top: 0; }

/* ── Virus scan badge (step 2 preview) ──────────── */
.photo-scan-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f0faf4;
    border: 1px solid #6dbf8b;
    border-left: 4px solid #28a745;
    border-radius: 5px;
    padding: 9px 14px;
    margin-bottom: 14px;
    font-size: 13px;
}
.photo-scan-badge-icon {
    font-size: 20px;
    flex-shrink: 0;
    line-height: 1;
}
.photo-scan-badge-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.photo-scan-badge-text strong {
    color: #1a6e35;
    font-size: 13px;
}
.photo-scan-badge-text span {
    color: #4a8c60;
    font-size: 11px;
}

/* ─── Photo view: download + view count bar ─────────────────────────────── */
.photo-view-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: .75rem 0 1rem;
}
.btn-download {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .45rem .9rem;
    background: #2563eb;
    color: #fff;
    border-radius: 6px;
    font-size: .875rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s;
}
.btn-download:hover { background: #1d4ed8; }
.photo-view-count {
    font-size: .85rem;
    color: #6b7280;
}

/* ── Photo source validation card (step 2 preview) ─────────────────────── */
.photo-source-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: 0.85rem 1rem;
    margin: 0.75rem 0;
}
.photo-source-icon {
    font-size: 1.25rem;
    line-height: 1;
    flex-shrink: 0;
}
.photo-source-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.875rem;
}
.photo-source-body strong {
    font-size: 0.9rem;
    color: #166534;
}
.photo-source-body span {
    color: #374151;
}
.photo-privacy-note {
    color: #6b7280 !important;
    font-style: italic;
    font-size: 0.8rem !important;
}
