/* Shared Current Work carousel
   Loaded after every selectable theme so component geometry remains consistent
   while colors and typography continue to come from the active theme. */

.now-module,
.now-module *,
.now-story-modal,
.now-story-modal * {
  box-sizing: border-box;
}

.now-module {
  --now-tile-width: clamp(210px, 23vw, 250px);
  --now-tile-height: 360px;
  padding: clamp(16px, 2.4vw, 24px);
  margin: 0 0 16px;
  background: linear-gradient(135deg, var(--card-bg, #fff), var(--progress-bg, #f2f2f2));
  border: 1px solid var(--border-color, rgba(0, 0, 0, .14));
  border-radius: var(--radius-lg, 18px);
  box-shadow: 0 8px 24px var(--shadow-color, rgba(0, 0, 0, .12));
  overflow: hidden;
}

.now-module-header {
  margin-bottom: 12px;
}

.now-module-header .eyebrow {
  display: inline-block;
  margin-bottom: 5px;
  color: var(--accent-color, #607d3b);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.now-module-header h2 {
  margin: 0 0 8px;
}

.now-module-header p {
  max-width: 760px;
  margin: 0;
  color: var(--secondary-text, var(--text-color, #333));
}

.now-marquee {
  position: relative;
  margin-top: 12px;
}

.now-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
}

.now-control {
  appearance: none;
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  height: 34px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--border-color, rgba(0, 0, 0, .14));
  border-radius: 999px;
  background: var(--card-bg, #fff);
  color: var(--accent-color, #607d3b);
  box-shadow: 0 2px 8px var(--shadow-color, rgba(0, 0, 0, .12));
  font: inherit;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: transform .2s ease, background-color .2s ease;
}

.now-control:hover,
.now-control:focus-visible {
  background: var(--progress-bg, #f2f2f2);
  transform: translateY(-1px);
  outline: 2px solid var(--accent-color, currentColor);
  outline-offset: 2px;
}

.now-pause {
  min-width: 72px;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.now-viewport {
  height: calc(var(--now-tile-height) + 18px);
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px 14px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-color, #607d3b) transparent;
  overscroll-behavior-inline: contain;
  touch-action: pan-x;
}

.now-viewport::-webkit-scrollbar {
  height: 8px;
}

.now-viewport::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--accent-color, #607d3b);
}

.now-track {
  display: flex;
  align-items: stretch;
  width: max-content;
  height: var(--now-tile-height);
  gap: 16px;
  animation: nowMarquee 55s linear infinite;
  will-change: transform;
}

.now-marquee:hover .now-track,
.now-marquee.is-paused .now-track,
.now-viewport:focus-within .now-track {
  animation-play-state: paused;
}

@keyframes nowMarquee {
  from { transform: translateX(0); }
  to { transform: translateX(calc(-50% - 8px)); }
}

.now-tile {
  appearance: none;
  flex: 0 0 var(--now-tile-width);
  display: flex;
  flex-direction: column;
  width: var(--now-tile-width);
  min-width: 0;
  height: var(--now-tile-height);
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border-color, rgba(0, 0, 0, .14));
  border-radius: var(--radius-lg, 16px);
  background: var(--card-bg, #fff);
  color: var(--text-color, #222);
  box-shadow: 0 4px 14px var(--shadow-color, rgba(0, 0, 0, .12));
  font: inherit;
  text-align: left;
  text-decoration: none;
  scroll-snap-align: start;
  transition: transform .2s ease, box-shadow .2s ease;
}

.now-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px var(--shadow-color, rgba(0, 0, 0, .16));
  text-decoration: none;
}

.now-tile:focus-visible {
  outline: 3px solid var(--accent-color, currentColor);
  outline-offset: 3px;
}

.now-tile-media {
  flex: 0 0 128px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 128px;
  overflow: hidden;
  background: var(--progress-bg, #eee);
}

.now-tile-photo .now-tile-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.now-tile-info .now-tile-media {
  flex-basis: 96px;
  height: 96px;
  background: linear-gradient(135deg, var(--progress-bg, #eee), var(--card-bg, #fff));
}

.now-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: var(--accent-color, #607d3b);
  color: #fff;
  font-size: 27px;
  font-weight: 800;
}

.now-tile-body {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  padding: 13px 14px 14px;
  overflow: hidden;
}

.now-tile-badge {
  align-self: flex-start;
  flex: 0 0 auto;
  max-width: 100%;
  margin-bottom: 7px;
  padding: 3px 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--accent-color, #607d3b);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.now-tile h3 {
  margin: 0 0 7px;
  color: var(--accent-color, #607d3b);
  font-size: 16px;
  line-height: 1.22;
}

.now-tile p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--text-color, #222);
  font-size: 13px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
}

.now-tile-photo p {
  -webkit-line-clamp: 4;
}

.now-tile-links {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 10px;
}

.now-tile-links a,
.now-modal-hint {
  display: inline-block;
  padding: 6px 10px;
  border-radius: var(--radius-sm, 7px);
  background: var(--accent-color, #607d3b);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
}

.now-tile-links a:hover,
.now-tile-links a:focus-visible {
  background: var(--accent-hover, var(--accent-color, #607d3b));
  color: #fff;
}

/* Origin-story modal shared by every theme. */
.now-story-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

.now-story-modal.is-open {
  display: block;
}

.now-story-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 20, .72);
  backdrop-filter: blur(4px);
}

.now-story-window {
  position: relative;
  display: flex;
  width: min(980px, calc(100vw - 32px));
  height: min(820px, calc(100vh - 48px));
  margin: 24px auto;
  overflow: hidden;
  flex-direction: column;
  border-radius: var(--radius-lg, 18px);
  background: var(--card-bg, #fff);
  color: var(--text-color, #111);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .45);
}

.now-story-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-color, rgba(127, 127, 127, .25));
}

.now-story-header h2 {
  margin: .2rem 0 0;
}

.now-story-close {
  appearance: none;
  margin: 0;
  padding: 0 .25rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.now-story-frame {
  width: 100%;
  flex: 1;
  border: 0;
  background: #fff;
}

.now-story-footer {
  padding: 12px 22px;
  border-top: 1px solid var(--border-color, rgba(127, 127, 127, .25));
  text-align: right;
}

.now-story-footer a {
  color: var(--accent-color, currentColor);
  font-weight: 800;
  text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
  .now-track {
    animation: none;
  }
}

@media (max-width: 768px) {
  .now-module {
    --now-tile-width: min(78vw, 235px);
    --now-tile-height: 340px;
    padding: 16px;
  }

  .now-module-header {
    margin-bottom: 10px;
  }

  .now-controls {
    margin-bottom: 8px;
  }

  .now-tile-media {
    flex-basis: 116px;
    height: 116px;
  }

  .now-tile-info .now-tile-media {
    flex-basis: 88px;
    height: 88px;
  }

  .now-tile p {
    -webkit-line-clamp: 5;
  }
}
