/* =====================================================================
   1333 publications - site-matched styling
   Palette and fonts follow the rest of 13 <33 Covenant.
   Class names are shared with magazine-viewer.js: do not rename
   .hidden .is-single .is-turning .is-zoomed .is-active .thumb
   .thumbs-open .fake-fullscreen .is-lookbook
   ===================================================================== */

@font-face {
  font-family: 'basiic';
  src: url(https://cinni.net/fonts/basiic.ttf);
  font-display: swap;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --purple-main: #C4A8E8;
  --purple-dark: #96799c;
  --purple-border: #9B6CD8;
  --purple-light: #c4a8e8;
  --purple-lighter: #e0ccf8;
  --text-dark: #322036;
  --mauve: #96799c;
  --teal: #84c4c4;
  --page-bg: #f8f4ff;
  --panel-bg: radial-gradient(circle, rgba(255,255,255,1) 58%, rgba(242,232,255,1) 85%, rgba(220,200,248,1) 100%);
  --chrome-bg: linear-gradient(180deg, #ede0ff 0%, #dcc8f8 40%, #ede0ff 100%);
  --display: 'basiic', 'MS UI Gothic', Arial, sans-serif;
  --body: 'MS UI Gothic', 'Segoe UI', Arial, sans-serif;
}

html, body { height: 100%; }

body {
  font-family: var(--body);
  font-size: 13px;
  color: var(--text-dark);
  background: var(--page-bg);
  min-height: 100vh;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
button, input { font: inherit; }

a { color: var(--mauve); text-decoration: none; font-weight: bold; }
a:hover { color: var(--text-dark); }

::selection { color: #fff; background: var(--mauve); }

::-webkit-scrollbar { width: 15px; height: 10px; }
::-webkit-scrollbar-thumb:vertical {
  background: linear-gradient(180deg, #c4a8e8, #96799c);
  border-top: 1px solid #ddc8f8; border-left: 1px solid #ddc8f8;
  border-right: 1px solid #96799c; border-bottom: 1px solid #96799c;
}
::-webkit-scrollbar-track { background: #f0e8ff; }

/* ---------------------------------------------------------------
   Site chrome: top nav, header panel, footer, floating glyphs
   --------------------------------------------------------------- */

.topnav {
  background: var(--chrome-bg);
  border: 2px solid var(--purple-border);
  border-top: none;
  border-radius: 0 0 16px 16px;
  box-shadow: 0 4px 18px rgba(107,40,200,0.2), inset 0 1px 0 rgba(255,255,255,0.7), inset 0 -1px 0 rgba(107,40,200,0.15);
  margin: 0 20px 14px;
  position: sticky; top: 0; z-index: 100;
}

.topnav ul {
  display: flex; justify-content: center; align-items: center;
  flex-wrap: wrap; gap: 2px; margin: 0; padding: 7px 15px; list-style: none;
}

.topnav a {
  color: var(--text-dark); text-align: center; padding: 6px 11px; display: inline-block;
  font-family: var(--body); font-size: 11px; font-weight: normal;
  letter-spacing: 1px; text-transform: uppercase; border-radius: 3px;
  transition: background 0.15s, color 0.15s;
}

.topnav a:hover { background: rgba(180,140,255,0.2); color: #1a0438; }
.topnav a.active { background: rgba(180,140,255,0.15); color: #1a0438; }

.header-title {
  background: linear-gradient(180deg, #ede0ff 0%, #dcc8f8 50%, #ede0ff 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 3px 14px rgba(107,40,200,0.15);
  padding: 14px 20px; color: var(--text-dark); text-align: center;
  border: 2px solid var(--purple-border); border-top: none;
  border-radius: 0 0 0 40px;
  margin-bottom: 18px;
}

.header-title h1 {
  font-family: var(--display);
  font-size: 26px; letter-spacing: 2px; margin-bottom: 6px; font-weight: normal;
}

.header-title p { font-size: 12px; opacity: 0.9; }

.site-footer {
  text-align: center; padding: 14px;
  background: linear-gradient(180deg, #ede0ff, #dcc8f8);
  border-top: 2px solid var(--purple-border);
  color: var(--text-dark); font-size: 11px; margin-top: 24px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}
.site-footer a { color: var(--text-dark); }
.site-footer a:hover { color: #1a0438; }
.footer-links { margin: 7px 0; }
.footer-links a { padding: 0 8px; font-size: 11px; border-right: 1px solid var(--purple-border); }
.footer-links a:last-child { border-right: none; }

.floating-element {
  position: fixed; font-size: 24px; opacity: 0.3; pointer-events: none;
  animation: float-drift 8s ease-in-out infinite; z-index: 0;
}
.float-1 { top: 20%; left: 5%; }
.float-2 { top: 60%; right: 5%; animation-delay: 2s; }
.float-3 { bottom: 15%; left: 50%; animation-delay: 4s; }
@keyframes float-drift {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(10deg); }
}

/* ---------------------------------------------------------------
   Landing page
   --------------------------------------------------------------- */

.landing-page { padding: 0 0 10px; position: relative; z-index: 1; }
.landing-panel { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

.landing-header {
  background: var(--panel-bg);
  border: 2px solid var(--purple-border);
  border-radius: 0 0 60px 0;
  padding: 18px 22px; margin-bottom: 18px; text-align: center;
}

.landing-title {
  font-family: var(--display);
  font-size: 20px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--text-dark); font-weight: normal; margin-bottom: 8px;
}

.landing-subtitle { font-size: 12px; line-height: 1.7; color: var(--purple-dark); }

.landing-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}

.issue-card {
  background: var(--panel-bg);
  border: 2px solid var(--purple-border);
  border-radius: 0 0 40px 0;
  padding: 16px;
  display: flex; flex-direction: column; align-items: center;
  box-shadow: 2px 2px 0 rgba(107,40,200,0.15);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.issue-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(155,108,216,0.35);
}

.issue-card.is-soon { opacity: 0.6; pointer-events: none; }

.issue-link {
  width: 100%; color: inherit; text-decoration: none; font-weight: normal;
  display: flex; flex-direction: column; align-items: center;
}

.issue-thumbnail {
  width: 100%; aspect-ratio: 3 / 4; object-fit: cover;
  border: 2px solid var(--purple-border);
  border-radius: 4px; margin-bottom: 14px;
  background: #efe6ff;
}

.issue-title {
  font-family: var(--display);
  font-weight: normal; font-size: 15px; letter-spacing: 1px;
  text-align: center; color: var(--text-dark); text-transform: uppercase;
}

.issue-meta {
  margin-top: 7px; font-size: 11px; letter-spacing: 1px;
  text-transform: uppercase; color: var(--teal); font-weight: bold;
}

.order-btn, .soon-label {
  margin-top: 14px; display: inline-block;
  font-family: var(--body); font-size: 10px;
  letter-spacing: 1px; text-transform: uppercase;
  padding: 8px 16px;
  border: 1px solid var(--purple-border);
  background: linear-gradient(180deg, rgba(224,208,248,0.96), rgba(150,121,156,0.92));
  color: var(--text-dark);
  text-shadow: 0 1px 0 rgba(255,255,255,0.5);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 2px 2px 0 rgba(107,40,200,0.15);
}

.order-btn:hover { box-shadow: 0 4px 15px rgba(203,169,244,0.5); color: #fff; }
.soon-label { opacity: 0.75; }

/* ---------------------------------------------------------------
   Reader / viewer
   --------------------------------------------------------------- */

.viewer-body { overflow: hidden; height: 100%; background: var(--page-bg); }

.loading-screen {
  position: fixed; inset: 0; z-index: 40;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--page-bg);
  transition: opacity 0.28s ease;
}

.loading-screen.hidden { opacity: 0; pointer-events: none; }

.loading-spinner {
  width: 38px; height: 38px;
  border: 3px solid rgba(155,108,216,0.25);
  border-top-color: var(--purple-border);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
  margin-top: 16px;
  font-family: var(--display);
  font-size: 14px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--text-dark);
}

.loading-track {
  width: min(240px, 60vw); height: 6px; margin-top: 18px;
  background: #e6d9fb;
  border: 1px solid var(--purple-border);
  border-radius: 99px; overflow: hidden;
}

.loading-bar {
  width: 0; height: 100%;
  background: linear-gradient(90deg, var(--purple-lighter), var(--mauve));
  transition: width 0.25s ease;
}

.topbar, .dock {
  position: fixed; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  background: var(--chrome-bg);
  border: 2px solid var(--purple-border);
  box-shadow: 0 4px 18px rgba(107,40,200,0.2), inset 0 1px 0 rgba(255,255,255,0.7);
}

.topbar {
  top: 0; left: 14px; right: 14px;
  justify-content: space-between;
  padding: 7px 12px;
  border-top: none;
  border-radius: 0 0 16px 16px;
}

.topbar-side { display: flex; align-items: center; gap: 8px; }

.viewer-title {
  font-family: var(--display);
  font-weight: normal; font-size: 15px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--text-dark);
}

.icon-btn, .home-btn {
  height: 34px;
  border: 1px solid var(--purple-border);
  border-radius: 3px;
  background: linear-gradient(180deg, #f2e8ff, #dcc8f8);
  color: var(--text-dark);
  display: grid; place-items: center;
  cursor: pointer; text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 1px 1px 0 rgba(107,40,200,0.15);
  text-shadow: 0 1px 0 rgba(255,255,255,0.5);
}

.icon-btn { width: 34px; font-size: 15px; }

.home-btn {
  width: auto; padding: 0 12px;
  font-family: var(--body); font-size: 10px;
  letter-spacing: 1px; text-transform: uppercase; font-weight: bold;
}

.icon-btn:hover, .home-btn:hover {
  background: linear-gradient(180deg, #fff, #e6d3fb);
  color: #1a0438;
}
.icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.stage {
  height: 100%;
  padding: 74px 12px 92px;
  display: grid; place-items: center;
  touch-action: none; user-select: none;
  cursor: grab;
}

.stage.is-zoomed { cursor: move; }

.spread {
  display: flex; align-items: center; justify-content: center;
  max-width: min(1480px, 100%); max-height: 100%;
  transform-origin: center center;
  transition: opacity 0.16s ease;
  filter: drop-shadow(0 10px 26px rgba(107,40,200,0.35));
}

.spread.is-turning { opacity: 0.55; }

.spread img {
  max-height: calc(100vh - 180px);
  width: auto; height: auto; object-fit: contain;
  background: #efe6ff;
  border: 2px solid var(--purple-border);
}

.spread img:first-child { border-radius: 4px 0 0 4px; border-right-width: 1px; }
.spread img:last-child { border-radius: 0 4px 4px 0; border-left-width: 1px; }
.spread.is-single img { border-radius: 4px; border-width: 2px; }
.spread img[hidden] { display: none; }

.is-lookbook .spread img { max-height: calc(100vh - 164px); }

.dock {
  left: 50%; bottom: 14px;
  transform: translateX(-50%);
  width: min(760px, calc(100% - 20px));
  padding: 8px 12px;
  border-radius: 16px;
  justify-content: center;
}

.page-slider { flex: 1; min-width: 80px; accent-color: var(--mauve); }

.page-counter {
  min-width: 92px; text-align: center;
  font-size: 11px; letter-spacing: 1px;
  color: var(--text-dark);
  font-variant-numeric: tabular-nums;
}

.thumbs {
  position: fixed; left: 12px; right: 12px; bottom: 76px; z-index: 19;
  display: none; gap: 8px; overflow-x: auto; padding: 10px;
  background: var(--chrome-bg);
  border: 2px solid var(--purple-border);
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(107,40,200,0.2);
}

.thumbs-open .thumbs { display: flex; }

.thumb {
  flex: 0 0 64px; width: 64px; height: 84px;
  border: 2px solid transparent;
  border-radius: 4px;
  background: #efe6ff center/cover no-repeat;
  cursor: pointer;
}

.thumb.is-active { border-color: var(--purple-border); }

.fake-fullscreen .topbar { top: 0; }
.fake-fullscreen .dock { bottom: 8px; }

@media (max-width: 720px) {
  .viewer-title { display: none; }
  .stage { padding: 66px 0 88px; }
  .spread img { max-height: calc(100vh - 160px); }
  .page-counter { min-width: 72px; font-size: 10px; }
  .icon-btn, .home-btn { height: 32px; }
  .icon-btn { width: 32px; font-size: 13px; }
  .home-btn { padding: 0 8px; font-size: 9px; }
}

/* Zoom controls sit in the top bar with the other viewer buttons. */
.zoom-sep {
  width: 1px; height: 20px; flex: 0 0 1px;
  background: var(--purple-border); opacity: 0.45;
}

@media (max-width: 480px) {
  /* Five chrome buttons plus two back links have to fit one 360px row. */
  .topbar { left: 6px; right: 6px; padding: 6px 8px; gap: 6px; }
  .topbar-side { gap: 6px; }
  .icon-btn { width: 30px; height: 30px; font-size: 13px; }
  .home-btn { height: 30px; padding: 0 7px; font-size: 8px; letter-spacing: 0.5px; }
  .zoom-sep { display: none; }
  .topnav { position: static; margin: 5px 8px; border-radius: 15px; border-top: 2px solid var(--purple-border); }
  .topnav ul { gap: 0; padding: 4px 6px; }
  .topnav a { padding: 9px 8px; font-size: 10px; letter-spacing: 0.5px; }
  .landing-panel { padding: 0 10px; }
}
