/* The Roast-o-scope. Loads after /styles.css and /assets/sitenav.css and only
   adds the horoscope page on top of the site's header/footer/tokens.
   Mobile first: one column of sign cards IS the layout; wider screens get a
   grid and more air. The masthead pieces (.section-mast, .section-blurb,
   .section-lead) come from /styles.css; the controls and the grid are both
   the lead, so on a phone the blurb trails the twelve signs. */

.scope-main {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: clamp(22px, 3.4vw, 40px) clamp(16px, 4vw, 48px) clamp(48px, 7vw, 96px);
}

/* --- today's sky, as chips --------------------------------------------- */

.sky-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.sky-strip li {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 6px 11px 5px;
  border: 2px solid var(--ink);
  background: var(--paper-light);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sky-strip .is-retro {
  background: var(--pink);
}

.sky-glyph {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  line-height: 1;
}

/* --- the controls -------------------------------------------------------- */

.scope-controls {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  gap: 14px;
  margin: clamp(20px, 3vw, 32px) 0 0;
  padding: 14px clamp(14px, 2.5vw, 22px) 12px;
  border: var(--border);
  background: var(--paper-light);
  box-shadow: var(--shadow);
}

.control-row {
  display: grid;
  gap: 8px;
}

.control-label,
.control-note {
  margin: 0;
  font-size: 0.62rem;
  font-weight: 950;
  letter-spacing: 0.16em;
}

.control-note {
  min-height: 1.2em;
  color: #594f45;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.86rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.pick-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.pick-group--dose {
  /* four doses: two by two on a phone; one row once there's room */
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
}

.pick {
  padding: 11px 10px 10px;
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--ink);
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.08s ease;
}

.pick:hover {
  background: var(--orange);
}

.pick[aria-pressed="true"] {
  background: var(--pink);
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

.pick[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.sign-jump {
  /* twelve glyphs spread edge to edge across the panel */
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 2px 2px 6px;
}

.sign-jump a {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 2px solid var(--ink);
  background: var(--paper-light);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
  line-height: 1;
  text-decoration: none;
  box-shadow: 2px 2px 0 var(--ink);
}

.sign-jump a:hover,
.sign-jump a:focus-visible {
  background: var(--orange);
}

/* the sign's name, the instant the pointer lands (no browser title delay) */
.sign-jump a::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 7px);
  left: 50%;
  z-index: 30;
  padding: 5px 8px 4px;
  background: var(--ink);
  color: var(--paper-light);
  font-family: "Arial Narrow", "Franklin Gothic Medium", Arial, sans-serif;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%);
}

.sign-jump a:first-child::after { left: 0; transform: none; }
.sign-jump a:last-child::after { left: auto; right: 0; transform: none; }

.sign-jump a:hover::after,
.sign-jump a:focus-visible::after {
  opacity: 1;
}

@media (hover: none) {
  .sign-jump a::after { display: none; }
}

/* --- the twelve ---------------------------------------------------------- */

.scope-grid {
  display: grid;
  gap: clamp(16px, 2.5vw, 26px);
  margin: clamp(24px, 4vw, 40px) 0 0;
  padding: 0;
  list-style: none;
}

.sign-card {
  /* room for the sticky controls when jumping by anchor */
  scroll-margin-top: 230px;
  display: grid;
  grid-template-rows: auto 1fr;
  border: var(--border);
  background: white;
  box-shadow: var(--shadow);
}

.card-head {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px 18px 12px;
  border-bottom: 2px solid var(--ink);
  background: var(--paper-light);
}

.card-glyph {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 3px 3px 0 var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  line-height: 1;
}

.card-head h2 {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0;
  font-size: 1.35rem;
  font-weight: 950;
  letter-spacing: -0.04em;
  line-height: 1;
  text-transform: uppercase;
}

.card-season {
  padding: 3px 6px 2px;
  border: 2px solid var(--ink);
  background: var(--pink);
  font-size: 0.55rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  transform: rotate(-2deg);
}

.card-meta {
  margin: 5px 0 0;
  color: #594f45;
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.card-body {
  padding: 18px clamp(16px, 2.5vw, 24px) 20px;
}

.reading p {
  margin: 0 0 1em;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 1.3vw, 1.08rem);
  line-height: 1.58;
  overflow-wrap: anywhere;
}

.reading p:last-child {
  margin-bottom: 0;
}

.reading .five {
  font-family: "Arial Narrow", "Franklin Gothic Medium", Arial, sans-serif;
  font-size: clamp(1.5rem, 2.4vw, 1.95rem);
  font-weight: 950;
  letter-spacing: -0.04em;
  line-height: 1.05;
  text-transform: uppercase;
  text-wrap: balance;
}

.reading .liner {
  font-size: clamp(1.15rem, 1.7vw, 1.35rem);
  line-height: 1.4;
  text-wrap: balance;
}

.dodont {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 2px dashed rgba(23, 19, 15, 0.35);
}

.dodont-h {
  display: inline-block;
  margin: 0 0 8px;
  padding: 3px 8px 2px;
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  font-size: 0.62rem;
  font-weight: 950;
  letter-spacing: 0.14em;
  transform: rotate(-2deg);
}

.dodont-h--do { background: var(--green); color: white; }
.dodont-h--dont { background: var(--pink); }

.dodont ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.dodont li {
  padding: 7px 0;
  border-top: 1px solid rgba(23, 19, 15, 0.18);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.98rem;
  line-height: 1.35;
}

.reading-missing {
  color: #594f45;
  font-style: italic;
}

/* Five Words wants a tighter, punchier grid than the paragraphs do. */
body[data-dose="five"] .scope-grid {
  gap: 12px;
}

body[data-dose="five"] .card-body {
  padding-top: 14px;
  padding-bottom: 16px;
}

/* --- sign-off, sky table, fine print ------------------------------------- */

.scope-signoff {
  margin: clamp(30px, 5vw, 52px) 0 0;
  text-align: center;
}

.scope-signoff span {
  display: inline-block;
  padding: 10px 18px 9px;
  border: 3px solid var(--ink);
  background: var(--orange);
  box-shadow: 6px 6px 0 var(--ink);
  font-size: 1.1rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  transform: rotate(-2.5deg);
}

.sky-table {
  margin: clamp(30px, 5vw, 52px) 0 0;
  border: 2px solid var(--ink);
  background: var(--paper-light);
  box-shadow: 4px 4px 0 var(--ink);
}

.sky-table summary {
  padding: 13px 16px 12px;
  font-size: 0.7rem;
  font-weight: 950;
  letter-spacing: 0.14em;
  cursor: pointer;
}

.sky-table summary:hover {
  background: var(--orange);
}

.sky-sub {
  display: block;
  margin-top: 4px;
  color: #594f45;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: none;
}

.sky-grid {
  display: grid;
  gap: 18px;
  padding: 6px 16px 18px;
  border-top: 2px solid var(--ink);
}

.sky-grid table {
  width: 100%;
  border-collapse: collapse;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.95rem;
}

.sky-grid th,
.sky-grid td {
  padding: 6px 4px;
  border-bottom: 1px solid rgba(23, 19, 15, 0.18);
  text-align: left;
}

.sky-grid th {
  font-weight: 700;
}

.sky-grid abbr {
  color: var(--pink-dark);
  text-decoration: none;
}

.sky-h {
  margin: 12px 0 8px;
  font-size: 0.62rem;
  font-weight: 950;
  letter-spacing: 0.16em;
}

.aspect-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.95rem;
  line-height: 1.6;
}

.aspect-list em {
  color: var(--pink-dark);
  font-style: normal;
  font-weight: 700;
}

.aspect-list .orb {
  color: #594f45;
  font-size: 0.85rem;
}

/* --- how the sausage is made --------------------------------------------- */

.method-panel {
  margin-top: 14px;
}

.method-body {
  max-width: 760px;
  padding: 4px 16px 18px;
  border-top: 2px solid var(--ink);
}

.method-body p {
  margin: 14px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.95rem;
  line-height: 1.6;
}

.method-body strong {
  display: block;
  margin-bottom: 3px;
  font-family: "Arial Narrow", "Franklin Gothic Medium", Arial, sans-serif;
  font-size: 0.66rem;
  font-weight: 950;
  letter-spacing: 0.14em;
  color: var(--pink-dark);
}

.scope-fineprint a {
  color: inherit;
  font-weight: 700;
}

.scope-fineprint {
  max-width: 700px;
  margin: 22px 0 0;
  color: #594f45;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.86rem;
  line-height: 1.5;
}

/* --- yesterday / tomorrow, archive ---------------------------------------- */

.scope-pager {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: clamp(26px, 4vw, 40px) 0 0;
}

.scope-pager-link,
.scope-crumb a,
.archive-link {
  color: var(--ink);
  font-size: 0.66rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-decoration: none;
}

.scope-pager-link {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  border: 2px solid var(--ink);
  background: var(--paper-light);
  box-shadow: 3px 3px 0 var(--ink);
}

.scope-pager-link:hover {
  background: var(--orange);
}

.scope-pager-link.is-empty {
  display: none;
}

.scope-pager-label {
  font-size: 0.6rem;
  letter-spacing: 0.14em;
}

.scope-pager-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.92rem;
  font-weight: 400;
  letter-spacing: 0;
}

.scope-crumb {
  margin: 26px 0 0;
}

.archive-list {
  margin: clamp(20px, 3vw, 32px) 0 0;
  padding: 0;
  list-style: none;
  border: var(--border);
  background: var(--paper-light);
  box-shadow: var(--shadow);
}

.archive-item + .archive-item {
  border-top: 2px solid var(--ink);
}

.archive-link {
  display: grid;
  gap: 5px;
  padding: 16px clamp(14px, 3vw, 24px);
}

.archive-link:hover {
  background: var(--orange);
}

.archive-date {
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.archive-sky,
.archive-methods {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.88rem;
  font-weight: 400;
  letter-spacing: 0;
  color: #594f45;
}

/* --- wider screens -------------------------------------------------------- */

@media (min-width: 620px) {
  .scope-controls {
    grid-template-columns: 1.4fr 1fr;
    column-gap: 22px;
  }

  .sign-jump {
    grid-column: 1 / -1;
  }

  .pick-group {
    grid-template-columns: repeat(3, 1fr);
  }

  .pick-group--dose {
    grid-template-columns: repeat(4, 1fr);
  }

  .scope-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sign-card {
    scroll-margin-top: 190px;
  }

  .scope-pager {
    grid-template-columns: 1fr 1fr;
  }

  .scope-pager-link.is-next {
    text-align: right;
  }

  .scope-pager-link.is-empty {
    display: block;
    visibility: hidden;
  }

  .sky-grid {
    grid-template-columns: 1fr 1.3fr;
  }

  .archive-link {
    grid-template-columns: auto 1fr auto;
    align-items: baseline;
    gap: 16px;
  }
}

@media (min-width: 1000px) {
  .scope-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body[data-dose="full"] .scope-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-dose="five"] .scope-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  body[data-dose="liner"] .scope-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .scope-controls {
    /* on a phone the panel is tall; let it scroll away instead of eating the screen */
    position: static;
    box-shadow: 5px 5px 0 var(--ink);
  }

  /* twelve glyphs don't fit one phone-width row: six and six, still spread */
  .sign-jump {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    justify-items: center;
    row-gap: 10px;
  }

  .sign-card {
    scroll-margin-top: 12px;
    box-shadow: 6px 6px 0 var(--ink);
  }

  .scope-signoff span {
    box-shadow: 4px 4px 0 var(--ink);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pick {
    transition: none;
  }
}
