@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap');

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

body {
  font-family: 'Montserrat', sans-serif;
  background-color: #5a7a50;
  background-image: url('../assets/bg.png');
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
  color: #222;
  line-height: 1.7;
}

@media (max-width: 600px) {
  body {
    background-image: none;
  }

  body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../assets/background-image-mobile.jpg');
    background-size: cover;
    background-position: center;
    z-index: -1;
  }
}

a {
  color: #c0392b;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ===========================
   Header / Navigation
   =========================== */
header {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

header .container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header .site-brand {
  display: flex;
  flex-direction: column;
  gap: 0px;
}

header .site-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: #222;
  line-height: 1.1;
}

header .site-tagline {
  font-size: 0.7rem;
  color: #777;
  font-weight: 400;
}

header nav a {
  margin-left: 20px;
  font-size: 0.95rem;
  color: #555;
}

.menu-toggle {
  display: none;
}

.scroll-top-btn {
  display: none;
}

/* ===========================
   Main Content Area
   =========================== */
main {
  max-width: 720px;
  margin: 40px auto;
  padding: 32px 40px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

/* ===========================
   Hero / Intro Section
   =========================== */
.hero {
  margin-bottom: 50px;
  text-align: center;
}

.hero h1 {
  font-size: 2.2rem;
  margin-bottom: 10px;
}

.hero p {
  font-size: 1.1rem;
  color: #555;
}

.search-bar {
  position: relative;
  margin-top: 20px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #555;
  pointer-events: none;
}

#search-input {
  width: 100%;
  padding: 12px 20px 12px 42px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 40px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #222;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

#search-input::placeholder {
  color: #aaa;
}

#search-input:focus {
  border-color: rgba(0, 0, 0, 0.2);
  background: rgba(255, 255, 255, 0.7);
}

@media (max-width: 600px) {
  .search-bar {
    max-width: 100%;
  }
}

/* ===========================
   Category Tabs (Homepage)
   =========================== */
.tabs-wrapper {
  position: relative;
  margin-bottom: 40px;
}

.tabs-wrapper::after {
  content: '›';
  position: absolute;
  top: 0;
  right: 0;
  width: 64px;
  height: 100%;
  background: none;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  font-size: 1.4rem;
  color: rgba(0, 0, 0, 0.35);
}

.tabs-wrapper.can-scroll-right::after {
  opacity: 1;
}

.category-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 0;
  padding-bottom: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  background: none;
  border: none;
  padding: 10px 16px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #aaa;
  cursor: pointer;
  transition: color 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.tab-btn:hover {
  color: #c0392b;
}

.tab-btn.active {
  color: #c0392b;
  box-shadow: inset 0 -2px 0 #c0392b;
}

/* ===========================
   Category Sections (Homepage)
   =========================== */
.category-section {
  margin-bottom: 0;
}

.category-heading {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #aaa;
  border-bottom: 2px solid #eee;
  padding-bottom: 8px;
  margin-bottom: 0;
}

/* ===========================
   Post List (Homepage)
   =========================== */
.post-list {
  list-style: none;
}

.post-list li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  padding: 16px 0;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.post-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.post-text {
  flex: 1;
}

.post-list .post-title {
  font-size: 1.4rem;
  margin-bottom: 6px;
}

.post-list .post-meta {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 6px;
}

.post-list .post-excerpt {
  color: #444;
  margin-bottom: 12px;
}

.read-more {
  font-size: 0.9rem;
  font-weight: bold;
}

/* ===========================
   Breadcrumb
   =========================== */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 0.78rem;
  color: #aaa;
  margin-bottom: 20px;
}

.breadcrumb a {
  color: #aaa;
  text-decoration: none;
}

.breadcrumb a:hover {
  color: #c0392b;
  text-decoration: underline;
}

.bc-sep {
  color: #ccc;
}

.bc-current {
  color: #555;
}

/* ===========================
   Single Post Page
   =========================== */
.post-header {
  margin-bottom: 30px;
}

.post-header h1 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.post-header .post-meta {
  font-size: 0.85rem;
  color: #888;
}

.post-content p {
  margin-bottom: 20px;
  font-size: 1.05rem;
}

.post-content h2 {
  font-size: 1.4rem;
  margin: 35px 0 15px;
}

.post-content ul,
.post-content ol {
  padding-left: 1.5em;
  margin-bottom: 20px;
}

.post-content li {
  margin-bottom: 6px;
}

.post-content blockquote {
  border-left: 4px solid #c0392b;
  padding-left: 16px;
  margin: 25px 0;
  color: #555;
  font-style: italic;
}

.post-content img {
  width: 100%;
  height: auto;
  margin: 16px 0;
  border-radius: 4px;
}

.back-link {
  display: inline-block;
  margin-top: 40px;
  font-size: 0.9rem;
}

/* ===========================
   Postcards Grid
   =========================== */
.main-full {
  max-width: 100%;
  margin: 40px;
  padding: 0;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.main-full .post-header .post-meta {
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

@media (max-width: 600px) {
  .main-full .post-header .post-meta {
    color: #222;
    text-shadow: none;
  }
}

.postcards-grid {
  columns: 4;
  column-gap: 12px;
}

@media (max-width: 600px) {
  .main-full {
    margin: 16px;
  }
}


.postcard {
  break-inside: avoid;
  margin-bottom: 12px;
  border-radius: 8px;
  cursor: pointer;
}

.postcard {
  perspective: 900px;
}

.postcard-inner {
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.65s ease;
  border-radius: 8px;
}

.postcard-inner.flipped {
  transform: rotateY(180deg);
}

.postcard-front,
.postcard-back {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 8px;
}

.postcard-front img {
  width: 100%;
  display: block;
  border-radius: 8px;
}

.postcard-back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
  background: #fffef8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
}

.pc-city {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #bbb;
}

.pc-note {
  font-family: 'Caveat', cursive;
  font-size: 1.1rem;
  line-height: 1.6;
  color: #444;
  text-align: center;
  margin: 0;
}

@media (max-width: 600px) {
  .postcards-grid {
    columns: 2;
  }
}


/* ===========================
   Social Links (About page)
   =========================== */
.social-links {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.social-icon {
  color: #555;
  transition: color 0.2s;
}

.social-icon:hover {
  color: #c0392b;
  text-decoration: none;
}

/* ===========================
   Responsive — Mobile
   =========================== */
@media (max-width: 600px) {
  header {
    padding: 12px 0;
  }

  header {
    position: relative;
  }

  header .container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 0;
  }

  header .site-brand {
    align-items: flex-start;
    text-align: left;
  }

  header .site-title {
    font-size: 1.2rem;
  }

  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #222;
    cursor: pointer;
    padding: 4px 0;
    line-height: 1;
  }

  header nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.6);
    flex-direction: column;
    padding: 8px 20px 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    gap: 0;
  }

  header nav.open {
    display: flex;
  }

  header nav a {
    margin-left: 0;
    padding: 12px 0;
    font-size: 1rem;
    color: #333;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  }

  header nav a:last-child {
    border-bottom: none;
  }

  main {
    margin: 16px;
    padding: 24px 20px;
    border-radius: 6px;
  }

  .hero h1 {
    font-size: 1.6rem;
  }

  .post-list .post-title {
    font-size: 1.1rem;
  }

  .post-thumb {
    width: 64px;
    height: 64px;
  }

  p, .post-excerpt {
    line-height: 1.5;
  }

  .post-header h1 {
    line-height: 1.3;
  }

  .pc-note {
    line-height: 1.3;
  }

  .scroll-top-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: 24px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    font-size: 1.2rem;
    color: #222;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
    z-index: 200;
  }

  .scroll-top-btn.visible {
    opacity: 1;
    pointer-events: auto;
  }
}

/* ===========================
   Footer — sticky bottom when searching (desktop)
   =========================== */
body.is-searching {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body.is-searching footer {
  margin-top: auto;
}

footer {
  text-align: center;
  padding: 30px 20px;
  margin-top: 60px;
  font-size: 0.85rem;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}
