/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Inter:wght@300;400;500;600;700&family=Crimson+Text:wght@400;600&family=Caveat:wght@400;700&display=swap');

/* --- CSS Variables - Warm Travel Colors --- */
:root {
  /* Warm Travel Palette */
  --sunset-orange: #ff6b6b;
  --warm-coral: #ff8e8e;
  --desert-sand: #f4a261;
  --golden-yellow: #e9c46a;
  --sage-green: #2a9d8f;
  --ocean-blue: #264653;
  --terracotta: #e76f51;
  --cream: #fff8f0;
  --warm-beige: #fef5e7;
  --soft-peach: #ffe5d9;
  
  /* Text Colors */
  --text-dark: #2d3436;
  --text-medium: #636e72;
  --text-light: #b2bec3;
  
  /* Glass Morphism */
  --glass-bg: rgba(255, 255, 255, 0.25);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-shadow: rgba(31, 38, 135, 0.37);
  
  /* Shadows */
  --shadow-soft: rgba(0, 0, 0, 0.08);
  --shadow-medium: rgba(0, 0, 0, 0.12);
  --shadow-strong: rgba(0, 0, 0, 0.2);
  
  /* Transitions */
  --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.7;
  background-color: var(--warm-beige);
  background-image: 
    linear-gradient(135deg, var(--warm-beige) 0%, var(--cream) 50%, var(--soft-peach) 100%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23e76f51' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  background-attachment: fixed;
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* --- Glass Morphism Navigation --- */
.glass-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transition: var(--transition-smooth);
}

.glass-nav:hover {
  background: rgba(255, 255, 255, 0.15);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-family: 'Caveat', cursive;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-dark);
  text-decoration: none;
  transition: var(--transition-smooth);
  transform: rotate(-2deg);
  display: inline-block;
}

.nav-logo:hover {
  color: var(--terracotta);
  transform: rotate(0deg) scale(1.1);
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  transition: var(--transition-smooth);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--sunset-orange);
  transition: width 0.3s ease;
}

.nav-links a:hover {
  color: var(--sunset-orange);
}

.nav-links a:hover::after {
  width: 100%;
}

/* --- Hero Header --- */
.hero-header {
  margin-top: 80px;
  padding: 4rem 2rem 3rem;
  text-align: center;
  background: transparent; /* Remove gradient background for cleaner look */
  position: relative;
  overflow: visible;
  border-bottom: 2px dashed rgba(0,0,0,0.1); /* Dashed line separator */
}

/* Remove blobs for a cleaner journal look */
.hero-header::before, .hero-header::after {
  display: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}

.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(3.5rem, 9vw, 6rem);
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  letter-spacing: -1px;
  /* Removed gradient text for solid ink look */
  background: none;
  -webkit-text-fill-color: initial;
  background-clip: border-box;
}

.hero-subtitle {
  font-family: 'Caveat', cursive;
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--terracotta);
  font-weight: 400;
  transform: rotate(-2deg);
  display: inline-block;
  margin-top: 0.5rem;
}

/* --- Main Content --- */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  margin-top: 2rem;
}

/* --- Masonry Grid Layout --- */
.masonry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  grid-auto-flow: row;
}

@media (max-width: 1024px) {
  .masonry-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .masonry-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* --- Journal Cards --- */
.journal-card {
  position: relative;
  border-radius: 2px;
  overflow: visible; /* Changed for tape/stickers */
  background: #fff;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  height: 650px;
  animation: fadeInUp 0.6s ease-out;
  animation-fill-mode: both;
  /* Polaroid Effect */
  padding: 15px 15px 25px 15px;
  transform: rotate(0deg);
}

/* Tape effect */
.journal-card::before {
  content: '';
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 100px;
  height: 30px;
  background-color: rgba(255, 255, 255, 0.6);
  border-left: 1px dashed rgba(0, 0, 0, 0.1);
  border-right: 1px dashed rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  z-index: 10;
  opacity: 0.8;
}

.journal-card:nth-child(even)::before {
  transform: translateX(-50%) rotate(2deg);
}

.journal-card:nth-child(1) { animation-delay: 0.1s; transform: rotate(-1deg); }
.journal-card:nth-child(2) { animation-delay: 0.2s; transform: rotate(1deg); }
.journal-card:nth-child(3) { animation-delay: 0.3s; transform: rotate(-0.5deg); }
.journal-card:nth-child(4) { animation-delay: 0.4s; transform: rotate(1.5deg); }
.journal-card:nth-child(5) { animation-delay: 0.5s; transform: rotate(-1.5deg); }
.journal-card:nth-child(6) { animation-delay: 0.6s; transform: rotate(0.5deg); }

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    /* We don't reset transform here to keep the rotation */
  }
}

.journal-card:hover {
  transform: translateY(-10px) scale(1.02) rotate(0deg) !important;
  box-shadow: 0 20px 60px var(--shadow-medium);
  z-index: 5;
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card-image-wrapper {
  position: relative;
  width: 100%;
  height: 350px;
  flex-shrink: 0;
  overflow: hidden;
  background: linear-gradient(135deg, var(--desert-sand), var(--golden-yellow));
  border: 1px solid rgba(0,0,0,0.05); /* Image border */
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
  display: block;
}

.card-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--desert-sand), var(--golden-yellow));
}

.placeholder-icon {
  font-size: 4rem;
  opacity: 0.5;
}

.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  transition: var(--transition-smooth);
}

.journal-card:hover .card-overlay {
  opacity: 1;
}

.journal-card:hover .card-image {
  transform: scale(1.1);
}

.read-more {
  color: white;
  font-weight: 600;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  transform: translateY(20px);
  transition: var(--transition-smooth);
}

.journal-card:hover .read-more {
  transform: translateY(0);
}

.card-content {
  padding: 1.5rem 1rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-family: 'Caveat', cursive;
  font-size: 1.2rem;
}

.location-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0;
  background: none;
  color: var(--terracotta);
  border-radius: 0;
  font-weight: 700;
  border: none;
  font-size: 1.3rem;
}

.date-tag {
  display: inline-flex;
  align-items: center;
  padding: 0;
  background: none;
  color: var(--text-medium);
  border-radius: 0;
  font-weight: 400;
  border: none;
  font-style: italic;
  font-size: 1.1rem;
}

.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  line-height: 1.2;
  transition: var(--transition-smooth);
  flex-shrink: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.journal-card:hover .card-title {
  color: var(--terracotta);
}

.card-quote {
  font-family: 'Caveat', cursive;
  font-size: 1.4rem;
  font-style: normal;
  color: var(--text-medium);
  line-height: 1.4;
  margin-top: 0.5rem;
  display: none !important; /* Hidden by default - revealed with secret code */
  transform: rotate(-1deg);
}

.card-quote.is-visible {
  display: block !important;
}

/* --- Post Page Styles --- */
.post-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
  margin-top: 100px;
}

.post-header {
  margin-bottom: 3rem;
  text-align: center;
}

.post-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1rem;
}

.post-meta {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

/* --- Secret Quote Styling --- */
/* 1. Hide the quote by default */
.quote-of-the-week {
  display: none;
}

/* 2. When it has the 'is-visible' class, show it */
/* This matches the minimalist design */
.quote-of-the-week.is-visible {
  display: block;
  border-left: 3px solid #ccc;
  margin: 2em 0;
  padding: 1em 1.5em;
  background-color: #f9f9f9;
  font-style: italic;
  border-radius: 5px;
}

.quote-of-the-week.is-visible blockquote {
  font-size: 1.25rem;
  margin: 0;
}

.quote-of-the-week.is-visible figcaption {
  text-align: right;
  font-style: normal;
  font-weight: 600;
  margin-top: 1em;
}

/* --- Photo Gallery Styling (Polaroids) --- */
.photo-gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  margin: 3em 0;
  padding: 1rem;
}

.photo-gallery img {
  width: 280px; /* Fixed width for polaroid feel */
  height: 320px; /* Include space for "writing" at bottom */
  object-fit: cover;
  padding: 10px 10px 60px 10px; /* Large bottom padding for polaroid look */
  background-color: white;
  box-shadow: 2px 5px 15px rgba(0,0,0,0.15);
  transition: var(--transition-smooth);
  border: 1px solid #f0f0f0;
  transform: rotate(var(--rotation, 0deg));
  cursor: pointer;
}

/* Simulate random rotations using nth-child */
.photo-gallery img:nth-child(odd) { --rotation: -2deg; }
.photo-gallery img:nth-child(even) { --rotation: 2deg; }
.photo-gallery img:nth-child(3n) { --rotation: 1deg; }
.photo-gallery img:nth-child(4n) { --rotation: -3deg; }

.photo-gallery img:hover {
  transform: scale(1.1) rotate(0deg);
  box-shadow: 0 20px 50px var(--shadow-strong);
  z-index: 10;
  position: relative;
}

/* --- Map Container --- */
#travel-map {
  box-shadow: 0 15px 40px var(--shadow-medium);
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  overflow: hidden;
  margin: 3em 0;
  transition: var(--transition-smooth);
}

#travel-map:hover {
  box-shadow: 0 20px 60px var(--shadow-strong);
  transform: translateY(-5px);
}

#travel-map.leaflet-container {
  background: #e8ecf1;
  font-family: inherit;
  border-radius: 17px;
}

#travel-map .leaflet-popup-content-wrapper {
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
}

/* --- Typography --- */
h1, h2, h3 {
  font-family: 'Playfair Display', serif;
  color: var(--text-dark);
  line-height: 1.3;
  font-weight: 700;
}

h2 {
  font-size: 2.2rem;
  margin-top: 2em;
  margin-bottom: 1em;
  border-bottom: 3px solid var(--sunset-orange);
  padding-bottom: 0.5em;
}

h3 {
  font-size: 1.8rem;
  margin-top: 1.5em;
  margin-bottom: 0.8em;
  font-weight: 600;
}

p {
  margin-bottom: 1.5em;
  text-align: justify;
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-dark);
}

a {
  color: var(--sunset-orange);
  text-decoration: none;
  transition: var(--transition-smooth);
}

a:hover {
  color: var(--terracotta);
}

/* --- Footer --- */
.site-footer {
  text-align: center;
  padding: 3rem 2rem;
  margin-top: 5rem;
  color: var(--text-medium);
  font-size: 0.95rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
}

/* --- Responsive Design --- */

@media (max-width: 768px) {
  .glass-nav {
    padding: 0.75rem 1rem;
  }
  
  .nav-container {
    padding: 0.5rem 1rem;
  }
  
  .nav-logo {
    font-size: 1.25rem;
  }
  
  .nav-links {
    gap: 1rem;
  }
  
  .hero-header {
    padding: 2rem 1.5rem 1.5rem;
    margin-top: 70px;
  }
  
  .card-image-wrapper {
    height: 280px;
  }
  
  .journal-card {
    height: 580px;
  }
  
  .main-content {
    padding: 1rem;
  }
  
  .photo-gallery {
    grid-template-columns: 1fr;
  }
  
  .photo-gallery img {
    height: 250px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-header {
    padding: 1.5rem 1rem 1rem;
  }
  
  .card-content {
    padding: 1.5rem;
  }
  
  .card-title {
    font-size: 1.5rem;
  }
  
  .card-image-wrapper {
    height: 250px;
  }
  
  .journal-card {
    height: 530px;
  }
  
  .card-meta {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* --- Smooth Scrollbar --- */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--warm-beige);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--sunset-orange), var(--terracotta));
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--terracotta), var(--sunset-orange));
}

/* --- Enhanced Footer --- */
.site-footer {
  text-align: center;
  padding: 4rem 2rem 2rem;
  margin-top: 5rem;
  color: var(--text-dark);
  font-size: 0.95rem;
  border-top: 1px dashed rgba(0, 0, 0, 0.1); /* Dashed line for journal feel */
  background: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%239C92AC' fill-opacity='0.05' fill-rule='evenodd'%3E%3Ccircle cx='3' cy='3' r='3'/%3E%3Ccircle cx='13' cy='13' r='3'/%3E%3C/g%3E%3C/svg%3E");
}

.footer-content {
  max-width: 900px;
  margin: 0 auto 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  text-align: left;
}

.footer-about h3, .footer-links h3 {
  font-family: 'Caveat', cursive;
  font-size: 1.8rem;
  color: var(--terracotta);
  margin-top: 0;
  margin-bottom: 1rem;
  border: none; /* Override h2/h3 border */
}

.footer-about p {
  font-size: 1rem;
  line-height: 1.6;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  font-family: 'Caveat', cursive;
  font-size: 1.4rem;
  color: var(--text-dark);
}

.footer-links a:hover {
  color: var(--sunset-orange);
  transform: translateX(5px);
  display: inline-block;
}

.copyright {
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--text-medium);
  font-family: 'Inter', sans-serif;
}

@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }
  
  .footer-links {
    align-items: center;
  }
}
