/* =========================
   Single article page theme
   (matches timeline palette)
   ========================= */

/* ---- Reset / base ---- */
*,
*::before,
*::after { box-sizing: border-box; }

/* ---- Theme variables (same 5 colors) ---- */
:root{
  --charcoal: #605b56ff;
  --atomic-tangerine: #ff7733ff;
  --muted-olive: #acc18aff;
  --wisteria-blue: #ADA8B6;
  --tea-green: #dafeb7ff;

  --radius: 18px;
}

html{
  height: 100%;
  overflow: hidden;
}

body{
  margin: 0;
  height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--charcoal);

  background:
    radial-gradient(900px 520px at 10% 8%, var(--atomic-tangerine), transparent 60%),
    radial-gradient(850px 520px at 88% 20%, var(--muted-olive), transparent 62%),
    radial-gradient(1100px 700px at 50% 92%, var(--wisteria-blue), transparent 64%),
    linear-gradient(180deg, var(--tea-green) 0%, var(--muted-olive) 55%, var(--wisteria-blue) 100%);

  overflow: hidden;
}

.wrap{
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 18px 44px;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

a{ color: inherit; }

.back{
  display: inline-flex;
  align-items: center;
  gap: 10px;

  align-self: flex-start;
  width: fit-content;
  margin-bottom: 16px;
  padding: 6px 10px;

  text-decoration: none;
  color: var(--charcoal);

  background: linear-gradient(180deg, var(--tea-green), var(--wisteria-blue));
  border: 2px solid var(--charcoal);
  border-radius: 999px;
}

.back:hover{
  border-color: var(--atomic-tangerine);
  background: linear-gradient(180deg, var(--tea-green), var(--muted-olive));
}

.article-shell{
  background: linear-gradient(180deg, var(--tea-green), var(--wisteria-blue));
  border: 2px solid var(--charcoal);
  border-radius: var(--radius);
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.article-scroll{
  height: 100%;
  padding: 18px;
  overflow-y: auto;
  overflow-x: hidden;
  overflow-wrap: anywhere;

  scrollbar-width: thin;
  scrollbar-color: var(--charcoal) var(--tea-green);
}

/* Pretty scrollbar (webkit) */
.article-scroll::-webkit-scrollbar{ width: 10px; }
.article-scroll::-webkit-scrollbar-track{
  background: var(--tea-green);
  border-radius: calc(var(--radius) - 6px);
  margin-block: 8px;
}
.article-scroll::-webkit-scrollbar-thumb{
  background: var(--charcoal);
  border-radius: 999px;
  border: 2px solid var(--tea-green);
}
.article-scroll::-webkit-scrollbar-thumb:hover{
  background: var(--atomic-tangerine);
}

h1{
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: .2px;
  color: var(--charcoal);
}

.meta{
  margin-bottom: 18px;
  color: var(--charcoal);
}

.meta span,
.meta time{
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--muted-olive);
  border: 2px solid var(--atomic-tangerine);
  color: var(--charcoal);
}

.hero{
  border-radius: calc(var(--radius) - 6px);
  overflow: hidden;
  margin: 16px 0 18px;

  border: 2px solid var(--charcoal);
  aspect-ratio: 16/9;

  background: var(--wisteria-blue);
}

.hero img{
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: cover;
  display: block;
}

p{
  line-height: 1.7;
  color: var(--charcoal);
}

/* Standalone images (not carousel) */
.article-scroll img{
  max-width: 70%;
  height: auto;
}

.carousel-slide img{
  max-width: 100%;
  width: 100%;
  height: 100%;
}

/* =========================
   Image viewer
   ========================= */
.viewer-open{
  overflow: hidden;
}

.viewer-target{
  cursor: zoom-in;
  transition: transform .15s ease, box-shadow .15s ease;
}

.viewer-target:hover{
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.image-viewer{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
}

.image-viewer[hidden]{
  display: none;
}

.image-viewer__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(13, 12, 10, 0.7);
  backdrop-filter: blur(4px);
}

.image-viewer__panel{
  position: relative;
  width: min(1100px, 92vw);
  height: min(80vh, 760px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  padding: 12px;
  border-radius: calc(var(--radius) + 6px);
  border: 2px solid var(--charcoal);
  background: linear-gradient(180deg, var(--tea-green), var(--wisteria-blue));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.image-viewer__top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 16px;
}

.image-viewer__stage{
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--radius) - 4px);
  border: 2px solid var(--charcoal);
  background: var(--wisteria-blue);
  touch-action: none;
}

.image-viewer__stage img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transform-origin: center center;
  will-change: transform;
}

.image-viewer__controls{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.image-viewer__btn{
  border: 2px solid var(--charcoal);
  background: var(--tea-green);
  color: var(--charcoal);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
}

.image-viewer__btn:hover{
  background: var(--muted-olive);
  border-color: var(--atomic-tangerine);
}

.image-viewer__btn:focus-visible{
  outline: 2px solid var(--atomic-tangerine);
  outline-offset: 2px;
}

.image-viewer__spacer{
  flex: 1 1 auto;
}

@media (max-width: 800px){
  .image-viewer__panel{
    height: 82vh;
  }
}
