:root{
  --ff-ical-card-bg: #ffffff;
  --ff-ical-card-fg: #333333;
  --ff-ical-muted: #6a6a6a;
  --ff-ical-border: #dddddd;
  --ff-ical-radius: 24px;
  --ff-ical-shadow: 0 16px 40px rgba(0,0,0,0.10);
  --ff-ical-accent: #c0392b; /* Feuerwehr-Rot */
}

/* =========================================================
   CARD
   ========================================================= */

.ff-ical-qr{
  max-width: 600px;
  margin: 30px auto;
  padding: 0;
  border-radius: var(--ff-ical-radius);
  background: var(--ff-ical-card-bg);
  box-shadow: var(--ff-ical-shadow);
  color: var(--ff-ical-card-fg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* =========================================================
   HEADER
   ========================================================= */

.ff-ical-qr__header{
  position: relative;
  padding: 24px 28px;
  padding-right: 72px; /* Platz für Share-Button */
  background: var(--ff-ical-accent);
  font-weight: 700;
  color: #ffffff;
}

.ff-ical-qr__next{
  margin: 0;
  font-weight: 900;
  line-height: 1.1;
  font-size: 1.6rem;
}

.ff-ical-qr__next span{
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #ffffff;
  opacity: 1;
}

.ff-ical-qr__event-title{
  margin-top: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: #ffffff;
  opacity: 1;
}

/* Für Special-Events (Header-Gradient) */
.ff-ical-qr--special .ff-ical-qr__header{
  background: linear-gradient(135deg, var(--ff-ical-accent), #8e1f14);
}

/* =========================================================
   SHARE BUTTON (SVG MASK)
   ========================================================= */

/* Der Button als Container */
.ff-ical-qr__share {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border-radius: 50%; /* Sicherer als 999px */
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.10);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease;
  padding: 0; /* Wichtig, um Default-Browser-Padding zu entfernen */
}

.ff-ical-qr__share:hover {
  background: rgba(0, 0, 0, 0.25);
}

/* Das Icon-Span innerhalb des Buttons */
.ff-ical-qr__share-icon {
  display: block; /* Nicht mehr hidden! */
  width: 20px;
  height: 20px;
  background-color: currentColor; /* Erlaubt Farbsteuerung via Button-Color */
  
  /* Maske mit allen Präfixen für maximale Kompatibilität */
  -webkit-mask-image: url(//ff-havighorst.de/ff3/wp-content/plugins/ff-dynamic-ical-qr/assets/img/icon-share.svg);
  mask-image: url(//ff-havighorst.de/ff3/wp-content/plugins/ff-dynamic-ical-qr/assets/img/icon-share.svg);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

/* Entferne den ::before Hack vom Button */
.ff-ical-qr__share::before {
  content: none !important;
}

/* =========================================================
   BODY LAYOUT
   ========================================================= */

.ff-ical-qr__body-content{
  padding: 28px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 22px;
  align-items: start;
}

.ff-ical-qr__left{
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.ff-ical-qr__img{
  display: block;
  width: 160px;
  max-width: 160px;
  height: auto;
  border-radius: 18px;
  background: #ffffff;
  padding: 12px;
  border: 1px solid var(--ff-ical-border);
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.ff-ical-qr__right{
  min-width: 0;
  padding-top: 4px;
}

.ff-ical-qr__title{
  font-weight: 800;
  margin: 0 0 8px 0;
  font-size: 1.1rem;
}

.ff-ical-qr__body{
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--ff-ical-muted);
}

/* =========================================================
   META (Ort / Beschreibung)
   ========================================================= */

.ff-ical-qr__meta{
  margin: .55rem 0 0;
  line-height: 1.45;
}

.ff-ical-qr__location{
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  text-decoration: none;
  font-weight: 700;
  color: inherit;
  padding: .15rem .35rem;
  border-radius: 10px;
}

.ff-ical-qr__location:hover{
  text-decoration: underline;
  background: rgba(0,0,0,.04);
}

.ff-ical-qr__icon{
  font-size: 1.05em;
  line-height: 1;
}

/* =========================================================
   ALTERNATIVE (.ics Download)
   ========================================================= */

.ff-ical-qr__alt{
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px dashed var(--ff-ical-border);
}

.ff-ical-qr__alt-title{
  font-weight: 700;
  margin: 0 0 8px 0;
  color: var(--ff-ical-muted);
}

.ff-ical-qr__alt a{
  font-weight: 900;
  color: var(--ff-ical-accent);
  text-decoration: none !important;
  text-underline-offset: 2px;
  display: inline-block;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}

.ff-ical-qr__alt a::before{
  content: '⬇ ';
  font-weight: 900;
}

.ff-ical-qr__alt a:hover{
  border-bottom-color: var(--ff-ical-accent);
}

.ff-ical-qr__alt a:focus-visible{
  outline: 3px solid #ffcc00;
  outline-offset: 2px;
}

/* =========================================================
   BADGE / INTRO (Special)
   ========================================================= */

.ff-ical-qr__badge{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: .02em;
  opacity: .95;
  margin-bottom: 8px;
}

.ff-ical-qr__intro{
  margin: 0 0 14px 0;
  font-size: 0.98rem;
  line-height: 1.5;
  color: #ffffff;
  opacity: .95;
}

/* =========================================================
   BUTTONS / FLYER
   ========================================================= */

.ff-ical-qr__btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .55rem .8rem;
  border-radius: 12px;
  border: 1px solid var(--ff-ical-border);
  background: #ffffff;
  color: var(--ff-ical-card-fg);
  text-decoration: none;
  font-weight: 700;
}

.ff-ical-qr__btn:hover{
  transform: translateY(-1px);
}

.ff-ical-qr__btn:focus-visible{
  outline: 3px solid #ffcc00;
  outline-offset: 2px;
}

.ff-ical-qr__flyers{
  margin-top: .75rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
}

/* =========================================================
   FLYER PREVIEW GRID (wenn du Preview statt Buttons nutzt)
   ========================================================= */

.ff-ical-qr__flyer-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 10px;
}

@media (min-width: 520px){
  .ff-ical-qr__flyer-grid{
    grid-template-columns: 1fr 1fr;
  }
}

.ff-ical-qr__flyer-card{
  display: block;
  text-decoration: none;
  border: 1px solid rgba(14,42,71,.18);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.ff-ical-qr__flyer-thumb{
  background: #f6f7f7;
  padding: 10px;
}

.ff-ical-qr__flyer-thumb img{
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
}

.ff-ical-qr__flyer-fallback{
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #0e2a47;
  border: 1px dashed rgba(14,42,71,.25);
  border-radius: 8px;
}

.ff-ical-qr__flyer-label {
  padding: 10px 12px;
  font-weight: 600;
  text-decoration: none !important;
  /* align-items: center;  <-- Diese Zeile entfernen, sie bewirkt hier nichts */
  text-align: center;   /* <-- Diese Zeile hinzufügen */
  color: #0e2a47;
  /* Falls es ein a-Tag ist, hilft oft auch: display: block; */
  display: block; 
}

/* PDF Preview Wrapper */
.ff-ical-qr__pdf-preview{
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 16px;
	margin-top: 16px;
}

/* Einzelnes Vorschaubild */
.ff-ical-qr__pdf-thumb{
	text-decoration: none;
	color: inherit;
	display: block;
	text-align: center;
}

.ff-ical-qr__pdf-img{
	width: 100%;
	height: auto;
	border-radius: 8px;
	box-shadow: 0 6px 18px rgba(0,0,0,.15);
	transition: transform .2s ease, box-shadow .2s ease;
}

.ff-ical-qr__pdf-thumb:hover .ff-ical-qr__pdf-img{
	transform: translateY(-2px);
	box-shadow: 0 10px 26px rgba(0,0,0,.25);
}

.ff-ical-qr__pdf-thumb span{
	display: block;
	margin-top: 6px;
	font-size: 13px;
	opacity: .85;
}

/* Mobile */
@media (max-width: 680px){
	.ff-ical-qr__pdf-preview{
		grid-template-columns: 1fr;
	}
}



/* =========================================================
   TOAST (Share-Fallback)
   ========================================================= */

.ff-ical-qr-toast{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(10px);
  opacity: 0;
  background: rgba(14,42,71,.92); /* Marine */
  color: #fff;
  padding: 10px 14px;
  border-radius: 999px;
  z-index: 999999;
  transition: all .2s ease;
  font-weight: 700;
}

.ff-ical-qr-toast.is-visible{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 720px){
  .ff-ical-qr{
    max-width: 100%;
    margin: 18px;
  }

  .ff-ical-qr__header{
    text-align: left;
    padding: 18px 20px;
    padding-right: 72px;
  }

  .ff-ical-qr__body-content{
    grid-template-columns: 1fr;
    text-align: center;
    padding: 20px;
  }

  .ff-ical-qr__img{
    width: 180px;
    max-width: 180px;
    margin: 0 auto;
  }

  .ff-ical-qr__flyers{
    justify-content: center;
  }
}