[data-postcode], #infosec, #search {
  scroll-margin-block-start: 60px;
}

.forms {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: end;
  margin: 0 0 20px 0;
  text-align: left;
}

.or {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  gap: 5px;
  position: relative;
  margin-left: -20px;
  margin-right: -20px;
  flex-grow: 1;
  color: var(--fglv2);
}

.or:before,
.or:after {
  height: 1px;
  content: '';
  display: block;
  background-color: var(--borderColor);
}

.or:before {
  width: 15px;
}

.or:after {
  flex: 1 0 auto;
}

ul[data-city] {
  list-style: none;
  padding: 0;
  margin-bottom: 80px;
}

.legislator {
  background: var(--bglv2);
  border-radius: var(--radii);
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  border: 0.5px solid var(--borderColor);
  text-align: left;  
  margin-bottom: 100px;
}

.info-links:has(.watchout):last-child {
  overflow: visible;
}

.info-links:last-child,
.watchout {
  border-bottom-right-radius: 4px;
  border-bottom-left-radius: 4px;
}

.info-links {
  overflow: hidden;
  width: 100%;
  flex: 1 0 auto;
  justify-content: start;
  justify-items: start;;
  margin: 0;
  display: flex;
  gap: 1px;
  background: var(--borderColor);
  padding-top: 1px;
  overflow: hidden;
  flex-wrap: wrap;
}

.button:last-child {
  position: relative;
}

.info-links .button:last-child:after {
  content: '';
  display: block;
  background: var(--bglv2);
  height: 100%;
  width: 100vw;
  left: calc(100% + 1px);
  top: 0;
  position: absolute;
}

.info-links a:has(svg) {
  display: inline-flex;
  align-items: center;
}

.info-links svg {
  margin-right: 4px;
}

.info-links .text-link {
  margin: 0 !important; /* external link */
  padding: 16px 24px; 
  background: var(--bglv2);
  white-space: nowrap;
  flex-grow: 1;
  border-bottom: 0;
  text-underline-offset: 3px;
}

.info-links > *:last-child {
  --duration: 1.2s !important;
}

@property --offset {
  syntax: "<length>";
  inherits: false;
  initial-value: 0;
}

.info-links .text-link:hover {
  --duration: 1s;
  --offset: 48em;
  transition:  --offset var(--duration);
  background-image: linear-gradient(60deg, var(--bglv1) -10em, var(--bglv1) var(--offset), transparent var(--offset) calc(var(--offset)), transparent calc(var(--offset)));
}

.selected {
  box-shadow: 0 0 0 1px var(--bgactive);
  position: relative;
  
}

.status {
  display: inline-block;
  padding: 4px 8px;
  margin-bottom: 8px;
  font-weight: bold;
  position: absolute;
  transform: translate(20px, -20px);
}

.status.active {
  background: var(--bgactive);
  color: var(--fgactive);
}

.status.inactive {
  background: var(--bglv0);
  color: var(--fglv2);
}

.status.processing {
  background: #10d402;
  color: var(--bglv0);
}

a.line,
a.facebook,
a.threads,
a.instagram {
  border: 0;
  border-radius: 0;
  background-color: var(--bglv1);
  color: var(--bglv2);
  padding: 0.5em;
  box-shadow: none;
}

a.instagram {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

a.threads {
  background: rgb(10, 10, 10);
}

a.facebook {
  background: #3b5998;
}

a.line {
  background: #06c755;
}

.instagram:before,
.line:before,
.facebook:before,
.threads:before {
  display: inline-block;
  background-size: 24px 24px;
  background-position: center center;
  background-repeat: no-repeat;
  height: 100%;
  width: 30px;
  aspect-ratio: 1;
  vertical-align: middle;
  content: '';
  fill: inherit;
  align-self: center;
  padding: 0.6em 1.2em;
}

.line:before {
  background-image: url(/icons/line.svg);
  margin: -0.5em -0.6em 0;
}

.instagram:before {
  background-image: url(/icons/instagram.svg);
  background-size: 20px 20px;
  margin: -0.5em -0.6em 0;
}

.threads:before {
  background-image: url(/icons/threads.svg);
  background-size: 18px 18px;
  margin: -0.5em -0.6em 0;
}

.facebook:before {
  background-image: url(/icons/facebook.svg);
  background-size: 18px 18px;
  margin: -0.5em -0.6em 0;
}

.heading {
  position: relative;
  z-index: 1;
  padding: 20px 0 0 20px;
  flex: 1 0 auto;
  margin-top: 5px;
  margin-bottom: 20px;
}

.heading:has(.dates) {
  padding-bottom: 40px;
}

.actions {
  padding: 18px 20px;
  flex: 0 1 auto;
  align-items: start;
  display: flex;
  align-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.actions button {
  padding: 12px 16px;
}

.chapter {
  color: inherit;
  text-decoration: none;
  padding: 0 5px;
  align-self: center;
}

.images img {
  margin-bottom: 0.4em;
  background-color: var(--bglv1);
  width: 100%;
  overflow: hidden;
  min-width: 200px;
}

[data-story] {
  aspect-ratio: 9/16;
}

[data-square] {
  aspect-ratio: 1;
}

.image-share {
  width: 50%;
  flex: 1 1 auto;
}

.dialog-actions {
  margin-bottom: 1em;
}

.team {
  display: flex;
  gap: 3em;
  justify-content: center;
}

.team img {
  border: 1px solid rgba(0, 0, 0, .5);
  margin: 0.8em 0 0.4em;
  border-radius: 50%;
}

.name {
  font-size: 1.15rem;
  margin: 0;
  white-space: nowrap;
}


.images {
  display: flex;
  gap: 1em;
  margin: auto;
  max-width: 36em;
}

.headshot {
  align-self: end;
  height: 160px;
  padding-right: 20px;
  margin: -15px 0 0 -50px;
  position: relative;
  border: 0;
  flex-shrink: 0;
  box-sizing: border-box;
}

.attribute {
  filter: invert();
}

@media (max-width: 500px) {
  .heading {
    margin-bottom: 0;
    width: 100%;
  }

  .text-link {
    flex: 1 0 auto;
  }

  .headshot {
    padding-right: 0;
    margin: -80px -10px 0 auto;
  }

  .actions {
    width: 100%;
    border-top: 1px solid var(--borderColor);
  }
}

.tooltip {
  vertical-align: super;
  font-size: 0.8rem;
  padding: 0 4px 0 0;
  border: 0;
  color: var(--bgactive);
  box-shadow: none;
  background: none;
}

.text-link.watchout {
  background: var(--bglv1);
  display: flex;;
  align-items: center;
  justify-content: center;
  position: relative;
  padding-left: 95px;
  color: #50E3C2;
  font-size: 1.15em;
}

.watchout-atsao {
  margin: -30px 0 -16px -70px;
  height: 70px;
}

.watchout-logo {
  margin-right: 10px;
}

.day-progress-bar-gradient {
  --total-days: 60;
  --current-day: calc(var(--today) - var(--start)); 

  --segment-width-percent: calc(100% / var(--total-days));
  --progress-percent: calc(var(--current-day) * 100% / var(--total-days));

  width: 100%; 
  height: 10px;
  border-top: 1px solid var(--borderColor);
  position: relative;
  background-color: var(--bglv4);

  background-image: 
    repeating-linear-gradient(
      to right, 
      transparent 0, 
      transparent calc(var(--segment-width-percent) - 1px), 
      var(--borderColor) calc(var(--segment-width-percent) - 1px), 
      var(--borderColor) var(--segment-width-percent)
    ),
  
    linear-gradient(
      to right, 
      var(--bglv0) 0%, 
      var(--bglv0) var(--progress-percent), 
      transparent var(--progress-percent), 
      transparent 100%
    );
  
  background-repeat: no-repeat;
  background-size: auto, 100% 100%;

  background-position: 1px 0, 0 0;
}

.dates {
  border-top: 1px solid var(--borderColor);
  padding: 5px;
  display: flex;
  justify-content: space-between;
  width: 100%;
  position: relative;
}

.step-start,
.step-note,
.step-end {
  background-color: var(--bglv0);
  border-radius: 50px;
  border: 1px solid var(--bglv4);
  padding: 2px 10px;
  font-size: 0.85em;
  font-weight: bold;
  letter-spacing: 1px;
  position: relative;
  margin: 0 -13px -2px;
  z-index: 1;
  transition: transform 0.2s;
  cursor: default;
}

.step-start:hover,
.step-note:hover,
.step-end:hover {
  z-index: 2;
  transform: scale(1.2);
}

.step-note {
  color: var(--bgactive);
  position: absolute;
  left: 66.66%;
}

.step-start { transform-origin: bottom left; }
.step-note { transform-origin: bottom center; }
.step-end { transform-origin: bottom right; }

.step-start::after,
.step-note::after,
.step-end::after {
  content: ''; 
  position: absolute;
  width: 10px; 
  height: 10px;
  background-color: inherit; 
  top: 100%; 
  transform-origin: center top;
  border-bottom: 1px solid var(--bglv4);
  border-right: 1px solid var(--bglv4);
  transform: translateX(-50%) rotate(45deg);
  margin-top: -4px; 
}

.step-start::after {
  left: 0;
  transform: translateX(100%) rotate(45deg);
}

.step-note::after {
  left: 50%;
}

.step-end::after {
  right: 0;
}

.clip-x {
  width: 100%;
  overflow: hidden;
}

.watchout-shorts {
position: relative;
}

.watchout-shorts-logo {
  position: absolute;
  width: 16px;
  height: 16px;
  right: -4px;
  top: -4px;
}

.video-dialog {
  border-radius: 16px;
  overflow: hidden;
}

.video-dialog button[aria-label="關閉"] {
  background: var(--fglv1);
  color: var(--bglv0);
}

.video-dialog button[aria-label="關閉"]:focus-visible {
  transform: scale(105%);
}
.pane.alert {
  border-color: var(--bgactive); 
  text-align: left; 
  margin-top: 50px;
}

.grid-view ul {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px 40px;
}

.grid-view .legislator {
  position: relative;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}

.grid-view .headshot {
  width: 80%;
  height: auto;;
  margin-top: -60px;
}

.grid-view .dates {
  position: absolute;
  bottom: 10px;
  border-top: 0;
}

.grid-view .actions,
.grid-view .info-links,
.grid-view h3 {
  display: none;
}

@media (max-width: 500px) {
  .grid-view ul {
    grid-template-columns: 1fr;
  }


  .grid-view .headshot {
    margin-right: 20px;
    margin-top: -20px;
  }
}

.stage {
  padding: 10px 20px;
  border-top: 1px solid var(--borderColor);
  background: var(--bgactive);
  color: var(--bglv0);
  text-align: center;
}

.stage span {
  display: inline-block;
}

.stage.ongoing {
  background-color: #ff5700;
}

.stage.failed {
  background-color: #777;
}
