/* ============================================================
   Journal Feed — journal-feed.css
   Instagram-style social feed for single trip pages.
   ============================================================ */

/* ── Feed wrapper ── */
.h2c-st-journal-feed {
  /* max-width: 640px; */
  margin: 0 auto;
}

/* ── Sitewide /journals archive feed (single-column, infinite scroll) ── */
.h2c-all-journals-feed {
  max-width: 640px;
  margin: 0 auto;
}
.h2c-jf-infinite-sentinel {
  height: 1px;
}
.h2c-jf-infinite-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
}

/* ── Login prompt ── */
.h2c-jf-login-prompt {
  text-align: center;
  padding: 12px 0 20px;
  font-size: 14px;
}
.h2c-jf-login-prompt a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
}

/* ── Post submission form ── */
.h2c-jf-post-form {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
}

.h2c-jf-form-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.h2c-jf-form-prompt {
  font-size: 14px;
  color: #999;
  flex: 1;
}

.h2c-jf-title-input {
  width: 100%;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
  color: #333;
  box-sizing: border-box;
  margin-bottom: 8px;
}
.h2c-jf-title-input:focus {
  border-color: #aaa;
}

.h2c-jf-caption-textarea {
  width: 100%;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.55;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
  color: #333;
  box-sizing: border-box;
}
.h2c-jf-caption-textarea:focus {
  border-color: #aaa;
}

/* Media upload area */
.h2c-jf-media-area {
  margin-top: 10px;
}

.h2c-jf-photo-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.h2c-jf-preview-item {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 6px;
  overflow: hidden;
  background: #f0f0f0;
}

.h2c-jf-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.h2c-jf-remove-photo {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #fff;
}
.h2c-jf-remove-photo svg {
  width: 12px;
  height: 12px;
}

.h2c-jf-upload-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px dashed #ccc;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #777;
  transition: border-color 0.2s, color 0.2s;
}
.h2c-jf-upload-label:hover {
  border-color: #999;
  color: #444;
}
.h2c-jf-upload-label svg {
  width: 16px !important;
  height: 16px !important;
  flex-shrink: 0;
}
.h2c-jf-upload-spinner {
    display: inline-flex;
}
.h2c-jf-upload-label.uploading {
  pointer-events: none;
  opacity: 0.7;
}
.h2c-jf-upload-spinner .loading-icon {
  width: 16px;
  height: 16px;
  animation: h2c-jf-spin 0.8s linear infinite;
}
.h2c-jf-submit-btn .loading-icon svg {
  width: 16px !important;
  height: 16px !important;
}
/* Video toggle */
.h2c-jf-video-toggle-wrap {
  margin-top: 8px;
}
.h2c-jf-toggle-video,
.h2c-jf-toggle-photos {
  font-size: 12px;
  color: #888;
  text-decoration: underline;
  cursor: pointer;
}
.h2c-jf-toggle-video:hover,
.h2c-jf-toggle-photos:hover {
  color: #444;
}
.h2c-jf-video-field {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.h2c-jf-video-input {
  width: 100%;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
  color: #333;
}
.h2c-jf-video-input:focus {
  border-color: #aaa;
}

/* User consent */
.h2c-jf-consent-wrap {
  margin-top: 10px;
}
.h2c-jf-consent-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.5;
  color: #555;
}
.h2c-jf-consent-label input[type="checkbox"] {
  flex-shrink: 0;
  margin-top: 2px;
  width: 15px;
  height: 15px;
  accent-color: currentColor;
  cursor: pointer;
}
.h2c-jf-consent-error {
  margin: 4px 0 0;
  font-size: 12px;
  color: #b91c1c;
}

/* My-account journal consent (add/edit form) */
.h2c-journal-consent-wrap {
  margin-bottom: 8px;
}
.h2c-journal-consent-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.5;
  color: #444;
}
.h2c-journal-consent-label input[type="checkbox"] {
  flex-shrink: 0;
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: currentColor;
  cursor: pointer;
}

/* Form actions */
.h2c-jf-form-actions {
  margin-top: 12px;
}
.h2c-jf-submit-btn {
  min-width: 100px;
}
.h2c-jf-submit-btn .loading-icon {
  display: none;
  width: 16px;
  height: 16px;
  margin-left: 6px;
  animation: h2c-jf-spin 0.8s linear infinite;
}
.h2c-jf-submit-btn.loading .loading-icon {
  display: inline-block;
}

/* Form messages */
.h2c-jf-form-msg {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
}
.h2c-jf-msg-success {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}
.h2c-jf-msg-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* ── Feed list ── */
.h2c-jf-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.h2c-jf-empty {
  text-align: center;
  padding: 32px 16px;
  color: #aaa;
  font-size: 14px;
}

/* ── Feed card ── */
.h2c-jf-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  overflow: hidden;
}

/* Media area */
.h2c-jf-media {
  position: relative;
  width: 100%;
  background: #f5f5f5;
  line-height: 0;
}

.h2c-jf-media img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  display: block;
}

.h2c-jf-media-video {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.h2c-jf-media-video iframe,
.h2c-jf-media-video video {
  width: 100%;
  height: 100%;
  display: block;
}

/* Photo carousel inside card */
.h2c-jf-media-carousel .h2c-swiper {
  line-height: 0;
}
.h2c-jf-media-carousel .swiper-slide img {
  width: 100%;
  height: 480px;
  object-fit: cover;
  display: block;
}

/* Card body */
.h2c-jf-card-body {
  padding: 14px 16px;
}

/* Author */
.h2c-jf-author {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.h2c-jf-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #e0e0e0;
}
.h2c-jf-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.h2c-jf-author-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.h2c-jf-author-name {
  font-size: 14px;
  font-weight: 700;
  color: #213246;
}
.h2c-jf-date {
  font-size: 12px;
  color: #aaa;
}

/* Caption */
.h2c-jf-caption {
  margin-bottom: 12px;
}
.h2c-jf-caption-text {
  font-size: 14px;
  line-height: 1.6;
  color: #333;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Reactions row */
.h2c-jf-reactions {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
}

.h2c-jf-love-btn,
.h2c-jf-comment-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  color: #777;
  transition: color 0.15s;
}
.h2c-jf-love-btn:hover,
.h2c-jf-comment-btn:hover {
  color: #333;
}
.h2c-jf-love-btn.loved {
  color: #f60c09;
}
.h2c-jf-love-btn svg,
.h2c-jf-comment-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: fill 0.15s, color 0.15s;
}
.h2c-jf-love-btn.loved svg {
  fill: currentColor;
}
.h2c-jf-love-count,
.h2c-jf-comment-count {
  font-weight: 600;
  font-size: 13px;
}

/* ── Comment modal ── */
.h2c-jf-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
}
.h2c-jf-modal.h2c-jf-modal--open {
  pointer-events: auto;
  opacity: 1;
}

.h2c-jf-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}

.h2c-jf-modal-wrap {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.25);
  transform: translateY(20px);
  transition: transform 0.25s;
}
.h2c-jf-modal--open .h2c-jf-modal-wrap {
  transform: translateY(0);
}

.h2c-jf-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  background: rgba(255,255,255,0.9);
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: background 0.15s;
}
.h2c-jf-modal-close:hover {
  background: #fff;
}
.h2c-jf-modal-close svg {
  width: 18px;
  height: 18px;
  color: #444;
}

/* Modal panels */
.h2c-jf-modal-left {
  flex: 0 0 55%;
  max-width: 55%;
  background: #000;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.h2c-jf-modal-right {
  flex: 1;
  border-left: 1px solid #f0f0f0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Spinner placeholder */
.h2c-jf-modal-spinner-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 40px;
}
.h2c-jf-spinner {
  width: 32px;
  height: 32px;
  animation: h2c-jf-spin 0.8s linear infinite;
  color: #ccc;
}

/* Modal left — media */
.h2c-jf-modal-media {
  flex-shrink: 0;
  line-height: 0;
}
.h2c-jf-modal-media img,
.h2c-jf-modal-media .h2c-swiper {
  width: 100%;
  height: 420px;
  object-fit: cover;
  display: block;
}
.h2c-jf-modal-media .h2c-swiper .swiper-slide img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  display: block;
}
.h2c-jf-single-photo {
  width: 100%;
  height: 420px;
  object-fit: cover;
  display: block;
}
.h2c-jf-video-wrap {
  aspect-ratio: 16 / 9;
  width: 100%;
}
.h2c-jf-video-wrap iframe {
  width: 100%;
  height: 100%;
  display: block;
}

/* Modal left — body */
.h2c-jf-modal-body {
  padding: 16px;
  background: #fff;
  flex: 1;
}

.h2c-jf-modal-author {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.h2c-jf-modal-caption {
  margin-bottom: 12px;
}
.h2c-jf-modal-caption p {
  font-size: 14px;
  line-height: 1.6;
  color: #333;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.h2c-jf-reactions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Modal right — comments */
.h2c-jf-comments-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
  font-weight: 700;
  color: #213246;
  flex-shrink: 0;
}

.h2c-jf-comments-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.h2c-jf-no-comments {
  font-size: 13px;
  color: #aaa;
  text-align: center;
  padding: 24px 0;
  margin: 0;
}

/* Single comment item */
.h2c-jf-comment-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.h2c-jf-comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #e0e0e0;
}

.h2c-jf-comment-body {
  flex: 1;
  min-width: 0;
}
.h2c-jf-comment-author {
  font-size: 13px;
  font-weight: 700;
  color: #213246;
  display: inline;
  margin-right: 6px;
}
.h2c-jf-comment-date {
  font-size: 11px;
  color: #bbb;
}
.h2c-jf-comment-text {
  font-size: 13px;
  line-height: 1.5;
  color: #444;
  margin: 3px 0 0;
  word-break: break-word;
}

/* Comment submission form */
.h2c-jf-comment-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 14px 14px;
  border-top: 1px solid #f0f0f0;
  flex-shrink: 0;
}

.h2c-jf-comment-input {
  flex: 1;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  font-family: inherit;
  resize: none;
  outline: none;
  min-height: 36px;
  max-height: 100px;
  line-height: 1.4;
  transition: border-color 0.2s;
}
.h2c-jf-comment-input:focus {
  border-color: #aaa;
}

.h2c-jf-comment-submit {
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 60px;
  padding: 8px 16px;
  font-size: 13px;
}
.h2c-jf-comment-submit .loading-icon {
  display: none;
  width: 14px;
  height: 14px;
  margin-left: 4px;
  animation: h2c-jf-spin 0.8s linear infinite;
}
.h2c-jf-comment-submit.loading .loading-icon {
  display: inline-block;
}

/* Prevent body scroll when modal is open */
body.h2c-jf-modal-open {
  overflow: hidden;
}

/* ── Animations ── */
@keyframes h2c-jf-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .h2c-jf-modal-wrap {
    flex-direction: column;
    max-height: 92vh;
  }
  .h2c-jf-modal-left {
    flex: 0 0 auto;
    max-width: 100%;
    max-height: 50vh;
    overflow-y: auto;
  }
  .h2c-jf-modal-right {
    border-left: none;
    border-top: 1px solid #f0f0f0;
    max-height: 42vh;
  }
}
