.twfg { --twfg-gap: 24px; width: 100%; color: inherit; font: inherit; line-height: 1.5; }
.twfg *, .twfg-lightbox * { box-sizing: border-box; }
.twfg a { color: var(--twfg-accent, #286978); }
.twfg a:focus-visible, .twfg button:focus-visible, .twfg input:focus-visible, .twfg select:focus-visible { outline: 3px solid var(--twfg-accent, #286978); outline-offset: 4px; }
.twfg .twfg-albums, .twfg .twfg-photos { display: grid; grid-template-columns: repeat(var(--twfg-columns, 3), minmax(0, 1fr)); gap: var(--twfg-gap); }
.twfg .twfg-card { margin: 0; border: 1px solid #e2e7e8; border-radius: 10px; overflow: hidden; background: #fff; color: #233035; min-width: 0; }
.twfg .twfg-card-link { display: block; height: 100%; color: inherit; text-decoration: none; }
.twfg .twfg-card-link:hover h3 { color: var(--twfg-accent, #286978); text-decoration: underline; text-underline-offset: 4px; }
.twfg .twfg-cover { aspect-ratio: 4 / 3; background: #edf2f3; overflow: hidden; display: grid; place-items: center; }
.twfg .twfg-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.twfg .twfg-placeholder { color: #53656b; font-size: .9em; padding: 20px; text-align: center; }
.twfg .twfg-card-body { padding: 20px; }
.twfg .twfg-card h3 { font-size: 1.2em; line-height: 1.35; margin: 8px 0; font-weight: 650; }
.twfg .twfg-card p { font-size: .95em; margin: 10px 0 16px; }
.twfg .twfg-date, .twfg .twfg-count, .twfg .twfg-album-count { font-size: .88em; color: #55666c; }
.twfg .twfg-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 14px; padding: 20px; background: #f4f7f7; border-radius: 10px; color: #233035; margin: 0 0 28px; }
.twfg .twfg-filters label { display: flex; flex-direction: column; gap: 6px; font-size: .9em; font-weight: 600; margin: 0; }
.twfg .twfg-search { flex: 1 1 180px; }
.twfg .twfg-filters input, .twfg .twfg-filters select { font: inherit; font-weight: 400; color: #233035; background: #fff; border: 1px solid #abbac0; padding: 10px 12px; border-radius: 5px; min-height: 44px; max-width: 100%; width: 100%; }
.twfg .twfg-button { font: inherit; font-weight: 600; border: 0; border-radius: 5px; padding: 10px 18px; min-height: 44px; background: var(--twfg-accent, #286978); color: #fff; cursor: pointer; }
.twfg .twfg-reset { padding: 10px 0; font-size: .9em; text-underline-offset: 3px; }
.twfg .twfg-back { display: inline-block; margin-bottom: 20px; text-underline-offset: 4px; }
.twfg .twfg-album-header h2 { margin: 8px 0 16px; font-size: clamp(1.6em, 3vw, 2.2em); line-height: 1.2; }
.twfg .twfg-description { max-width: 75ch; }
.twfg .twfg-description p { margin: 0 0 16px; }
.twfg .twfg-photo { margin: 0; min-width: 0; }
.twfg .twfg-photo-link { display: block; background: #edf2f3; aspect-ratio: 4 / 3; border-radius: 7px; overflow: hidden; }
.twfg .twfg-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.twfg .twfg-photo figcaption { font-size: .9em; margin-top: 8px; overflow-wrap: anywhere; }
.twfg .twfg-pagination { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 30px; }
.twfg .twfg-pagination a, .twfg .twfg-pagination span { padding: 8px 13px; border: 1px solid #d4dfe2; border-radius: 4px; text-decoration: none; }
.twfg .twfg-pagination [aria-current] { color: #fff; background: var(--twfg-accent, #286978); border-color: var(--twfg-accent, #286978); }
.twfg .twfg-empty { padding: 28px; background: #f4f7f7; color: #33474f; border-radius: 8px; }
.twfg-lightbox { border: 0; padding: 0; margin: auto; width: 100vw; height: 100dvh; max-width: 100vw; max-height: 100dvh; background: #11191ff5; color: #fff; font-family: system-ui, sans-serif; }
.twfg-lightbox::backdrop { background: #11191f; }
.twfg-lightbox[open] { display: grid; grid-template-rows: 56px minmax(0, 1fr) auto; }
.twfg-lightbox .twfg-lb-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 4px 16px; gap: 12px; }
.twfg-lightbox button { cursor: pointer; font: inherit; color: #fff; background: #ffffff17; border: 1px solid #ffffff55; border-radius: 6px; min-width: 44px; min-height: 44px; padding: 8px 12px; }
.twfg-lightbox button:hover { background: #ffffff30; }
.twfg-lightbox button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.twfg-lightbox .twfg-lb-stage { min-height: 0; display: flex; align-items: center; justify-content: center; position: relative; padding: 8px 72px; touch-action: pan-y pinch-zoom; }
.twfg-lightbox .twfg-lb-image { display: block; max-width: 100%; max-height: 100%; object-fit: contain; width: auto; height: auto; }
.twfg-lightbox .twfg-lb-image[hidden] { display: none; }
.twfg-lightbox .twfg-lb-prev, .twfg-lightbox .twfg-lb-next { position: absolute; top: 50%; transform: translateY(-50%); font-size: 26px; line-height: 1; }
.twfg-lightbox .twfg-lb-prev { left: 14px; }
.twfg-lightbox .twfg-lb-next { right: 14px; }
.twfg-lightbox .twfg-lb-caption { text-align: center; padding: 14px 24px 24px; max-height: 25dvh; overflow: auto; margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.twfg-lightbox .twfg-lb-message { position: absolute; inset: 40% 20%; text-align: center; }
.twfg-lightbox .twfg-lb-message[hidden], .twfg-lightbox button[hidden] { display: none; }
@media (max-width: 760px) {
    .twfg .twfg-albums, .twfg .twfg-photos { grid-template-columns: repeat(min(2, var(--twfg-columns, 3)), minmax(0, 1fr)); gap: 16px; }
    .twfg .twfg-filters { padding: 16px; }
    .twfg .twfg-filters label { flex: 1 1 140px; }
    .twfg-lightbox .twfg-lb-stage { padding: 8px 48px; }
    .twfg-lightbox .twfg-lb-prev { left: 2px; }
    .twfg-lightbox .twfg-lb-next { right: 2px; }
}
@media (max-width: 480px) {
    .twfg .twfg-albums { grid-template-columns: 1fr; }
    .twfg .twfg-card-body { padding: 16px; }
    .twfg .twfg-photos { gap: 12px; }
}
