:root {
  --bg: #fffaf2;
  --bg-soft: #fffdf8;
  --paper: #fffaf4;
  --paper-2: #fff6eb;
  --line: rgba(141, 127, 106, 0.12);
  --ink: #2d2a26;
  --muted: #6c6761;
  --accent: #ecd9b8;
  --accent-2: #f7eddc;
  --shadow: 0 16px 36px rgba(52, 41, 24, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  height: 100%;
}

body {
  min-height: 100dvh;
  height: 100dvh;
  overflow: hidden;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 8%, rgba(255, 255, 255, 0.95) 0 12%, transparent 13%),
    radial-gradient(circle at 92% 12%, rgba(255, 245, 226, 0.9) 0 14%, transparent 15%),
    linear-gradient(180deg, var(--bg-soft) 0%, #fff9ef 40%, #fff7eb 100%);
}

.journal-shell {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  height: 100dvh;
  padding: 0.75rem 0 0.9rem;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 0.55rem;
}

.blog-hero {
  padding: 0.15rem 0 0;
  text-align: center;
  padding-inline: 0.75rem;
}

.kicker {
  margin: 0 0 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.journal-layout {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  min-height: 0;
  height: 100%;
}

.journal-side {
  position: static;
  display: block;
  padding-inline: 0.75rem;
}

.side-card {
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(255, 248, 238, 0.96));
  border: 1px solid var(--line);
  padding: 0.7rem 0.8rem;
  box-shadow: var(--shadow);
}

.side-label {
  margin: 0 0 0.35rem;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.84rem;
}

.side-card p {
  margin: 0;
  line-height: 1.42;
  font-size: 0.86rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.side-list {
  margin: 0.55rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.side-list li {
  border: 1px solid rgba(220, 194, 152, 0.28);
  background: rgba(255, 252, 245, 0.9);
  border-radius: 999px;
  padding: 0.22rem 0.5rem;
}

.carousel-panel {
  min-width: 0;
  min-height: 0;
  height: 100%;
  border-radius: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 0;
  border-right: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 248, 237, 0.9));
  box-shadow: none;
  padding: 0.45rem 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0;
}

.carousel-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  padding: 0.2rem 0.75rem 0.65rem;
  text-align: center;
}

.panel-label {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.panel-sub {
  margin: 0.15rem 0 0;
  font-size: 0.92rem;
  font-weight: 600;
}

.carousel-controls {
  display: flex;
  gap: 0.45rem;
  width: 100%;
}

.ctrl-btn {
  flex: 1;
  border: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.95);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.58rem 0.8rem;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: background-color 120ms ease, transform 120ms ease;
}

.ctrl-btn:hover {
  background: #fff;
  transform: translateY(-1px);
}

.ctrl-btn.primary {
  background: linear-gradient(180deg, #fff6e9, #f8ecd9);
  border-color: rgba(220, 194, 152, 0.45);
}

.carousel-viewport {
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
  min-height: 0;
  height: 100%;
  border-radius: 0;
  border-top: 1px solid rgba(141, 127, 106, 0.1);
  border-bottom: 1px solid rgba(141, 127, 106, 0.1);
  border-left: 0;
  border-right: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 251, 244, 0.93)),
    repeating-linear-gradient(
      0deg,
      rgba(170, 150, 120, 0.03) 0 1px,
      transparent 1px 28px
    );
}

.carousel-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 260ms ease;
}

.entry-card {
  flex: 0 0 100%;
  width: 100%;
  min-height: 0;
  height: 100%;
  padding: 0.75rem;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 0.6rem;
  align-content: stretch;
}

.entry-top {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid rgba(141, 127, 106, 0.1);
}

.entry-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  min-width: 0;
  max-width: min(52vw, 260px);
}

.entry-stamps {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.35rem;
  min-width: 0;
}

.entry-top > :first-child {
  min-width: 0;
  flex: 1;
}

.entry-meta {
  margin: 0 0 0.35rem;
  color: #756653;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.63rem;
  font-weight: 700;
}

.entry-meta:empty {
  display: none;
}

.year-stamp {
  min-width: 52px;
  height: 32px;
  border-radius: 10px;
  border: 1px dashed rgba(171, 132, 73, 0.48);
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.85) 0 20%, transparent 21%),
    linear-gradient(180deg, rgba(255, 247, 230, 0.96), rgba(245, 231, 203, 0.95));
  color: #5f4a2e;
  padding: 0 0.45rem;
  display: inline-grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  font-family: "Newsreader", serif;
  font-size: 0.9rem;
  line-height: 1;
  letter-spacing: 0.08em;
}

.year-stamp.is-empty {
  min-width: 78px;
  font-family: "Manrope", sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  opacity: 0.8;
}

.entry-title {
  margin: 0;
  font-family: "Newsreader", serif;
  font-size: clamp(1.7rem, 8.8vw, 2.2rem);
  line-height: 0.98;
  word-break: break-word;
}

.entry-badge {
  align-self: center;
  min-width: 48px;
  height: 48px;
  padding: 0 0.5rem;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  background: linear-gradient(180deg, rgba(255, 248, 233, 0.95), rgba(247, 237, 216, 0.95));
  border: 1px solid rgba(220, 194, 152, 0.45);
  color: #5e5549;
  text-decoration: none;
}

.entry-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}

.entry-tab {
  border: 1px solid rgba(220, 194, 152, 0.35);
  background: rgba(255, 251, 243, 0.9);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.42rem 0.65rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.entry-tab.is-active {
  background: linear-gradient(180deg, #fff5e6, #f9edd8);
  color: var(--ink);
  border-color: rgba(220, 194, 152, 0.5);
}

.entry-grid {
  display: block;
  min-height: 0;
  height: 100%;
}

.entry-grid > * {
  min-width: 0;
}

.entry-story-block,
.entry-places-block {
  height: 100%;
  min-height: 0;
  border-radius: 14px;
  border: 1px solid rgba(141, 127, 106, 0.1);
  background: rgba(255, 253, 247, 0.78);
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
}

.entry-card[data-mobile-panel="story"] .entry-places-block {
  display: none;
}

.entry-card[data-mobile-panel="places"] .entry-story-block {
  display: none;
}

.entry-section-label {
  margin: 0 0 0.6rem;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.entry-story {
  margin: 0;
  padding-left: 0.95rem;
  display: grid;
  gap: 0.52rem;
  line-height: 1.42;
  font-size: 0.9rem;
  align-content: start;
}

.entry-story li::marker {
  color: rgba(92, 82, 69, 0.65);
  font-weight: 600;
}

.place-links {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.5rem;
  align-content: start;
}

.place-links a {
  display: block;
  text-decoration: none;
  color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 251, 243, 0.96), rgba(252, 244, 230, 0.96));
  border: 1px solid rgba(220, 194, 152, 0.33);
  border-radius: 11px;
  padding: 0.62rem 0.68rem;
  line-height: 1.32;
  font-size: 0.88rem;
  transition: transform 120ms ease, border-color 120ms ease, background-color 120ms ease;
}

.place-links a::before {
  content: "Открыть в Google Maps";
  display: block;
  margin-bottom: 0.18rem;
  font-size: 0.62rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.place-links a:hover {
  transform: translateY(-1px);
  border-color: rgba(216, 185, 139, 0.55);
  background: rgba(255, 252, 246, 1);
}

.carousel-footer {
  padding: 0.7rem 0.75rem 0.1rem;
}

.dot-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  overflow-x: auto;
  padding-bottom: 0.15rem;
  scrollbar-width: none;
  justify-content: center;
}

.dot-row::-webkit-scrollbar {
  display: none;
}

.dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: 0;
  background: rgba(123, 112, 98, 0.24);
  cursor: pointer;
  padding: 0;
  transition: transform 120ms ease, background-color 120ms ease;
}

.dot:hover {
  transform: scale(1.15);
  background: rgba(123, 112, 98, 0.42);
}

.dot.is-active {
  width: 20px;
  background: #dcc08d;
}

.entry-card:not([data-active]) {
  opacity: 0.96;
}

@media (min-width: 640px) {
  body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .journal-shell {
    height: auto;
    display: block;
    padding: 1.15rem 0.9rem 1.7rem;
  }

  .blog-hero {
    padding-bottom: 1rem;
    text-align: left;
    padding-inline: 0;
  }

  .kicker {
    font-size: 0.98rem;
  }

  .journal-layout {
    grid-template-rows: none;
    height: auto;
  }

  .journal-side {
    padding-inline: 0;
  }

  .side-card p {
    font-size: 0.93rem;
    display: block;
  }

  .side-list {
    margin: 0.7rem 0 0;
    padding-left: 1rem;
    list-style: disc;
    font-size: 0.9rem;
    line-height: 1.45;
    display: block;
    gap: 0;
  }

  .side-list li {
    border: 0;
    background: transparent;
    border-radius: 0;
    padding: 0;
  }

  .carousel-panel {
    border-radius: 24px;
    border: 1px solid var(--line);
    height: auto;
    padding: 0.8rem;
    display: block;
    box-shadow: var(--shadow);
  }

  .carousel-head {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
    padding: 0.3rem 0.15rem 0.75rem;
    text-align: left;
  }

  .carousel-controls {
    width: auto;
  }

  .ctrl-btn {
    flex: 0 0 auto;
    min-width: 86px;
    padding-inline: 0.95rem;
  }

  .carousel-viewport {
    border-radius: 18px;
    height: auto;
    border: 1px solid rgba(141, 127, 106, 0.1);
  }

  .entry-card {
    height: auto;
    padding: 1rem;
    gap: 0.9rem;
    grid-template-rows: auto auto 1fr;
  }

  .entry-top {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.9rem;
    padding-bottom: 0.8rem;
  }

  .entry-badge {
    min-width: 54px;
    height: 54px;
    border-radius: 15px;
  }

  .year-stamp {
    min-width: 58px;
    height: 34px;
    border-radius: 11px;
    font-size: 0.95rem;
  }

  .year-stamp.is-empty {
    min-width: 86px;
  }

  .entry-tabs {
    gap: 0.45rem;
  }

  .entry-tab {
    padding: 0.48rem 0.75rem;
    font-size: 0.85rem;
  }

  .entry-title {
    font-size: clamp(2rem, 5vw, 2.7rem);
  }

  .entry-meta {
    font-size: 0.72rem;
  }

  .entry-story-block,
  .entry-places-block {
    min-height: 0;
    display: block;
    border-radius: 16px;
    padding: 0.9rem;
  }

  .entry-section-label {
    font-size: 0.76rem;
    margin-bottom: 0.7rem;
  }

  .entry-story {
    font-size: 0.95rem;
    line-height: 1.48;
    gap: 0.6rem;
  }

  .place-links a {
    font-size: 0.94rem;
    padding: 0.75rem 0.82rem;
    border-radius: 13px;
  }

  .carousel-footer {
    padding-top: 0.8rem;
    padding-inline: 0.05rem;
  }

  .dot-row {
    gap: 0.42rem;
    justify-content: flex-start;
  }
}

@media (min-width: 860px) {
  .journal-shell {
    padding: 1.4rem 1rem 2rem;
  }

  .entry-card {
    min-height: clamp(480px, 62vh, 560px);
    padding: 1.1rem;
    grid-template-rows: auto 1fr;
  }

  .entry-tabs {
    display: none;
  }

  .entry-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 0.9rem;
  }

  .entry-card[data-mobile-panel="story"] .entry-places-block,
  .entry-card[data-mobile-panel="places"] .entry-story-block {
    display: block;
  }

  .entry-story-block,
  .entry-places-block {
    padding: 1rem;
  }
}

@media (min-width: 1080px) {
  .journal-shell {
    padding: 2rem 1rem 2.5rem;
  }

  .blog-hero {
    padding: 0.5rem 0 1.2rem;
  }

  .kicker {
    font-size: 1.05rem;
  }

  .journal-layout {
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
    gap: 1rem;
  }

  .journal-side {
    position: sticky;
    top: 1rem;
    display: block;
    padding-inline: 0;
  }

  .side-card {
    border-radius: 22px;
    padding: 1rem;
  }

  .side-label {
    font-size: 0.9rem;
  }

  .side-card p {
    font-size: 0.95rem;
    line-height: 1.45;
  }

  .carousel-panel {
    border-radius: 28px;
    padding: 0.9rem;
  }

  .carousel-head {
    padding: 0.35rem 0.2rem 0.8rem;
    gap: 1rem;
  }

  .panel-label {
    font-size: 0.8rem;
  }

  .panel-sub {
    font-size: 1rem;
    margin-top: 0.2rem;
  }

  .entry-card {
    padding: 1.25rem;
    gap: 1rem;
  }

  .entry-title {
    font-size: clamp(2.2rem, 4vw, 3rem);
  }

  .entry-grid {
    grid-template-columns: 1.35fr 1fr;
    gap: 1rem;
  }

  .entry-story-block,
  .entry-places-block {
    border-radius: 18px;
  }

  .entry-section-label {
    font-size: 0.82rem;
    letter-spacing: 0.12em;
  }

  .entry-story {
    font-size: 1rem;
    line-height: 1.52;
    gap: 0.7rem;
    padding-left: 1.05rem;
  }

  .place-links {
    gap: 0.65rem;
  }

  .place-links a {
    border-radius: 14px;
    padding: 0.8rem 0.9rem;
    line-height: 1.35;
    font-size: 0.98rem;
  }

  .place-links a::before {
    font-size: 0.7rem;
    letter-spacing: 0.13em;
    margin-bottom: 0.2rem;
  }

  .carousel-footer {
    padding: 0.85rem 0.2rem 0.15rem;
  }

  .dot-row {
    gap: 0.45rem;
  }

  .dot.is-active {
    width: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .carousel-track,
  .ctrl-btn,
  .place-links a,
  .dot {
    transition: none;
  }
}
