/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
*/

/* Bookmark list item - show remove button on hover */
.bookmark-item .bookmark-remove {
  opacity: 0;
  transition: opacity 0.15s ease-in-out;
}

.bookmark-item:hover .bookmark-remove {
  opacity: 1;
}

/* IWgR stamp overlay on homepage */
.iwgr-stamp-wrapper {
  position: absolute;
  top: 52%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-18deg);
  z-index: 10;
}

.iwgr-stamp {
  position: relative;
  display: block;
  font-size: 4.5rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #E53935;
  border: 0.2em solid #E53935;
  border-radius: 0.2em;
  padding: 0.1em 0.4em;
  opacity: 0.9;
  text-decoration: none;
  pointer-events: auto;
  white-space: nowrap;
  line-height: 1.2;
  animation: stamp-press 1.5s ease-in-out infinite;
}

.iwgr-stamp-wrapper:hover .iwgr-stamp {
  opacity: 1;
  color: #E53935;
  animation: none;
  transform: scale(1.08);
}

.iwgr-stamp-wrapper:hover .iwgr-tap {
  animation: none;
  transform: scale(0.75);
}

/* Pulsing tap finger on the stamp */
.iwgr-tap {
  position: absolute;
  bottom: -0.5em;
  left: 50%;
  margin-left: -0.5em;
  font-size: 4.5rem;
  pointer-events: none;
  animation: tap 1.5s ease-in-out infinite;
  transform-origin: center bottom;
}

@keyframes tap {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  40% { transform: scale(0.75); opacity: 1; }
  55% { transform: scale(1.05); opacity: 0.9; }
}

@keyframes stamp-press {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  40% { transform: scale(1.08); opacity: 1; }
  55% { transform: scale(1); opacity: 0.9; }
}

/* Temporary highlight for linked events */
@keyframes event-highlight {
  0% { box-shadow: 0 0 0 4px rgba(37, 179, 209, 0.8); }
  100% { box-shadow: 0 0 0 4px transparent; }
}

.event-highlight .card {
  animation: event-highlight 2s ease-out;
}

/* Kommunalwahl banner on homepage - looks like a ballot paper */
.kw-banner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.35rem;
  overflow: hidden;
  text-decoration: none;
  color: #fff;
  padding: 1.6rem 1.75rem 1.6rem 2.25rem;
  border-radius: 1rem;
  background: #1D2233;
  box-shadow: 0 6px 20px rgba(29, 34, 51, 0.25);
  transition: transform 0.18s ease-out, box-shadow 0.18s ease-out;
}

/* Hard colour stops keep every logo colour pure - no muddy blending */
.kw-banner::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0.7rem;
  background: linear-gradient(
    180deg,
    #25B3D1 0 16.66%,
    #9B7AB8 0 33.33%,
    #E84C8A 0 50%,
    #F5A623 0 66.66%,
    #8BC53F 0 83.33%,
    #E53935 0
  );
  transition: width 0.18s ease-out;
}

.kw-banner:hover,
.kw-banner:focus {
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(29, 34, 51, 0.38);
}

.kw-banner:hover::before,
.kw-banner:focus::before {
  width: 1rem;
}

/* The checkbox that keeps getting crossed */
.kw-banner-mark {
  flex: 0 0 auto;
  width: 3.5rem;
  height: 3.5rem;
}

.kw-banner-mark svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.kw-box {
  fill: rgba(255, 255, 255, 0.14);
  stroke: #fff;
  stroke-width: 3;
}

.kw-tick {
  stroke: #fff;
  stroke-width: 5;
  stroke-linecap: round;
  fill: none;
  stroke-dasharray: 29;
  stroke-dashoffset: 29;
  animation: kw-draw 4.5s ease-in-out infinite;
}

.kw-tick-2 {
  animation-delay: 0.25s;
}

@keyframes kw-draw {
  0%       { stroke-dashoffset: 29; }
  15%, 75% { stroke-dashoffset: 0; }
  90%, 100% { stroke-dashoffset: 29; }
}

.kw-banner-body {
  min-width: 0;
}

.kw-banner-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #F5A623;
  margin-bottom: 0.35rem;
}

.kw-banner-title {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.25;
  text-wrap: balance;
}

.kw-banner-foot {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.7rem;
}

.kw-countdown {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background-color: #E53935;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.kw-banner-cta {
  display: inline-block;
  font-size: 0.95rem;
  font-weight: 700;
  color: #5FD0E8;
  border-bottom: 2px solid rgba(95, 208, 232, 0.45);
}

.kw-banner-cta i {
  transition: transform 0.18s ease-out;
}

.kw-banner:hover .kw-banner-cta i {
  transform: translateX(4px);
}

@media (max-width: 575.98px) {
  .kw-banner {
    gap: 1rem;
    padding: 1.25rem;
  }

  .kw-banner-mark {
    width: 2.75rem;
    height: 2.75rem;
  }

  .kw-banner-title {
    font-size: 1.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kw-banner,
  .kw-tick {
    animation: none;
  }

  .kw-tick {
    stroke-dashoffset: 0;
  }
}

/* Kommunalwahl article page */
.kommunalwahl-datum {
  font-size: 1rem;
  color: #5A6072;
}

.kommunalwahl-text {
  font-size: 1.075rem;
  line-height: 1.75;
}

.kommunalwahl-text h2 {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  margin-top: 2.75rem;
  margin-bottom: 1rem;
  font-size: 1.6rem;
  font-weight: 700;
}

/* Numbered section badges in the logo colours */
.kw-num {
  flex: 0 0 auto;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  background-color: #25B3D1;
}

.kw-num-1 { background-color: #25B3D1; }
.kw-num-2 { background-color: #9B7AB8; }
.kw-num-3 { background-color: #E84C8A; }
.kw-num-4 { background-color: #D18A00; }
.kw-num-5 { background-color: #6D9E23; }
.kw-num-6 { background-color: #E53935; }
.kw-num-7 { background-color: #1D2233; }

.kommunalwahl-text .lead {
  font-size: 1.2rem;
}

/* `strong` resolves to `bolder`, which against .lead's weight 300 only reaches 400 */
.kommunalwahl-text strong {
  font-weight: 700;
}

.kommunalwahl-example {
  background-color: #f8f9fa;
  border-left: 5px solid #25B3D1 !important;
}

.kommunalwahl-example h3 {
  margin-bottom: 1rem;
  font-weight: 700;
}

/* Bunter Block colorful text - matches logo colors */
.text-bunter {
  background: linear-gradient(
    90deg,
    #25B3D1,  /* cyan */
    #9B7AB8,  /* purple */
    #E84C8A,  /* pink */
    #F5A623,  /* orange */
    #8BC53F,  /* green */
    #E53935   /* red */
  );
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Teilen und folgen page */
.share-lead {
  font-size: 1.15rem;
  line-height: 1.7;
  color: #5A6072;
  text-wrap: pretty;
}

.share-btn-primary {
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.5rem;
  font-weight: 700;
  color: #fff;
  background-color: #1D2233;
  transition: transform 0.18s ease-out, box-shadow 0.18s ease-out;
}

.share-btn-primary:hover,
.share-btn-primary:focus {
  color: #fff;
  background-color: #2A3149;
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(29, 34, 51, 0.28);
}

.share-actions-main .btn {
  border-radius: 999px;
  padding: 0.65rem 1.5rem;
  font-weight: 600;
}

/* Panel with the QR code for this page itself */
.share-self {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  max-width: 32rem;
  margin: 0 auto;
  padding: 1.1rem 1.35rem 1.1rem 1.6rem;
  text-align: left;
  border-radius: 1.15rem;
  background-color: #f8f9fa;
  position: relative;
  overflow: hidden;
}

/* Hard colour stops keep every logo colour pure - no muddy blending */
.share-self::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0.5rem;
  background: linear-gradient(
    180deg,
    #25B3D1 0 16.66%,
    #9B7AB8 0 33.33%,
    #E84C8A 0 50%,
    #F5A623 0 66.66%,
    #8BC53F 0 83.33%,
    #E53935 0
  );
}

.share-self-frame {
  flex: 0 0 auto;
  /* Keeps the modules near 3 px so a phone can read it off a screen */
  width: 160px;
  margin: 0;
  border-color: #dee2e6;
}

.share-self-body {
  min-width: 0;
}

.share-self-label {
  display: block;
  font-weight: 700;
  color: #1D2233;
  margin-bottom: 0.35rem;
}

.share-self-text {
  display: block;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #5A6072;
}

.share-self-url {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #6c757d;
  overflow-wrap: anywhere;
}

/* Side by side gets too cramped on a phone - stack it and lay the colour bar
   across the top instead */
@media (max-width: 575.98px) {
  .share-self {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem 1.25rem 1.25rem;
  }

  .share-self::before {
    right: 0;
    bottom: auto;
    width: auto;
    height: 0.5rem;
    background: linear-gradient(
      90deg,
      #25B3D1 0 16.66%,
      #9B7AB8 0 33.33%,
      #E84C8A 0 50%,
      #F5A623 0 66.66%,
      #8BC53F 0 83.33%,
      #E53935 0
    );
  }
}

.share-card {
  border-radius: 1.15rem;
  overflow: hidden;
  transition: transform 0.18s ease-out, box-shadow 0.18s ease-out;
}

/* Colour bar across the top, in the channel's own colour */
.share-card::before {
  content: "";
  display: block;
  height: 0.55rem;
  background-color: var(--share-color);
}

.share-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(29, 34, 51, 0.16) !important;
}

.share-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto;
  border-radius: 50%;
  font-size: 1.75rem;
  color: var(--share-color);
  background-color: #f1f3f5;
  background-color: color-mix(in srgb, var(--share-color) 14%, #fff);
}

.share-handle {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--share-color);
  overflow-wrap: anywhere;
}

.share-qr-frame {
  position: relative;
  max-width: 190px;
  margin: 0 auto;
  /* Doubles as the quiet zone the code needs to stay scannable - keep >= 1rem */
  padding: 1.1rem;
  border-radius: 0.9rem;
  background-color: #fff;
  border: 2px solid #e9ecef;
  border-color: color-mix(in srgb, var(--share-color) 35%, #fff);
}

.qr-code-svg {
  display: block;
  width: 100%;
  height: auto;
}

/* Sits in the middle of the code - level H error correction covers the gap */
.share-qr-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22%;
  height: 22%;
  border-radius: 0.35rem;
  font-size: 1.05rem;
  line-height: 1;
  color: var(--share-color);
  background-color: #fff;
}

.share-qr-caption {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: #6c757d;
}

.share-btn {
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-weight: 700;
  color: #fff;
  background-color: var(--share-color);
}

.share-btn:hover,
.share-btn:focus {
  color: #fff;
  filter: brightness(0.92);
}

.share-footnote {
  font-size: 0.95rem;
  color: #6c757d;
}

/* Printed sheets only need the codes - buttons and navigation are noise */
@media print {
  /* Trim everything that only makes sense on screen so all four codes fit on
     a single sheet */
  .share-actions,
  .share-footnote,
  .share-lead,
  .share-icon,
  .share-self,
  .site-footer {
    display: none !important;
  }

  .share-page {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }

  .share-logo {
    max-height: 70px !important;
  }

  .share-card .card-body {
    padding: 1rem !important;
  }


  /* A printed page is narrower than Bootstrap's md breakpoint, so the cards
     would end up one per sheet. Flex rows and inline-block columns both
     refuse to start next to the heading; floats fill the page properly. */
  .share-grid,
  .share-grid-outer {
    display: block;
  }

  .share-grid-outer > * {
    width: 100%;
    max-width: 100%;
  }

  .share-grid::after {
    content: "";
    display: block;
    clear: both;
  }

  .share-col {
    display: block;
    float: left;
    width: 48%;
    max-width: 48%;
  }

  .share-card {
    height: auto !important;
    break-inside: avoid;
    border: 1px solid #dee2e6 !important;
    box-shadow: none !important;
  }

  /* The gradient prints as nothing, so fall back to solid ink */
  .text-bunter {
    background: none;
    color: #1D2233;
    -webkit-text-fill-color: #1D2233;
  }
}

@media (prefers-reduced-motion: reduce) {
  .share-card,
  .share-btn-primary {
    transition: none;
  }

  .share-card:hover,
  .share-btn-primary:hover {
    transform: none;
  }
}
