/* Reuse the theme's Genericons; this local face is loaded only as a fallback. */
@font-face { font-family: 'Timeline Genericons'; src: url('fonts/genericons.woff') format('woff'); font-style: normal; font-weight: normal; font-display: block; }
.p4et {
  --p4et-accent: currentColor;
  --p4et-ink: currentColor;
  --p4et-muted: currentColor;
  --p4et-line: currentColor;
  --p4et-card: transparent;
  --p4et-border: currentColor;
  --p4et-soft: transparent;
  --p4et-hover: transparent;
  --p4et-on-accent: currentColor;
  --p4et-shadow: transparent;
  --p4et-shadow-hover: transparent;
  container-type: inline-size;
  width: 100%; min-width: 0; margin: 2rem 0;
  color: inherit; font: inherit; line-height: 1.65;
  text-align: start; isolation: isolate;
}
.p4et *, .p4et *::before, .p4et *::after { box-sizing: border-box; }
.p4et [hidden] { display: none !important; }
.p4et .p4et-heading { margin: 0 0 1.5rem; padding: 0; font-family: inherit; font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 700; line-height: 1.2; color: var(--p4et-ink); text-transform: none; letter-spacing: -.025em; }
.p4et .p4et-demo-label { margin: 0 0 .6rem; color: var(--p4et-muted); font-size: .8em; letter-spacing: .035em; }
.p4et .p4et-toolbar { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; padding: 18px; border: 1px solid var(--p4et-border); border-radius: 12px; background: var(--p4et-card); }
.p4et .p4et-field { display: flex; flex: 1 1 160px; flex-direction: column; gap: 5px; min-width: 0; }
.p4et .p4et-field label { font: inherit; font-size: .8em; font-weight: 600; color: var(--p4et-muted); }
.p4et select { width: 100%; max-width: 100%; min-height: 44px; padding: 8px 30px 8px 12px; font: inherit; font-size: .9em; line-height: 1.4; color: var(--p4et-ink); background-color: var(--p4et-card); border: 1px solid var(--p4et-border); border-radius: 6px; text-transform: none; }
.p4et button { min-height: 44px; padding: 10px 18px; font: inherit; font-size: .9em; font-weight: 600; line-height: 1.4; letter-spacing: normal; text-transform: none; border: 1px solid var(--p4et-border); border-radius: 7px; cursor: pointer; box-shadow: none; background: var(--p4et-card); color: var(--p4et-ink); white-space: normal; }
.p4et .p4et-reset { background: transparent; border-color: transparent; color: var(--p4et-muted); padding-inline: 10px; }
.p4et .p4et-status { margin: 14px 0 24px; font-size: .8em; color: var(--p4et-muted); }
.p4et .p4et-list { position: relative; padding: 0 !important; margin: 0 !important; list-style: none !important; }
.p4et .p4et-list::before { content: ""; position: absolute; z-index: -1; top: 20px; bottom: 32px; left: 18px; width: 2px; background: var(--p4et-line); }
.p4et .p4et-list:empty::before { display: none; }
.p4et .p4et-list > li { list-style: none !important; }

/* MONTH / YEAR LABELS */
.p4et .p4et-year { position: relative; padding: 0; margin: 34px 0 22px; z-index: 1; }
.p4et .p4et-year:first-child { margin-top: 0; }
.p4et .p4et-year > span { display: inline-block; background: var(--p4et-soft); border: 1px solid var(--p4et-border); border-radius: 6px; padding: 4px 11px; color: var(--p4et-ink); font-size: .82em; font-weight: 700; letter-spacing: .03em; }

.p4et .p4et-event { position: relative; min-width: 0; margin: 0 0 24px; padding-left: 56px; }
.p4et .p4et-event::before { content: ""; position: absolute; left: 18px; top: 29px; width: 38px; height: 1px; background: var(--p4et-line); z-index: -1; }
.p4et .p4et-marker { position: absolute; top: 12px; left: 18px; transform: translateX(-50%); display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 2px solid var(--p4et-line); border-radius: 50%; background: var(--p4et-card); color: var(--p4et-accent); }
.p4et .p4et-marker svg { display: block; width: 17px; height: 17px; }
.p4et .p4et-featured .p4et-marker { border-color: var(--p4et-accent); background: var(--p4et-accent); color: var(--p4et-on-accent); }

.p4et .p4et-card { overflow: hidden; width: 100%; min-width: 0; margin: 0; border: 1px solid var(--p4et-border); border-radius: 11px; background: var(--p4et-card); box-shadow: 0 3px 15px var(--p4et-shadow); transition: box-shadow .2s ease, transform .2s ease; }
.p4et .p4et-featured .p4et-card { border-top: 3px solid var(--p4et-accent); }

/* FIX: Clearfix за card-body, за да може float-натите снимки да не излизат от кутията */
.p4et .p4et-card-body { padding: 22px 24px; }
.p4et .p4et-card-body::after { content: ""; display: table; clear: both; }

.p4et .p4et-date { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 12px; margin: 0 0 10px; color: var(--p4et-muted); font-size: .78em; font-weight: 500; line-height: 1.5; }
.p4et .p4et-key { color: var(--p4et-accent); font-weight: 650; }
.p4et .p4et-event-title { margin: 0 0 12px; padding: 0; font-family: inherit; font-size: 1.2em; font-weight: 650; color: var(--p4et-ink); text-transform: none; letter-spacing: -.015em; line-height: 1.35; }

/* FIX: ОБТИЧАНЕ (Text Wrap) НА СНИМКИТЕ */
.p4et-thumb-float {
    float: left;
    width: 130px;
    margin: 5px 15px 10px 0;
    border-radius: 8px;
}
.p4et-thumb-float img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

/* FIX: ПРЕДСТОЯЩО СЪБИТИЕ (Голяма снимка отгоре) */
.p4et-large-image {
    width: 100%;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid var(--p4et-border);
}
.p4et-large-image img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    max-height: 400px;
}

/* FIX: МНОГО ПО-КРЕЩЯЩ АКЦЕНТ "ПРЕДСТОЯЩО" */
.p4et-upcoming-badge-wrapper {
    margin-bottom: 16px;
    clear: both;
}
.p4et-upcoming-badge {
    display: inline-flex;
    align-items: center;
    background: #ff2a2a; /* Много ярко червено */
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 900; /* Black/най-дебел шрифт */
    text-transform: uppercase;
    letter-spacing: 0.1em;
    box-shadow: 0 4px 12px rgba(255, 42, 42, 0.5);
    border: 2px solid #fff;
    animation: p4et-pulse-badge 2s infinite;
}

@keyframes p4et-pulse-badge {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 42, 42, 0.7); }
    50% { transform: scale(1.03); box-shadow: 0 0 0 8px rgba(255, 42, 42, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 42, 42, 0); }
}

.p4et .p4et-excerpt { margin: 0 0 16px; font: inherit; font-size: .95em; line-height: 1.7; color: var(--p4et-muted); }
.p4et .p4et-excerpt > :first-child { margin-top: 0; }
.p4et .p4et-excerpt > :last-child { margin-bottom: 0; }

.p4et .p4et-tags { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 8px; clear: both; /* подсигурява, че таговете минават под снимката, ако текстът е прекалено къс */ }

/* FIX: КАТЕГОРИИ БЕЗ НАГЪРЧВАНЕ (white-space: nowrap) */
.p4et .p4et-tag { display: inline-flex; align-items: baseline; gap: 6px; color: var(--p4et-muted); font-size: .72em; line-height: 1.5; white-space: nowrap; text-align: left; }
.p4et .p4et-tag::before { content: ""; flex: 0 0 6px; height: 6px; border-radius: 50%; background: var(--p4et-tag-color, var(--p4et-accent)); position: relative; top: -1px;}

.p4et .p4et-details { padding: 0; margin: 18px 0 0; border: 1px solid transparent; border-top-color: var(--p4et-border); border-radius: 0; background: transparent; }
.p4et .p4et-details[open] { border-color: var(--p4et-border); border-radius: 8px; }
.p4et .p4et-details > summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; padding: 10px 8px; margin: 0; cursor: pointer; list-style: none; font: inherit; font-weight: 600; font-size: .8em; background: transparent; color: var(--p4et-ink); }
.p4et .p4et-details-title { margin-inline-start: 6px; }
.p4et .p4et-details[open] > summary { border-bottom: 1px solid var(--p4et-border); }
.p4et .p4et-details-icons { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 20px; height: 20px; }
.p4et .p4et-icon { display: inline-block; font-family: Genericons, 'Timeline Genericons'; font-size: 18px; font-weight: normal; font-style: normal; line-height: 1; text-transform: none; text-decoration: none; speak: never; -webkit-font-smoothing: antialiased; }
.p4et .p4et-icon-plus::before { content: '\f510'; }
.p4et .p4et-icon-close::before { content: '\f405'; }
.p4et .p4et-icon-external::before { content: '\f442'; }
.p4et .p4et-details-icons .p4et-icon-close { display: none; }
.p4et .p4et-details[open] .p4et-details-icons .p4et-icon-plus { display: none; }
.p4et .p4et-details[open] .p4et-details-icons .p4et-icon-close { display: inline-block; }
.p4et .p4et-content { margin: 0; padding: 14px; color: var(--p4et-muted); font-size: .92em; }
.p4et .p4et-content > :first-child { margin-top: 0; }
.p4et .p4et-content > :last-child { margin-bottom: 0; }
.p4et :is(.p4et-content, .p4et-excerpt) :is(img, video, iframe) { max-width: 100%; height: auto; }
.p4et :is(.p4et-content, .p4et-excerpt) table { display: block; max-width: 100%; overflow: auto; }
.p4et :is(.p4et-content, .p4et-excerpt) pre { overflow: auto; }

.p4et .p4et-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 10px; color: var(--p4et-accent); font: inherit; font-size: .85em; font-weight: 600; text-decoration: none; background: transparent; }
.p4et .p4et-link:hover, .p4et :is(.p4et-content, .p4et-excerpt) a:hover { color: var(--p4et-accent); text-decoration: underline; background: transparent; }
.p4et :is(.p4et-content, .p4et-excerpt) a { color: var(--p4et-accent); }
.p4et .p4et-footer { display: flex; gap: 10px; justify-content: center; margin: 30px 0 0; }
.p4et .p4et-more, .p4et .p4et-retry { border-color: var(--p4et-accent); color: var(--p4et-accent); }
.p4et .p4et-more span { padding-left: 12px; }
.p4et .p4et-empty { padding: 24px; border: 1px dashed var(--p4et-border); border-radius: 10px; font-size: .95em; color: var(--p4et-muted); }
.p4et button:hover, .p4et .p4et-details > summary:hover { color: var(--p4et-accent); background: var(--p4et-hover); }
.p4et button:disabled { cursor: progress; opacity: .65; }
.p4et :is(button, select, a, summary):focus-visible { outline: 3px solid var(--p4et-accent); outline-offset: 3px; }
@media (hover: hover) { .p4et .p4et-card:hover { transform: translateY(-2px); box-shadow: 0 6px 22px var(--p4et-shadow-hover); } }

/* Desktop Alternate layout styling untouched */
@container (min-width: 760px) {
  .p4et-layout-alternate .p4et-list::before { left: 50%; transform: translateX(-50%); }
  .p4et-layout-alternate .p4et-year { text-align: center; }
  .p4et-layout-alternate .p4et-event { display: grid; grid-template-columns: minmax(0, 1fr) 68px minmax(0, 1fr); padding: 0; }
  .p4et-layout-alternate .p4et-odd .p4et-card { grid-column: 1; }
  .p4et-layout-alternate .p4et-even .p4et-card { grid-column: 3; }
  .p4et-layout-alternate .p4et-marker { left: 50%; }
  .p4et-layout-alternate .p4et-event::before { left: 50%; width: 34px; }
  .p4et-layout-alternate .p4et-odd::before { left: calc(50% - 34px); }
}

@container (max-width: 420px) {
  .p4et .p4et-toolbar { padding: 13px; gap: 10px; }
  .p4et .p4et-field { flex-basis: 100%; }
  .p4et .p4et-reset { width: 100%; }
  .p4et .p4et-card-body { padding: 16px; }
  .p4et .p4et-event { padding-left: 44px; }
  .p4et .p4et-event::before { width: 26px; }
  .p4et .p4et-event-title { font-size: 1.06em; }
  .p4et .p4et-marker { width: 30px; height: 30px; top: 14px; }
}

@media (prefers-reduced-motion: reduce) { .p4et *, .p4et *::before, .p4et *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } .p4et .p4et-card:hover { transform: none; } }
@media print { .p4et .p4et-toolbar, .p4et .p4et-footer { display: none !important; } .p4et .p4et-card { box-shadow: none; break-inside: avoid; } .p4et .p4et-event { break-inside: avoid; } }

/* Локация - Пин и Име */
.p4et-location-wrap { margin-left: 0px; font-size: 0.78em; font-weight: 500; line-height: 1.5; display: inline-flex; align-items: center; gap: 4px; color: var(--p4et-muted); }
.p4et-location-link { text-decoration: none !important; color: var(--p4et-accent); font-weight: 600; transition: opacity 0.2s ease; }
.p4et-location-link:hover { opacity: 0.8; text-decoration: underline !important; }
.p4et-location-text { font-weight: 600; color: var(--p4et-ink); }

/* --- 1. ИЗМИНАЛИ СЪБИТИЯ (Посивяла / "Забранена" визия) --- */
.p4et-event.p4et-past article.p4et-card {
    opacity: 0.65;
    filter: grayscale(85%);
    transition: filter 0.3s ease, opacity 0.3s ease;
}
.p4et-event.p4et-past:hover article.p4et-card {
    opacity: 0.95;
    filter: grayscale(20%);
}

/* Текущо събитие - акцент */
.p4et-event.p4et-current article.p4et-card {
    border: 2px solid var(--p4et-accent, #2271b1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

/* --- 2. СТИЛИЗИРАНЕ НА СВИТИТЕ СЕКЦИИ (<details>) --- */
/* МАХАМЕ DEFAULT СТРЕЛКИТЕ НА ВСИЧКИ БРАУЗЪРИ, ВКЛЮЧИТЕЛНО SAFARI/IOS */
.p4et .p4et-details > summary,
.p4et-group-summary,
.p4et .p4et-filters-summary {
    list-style: none !important; 
}
.p4et .p4et-details > summary::-webkit-details-marker,
.p4et-group-summary::-webkit-details-marker,
.p4et .p4et-filters-summary::-webkit-details-marker,
.p4et .p4et-details > summary::marker,
.p4et-group-summary::marker,
.p4et .p4et-filters-summary::marker {
    display: none !important;
    content: "" !important;
}

.p4et-group-wrapper { list-style: none !important; margin: 20px 0 !important; width: 100%; }
.p4et-group-details {
    background: rgba(0, 0, 0, 0.03); border: 1px dashed var(--p4et-border, #ccc); border-radius: 8px;
    padding: 10px; transition: background 0.2s ease;
}
.p4et-group-details[open] { background: transparent; border-style: solid; padding-bottom: 15px;}
.p4et-group-summary {
    font-weight: 600; font-size: 1.05em; cursor: pointer; display: flex;
    justify-content: space-between; align-items: center; padding: 12px 10px;
    color: var(--p4et-ink, #333); user-select: none;
    background: var(--p4et-card); border-radius: 6px;
    margin: 0; box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.p4et-group-summary:hover { color: var(--p4et-accent, #2271b1); background: var(--p4et-hover, rgba(0,0,0,0.02)); }
.p4et-group-toggle-icon { font-size: 0.8em; transition: transform 0.2s ease; display: inline-block; }
.p4et-group-details[open] .p4et-group-toggle-icon { transform: rotate(180deg); }
.p4et-group-list { list-style: none !important; padding: 20px 0 0 0 !important; margin: 0 !important; }

/* --- 3. СКРИТИ ФИЛТРИ С ФУНИЯ --- */
.p4et .p4et-toolbar { display: block !important; border: none !important; background: transparent !important; padding: 0 !important; }
.p4et .p4et-filters-details { margin-bottom: 20px; }
.p4et .p4et-filters-summary {
    display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
    font-weight: 600; color: var(--p4et-muted); padding: 10px 16px;
    border: 1px solid var(--p4et-border); border-radius: 8px;
    background: var(--p4et-card); user-select: none; transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.p4et .p4et-filters-summary:hover { color: var(--p4et-accent); background: var(--p4et-hover, rgba(0,0,0,0.03)); }
.p4et .p4et-toolbar-inner {
    display: flex; align-items: end; gap: 12px; flex-wrap: wrap;
    padding: 18px; margin-top: 10px; border: 1px solid var(--p4et-border);
    border-radius: 12px; background: var(--p4et-card); box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

/* MOBILE FIXES */
@media (max-width: 600px) {
    .p4et-thumb-float { width: 100px; margin: 5px 12px 5px 0; }
    .p4et-upcoming-badge { font-size: 0.7em; padding: 5px 10px; margin-bottom: 12px; }
    .p4et-group-summary { padding: 10px 12px; font-size: 0.95em; }
    .p4et-group-details { padding: 5px; }
    .p4et .p4et-toolbar-inner { padding: 12px; flex-direction: column; align-items: stretch; }
}
