body {
  width: 100%;
  min-height: 100vh;
}

header {
  display: flex;
  width: 100%;
  padding: 1rem;
  color: var(--bs-white);
  background-color: var(--bs-gray);
  justify-content: space-between;
  align-items: center;
}

main {
  display: flex;
  min-height: 100%;
}

aside {
  background-color: var(--bs-gray);
  min-width: 20%;
}

aside ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

aside ul li {
  background-color: var(--bs-gray);
  color: var(--bs-white);
  padding: 1rem;
  cursor: pointer;
  transition: 0.5s;
}

aside ul li.active,
aside ul li:hover {
  filter: brightness(0.7);
  transition: 0.5s;
}

#main-content {
  padding: 2rem;
  flex-grow: 1;
}

#container-login {
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

#container-login .card {
  min-width: 30%;
}

.error-msg {
  color: var(--bs-danger);
}

/*LINKS*/
#links-list {
  display: block;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 50%;
}

.link-element-header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.link-element-header-container button {
  margin-left: 1rem;
}

.copy-box {
  width: 1ch;
  height: 1ch;
  display: none;
}

#notification-container {
  width: 100%;
  display: flex;
  justify-content: center;
}

#notification {
  opacity: 0;
  margin: 1rem;
  position: fixed;
  z-index: 5;
  box-shadow: 0 0 1rem rgba(0, 0, 0, 0.5);
  transition: 0.5s;
}

#notification.visible {
  opacity: 1;
  transition: 0.5s;
}


/* Hosted page layout */
.page-content {
  --max-width: 1100px;
  --gap-lg: 2.5rem;
  --gap-md: 1.5rem;
  --gap-sm: 1rem;
  --border-color: #e5e7eb;
  --text-color: #1f2937;
  --muted-color: #6b7280;

  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: var(--gap-lg);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: #fff;
}

.page-content .content-section {
  padding-bottom: var(--gap-md);
  border-bottom: 1px solid var(--border-color);
}

.page-content .content-title {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  line-height: 1.2;
}

.page-content .content-line {
  margin: 0;
  min-height: 1.6em;
}

.page-content .gallery-section {
  display: flex;
  flex-direction: column;
  gap: var(--gap-md);
  margin: 0;
}

.page-content .section-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-color);
}

.page-content .gallery-wrapper {
  display: grid;
  gap: var(--gap-md);
}

.page-content .layout-grid .gallery-wrapper {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: stretch;
}

.page-content .gallery-item {
  margin: 0;
  border-radius: 8px;
  overflow: hidden;
  background-color: #f9fafb;
  border: 1px solid var(--border-color);
}

.page-content .gallery-item a {
  display: block;
  width: 100%;
  height: 100%;
}

.page-content .gallery-item picture {
  display: block;
  width: 100%;
  height: 100%;
}

.page-content .gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

/* Alternative gallery layouts remain available through the existing selector. */
.page-content .layout-flex .gallery-wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}

.page-content .layout-flex .gallery-item {
  flex: 1 1 280px;
}

.page-content .layout-masonry .gallery-wrapper {
  display: block;
  column-count: 3;
  column-gap: var(--gap-md);
}

.page-content .layout-masonry .gallery-item {
  margin: 0 0 var(--gap-md);
  break-inside: avoid;
}

.page-content .layout-native-masonry .gallery-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: start;
}

.page-content .layout-hero .gallery-wrapper {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.page-content .layout-hero .gallery-item.is-hero {
  grid-column: 1 / -1;
}

.page-content .layout-hero .gallery-item.is-hero img {
  max-height: 70vh;
  object-fit: contain;
  background: #f4f4f4;
}

.page-content .attached {
  margin-top: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.page-content .attached h2 {
  font-size: 1.15rem;
}

.page-content .attached li {
  margin: 0.75rem 0;
}

.page-content .attached a {
  overflow-wrap: anywhere;
}

.page-content .meta {
  display: block;
  font-size: 0.9rem;
  color: var(--muted-color);
}

@supports (grid-template-rows: masonry) {
  .page-content .layout-native-masonry .gallery-wrapper {
    grid-template-rows: masonry;
  }
}

@media (max-width: 800px) {
  .page-content .layout-masonry .gallery-wrapper {
    column-count: 2;
  }

  .page-content .layout-hero .gallery-wrapper {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-content {
    padding: 1rem;
  }

  .page-content .layout-grid .gallery-wrapper,
  .page-content .layout-native-masonry .gallery-wrapper {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 500px) {
  .page-content .layout-masonry .gallery-wrapper {
    column-count: 1;
  }
}

/* SoundCloud metadata and official Widget API player */
.soundcloud-section {
  width: 100%;
  margin: 0;
}

.soundcloud-metadata {
  margin-bottom: 1rem;
}

.soundcloud-metadata-row {
  margin: 0.25rem 0;
}

.soundcloud-player {
  width: 100%;
  margin-top: 1rem;
}

.soundcloud-player iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  border: 0;
}

.soundcloud-player.soundcloud-border {
  border: 1px solid var(--border-color);
}

.soundcloud-player.soundcloud-shadow {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.soundcloud-player.soundcloud-rounded {
  overflow: hidden;
}

.soundcloud-confirm-panel {
  padding-top: 0.5rem;
}

.soundcloud-confirm-panel .form-check {
  margin-top: 0.35rem;
}

/* YouTube lazy player */
.youtube-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.5rem 0;
  width: 100%;
}
.youtube-position-left { align-items: flex-start; }
.youtube-position-center { align-items: center; }
.youtube-position-right { align-items: flex-end; }
.youtube-player-wrap {
  max-width: 100%;
  line-height: 0;
}
.youtube-player-wrap iframe,
.youtube-player-wrap .youtube-lazy {
  display: block;
  max-width: 100%;
  border: 0;
}
.youtube-lazy {
  position: relative;
  padding: 0;
  margin: 0;
  overflow: hidden;
  background: #111;
  cursor: pointer;
}
.youtube-lazy img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.youtube-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(0,0,0,.78);
  color: #fff;
  font-size: 24px;
  line-height: 1;
}
.youtube-lazy:hover .youtube-play { background: rgba(255,0,0,.9); }
.youtube-metadata,
.youtube-text-under {
  width: 100%;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.youtube-metadata-row { margin: 0.2rem 0; }
.youtube-text-under { margin-top: 0.25rem; }
.youtube-microdata { display: none; }

/* Hosted page text fields and page tags */
.page-text-field {
  white-space: pre-wrap;
  overflow-wrap: break-word;
  padding: 0 0 1.5rem;
}

.page-footer-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-footer-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-tags {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.page-tag {
  display: inline-block;
}

.tag-results-list {
  margin: 0;
  padding-left: 1.5rem;
}


/* Shared public header / footer (feed, tag, single page) */
.site-header {
  background: #111827;
  color: #f9fafb;
  padding: 0.9rem 1.25rem;
}
.site-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 1.25rem;
}
.site-logo {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}
.site-logo img {
  display: block;
  width: 180px;
  height: auto;
  background: #111827;
  object-fit: contain;
}
.site-header-brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  flex: 0 0 auto;
}
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.site-nav-link {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  color: #e5e7eb;
  text-decoration: none;
  font-size: 0.92rem;
  border: 1px solid transparent;
}
.site-nav-link:hover {
  color: #fff;
  text-decoration: none;
}
.site-nav-link.is-active {
  background: #f9fafb;
  color: #111827;
  border-color: #f9fafb;
  font-weight: 600;
}
.site-nav-link.is-disabled {
  opacity: 0.45;
  cursor: default;
}
.site-subheading {
  margin: 0;
  font-size: 0.82rem;
  color: #9ca3af;
}
.site-header-custom {
  margin-left: auto;
  flex: 0 1 auto;
  text-align: right;
  color: #f9fafb;
  font-size: 0.95rem;
}
.site-header-custom p {
  margin: 0;
}
@media (max-width: 640px) {
  .site-header-inner {
    flex-wrap: wrap;
  }
  .site-header-custom {
    margin-left: 0;
    text-align: left;
  }
}
.site-header-custom a {
  color: #f9fafb;
}
.site-footer {
  background: #111827;
  color: #e5e7eb;
  padding: 1.25rem;
  margin-top: 2rem;
}
.site-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  font-size: 0.95rem;
}
.site-footer a {
  color: #f9fafb;
}
.page-body {
  margin: 0;
  background: #fff;
  color: #1f2937;
}
.tag-body {
  margin: 0;
  background: #fff;
}

/* ==========================================================================
   Feed viewport — concatenated pages (newest first), paginated at 10
   Templates alter appearance of each page when shown inside a concatenation
   ========================================================================== */

.feed-body {
  margin: 0;
  background: #000000;
  color: var(--text-color, #1f2937);
}

.feed-header {
  background: #111827;
  color: #f9fafb;
  padding: 1.25rem 1.5rem;
  margin-bottom: 0;
}

.feed-header-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.feed-title {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 650;
}

.feed-title a {
  color: inherit;
  text-decoration: none;
}

.feed-title a:hover {
  text-decoration: underline;
}

.feed-summary {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  opacity: 0.85;
}

.feed-template-switcher {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.feed-template-switcher > span {
  opacity: 0.7;
  margin-right: 0.25rem;
}

.feed-template-link {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #f9fafb;
  text-decoration: none;
  border: 1px solid transparent;
}

.feed-template-link:hover {
  background: rgba(255, 255, 255, 0.18);
}

.feed-template-link.is-active {
  background: #f9fafb;
  color: #111827;
  border-color: #f9fafb;
}

.feed-main {
  /* Same content column as a single item page (1100px, padding on .page-content). */
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 0 3rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.feed-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: #6b7280;
}

/* Shared page block inside feed */
.feed-page {
  margin: 0 0 2rem;
}

.feed-page:first-of-type {
  margin-top: 1rem;
}

.feed-page .page-content {
  /* Match the standalone item page so gallery images use the same column width. */
  --gap-lg: 2.5rem;
  max-width: none;
  width: auto;
  margin: 0;
  padding: 2rem 1.5rem;
}

/* --- Template: default — simple separator between pages --- */
.feed-template-default {
  border-bottom: 1px solid #d1d5db;
  padding-bottom: 2rem;
}

.feed-template-default:last-of-type {
  border-bottom: none;
}

/* --- Template: card — bordered card with header bar --- */
.feed-template-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  margin-bottom: 1.75rem;
}

.feed-template-card .feed-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

.feed-template-card .feed-page-title {
  font-weight: 600;
  color: #111827;
  text-decoration: none;
}

.feed-template-card .feed-page-title:hover {
  text-decoration: underline;
}

.feed-template-card .feed-page-date {
  font-size: 0.85rem;
  color: #6b7280;
}

.feed-template-card .feed-page-body {
  padding: 2rem 1.5rem;
  background-color: transparent;
}

/* --- Template: compact — tighter spacing, thin bar --- */
.feed-template-compact {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px dashed #d1d5db;
}

.feed-template-compact .feed-page-body.page-content {
  --gap-lg: 2.5rem;
  --gap-md: 1.5rem;
  padding: 2rem 1.5rem;
}

.feed-template-compact .page-footer {
  font-size: 0.8rem;
  opacity: 0.85;
}

.feed-compact-bar {
  font-size: 0.8rem;
  text-align: right;
  padding-top: 0.35rem;
}

.feed-compact-bar a {
  color: #6b7280;
  text-decoration: none;
}

.feed-compact-bar a:hover {
  color: #111827;
  text-decoration: underline;
}

/* --- Template: magazine — large editorial header --- */
.feed-template-magazine {
  background: #fff;
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 3px solid #111827;
}

.feed-magazine-header {
  padding: 1.5rem 0 1rem;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 1.25rem;
}

.feed-magazine-title {
  margin: 0 0 0.35rem;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.feed-magazine-title a {
  color: #111827;
  text-decoration: none;
}

.feed-magazine-title a:hover {
  text-decoration: underline;
}

.feed-magazine-meta {
  margin: 0;
  font-size: 0.9rem;
  color: #6b7280;
}

.feed-magazine-meta a {
  color: #374151;
}

/* Pagination */
.feed-pagination {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #d1d5db;
}

.feed-pagination ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.feed-pagination li a {
  display: inline-block;
  min-width: 2.25rem;
  padding: 0.4rem 0.7rem;
  text-align: center;
  text-decoration: none;
  color: #374151;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.9rem;
}

.feed-pagination li a:hover {
  background: #f3f4f6;
}

.feed-pagination li.is-active a {
  background: #111827;
  color: #fff;
  border-color: #111827;
  pointer-events: none;
}

@media (max-width: 640px) {
  .feed-header {
    padding: 1rem;
  }

  .feed-main {
    padding: 0 0 2rem;
  }
  .feed-page .page-content,
  .feed-template-card .feed-page-body,
  .feed-template-compact .feed-page-body.page-content {
    padding: 1.5rem 1rem;
  }

  .feed-magazine-title {
    font-size: 1.35rem;
  }

  .feed-template-card .feed-page-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Lyte-style title + channel overlay on lazy YouTube thumbnails */
.youtube-lazy {
  position: relative;
}
.youtube-thumb-overlay {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  padding: 0.55rem 0.75rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  text-align: left;
  color: #fff;
  background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0));
  pointer-events: none;
  z-index: 2;
}
.youtube-thumb-title {
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.25;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.youtube-thumb-channel {
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0.92;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.youtube-thumb-date {
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.88;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.youtube-thumb-duration {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  line-height: 1.2;
  pointer-events: none;
  z-index: 2;
}

/* Keep feed card contents off the card border */
.feed-page .feed-page-body.page-content {
  box-sizing: border-box;
  padding-left: 1.25rem !important;
  padding-right: 1.25rem !important;
}

.feed-page .soundcloud-section,
.feed-page .soundcloud-player,
.feed-page .soundcloud-player iframe {
  max-width: 100%;
  box-sizing: border-box;
}

.feed-page .page-footer {
  padding-left: 0.15rem;
  padding-right: 0.15rem;
}

.feed-atom-link {
  text-align: center;
  margin: 1.5rem 0 0;
  font-size: 0.9rem;
  display:none;
}
.feed-atom-link a {
  color: #374151;
}

/* Admin dark mode */
html.admin-dark body,
html.admin-dark #main-content,
html.admin-dark .card,
html.admin-dark .list-group-item {
  background: #1f2937 !important;
  color: #f9fafb !important;
}
html.admin-dark .form-control,
html.admin-dark .form-select {
  background: #111827;
  color: #f9fafb;
  border-color: #374151;
}
html.admin-dark aside {
  background: #111827;
}

/* Featured tags sidebar on public pages */
.public-layout {
  display: flex;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  gap: 1.5rem;
}
.public-layout > main {
  flex: 1 1 0;
  min-width: 0;
}
.featured-tags-sidebar {
  flex: 0 0 220px;
  background: #111827;
  color: #f9fafb;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 1rem;
  align-self: flex-start;
  margin-top: 1rem;
  position: static;
}


}
.featured-tags-sidebar h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #f9fafb;
}
.featured-tags-sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.featured-tags-sidebar li {
  margin: 0.35rem 0;
}
.featured-tags-sidebar a {
  color: #d1d5db;
  text-decoration: none;
}
.featured-tags-sidebar a:hover {
  text-decoration: underline;
}
.featured-tags-sidebar .tag-count {
  color: #9ca3af;
  font-size: 0.85rem;
}
@media (max-width: 768px) {
  .public-layout {
    flex-direction: column;
  }
  .featured-tags-sidebar {
    flex: none;
    width: 100%;
    position: static;
    order: -1;
  }
}

/* Placed at the bottom of styles.css */
body .page-gallery .gallery-item img,
body .gallery-item img,
body .card-body img {
  width: 100% !important;
  height: auto !important;
  max-width: 100% !important;
  object-fit: contain !important;
  aspect-ratio: unset !important;
}
