/* Composition 1: country archive (Timeline + Statistics + Calendar). */
.v3-archive-section {
  --arc-bg: #eff1f6;
  --arc-blue: #2540b0;
  --arc-blue-soft: #a9b4e2;
  --arc-track: #e4e6ec;
  --arc-day: #e9edf8;
  --arc-green: #2f8f6b;
  --arc-green-bg: #dcefe6;
  margin: 0;
}

.v3-archive-section .arc-defs {
  position: absolute;
}

.arc {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  gap: clamp(16px, 2.2vw, 28px);
  align-items: start;
  margin-top: 28px;
  padding: clamp(16px, 2.6vw, 30px);
  border-radius: 24px;
  background: var(--arc-bg);
}

.arc h3 {
  margin: 0;
  font-family: var(--v3-font);
}

/* ---- Timeline ---- */
.arc-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 4px 4px 0;
}

.arc-head img {
  width: 18px;
  height: 18px;
  justify-self: end;
  object-fit: contain;
}

.arc-head h3 {
  color: var(--v3-ink);
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.arc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: end;
  padding: 6px 12px;
  border-radius: 999px;
  background: #e3e7f5;
  color: var(--arc-blue);
  font-size: 13px;
  font-weight: 700;
}

.arc-chip svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.arc-rows {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.arc-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 14px 10px 10px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(11, 40, 57, 0.05);
}

.arc-thumb {
  display: block;
  width: 52px;
  height: 52px;
  overflow: hidden;
  border-radius: 12px;
  background: hsl(var(--h) 34% 84%);
}

.arc-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 28%;
}

.arc-thumb svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: hsl(var(--h) 26% 58%);
}

.arc-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.arc-copy strong {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--v3-ink);
  font-size: 15px;
  font-weight: 650;
}

.arc-copy strong > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.arc-copy strong .country-flag-v3,
.arc-day .country-flag-v3 {
  flex: 0 0 auto;
  width: 18px;
  height: 12px;
  border-radius: 2px;
}

.arc-copy time {
  color: var(--v3-tertiary);
  font-size: 13px;
  font-weight: 550;
}

.arc-seals {
  display: flex;
  gap: 6px;
}

.arc-seals i {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: var(--arc-green-bg);
}

.arc-seals svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--arc-green);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---- Statistics + calendar ---- */
.arc-side {
  display: grid;
  gap: clamp(12px, 1.6vw, 18px);
}

.arc-card {
  padding: 18px 18px 16px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(11, 40, 57, 0.05);
}

.arc-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #edeff3;
}

.arc-card-head h3 {
  color: var(--arc-blue);
  font-size: 16px;
  font-weight: 700;
}

.arc-year {
  padding: 5px 12px;
  border-radius: 999px;
  background: #edeff6;
  color: var(--arc-blue);
  font-size: 13px;
  font-weight: 650;
}

.arc-month {
  color: var(--arc-blue);
  font-size: 14px;
  font-weight: 650;
}

.arc-bar {
  position: relative;
  height: 14px;
  margin-top: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--arc-track);
}

.arc-bar-zone,
.arc-bar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  border-radius: 999px;
}

.arc-bar-zone {
  width: var(--zone);
  background: var(--arc-blue-soft);
}

.arc-bar-fill {
  width: var(--fill);
  background: var(--arc-blue);
}

.arc-scale {
  position: relative;
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--v3-tertiary);
  font-size: 12.5px;
}

.arc-scale-mid {
  position: absolute;
  left: var(--at);
  transform: translateX(-50%);
  white-space: nowrap;
}

.arc-bar-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--at);
  width: 2px;
  margin-left: -1px;
  background: #fff;
  opacity: 0.9;
}

.arc-profile {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 12px 0 0;
  color: var(--v3-copy);
  font-size: 14px;
}

.arc-profile b {
  color: var(--v3-tertiary);
  font-family: var(--v3-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.arc-totals {
  display: grid;
  gap: 6px;
  margin: 16px 0 0;
}

.arc-totals > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--v3-copy);
  font-size: 15px;
}

.arc-totals dd {
  margin: 0;
}

.arc-totals .is-main {
  color: var(--arc-blue);
  font-size: 18px;
  font-weight: 750;
}

.arc-totals dt {
  display: flex;
  align-items: center;
  gap: 9px;
}

.arc-totals dt .country-flag-v3 {
  width: 22px;
  height: 15px;
  border-radius: 2px;
}

.arc-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 10px 0 0;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  background: var(--arc-green-bg);
  color: #1d6f52;
  font-size: 13px;
  font-weight: 650;
}

.arc-status svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.arc-abroad {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid #edeff3;
  list-style: none;
}

.arc-abroad li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px 5px 7px;
  border: 1px solid #e6e9f0;
  border-radius: 999px;
  color: var(--v3-copy);
  font-size: 12.5px;
  line-height: 1;
}

.arc-abroad .country-flag-v3 {
  width: 16px;
  height: 11px;
  border-radius: 2px;
}

.arc-abroad b {
  color: var(--v3-ink);
  font-family: var(--v3-mono);
  font-size: 12px;
  font-weight: 650;
}

.arc-week,
.arc-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  text-align: center;
}

.arc-week {
  margin: 14px 0 6px;
  color: var(--v3-ink);
  font-size: 12px;
  font-weight: 700;
}

.arc-day {
  display: grid;
  min-height: 42px;
  place-content: center;
  justify-items: center;
  gap: 3px;
  border-radius: 8px;
  color: #9aa0ad;
  font-size: 13px;
}

.arc-day b {
  font-weight: 600;
}

.arc-day.is-on {
  background: var(--arc-day);
  color: var(--v3-ink);
}

/* Days in this guide's country stand out from the rest of the month. */
.arc-day.is-here {
  box-shadow: inset 0 0 0 1.5px var(--arc-blue);
}

/* ---- Assembly: runs once, only when JS arms it and motion is allowed ---- */
.arc.is-armed .arc-row {
  opacity: 0;
  transform: translateY(-10px);
}

.arc.is-armed .arc-day.is-new {
  background: transparent;
  color: #9aa0ad;
}

.arc.is-armed .arc-day.is-new .country-flag-v3 {
  opacity: 0;
}

.arc.is-armed .arc-bar-fill {
  width: var(--fill-start);
}

.arc.is-playing .arc-row {
  opacity: 1;
  transform: none;
  transition: opacity 0.42s ease, transform 0.42s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: calc(var(--step) * 260ms);
}

.arc.is-playing .arc-day.is-new {
  background: var(--arc-day);
  color: var(--v3-ink);
  transition: background 0.3s ease, color 0.3s ease;
  transition-delay: calc(var(--step) * 260ms);
}

.arc.is-playing .arc-day.is-new .country-flag-v3 {
  opacity: 1;
  transition: opacity 0.3s ease;
  transition-delay: calc(var(--step) * 260ms);
}

.arc.is-playing .arc-bar-fill {
  width: var(--fill);
  transition: width 1.5s cubic-bezier(0.2, 0.7, 0.2, 1) 0.2s;
}

@media (max-width: 860px) {
  .arc {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .arc {
    padding: 12px;
    border-radius: 18px;
  }

  .arc-row {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .arc-thumb {
    width: 44px;
    height: 44px;
  }

  .arc-seals i {
    width: 22px;
    height: 22px;
  }

  .arc-seals svg {
    width: 13px;
    height: 13px;
  }

  .arc-copy strong {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .arc .arc-row,
  .arc .arc-day,
  .arc .arc-bar-fill {
    transition: none !important;
  }
}
