* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", sans-serif;
  background: #080808;
  color: #f5f5f5;
}

/* ========================================
   PAGE
======================================== */

.page {
  display: grid;

  grid-template-columns: 230px minmax(0, 900px);

  justify-content: center;

  gap: 70px;

  max-width: 1300px;

  margin: 0 auto;

  padding: 110px 40px 100px;
}

/* ========================================
   SIDEBAR
======================================== */

.timeline-nav {
  position: sticky;
  top: 105px;

  align-self: start;

  height: calc(100vh - 140px);

  overflow-y: auto;

  padding-right: 10px;
}

.timeline-title {
  display: flex;
  flex-direction: column;

  margin-bottom: 28px;
}

.timeline-title span {
  font-family: "Playfair Display", serif;

  font-size: 24px;
}

.timeline-title small {
  color: #666;

  margin-top: 5px;

  font-size: 12px;
}

.timeline-item {
  position: relative;

  display: block;

  padding: 9px 10px 9px 24px;

  color: #666;

  text-decoration: none;

  font-size: 12px;

  border-left: 1px solid #252525;

  transition: 0.25s;
}

.timeline-item::before {
  content: "";

  position: absolute;

  width: 6px;
  height: 6px;

  border-radius: 50%;

  left: -3.5px;
  top: 15px;

  background: #383838;

  transition: 0.25s;
}

.timeline-item:hover {
  color: #bbb;
}

.timeline-item.active {
  color: white;
}

.timeline-item.active::before {
  background: #ff7fa7;

  box-shadow: 0 0 10px rgba(255, 127, 167, 0.7);

  transform: scale(1.5);
}

.timeline-date {
  display: block;

  font-size: 10px;

  margin-bottom: 3px;

  color: #555;
}

/* ========================================
   STORY
======================================== */

.story {
  padding-bottom: 110px;
}

.story-header {
  margin-bottom: 28px;
}

.story-date {
  color: #ff8eaf;

  text-transform: uppercase;

  letter-spacing: 2px;

  font-size: 11px;

  margin-bottom: 10px;
}

.story-title {
  font-family: "Playfair Display", serif;

  font-size: 38px;

  line-height: 1.15;

  font-weight: 500;
}

.story-time {
  color: #666;

  font-size: 13px;

  margin-top: 9px;
}

/* ========================================
   PHOTO STRIP
======================================== */

.photo-wrapper {
  position: relative;
}

.photo-strip {
  display: flex;

  gap: 14px;

  overflow-x: auto;

  padding-bottom: 12px;

  scroll-snap-type: x mandatory;

  scrollbar-width: thin;

  scrollbar-color: #383838 transparent;
}

.photo-strip::-webkit-scrollbar {
  height: 5px;
}

.photo-strip::-webkit-scrollbar-track {
  background: transparent;
}

.photo-strip::-webkit-scrollbar-thumb {
  background: #333;

  border-radius: 10px;
}

.photo {
  flex: 0 0 auto;

  width: 520px;
  height: 380px;

  object-fit: cover;

  border-radius: 14px;

  scroll-snap-align: start;

  background: #151515;

  transition: transform 0.3s;
}

.photo:hover {
  transform: scale(0.99);
}

/* ========================================
   STORY TEXT
======================================== */

.story-body {
  margin-top: 28px;

  max-width: 760px;

  color: #c0c0c0;

  font-size: 15px;

  line-height: 1.9;

  font-weight: 300;
}

.story-body p + p {
  margin-top: 16px;
}

/* ========================================
   LOCATION / META
======================================== */

.story-meta {
  display: flex;

  gap: 14px;

  margin-top: 25px;

  flex-wrap: wrap;
}

.meta {
  padding: 7px 12px;

  color: #888;

  font-size: 11px;

  border: 1px solid #252525;

  border-radius: 20px;
}

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

.comments {
  margin-top: 45px;

  padding-top: 24px;

  border-top: 1px solid #1d1d1d;
}

.comments-header {
  display: flex;

  justify-content: space-between;

  align-items: center;

  margin-bottom: 17px;
}

.comments-title {
  font-size: 12px;

  color: #777;

  text-transform: uppercase;

  letter-spacing: 1px;
}

.comment-button {
  border: none;

  background: none;

  color: #ff8eaf;

  cursor: pointer;

  font-size: 12px;
}

.comment {
  margin-top: 13px;

  padding: 13px 16px;

  background: #101010;

  border: 1px solid #1b1b1b;

  border-radius: 10px;
}

.comment-author {
  font-size: 11px;

  color: #777;

  margin-bottom: 5px;
}

.comment-text {
  font-size: 13px;

  color: #c4c4c4;

  line-height: 1.5;
}

/* ========================================
   MODAL
======================================== */

.comment-modal {
  display: none;

  position: fixed;

  inset: 0;

  background: rgba(0, 0, 0, 0.75);

  backdrop-filter: blur(8px);

  justify-content: center;

  align-items: center;

  padding: 20px;

  z-index: 2000;
}

.comment-modal-inner {
  position: relative;

  width: min(500px, 100%);

  background: #151515;

  border: 1px solid #292929;

  border-radius: 16px;

  padding: 28px;
}

.comment-modal-inner h2 {
  font-family: "Playfair Display", serif;

  font-weight: 500;

  margin-bottom: 20px;
}

.comment-modal textarea {
  width: 100%;

  min-height: 140px;

  resize: vertical;

  background: #0d0d0d;

  color: white;

  border: 1px solid #282828;

  border-radius: 10px;

  padding: 14px;

  outline: none;

  font-family: inherit;

  font-size: 13px;
}

.comment-modal textarea:focus {
  border-color: #555;
}

.close-modal {
  position: absolute;

  right: 18px;
  top: 15px;

  border: none;

  background: none;

  color: #777;

  font-size: 24px;

  cursor: pointer;
}

.submit-comment {
  margin-top: 14px;

  border: none;

  padding: 10px 16px;

  border-radius: 8px;

  background: #ff7fa7;

  color: white;

  cursor: pointer;
}

/* ========================================
   ADD MEMORY BUTTON
======================================== */

.add-story-button {
  position: fixed;
  right: 30px;
  bottom: 30px;

  z-index: 1500;

  border: 0;
  border-radius: 999px;

  padding: 13px 20px;

  background: #ff7fa7;
  color: white;

  font: inherit;
  font-size: 13px;
  font-weight: 500;

  cursor: pointer;

  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);

  transform: 0.25s ease;
  background: 0.25s ease;
}

.add-story-button:hover {
  transform: translateY(-3px);
  background: #ff6b99;
}

/* ========================================
   EDITOR
======================================== */

.story-editor {
  position: fixed;
  inset: 0;

  display: none;

  z-index: 2000;
}

.story-editor.open {
  display: flex;

  justify-content: center;
  align-items: center;
}

.story-editor-backdrop {
  position: absolute;
  inset: 0;

  background: rgba(0, 0, 0, 0.78);

  backdrop-filter: blur(8px);
}

.story-editor-panel {
  position: relative;

  width: min(600px, calc(100vw - 30px));
  max-height: calc(100vh - 40px);

  overflow-y: auto;

  padding: 30px;

  background: #151515;

  border: 1px solid #292929;

  border-radius: 18px;

  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.55);
}

.story-editor-panel h2 {
  font-family: "Playfair Display", serif;

  font-weight: 500;

  margin-bottom: 25px;
}

.editor-close {
  position: absolute;

  top: 15px;
  right: 18px;

  border: 0;

  background: transparent;

  color: #777;

  font-size: 28px;

  cursor: pointer;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;

  margin-bottom: 7px;

  color: #aaa;

  font-size: 12px;
}

.form-group input,
.form-group textarea {
  width: 100%;

  border: 1px solid #292929;

  border-radius: 9px;

  background: #0d0d0d;

  color: white;

  padding: 12px 13px;

  outline: none;

  font: inherit;

  font-size: 13px;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: #555;
}

.form-row {
  display: grid;

  grid-template-columns: 1fr 1fr;

  gap: 14px;
}

.muted {
  color: #555;
}

.photo-preview {
  display: flex;

  gap: 10px;

  margin-top: 10px;
}

.photo-preview img {
  width: 100px;
  height: 75px;

  object-fit: cover;

  border-radius: 7px;

  border: 1px solid #292929;
}

.editor-error {
  min-height: 18px;

  margin-bottom: 8px;

  color: #ff8da9;

  font-size: 12px;
}

.editor-actions {
  display: flex;

  justify-content: flex-end;

  gap: 10px;

  margin-top: 10px;
}

.editor-cancel,
.editor-save {
  border: 0;

  border-radius: 8px;

  padding: 11px 17px;

  font: inherit;

  font-size: 13px;

  cursor: pointer;
}

.editor-cancel {
  background: #292929;
  color: #bbb;
}

.editor-save {
  background: #ff7fa7;
  color: white;
}

.editor-save:hover {
  background: #ff6d99;
}

body.editor-open {
  overflow: hidden;
}

/* ========================================
   EMPTY STATE
======================================== */

.empty-state {
  padding: 100px 20px;

  text-align: center;
}

.empty-state h2 {
  font-family: "Playfair Display", serif;

  font-size: 34px;

  font-weight: 500;

  margin-bottom: 10px;
}

.empty-state p {
  color: #666;
}

/* ========================================
   LOGOUT
======================================== */

.logout-button {
  position: fixed;

  right: 30px;
  bottom: 80px;

  z-index: 1500;

  padding: 9px 14px;

  border: 1px solid #292929;

  border-radius: 8px;

  background: #151515;

  color: #888;

  cursor: pointer;
}

.logout-button:hover {
  color: white;
}

/* ========================================
   MOBILE
======================================== */

@media (max-width: 600px) {
  .add-story-button {
    right: 18px;
    bottom: 18px;
  }

  .story-editor-panel {
    padding: 22px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

@media (max-width: 900px) {
  .page {
    display: block;

    padding: 100px 20px 70px;
  }

  .timeline-nav {
    position: sticky;

    top: 68px;

    z-index: 500;

    height: auto;

    padding: 12px 0;

    background: rgba(8, 8, 8, 0.92);

    backdrop-filter: blur(12px);

    overflow-x: auto;

    white-space: nowrap;
  }

  .timeline-title {
    display: none;
  }

  #timelineLinks {
    display: flex;

    gap: 5px;
  }

  .timeline-item {
    border: 0;

    display: inline-block;

    padding: 7px 12px;

    border-radius: 20px;

    background: #111;
  }

  .timeline-item::before {
    display: none;
  }

  .timeline-item.active {
    background: #222;
  }

  .timeline-date {
    display: inline;

    margin-right: 5px;
  }

  .story {
    padding-top: 45px;
  }

  .story-title {
    font-size: 31px;
  }

  .photo {
    width: 84vw;

    height: 60vw;

    max-height: 450px;
  }
}
