:root {
  --paper: #fff9f2;
  --ink: #22211f;
  --accent: #ff7a59;
  --accent-2: #2ca58d;
  --line: #e9ddcf;
  --card: rgba(255, 255, 255, 0.85);
  --shadow: 0 14px 36px rgba(62, 45, 29, 0.14);
  --radius-xl: 28px;
  --radius-lg: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

img {
  max-width: 100%;
  height: auto;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, #ffe8cf 0%, transparent 38%),
    radial-gradient(circle at 90% 20%, #d2f2ea 0%, transparent 34%),
    linear-gradient(160deg, #fffdf9, var(--paper));
  color: var(--ink);
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  padding: 28px;
  overflow-x: hidden;
}

.bg-shape {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(14px);
  opacity: 0.35;
}

.bg-shape--one {
  width: 240px;
  height: 240px;
  background: #ff9f80;
  top: -60px;
  right: -50px;
}

.bg-shape--two {
  width: 280px;
  height: 280px;
  background: #97ddcc;
  bottom: -130px;
  left: -80px;
}

.topbar {
  max-width: 1180px;
  margin: 0 auto 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.brand {
  margin: 0;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: 0.02em;
  text-transform: lowercase;
}

.brand span {
  color: var(--accent);
  font-style: italic;
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.icon-btn {
  border: 1px solid var(--line);
  background: #ffffffd9;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.icon-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(35, 33, 30, 0.1);
}

.layout {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 22px;
}

.profile-card,
.gallery-section {
  background: var(--card);
  border: 1px solid #ffffff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

.profile-card {
  padding: 22px;
  position: sticky;
  top: 20px;
  height: fit-content;
  animation: rise 0.7s ease both;
}

.profile-main {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 6px 16px rgba(44, 165, 141, 0.3);
  flex-shrink: 0;
}

.profile-info {
  min-width: 0;
}

.profile-info h2 {
  margin: 4px 0 6px;
  font-size: 0.9rem;
}

.handle {
  margin: 0;
  color: #6c6257;
}

.bio {
  margin: 0;
  line-height: 1.6;
  font-size: 0.95rem;
}

.profile-stats {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  text-align: center;
}

.profile-stats strong {
  display: block;
  font-size: 1.2rem;
}

.profile-stats span {
  color: #756c63;
  font-size: 0.8rem;
}

.gallery-section {
  padding: 18px;
  animation: rise 0.8s 0.1s ease both;
}

.site-footer {
  max-width: 1180px;
  margin: 20px auto 0;
  padding: 16px;
  border: 1px solid #f3e7dc;
  border-radius: var(--radius-lg);
  background: #ffffffbf;
  box-shadow: 0 8px 22px rgba(55, 42, 29, 0.08);
}

.site-footer-title {
  margin: 0 0 10px;
  font-size: 1rem;
}

.site-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.site-links a {
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid #e7d7c7;
  background: #fff;
  color: #5c544b;
  text-decoration: none;
  font-size: 0.82rem;
}

.site-links a:hover {
  background: #fff7f0;
  text-decoration: underline;
  text-underline-offset: 0.14em;
}

.stories {
  display: flex;
  gap: 14px;
  padding: 2px 2px 16px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.story {
  min-width: 72px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  font-size: 0.78rem;
  color: #5d564e;
}

.story-ring {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent), #ffc36c, var(--accent-2));
  padding: 3px;
}

.story img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid #fff;
  object-fit: cover;
}

.gallery-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: end;
  margin-bottom: 14px;
}

.search-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
  max-width: 100%;
  color: #6f665c;
}

#searchInput {
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 11px 14px;
  background: #fff;
  font: inherit;
}

#searchInput:focus {
  outline: 2px solid #ffd2b8;
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid #e7d7c7;
  background: #fff;
  color: #5c544b;
  border-radius: 100px;
  padding: 8px 13px;
  font-size: 0.85rem;
  cursor: pointer;
}

.chip.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(120deg, var(--accent), #ff9f62);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.post-card {
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid #f3e7dc;
  box-shadow: 0 8px 22px rgba(55, 42, 29, 0.08);
  animation: rise 0.5s ease both;
}

.post-image {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  cursor: pointer;
}

.post-body {
  padding: 10px 12px 12px;
}

.post-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  gap: 8px;
  height: 110px;
}

.post-title {
  margin: 0;
  font-size: 0.76rem;
}

.post-title a,
.lightbox-caption h3 a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.post-date {
  color: #7a7168;
  font-size: 0.77rem;
}

.post-tags {
  margin: 0;
  color: #7a7168;
  font-size: 0.82rem;
}

.post-link {
  margin: 8px 0 0;
  font-size: 0.8rem;
  line-height: 1.4;
}

.post-link a {
  color: #2a8473;
  text-decoration: none;
}

.post-link a:hover {
  text-decoration: underline;
  text-underline-offset: 0.14em;
}

.post-thumbs {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.post-thumb-btn {
  border: 1px solid #eddccb;
  border-radius: 8px;
  padding: 0;
  background: #fff;
  cursor: pointer;
  flex: 0 0 auto;
}

.post-thumb-image {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 7px;
  display: block;
}

.post-actions {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.like-btn,
.save-btn {
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: #4f4841;
  padding: 4px;
}

.like-btn.liked {
  color: #df3a50;
}

.save-btn.saved {
  color: #2a8473;
}

.lightbox {
  width: min(850px, 94vw);
  border: none;
  border-radius: 20px;
  padding: 0;
  overflow: hidden;
  background: #fff;
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.62);
}

.lightbox img {
  width: 100%;
  max-height: 85vh;
  object-fit: contain;
  display: block;
}

.lightbox-caption {
  padding: 14px 16px 18px;
}

.lightbox-caption h3 {
  margin: 0 0 4px;
}

.lightbox-caption p {
  margin: 0;
  color: #645a51;
}

.lightbox-post-link {
  margin: 4px !important;

  font-size: 0.9rem;
}

.lightbox-post-link a {
  color: #2a8473;
  text-decoration: none;
}

.lightbox-post-link a:hover {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.lightbox-counter {
  margin-top: 8px;
  font-size: 0.86rem;
  color: #8a8076;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  color: #fff;
  background: rgba(0, 0, 0, 0.36);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-prev {
  left: 12px;
}

.lightbox-next {
  right: 12px;
}

.close-lightbox {
  position: absolute;
  right: 12px;
  top: 10px;
  z-index: 3;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  color: #fff;
  background: rgba(0, 0, 0, 0.44);
  font-size: 1.4rem;
  cursor: pointer;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  body {
    padding: 20px 14px 24px;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .profile-card {
    position: static;
  }
}

@media (max-width: 560px) {
  body {
    padding: 12px 10px 18px;
  }

  .topbar {
    align-items: flex-start;
  }

  .brand {
    min-width: 0;
    font-size: clamp(1.55rem, 8.8vw, 2.1rem);
    line-height: 1.08;
  }

  .topbar-actions {
    flex-shrink: 0;
  }

  .profile-main {
    align-items: flex-start;
    gap: 12px;
  }

  .search-wrap {
    min-width: 0;
    width: 100%;
  }

  #searchInput {
    width: 100%;
  }

  .avatar {
    width: 82px;
    height: 82px;
  }

  .profile-info h2 {
    font-size: 1.12rem;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .story {
    min-width: 68px;
  }

  .site-links a {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
}

.link-page-main {
  max-width: 1180px;
  margin: 0 auto;
}

.link-page-nav {
  max-width: 1180px;
  margin: 0 auto 12px;
}

.back-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid #e7d7c7;
  background: #fff;
  color: #5c544b;
  text-decoration: none;
  font-size: 0.85rem;
}

.back-home-btn:hover {
  background: #fff7f0;
}

.link-page-footer {
  max-width: 1180px;
  margin: 12px auto 0;
  padding-bottom: 12px;
  display: flex;
  justify-content: flex-end;
}

.back-top-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid #e7d7c7;
  background: #fff;
  color: #5c544b;
  text-decoration: none;
  font-size: 0.85rem;
}

.back-top-btn:hover {
  background: #fff7f0;
}

.link-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.deal-card {
  background: #fff;
  border: 1px solid #f3e7dc;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 22px rgba(55, 42, 29, 0.08);
  padding: 10px;
  font-size: 12px;
  word-break: break-word;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.deal-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 26px rgba(55, 42, 29, 0.13);
}

.deal-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.deal-image {
  width: 100%;
  border: 0;
  border-radius: var(--radius-sm);
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
}

.deal-title {
  display: -webkit-box;
  margin-top: 8px;
  text-align: left;
  line-height: 1.5;
  min-height: 3em;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.deal-meta {
  margin: 7px 0 0;
  color: #8c8c8c;
  font-size: 10px;
}

.deal-price {
  margin: 4px 0 0;
  color: #c00;
  font-weight: 700;
}

/* Fallback for legacy blocks that still use inline markup inside link pages. */
.link-gallery > div {
  background: #fff;
  border: 1px solid #f3e7dc;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 22px rgba(55, 42, 29, 0.08);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.link-gallery > div:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 26px rgba(55, 42, 29, 0.13);
}

.link-gallery > div > a {
  display: block !important;
  color: inherit;
  text-decoration: none;
}

.link-gallery > div > a > img {
  width: 100% !important;
  border-radius: var(--radius-sm);
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
}

.link-gallery > div > a > span {
  display: -webkit-box !important;
  margin-top: 8px !important;
  line-height: 1.5;
  min-height: 3em;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.link-gallery > div > p:first-of-type {
  margin: 7px 0 0 !important;
}

.link-gallery > div > p:last-of-type {
  margin: 4px 0 0 !important;
}

@media (max-width: 560px) {
  .link-gallery {
    grid-template-columns: 1fr 1fr;
  }
}
