/* Digitana Social - Galerie Mobile
   Ausschliesslich responsive Galerie-Regeln. */

@media (max-width: 980px) {
  .ds-gallery-shell {
    padding: 14px 12px 22px;
  }

  .ds-gallery-shell .ds-gallery-hub-layout,
  .ds-gallery-shell .ds-gallery-hub-main,
  .ds-profile-gallery-tab,
  #profile-gallery-workspace {
    min-width: 0;
    max-width: 100%;
  }

  .ds-gallery-shell .ds-gallery-search,
  .ds-profile-gallery-tab .ds-gallery-search {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
  }

  .ds-gallery-shell .ds-gallery-search-form,
  .ds-profile-gallery-tab .ds-gallery-search-form {
    min-width: 0;
  }

  .ds-gallery-shell .ds-gallery-section-title,
  .ds-profile-gallery-tab .ds-gallery-section-title {
    grid-template-columns: minmax(0, auto) minmax(32px, 1fr);
    min-width: 0;
  }

  .ds-gallery-shell .ds-gallery-section-title h2,
  .ds-profile-gallery-tab .ds-gallery-section-title h2 {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .ds-gallery-shell .ds-gallery-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .ds-gallery-shell .ds-gallery-category-grid.ds-gallery-category-grid-single {
    grid-template-columns: minmax(0, 1fr);
  }

  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-category-empty {
    display: none;
  }

  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-feed-list {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: 1fr;
    gap: 10px;
  }

  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-card,
  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-album-card,
  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-image-card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    align-content: stretch;
    gap: 8px;
    width: 100%;
    max-width: none;
    min-width: 0;
    height: 100%;
    padding: 8px;
  }

  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-card-media {
    width: 100%;
    min-width: 0;
  }

  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-cover,
  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-album-cover-link {
    width: 100%;
    height: clamp(112px, 30vw, 190px);
    min-width: 0;
  }

  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-card-main,
  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-album-body,
  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-card-titleblock {
    width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-card-main,
  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-album-body {
    display: grid;
    align-content: start;
  }

  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-card-titleblock {
    display: grid;
    grid-template-rows: auto auto minmax(calc(0.82rem * 1.45 * 2), auto);
    align-content: start;
  }

  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-card-meta,
  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-album-meta {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 5px;
    min-width: 0;
  }

  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-owner-chip {
    width: fit-content;
    min-width: 0;
    max-width: 100%;
    flex: 0 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-image-count {
    min-width: max-content;
    margin-left: 0;
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-card-titleblock h3,
  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-album-body h3,
  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-card-titleblock h3 a,
  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-album-body h3 a {
    display: block;
    max-width: 100%;
    min-height: 1.25em;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-info-divider,
  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-card-action-block {
    width: 100%;
    min-width: 0;
  }

  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-card-action-row {
    align-items: center;
    flex-wrap: nowrap;
    gap: 4px;
    min-width: 0;
  }

  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-card-action-left,
  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-card-action-right {
    flex-wrap: nowrap;
    gap: 3px;
    min-width: 0;
  }

  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-card-action-left {
    flex: 1 1 auto;
  }

  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-card-action-right {
    flex: 0 0 auto;
    justify-content: flex-end;
    margin-left: auto;
  }

  .ds-gallery-shell .ds-gallery-category-grid .ds-profile-reaction-popover,
  .ds-gallery-shell .ds-gallery-category-grid .ds-profile-post-visibility-popover,
  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-share-popover {
    max-width: calc(100vw - 28px);
  }

  .ds-gallery-shell .ds-gallery-search-results .ds-gallery-feed-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .ds-gallery-shell .ds-gallery-search-results .ds-gallery-card,
  .ds-gallery-shell .ds-gallery-search-results .ds-gallery-album-card,
  .ds-gallery-shell .ds-gallery-search-results .ds-gallery-image-card {
    width: 100%;
    max-width: none;
  }

  .ds-gallery-shell .ds-gallery-hub-main > .ds-gallery-image-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .ds-profile-gallery-tab .ds-profile-gallery-grid,
  .ds-profile-gallery-tab .ds-gallery-profile-overview-main > .ds-gallery-feed-list.ds-gallery-image-grid {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 12px;
  }

  .ds-profile-gallery-tab .ds-gallery-card,
  .ds-profile-gallery-tab .ds-gallery-album-card,
  .ds-profile-gallery-tab .ds-gallery-image-card,
  .ds-profile-gallery-tab .ds-profile-gallery-card {
    grid-template-rows: auto auto auto;
    align-items: start;
    align-content: start;
    gap: 8px;
    width: 100%;
    max-width: none;
    min-width: 0;
    height: auto;
    padding: 10px;
  }

  .ds-profile-gallery-tab .ds-gallery-card-main,
  .ds-profile-gallery-tab .ds-gallery-album-body,
  .ds-profile-gallery-tab .ds-profile-module-card-body,
  .ds-profile-gallery-tab .ds-gallery-card-titleblock {
    min-width: 0;
    align-self: start;
    overflow: hidden;
  }

  .ds-profile-gallery-tab .ds-gallery-card-head {
    margin-bottom: 0;
  }

  .ds-profile-gallery-tab .ds-gallery-card-meta,
  .ds-profile-gallery-tab .ds-gallery-album-meta {
    margin: 0 0 2px;
  }

  .ds-profile-gallery-tab .ds-gallery-card-description {
    max-width: 100%;
    margin-top: 0;
  }

  .ds-profile-gallery-tab .ds-gallery-info-divider {
    margin: 0;
  }

  .ds-profile-gallery-tab .ds-gallery-profile-overview {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .ds-profile-gallery-tab .ds-gallery-profile-overview-main,
  .ds-profile-gallery-tab .ds-gallery-profile-overview-side {
    width: 100%;
    max-width: none;
    min-width: 0;
    margin-left: 0;
  }

  .ds-gallery-shell .ds-gallery-album-header,
  .ds-gallery-shell .ds-gallery-panel,
  .ds-gallery-shell .ds-gallery-detail,
  .ds-profile-gallery-tab .ds-gallery-album-header,
  .ds-profile-gallery-tab .ds-gallery-panel,
  .ds-profile-gallery-tab .ds-gallery-detail {
    width: 100%;
    max-width: none;
    min-width: 0;
    padding: 10px 11px 12px;
  }

  .ds-gallery-shell .ds-gallery-detail-image,
  .ds-profile-gallery-tab .ds-gallery-detail-image {
    width: 100%;
    max-width: none;
  }

  .ds-gallery-shell .ds-gallery-comments,
  .ds-profile-gallery-tab .ds-gallery-comments {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .ds-gallery-shell .ds-gallery-comments > .ds-profile-comment,
  .ds-profile-gallery-tab .ds-gallery-comments > .ds-profile-comment {
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 900px) {
  .ds-gallery-shell {
    padding-left: 0;
    padding-right: 0;
  }

  .ds-gallery-shell .ds-gallery-topbar,
  .ds-gallery-shell .ds-gallery-search {
    width: calc(100% - 24px);
    margin-left: 12px;
    margin-right: 12px;
  }

  .ds-gallery-shell .ds-gallery-search-results > .ds-gallery-section-title,
  .ds-gallery-shell .ds-gallery-search-results > .ds-gallery-section-note,
  .ds-gallery-shell .ds-gallery-search-results > .ds-gallery-empty-line {
    margin-left: 12px;
    margin-right: 12px;
  }

  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-section-title {
    margin-left: 8px;
    margin-right: 8px;
  }

  .ds-profile-body:has(> .ds-profile-gallery-tab) {
    padding-left: 0;
    padding-right: 0;
  }

  .ds-profile-body:has(> .ds-profile-gallery-tab) > .ds-profile-save-note,
  .ds-profile-body:has(> .ds-profile-gallery-tab) > .ds-profile-error-note,
  .ds-profile-gallery-tab .ds-gallery-backnav-slim {
    margin-left: 12px;
    margin-right: 12px;
  }

  .ds-gallery-profile-tools,
  .ds-gallery-profile-overview,
  .ds-gallery-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .ds-gallery-profile-overview {
    gap: 18px;
  }

  .ds-gallery-profile-overview-side {
    margin-left: 0;
  }

  .ds-profile-gallery-tab .ds-gallery-profile-tools,
  .ds-profile-gallery-tab .ds-gallery-profile-tool-panel,
  .ds-profile-gallery-tab .ds-gallery-profile-tool-body,
  .ds-profile-gallery-tab .ds-gallery-profile-form {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .ds-profile-gallery-tab .ds-gallery-card-preview-zone {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .ds-profile-gallery-tab .ds-gallery-card-preview-panel,
  .ds-profile-gallery-tab .ds-gallery-card-preview-controls > .ds-gallery-album-target-field,
  .ds-profile-gallery-tab .ds-gallery-card-preview-controls > .ds-gallery-file-picker-field {
    grid-column: auto;
    grid-row: auto;
  }

  .ds-profile-gallery-tab .ds-gallery-card-preview-panel {
    justify-items: start;
  }

  .ds-profile-gallery-tab .ds-gallery-file-action-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    min-width: 0;
  }

  .ds-profile-gallery-tab .ds-gallery-image-clear-button {
    grid-column: auto;
  }

  .ds-profile-gallery-tab .ds-gallery-file-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ds-profile-gallery-tab .ds-gallery-manage-list {
    width: 100%;
    max-width: none;
  }

  .ds-profile-gallery-tab .ds-gallery-manage-row {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    min-width: 0;
  }

  .ds-profile-gallery-tab .ds-gallery-manage-rename-form {
    grid-template-columns: minmax(0, 1fr) auto auto;
    min-width: 0;
  }

  .ds-profile-gallery-tab .ds-gallery-manage-rename-form input[type="text"] {
    min-width: 0;
  }
}

@media (max-width: 720px) {
  .ds-gallery-shell .ds-gallery-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .ds-gallery-shell .ds-gallery-topbar-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
    width: 100%;
    min-width: 0;
  }

  .ds-gallery-shell .ds-gallery-topbar-actions:has(.ds-gallery-upload-primary-link) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 38px;
  }

  .ds-gallery-shell .ds-gallery-topbar-actions .ds-gallery-primary-link:not(.ds-gallery-upload-primary-link) {
    width: 100%;
    min-width: 0;
    padding: 7px 9px;
    font-size: 0.72rem;
    white-space: nowrap;
  }

  .ds-gallery-shell .ds-gallery-upload-primary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    min-width: 38px;
    padding: 0;
    font-size: 0;
    line-height: 1;
  }

  .ds-gallery-shell .ds-gallery-upload-primary-link::before {
    content: "+";
    font-size: 1.15rem;
    line-height: 1;
  }

  .ds-gallery-shell .ds-gallery-search,
  .ds-profile-gallery-tab .ds-gallery-search {
    width: 100%;
  }

  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-cover,
  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-album-cover-link {
    height: clamp(108px, 31vw, 160px);
  }

  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-section-title-small h2 {
    font-size: 0.78rem;
    letter-spacing: 0.07em;
  }

  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-card-titleblock h3,
  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-album-body h3 {
    font-size: 0.88rem;
  }

  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-card-description {
    font-size: 0.75rem;
  }

  .ds-gallery-shell .ds-gallery-hub-main > .ds-gallery-image-grid .ds-gallery-card {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .ds-profile-gallery-tab .ds-gallery-card,
  .ds-profile-gallery-tab .ds-gallery-album-card,
  .ds-profile-gallery-tab .ds-gallery-image-card,
  .ds-profile-gallery-tab .ds-profile-gallery-card {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .ds-gallery-shell .ds-gallery-hub-main > .ds-gallery-image-grid .ds-gallery-cover,
  .ds-gallery-shell .ds-gallery-hub-main > .ds-gallery-image-grid .ds-gallery-album-cover-link {
    width: 74px;
    height: 74px;
  }

  .ds-profile-gallery-tab .ds-gallery-cover,
  .ds-profile-gallery-tab .ds-gallery-album-cover-link,
  .ds-profile-gallery-tab .ds-profile-module-cover-link {
    width: 92px;
    height: 92px;
  }

  .ds-gallery-shell .ds-gallery-card-action-row,
  .ds-profile-gallery-tab .ds-gallery-card-action-row {
    min-width: 0;
  }

  .ds-gallery-shell .ds-gallery-detail-image,
  .ds-profile-gallery-tab .ds-gallery-detail-image {
    height: clamp(210px, 54vh, 460px);
  }

  .ds-profile-gallery-tab .ds-gallery-profile-tool-panel,
  .ds-profile-gallery-tab .ds-gallery-panel {
    padding: 10px;
  }

  .ds-profile-gallery-tab .ds-gallery-manage-search-form {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .ds-gallery-shell {
    padding: 10px 0 18px;
  }

  .ds-gallery-shell .ds-gallery-topbar {
    padding: 8px;
  }

  .ds-gallery-shell .ds-gallery-topbar-text {
    font-size: 0.82rem;
  }

  .ds-gallery-shell .ds-gallery-topbar-actions:has(.ds-gallery-upload-primary-link) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px;
    gap: 5px;
  }

  .ds-gallery-shell .ds-gallery-topbar-actions .ds-gallery-primary-link:not(.ds-gallery-upload-primary-link) {
    padding: 6px;
    font-size: 0.66rem;
    letter-spacing: 0.02em;
  }

  .ds-gallery-shell .ds-gallery-upload-primary-link {
    width: 36px;
    min-width: 36px;
  }

  .ds-gallery-shell .ds-gallery-category-grid {
    gap: 8px;
  }

  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-card,
  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-album-card,
  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-image-card {
    gap: 6px;
    padding: 7px;
  }

  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-cover,
  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-album-cover-link {
    height: 108px;
  }

  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-image-count {
    font-size: 0.7rem;
  }

  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-card-action-row,
  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-card-action-left,
  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-card-action-right {
    gap: 2px;
  }

  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-card .ds-profile-icon-link {
    width: 24px;
    min-width: 24px;
    height: 24px;
    min-height: 24px;
    border-radius: 7px;
    font-size: 0.88rem;
  }

  .ds-gallery-shell .ds-gallery-category-grid .ds-profile-action-count {
    margin-left: -3px;
    margin-right: 0;
    font-size: 0.66rem;
  }

  .ds-profile-gallery-tab .ds-gallery-file-action-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .ds-profile-gallery-tab .ds-gallery-file-name {
    display: none;
  }

  .ds-profile-gallery-tab .ds-gallery-manage-row {
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: start;
  }

  .ds-profile-gallery-tab .ds-gallery-manage-cover {
    width: 36px;
    height: 36px;
  }

  .ds-profile-gallery-tab .ds-gallery-manage-rename-form {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 6px;
  }

  .ds-profile-gallery-tab .ds-gallery-manage-delete-form {
    grid-column: 2;
    justify-self: end;
  }
}

@media (max-width: 360px) {
  .ds-gallery-shell .ds-gallery-category-grid {
    gap: 6px;
  }

  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-cover,
  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-album-cover-link {
    height: 96px;
  }

  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-card-action-row,
  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-card-action-left,
  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-card-action-right {
    gap: 1px;
  }

  .ds-gallery-shell .ds-gallery-category-grid .ds-gallery-card .ds-profile-icon-link {
    width: 22px;
    min-width: 22px;
    height: 22px;
    min-height: 22px;
    border-radius: 6px;
    font-size: 0.82rem;
  }

  .ds-gallery-shell .ds-gallery-topbar-actions .ds-gallery-primary-link:not(.ds-gallery-upload-primary-link) {
    font-size: 0.61rem;
    padding-left: 4px;
    padding-right: 4px;
  }
}
