* {
  margin: 0;
  padding: 0;

  box-sizing: border-box;
}

body {
  font-family: "Arial", sans-serif;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.container {
  padding-inline: 32px;
  margin-inline: auto;
  max-width: 1300px;
}

header {
  background-color: #c9a98d;
}

.main-header {
  min-height: 90px;
  padding-block: 20px;

  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
}

.brand-name {
  font-size: 2rem;
  font-weight: 800;
  text-decoration: none;
  color: #fff;
}

.navigation-drawer {
  min-height: 100vh;
  width: 200px;
  padding: 20px 10px;
  background-color: #c9a98d;

  position: fixed;
  inset-block-start: 0;
  inset-inline-start: 0;

  box-shadow: 0 0 4px 2px #00000033;
  transform: translateX(-100%);
  transition: transform 350ms;

  z-index: 9999;
}

.navigation-drawer.open {
  transform: translateX(0);
}

.drawer-button {
  padding: 8px;
  border: 0;
  border-radius: 4px;

  display: inline-block;
  background-color: transparent;

  font-weight: bold;
  font-size: 28px;
  color: #141e16;

  cursor: pointer;
}

.nav-list {
  list-style: none;

  display: flex;
  flex-direction: column;
  gap: 10px 20px;
}

.nav-list li a {
  padding: 10px 16px;
  display: inline-block;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

.nav-list li a:hover {
  opacity: 0.9;
}

/* Auth buttons */
.auth-btn {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  margin-left: 8px;
  text-decoration: none;
  font-weight: 600;
}
#notif-btn {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 8px;
  margin-left: 8px;
  text-decoration: none;
  font-weight: 600;
}
.register-btn {
  background: #4f7f65;
  color: #fff;
}
.login-btn {
  background: #f5f5f0;
  color: #4f7f65;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.user-area {
  display: flex;
  align-items: center;
  gap: 8px;
}
.notif-menu {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 8px;
  border-radius: 8px;
  margin-left: 6px;
}
.notif-menu button {
  background: #4f7f65;
  color: #fff;
  border: none;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.notif-menu button:hover {
  opacity: 0.95;
}

.main-header {
  align-items: center;
  display: flex;
  gap: 12px;
}
.nav-list {
  margin-inline: auto;
}

.main-content {
  padding-block: 20px;
}

.hero {
  display: flex;
  gap: 48px;
  align-items: center;
  padding-block: 36px;
}

.hero-left {
  flex: 1 1 52%;
}
.hero-right {
  flex: 1 1 48%;
  display: flex;
  justify-content: center;
}

.hero-title {
  font-size: 40px;
  line-height: 1.05;
  margin-bottom: 18px;
  color: #141e16;
  font-weight: 800;
}

.hero-desc {
  color: #333;
  max-width: 560px;
  margin-bottom: 18px;
  font-size: 16px;
}

.hero-illustration {
  max-width: 100%;
  height: auto;
}

.btn {
  display: inline-block;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  border: 0;
}
.post-btn {
  background: #4f7f65;
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
}
.guest-btn {
  background: #f5f5f0;
  color: #4f7f65;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.map-wrapper {
  max-width: 820px;
  margin: 28px auto;
  border: 4px solid #4f7f65;
  padding: 8px;
  box-shadow: 0 6px 0 rgba(79, 127, 101, 0.06);
}
.home-map {
  height: 360px;
  border: 0;
  margin: 0;
}

.guest-cta {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

@media screen and (max-width: 900px) {
  .hero {
    flex-direction: column-reverse;
    gap: 20px;
    padding-block: 24px;
  }
  .hero-left,
  .hero-right {
    flex: none;
    width: 100%;
  }
  .hero-title {
    font-size: 28px;
  }
  .map-wrapper {
    width: 100%;
    padding: 6px;
  }
}

.new-story-card {
  max-width: 820px;
  margin: 28px auto;
  background: #fff;
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.card-title {
  font-size: 28px;
  margin: 0;
  color: #141e16;
}
.guest-note {
  background: #f1f7f2;
  color: #4f7f65;
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 600;
}

.new-story-form .form-group {
  margin-bottom: 16px;
}
.new-story-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}
.new-story-form textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #e6e6e6;
  resize: vertical;
}
.new-story-form input[type="file"] {
  display: inline-block;
}
.photo-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}
.photo-controls .btn {
  background: #4f7f65;
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
}
.photo-preview {
  min-height: 160px;
  background: #fafafa;
  padding: 8px;
  border-radius: 8px;
  border: 1px dashed #e6e6e6;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-preview img,
.photo-preview video {
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
}

.story-map {
  height: 320px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}
.form-actions .post-btn {
  background: #4f7f65;
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  font-weight: 700;
}

@media screen and (max-width: 700px) {
  .card-title {
    font-size: 20px;
  }
  .new-story-card {
    padding: 14px;
  }
  .photo-preview {
    min-height: 120px;
  }
}

@media screen and (width > 1000px) {
  .navigation-drawer {
    min-height: auto;
    width: auto;
    padding: 0;
    background-color: transparent;

    flex-direction: row;
    justify-content: space-between;

    position: static;
    box-shadow: none;
    transform: translateX(0);
  }

  .nav-list {
    flex-direction: row;
  }

  .nav-list li a {
    display: inline-block;
  }

  .drawer-button {
    display: none;
  }
}

@media screen and (max-width: 800px) {
  .main-header {
    flex-wrap: nowrap;
    padding-block: 12px;
    gap: 8px;
    align-items: center;
  }
  .brand-name {
    font-size: 1.25rem;
  }
  .auth-btn {
    padding: 6px 10px;
    margin-left: 6px;
    font-size: 14px;
  }

  /* Mobile drawer: keep it hidden by default and overlay content when opened */
  .navigation-drawer {
    position: fixed;
    inset-block-start: 0; /* top: 0 */
    inset-inline-start: 0; /* left: 0 */
    bottom: 0;
    width: 80%;
    max-width: 320px;
    background: #fff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    transform: translateX(-100%);
    transition: transform 280ms ease;
    padding: 20px 16px;
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
    z-index: 9999;
  }
  .navigation-drawer.open {
    transform: translateX(0);
  }

  .nav-list {
    gap: 12px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }
  .nav-list li a {
    display: block;
    padding: 12px 14px;
    color: #274a37;
    font-weight: 700;
    font-size: 16px;
    border-radius: 6px;
    text-decoration: none;
  }
  .nav-list li a:hover {
    background: rgba(79, 127, 101, 0.06);
  }

  .user-area {
    gap: 6px;
  }

  /* Ensure main content is not hidden behind header */
  .main-content {
    padding-top: 12px;
  }

  /* Show drawer button on mobile */
  .drawer-button {
    display: inline-block;
  }
}

@media screen and (max-width: 420px) {
  .brand-name {
    font-size: 1rem;
  }
  .hero-title {
    font-size: 20px;
  }
  .card-title {
    font-size: 18px;
  }
  .main-header {
    padding-inline: 12px;
  }
  .container {
    padding-inline: 12px;
  }
  .auth-card {
    margin: 20px 12px;
    padding: 20px;
    max-width: 100%;
  }
  .auth-card h1 {
    font-size: 24px;
  }
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 8px;
  background: #1a7f4c;
  color: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  z-index: 99999;
}

.skip-link:focus {
  top: 8px;
}

.page-transition-out {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.page-transition-in {
  opacity: 1;
  transform: translateY(0);
  animation: pageFadeIn 320ms ease;
}

@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

::view-transition-old(
  .main-content
) {
  opacity: 0.9;
  transform: translateY(6px) scale(0.995);
}

::view-transition-new(
  .main-content
) {
  opacity: 0.0;
  transform: translateY(10px) scale(1.01);
}

::view-transition {
  transition: transform 340ms ease, opacity 340ms ease;
}

.home-map,
.story-map {
  height: 360px;
  border: 4px solid rgba(0, 0, 0, 0.08);
  margin: 16px 0;
}


.stories-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 16px;
  justify-items: center;
}
.story-card {
  width: 100%;
  max-width: 380px;
  background: transparent;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  margin: 12px 0;
}
.story-image {
  width: 100%;
  display: block;
}
.story-image img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}
.story-body {
  background: #4f7f65;
  color: #fff;
  padding: 20px;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
}
.story-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.story-author {
  font-weight: 800;
  font-size: 20px;
}
.story-date {
  font-size: 12px;
  opacity: 0.95;
}
.story-desc {
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 16px;
  line-height: 1.6;
  display: -webkit-box;
  line-clamp: 3;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
.story-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.details-btn {
  background: #f5f5f0;
  color: #4f7f65;
  padding: 12px 28px;
  border-radius: 18px;
  border: none;
  font-weight: 700;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.04);
}
.fav-btn {
  background: transparent;
  color: #fff;
  border: none;
  padding: 0;
  border-radius: 8px;
  cursor: pointer;
}

.save-icon {
  width: 40px;
  height: 40px;
  background: #fff;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #4f7f65;
}
.fav-btn .save-icon svg {
  width: 20px;
  height: 20px;
  stroke: #4f7f65;
}

.icon-btn i,
.story-actions i,
button i {
  width: 18px;
  height: 18px;
  color: #fff;
  vertical-align: middle;
  display: inline-block;
}
.icon-btn {
  background: transparent;
  color: #fff;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.fav-btn.active svg {
  stroke: gold !important;
  fill: gold !important;
}

.story-detail .back-btn {
  background: #4f7f65;
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
}
.page-title {
  font-size: 28px;
  margin: 12px 0 8px 0;
  color: #141e16;
}
.detail-header {
  max-width: 900px;
  margin: 0 auto 12px;
}
.story-title {
  font-size: 22px;
  margin: 0 0 8px 0;
  color: #141e16;
}

.page-title {
  text-align: center;
}
.site-footer .container {
  text-align: center;
  padding-block: 12px;
}
/* Saved / Favorite controls and create form */
.saved-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 12px 0 18px 0;
  flex-wrap: wrap;
}
.saved-controls input[type="text"], .saved-controls input, .saved-controls select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #e6e6e6;
  min-height: 38px;
  font-size: 14px;
}
.saved-controls #saved-sync {
  background: #4f7f65;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.saved-controls #saved-sync:hover { opacity: 0.95; }

.saved-create {
  background: #ffffff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
  margin-bottom: 18px;
}
.saved-create h2 {
  margin: 0 0 10px 0;
  font-size: 20px;
  color: #141e16;
}
/* create-form removed; responsive adjustments for saved-controls retained */
@media screen and (max-width: 900px) {
  .saved-controls { gap: 8px; }
}
.detail-image img {
  display: block;
  width: 100%;
  max-width: 900px;
  height: 300px;
  object-fit: cover;
  margin: 0 auto 12px;
}
.detail-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 900px;
  margin: 0 auto 12px;
  background: #4f7f65;
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
}
.detail-desc {
  max-width: 900px;
  margin: 12px auto 24px;
  line-height: 1.6;
}
.story-detail .story-map {
  max-width: 900px;
  margin: 0 auto 48px;
  border: 4px solid #4f7f65;
}

button:focus,
a:focus,
input:focus,
textarea:focus {
  outline: 3px solid #cfead6;
}

.auth-card {
  max-width: 520px;
  margin: 48px auto;
  background: #5a7f69;
  color: #fff;
  padding: 36px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.auth-card h1 {
  font-size: 34px;
  margin-bottom: 18px;
}

#favorite-content p {
  margin-top: 25px;
}

.auth-card p {
  margin-top: 10px;
  text-align: center;
}

.auth-card label {
  display: block;
  margin-top: 12px;
  margin-bottom: 6px;
}
.auth-card input {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 0;
  margin-bottom: 8px;
}
.auth-card button {
  display: block;
  margin: 18px auto 0;
  padding: 8px 28px;
  border-radius: 8px;
}

