/* ==============================
   BASE STYLES (v1.1 locked)
   ============================== */

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

body {
  background: #0e0e0e;
  color: #e8e8e8;
  font-family: 'Inter', sans-serif;
  font-size: clamp(16px, 4vw, 20px);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  padding: clamp(24px, 5vw, 48px) 20px clamp(24px, 5vw, 60px) 20px;
  max-width: 720px;
  margin: 0 auto;
}

/* Header / Brand */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: clamp(40px, 10vw, 72px);
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid #222;
  padding-bottom: clamp(12px, 3vw, 20px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand h1 {
  font-size: clamp(24px, 6vw, 36px);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.dot {
  width: 6px;
  height: 6px;
  background: #ffffff;
  border-radius: 50%;
  opacity: 0.6;
}

/* Navigation */
nav {
  display: flex;
  gap: clamp(24px, 6vw, 36px);
  flex-wrap: wrap;
  align-items: center;
}

nav a {
  text-decoration: none;
  font-size: clamp(15px, 4vw, 18px);
  font-weight: 600;
  color: #f0f0f0;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: clamp(4px, 1vw, 8px) clamp(8px, 2vw, 12px);
  border-radius: 4px;
  transition: all 0.2s ease;
}

nav a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

/* Now Section */
.now {
  position: relative;
  margin-bottom: clamp(20px, 5vw, 28px);
}

.now .date {
  font-size: clamp(12px, 3vw, 14px);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #9a9a9a;
  margin-bottom: clamp(20px, 5vw, 28px);
}

.now-text-wrapper {
  display: block;
  overflow: hidden;
}

.now-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4; /* 4 lines before Read More */
  overflow: hidden;
  transition: all 0.3s ease;
  opacity: 1;
}

.now-text.expanded {
  -webkit-line-clamp: unset;
  animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
  0% {opacity: 0;}
  100% {opacity: 1;}
}

.now-text p {
  margin-bottom: 1em;
}

.now-text p:last-child {
  margin-bottom: 0;
}

/* Bottom fade hint */
.now::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 36px;
  background: linear-gradient(to bottom, rgba(14,14,14,0) 0%, rgba(14,14,14,1) 100%);
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.now-text.expanded ~ .now::after {
  opacity: 0;
}

/* Read More Button */
.read-more-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: #888;
  font-weight: 500;
  cursor: pointer;
  padding: 12px 0;
  font-size: clamp(14px, 3.5vw, 16px);
  transition: color 0.2s ease;
}

.read-more-btn:hover {
  color: #fff;
}

.read-more-btn .arrow {
  font-size: 0.85em;
  transition: transform 0.3s ease;
  display: inline-block;
  animation: pulseArrow 1.2s infinite;
}

.now-text.expanded ~ .read-more-btn .arrow {
  animation: none;
}

@keyframes pulseArrow {
  0% { transform: translateY(0); opacity: 0.75; }
  50% { transform: translateY(1.5px); opacity: 1; }
  100% { transform: translateY(0); opacity: 0.75; }
}

/* Section Links Grid (Homepage) */
.links.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(16px, 4vw, 24px);
  margin-top: clamp(40px, 10vw, 60px);
}

.section-link {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: clamp(20px, 4vw, 28px);
  border-left: 3px solid #555;
  border-radius: 6px;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  background: rgba(255, 255, 255, 0.01);
}

.section-link h2 {
  font-size: clamp(20px, 4.5vw, 28px);
  font-weight: 600;
  margin-bottom: 6px;
}

.section-link p {
  font-size: clamp(15px, 3.5vw, 18px);
  color: #a8a8a8;
}

.section-link:hover {
  transform: translateY(-2px);
  border-left-color: #f0f0f0;
  background: rgba(255, 255, 255, 0.03);
}

@media screen and (min-width: 600px) {
  .links.grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Images */
img {
  width: 100%;
  height: auto;
  margin: clamp(40px, 10vw, 60px) 0;
}

.caption {
  font-size: clamp(12px, 3vw, 14px);
  color: #777;
  margin-top: -clamp(24px, 6vw, 40px);
  margin-bottom: clamp(40px, 10vw, 60px);
}

/* ==============================
   TRAVELS PAGE STYLES
   ============================== */
.travel-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}

.page-header h1 {
  font-size: clamp(28px, 6vw, 36px);
  margin-bottom: 12px;
  text-align: center;
}

.page-header a {
  display: inline-block;
  margin-top: 4px;
  font-size: clamp(14px, 3vw, 16px);
  color: #888;
  text-decoration: none;
  transition: color 0.2s ease;
}

.page-header a:hover {
  color: #fff;
}

/* Post Separation */
.trip {
  padding-bottom: 48px;
  margin-bottom: 48px;
  border-bottom: 1px solid #222;
}

.trip h2 {
  font-size: clamp(22px, 5vw, 28px);
  margin-bottom: 8px;
}

.trip p {
  font-size: clamp(16px, 4vw, 20px);
  line-height: 1.6;
  margin-bottom: 16px;
}

.trip img {
  width: 100%;
  height: auto;
  margin-bottom: clamp(20px, 5vw, 28px);
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* -----------------------------
   Travel Entries Read More & Fade
----------------------------- */
.trip-text-wrapper {
  position: relative;
  overflow: hidden;
}

.trip-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
  transition: all 0.3s ease;
}

.trip-text.expanded {
  -webkit-line-clamp: unset;
}

.trip-text-wrapper::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 36px;
  background: linear-gradient(to bottom, rgba(14,14,14,0) 0%, rgba(14,14,14,1) 100%);
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.trip-text.expanded ~ .trip-text-wrapper::after {
  opacity: 0;
}

.read-more-btn-trip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid #333;
  border-radius: 6px;
  color: #ccc;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 14px;
  margin-top: 12px;
  font-size: clamp(14px, 3.5vw, 16px);
  transition: all 0.2s ease;
}

.read-more-btn-trip:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-color: #555;
}

.read-more-btn-trip .arrow {
  font-size: 0.85em;
  transition: transform 0.3s ease;
  display: inline-block;
  animation: pulseArrow 1.2s infinite;
}

.trip-text.expanded ~ .read-more-btn-trip .arrow {
  animation: none;
}

/* Trip Date */
.trip-date {
  font-size: clamp(12px, 3vw, 14px);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #9a9a9a;
  display: block;
  margin-bottom: 8px;
}

/* ==============================
   CARVINGS PAGE STYLES (reuse trips layout)
   ============================== */
.carving-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}

.carving h2 {
  font-size: clamp(22px, 5vw, 28px);
  margin-bottom: 8px;
}

.carving p {
  font-size: clamp(16px, 4vw, 20px);
  line-height: 1.6;
  margin-bottom: 16px;
}

.carving img {
  width: 100%;
  height: auto;
  margin-bottom: clamp(20px, 5vw, 28px);
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Reuse travel read-more styles for carvings */
.carving-text-wrapper {
  position: relative;
  overflow: hidden;
}

.carving-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
  transition: all 0.3s ease;
}

.carving-text.expanded {
  -webkit-line-clamp: unset;
}

.carving-text-wrapper::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 36px;
  background: linear-gradient(to bottom, rgba(14,14,14,0) 0%, rgba(14,14,14,1) 100%);
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.carving-text.expanded ~ .carving-text-wrapper::after {
  opacity: 0;
}

/* ==============================
   PHOTOGRAPHY PAGE (v1.0)
   ============================== */

/* Latest Photo */
.latest-photo {
  text-align: center;
  margin-bottom: clamp(32px, 8vw, 48px);
}

.latest-photo .main-photo {
  width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  margin-bottom: clamp(12px, 3vw, 16px);
}

.latest-photo .photo-description {
  font-size: clamp(14px, 3.5vw, 16px);
  color: #ccc;
  max-width: 700px;
  margin: 0 auto;
}

/* Photo Grid */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: clamp(12px, 2vw, 16px);
  margin-bottom: clamp(40px, 10vw, 60px);
}

.photo-grid img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  object-fit: cover;
}

.photo-grid img:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
}

/* Modal */
.modal {
  display: none; 
  position: fixed;
  z-index: 9999;
  padding-top: 60px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  background-color: rgba(0,0,0,0.95);
}

.modal-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 80vh;
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.8);
}

#modalDescription {
  color: #ccc;
  text-align: center;
  margin: clamp(12px, 3vw, 16px) auto;
  font-size: clamp(14px, 3.5vw, 16px);
  max-width: 80%;
}

/* Close Button */
.modal .close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: clamp(24px, 5vw, 32px);
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s ease;
}

.modal .close:hover {
  color: #bbb;
}

/* Responsive adjustments */
@media screen and (max-width: 600px) {
  .photo-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
  }

  .modal-content {
    max-width: 95%;
    max-height: 70vh;
  }
}

/* -----------------------------
   Photo Fade-In Animation
----------------------------- */
.photo-grid img {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeInPhoto 0.6s forwards;
}

@keyframes fadeInPhoto {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.carving-text.expanded ~ .read-more-btn-trip .arrow {
  animation: none;
}