/* ========== QUILL EDITOR ========== */

.ql-toolbar.ql-snow {
    border: none;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 0.75rem 0.75rem 0 0;
}

.ql-container.ql-snow {
    border: none;
    background: white;
    border-radius: 0 0 0.75rem 0.75rem;
    font-family: inherit;
    min-height: 140px;
}

.ql-editor {
    min-height: 140px;
    font-size: 16px !important;
    line-height: 1.6 !important;
    color: #374151;
    padding: 16px;
}

.ql-editor.ql-blank::before {
    font-style: italic;
    color: #b8c1cf;
    font-size: 15px !important;
    line-height: 1.5 !important;
    white-space: pre-line; /* umożliwia \n w placeholder */
}

.ql-toolbar .ql-active,
.ql-toolbar button:hover,
.ql-toolbar button:focus,
.ql-toolbar button.ql-active,
.ql-toolbar .ql-picker-label:hover,
.ql-toolbar .ql-picker-label.ql-active,
.ql-toolbar .ql-picker-item:hover,
.ql-toolbar .ql-picker-item.ql-selected {
    color: #2563eb !important;
}

.ql-toolbar button.ql-active .ql-stroke,
.ql-toolbar button:hover .ql-stroke,
.ql-toolbar .ql-picker-label.ql-active .ql-stroke,
.ql-toolbar .ql-picker-label:hover .ql-stroke {
    stroke: #2563eb !important;
}

.ql-toolbar button.ql-active .ql-fill,
.ql-toolbar button:hover .ql-fill,
.ql-toolbar .ql-picker-label.ql-active .ql-fill,
.ql-toolbar .ql-picker-label:hover .ql-fill {
    fill: #2563eb !important;
}

.ql-toolbar button.ql-active {
    background: #dbeafe !important;
    border-radius: 4px;
}

.ql-editor h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1em;
    margin-bottom: 0.5em;
    color: #1f2937;
}

.ql-editor p {
    font-size: 16px;
    line-height: 1.6;
}

/* Przycisk Twitter/X */
.ql-toolbar button.ql-twitter {
    width: 28px !important;
}

.ql-toolbar button.ql-twitter::before {
    content: "𝕏";
    font-size: 16px;
    font-weight: bold;
}

/* Inline error przy submit */
.ql-submit-error {
    color: #ef4444;
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
}

/* Nagłówek w toolbarze */
.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="4"]::before,
.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="4"]::before {
    content: 'Nagłówek' !important;
    font-size: 1.1em;
    font-weight: 600;
}

/* Quill link tooltip na wierzchu */
.ql-tooltip {
    z-index: 9999 !important;
    position: fixed !important;
}

.ql-editing {
    left: 50% !important;
    transform: translateX(-50%) !important;
    top: 20% !important;
}

/* ========== EMBEDDED CONTENT W KOMENTARZACH ========== */

[id^="comment-text-"] iframe {
    max-width: 75%;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    margin: 12px auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: block;
}

[id^="comment-text-"] img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 12px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ql-editor iframe {
    max-width: 100%;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    margin: 12px 0;
}

.ql-editor .image-with-caption > img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Obrazki z podpisem */
.image-with-caption {
    margin: 16px 0;
    text-align: center;
}

.image-with-caption > img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    width: 50%; /* default, overridden by img-w-* */
}

/* Width classes — stored on div, safe through bleach (class attr allowed) */
.image-with-caption.img-w-25 > img  { width: 25%; }
.image-with-caption.img-w-50 > img  { width: 50%; }
.image-with-caption.img-w-75 > img  { width: 75%; }
.image-with-caption.img-w-100 > img { width: 100%; max-width: 560px; }

.image-with-caption > figcaption {
    font-size: 13px;
    color: #6b7280;
    margin-top: 6px;
    font-style: italic;
    text-align: center;
}

/* Twitter embed */
.twitter-embed-wrapper {
    margin: 16px 0;
    max-width: 550px;
}

.twitter-tweet {
    margin: 0 auto !important;
}

/* ========== HASHTAGI i CASHTAGI ========== */

a.hashtag,
a.cashtag {
    color: #1d9bf0 !important;
    font-weight: 600;
    text-decoration: none;
}

a.hashtag:hover,
a.cashtag:hover {
    text-decoration: underline;
}

/* ========== COMMENT-BODY WRAPPER ========== */
/* Główny wrapper treści komentarza — używaj .comment-body do stylowania wszystkiego
   co dotyczy wyłącznie komentarzy (linki, obrazki, emoji, typografia).
   Selektor [id^="comment-text-"] zostawiony dla kompatybilności wstecznej. */

.comment-body,
.comment-text,
[id^="comment-text-"] {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

/* Linki w komentarzach */
.comment-body a,
[id^="comment-text-"] a {
    color: #1d9bf0;
    text-decoration: none;
}
.comment-body a:hover,
[id^="comment-text-"] a:hover {
    text-decoration: underline;
}

/* ========== EMOJI ========== */

.comment-body img.emoji,
[id^="comment-text-"] img.emoji {
    width: 1.2em !important;
    height: 1.2em !important;
    margin: 0 0.05em 0 0.1em !important;
    vertical-align: -0.1em !important;
    display: inline !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Pusta linia między akapitami — mniejszy odstęp niż pełny akapit */
[id^="comment-text-"] p:empty,
[id^="comment-text-"] p > br:only-child {
    margin-top: 0;
    margin-bottom: 0;
    line-height: 0.4;
}
