/* ==========================================================
   AYW DESIGN SYSTEM
   PAGES / SOCIAL / FEED

   Responsabilidades:
   - estrutura principal do feed social;
   - cabeçalho da área de conteúdo;
   - navegação por abas;
   - painéis e listas;
   - paginação;
   - gerenciador de feeds RSS;
   - cards de notícias;
   - responsividade específica da área social.

   Aparência compartilhada vem de:
   - components/cards.css
   - components/buttons.css
   - components/forms.css
   - components/badges.css
   - components/alerts.css
   - components/empty-states.css

   Não utiliza:
   - Bootstrap;
   - regras internas do compositor;
   - regras internas dos posts;
   - regras internas dos comentários;
   - regras internas das mídias.
   ========================================================== */


/* ==========================================================
   ESTRUTURA PRINCIPAL
   ========================================================== */

   .ayw-feed-page,
   .ayw-feed-main,
   .ayw-feed-column {
     display: flex;
     flex-direction: column;
   
     width: 100%;
     min-width: 0;
     max-width: 100%;
   }
   
   .ayw-feed-page,
   .ayw-feed-main {
     gap: var(--ayw-space-3);
   }
   
   .ayw-feed-column {
     gap: var(--ayw-space-3);
   }
   
   
   /* ==========================================================
      CABEÇALHO
      ========================================================== */
   
   .ayw-feed-header {
     display: flex;
     flex-direction: column;
   
     width: 100%;
     min-width: 0;
   
     gap: var(--ayw-space-3);
   }
   
   .ayw-feed-header-main {
     flex: 1 1 auto;
   
     min-width: 0;
   }
   
   .ayw-feed-title {
     margin: 0;
   
     color: var(--ayw-text);
   
     line-height: var(--ayw-line-height-tight);
   }
   
   .ayw-feed-description {
     max-width: 42rem;
   
     margin:
       var(--ayw-space-2)
       0
       0;
   
     color: var(--ayw-text-muted);
   
     font-size: var(--ayw-font-size-sm);
     line-height: var(--ayw-line-height-relaxed);
   
     overflow-wrap: anywhere;
   }
   
   .ayw-feed-header-actions {
     display: flex;
     flex-wrap: wrap;
     align-items: center;
   
     min-width: 0;
   
     gap: var(--ayw-space-2);
   }
   
   .ayw-feed-header-actions form {
     margin: 0;
   }
   
   
   /* ==========================================================
      NAVEGAÇÃO POR ABAS
      ========================================================== */
   
   .ayw-feed-tabs {
     display: flex;
     align-items: center;
   
     width: 100%;
     min-width: 0;
   
     gap: var(--ayw-space-1);
   
     padding: 0.25rem;
   
     border: 1px solid var(--ayw-border);
     border-radius: var(--ayw-radius-lg);
   
     background: var(--ayw-surface);
   
     overflow-x: auto;
     overflow-y: hidden;
   
     scrollbar-width: none;
   
     -webkit-overflow-scrolling: touch;
   }
   
   .ayw-feed-tabs::-webkit-scrollbar {
     display: none;
   }
   
   
   /* ==========================================================
      ABA
      ========================================================== */
   
   .ayw-feed-tab {
     display: inline-flex;
     align-items: center;
     justify-content: center;
   
     flex: 1 1 0;
   
     min-width: max-content;
     min-height: 2.375rem;
   
     gap: var(--ayw-space-2);
   
     padding:
       0.5rem
       var(--ayw-space-3);
   
     border: 1px solid transparent;
     border-radius: var(--ayw-radius-md);
   
     background: transparent;
     color: var(--ayw-text-muted);
   
     font-size: var(--ayw-font-size-sm);
     font-weight: var(--ayw-font-weight-medium);
     line-height: 1;
   
     text-align: center;
     text-decoration: none;
     white-space: nowrap;
   
     cursor: pointer;
   
     -webkit-tap-highlight-color: transparent;
   
     transition:
       background-color var(--ayw-transition-fast),
       border-color var(--ayw-transition-fast),
       color var(--ayw-transition-fast),
       box-shadow var(--ayw-transition-fast);
   }
   
   .ayw-feed-tab:hover {
     background: var(--ayw-bg-muted);
     color: var(--ayw-text);
   
     text-decoration: none;
   }
   
   .ayw-feed-tab:focus-visible {
     outline: none;
   
     box-shadow:
       0 0 0 3px
       var(--ayw-focus-ring);
   }
   
   .ayw-feed-tab.is-active,
   .ayw-feed-tab[aria-selected="true"] {
     border-color: var(--ayw-primary-border);
   
     background: var(--ayw-primary-soft);
     color: var(--ayw-primary);
   
     font-weight: var(--ayw-font-weight-semibold);
   }
   
   .ayw-feed-tab.is-active:hover,
   .ayw-feed-tab[aria-selected="true"]:hover {
     border-color: var(--ayw-primary-border);
   
     background: var(--ayw-primary-soft);
     color: var(--ayw-primary);
   }
   
   .ayw-feed-tab-icon {
     display: grid;
     place-items: center;
   
     flex: 0 0 auto;
   
     width: 1rem;
     height: 1rem;
   }
   
   .ayw-feed-tab-count {
     display: inline-flex;
     align-items: center;
     justify-content: center;
   
     flex: 0 0 auto;
   
     min-width: 1.25rem;
     height: 1.25rem;
   
     padding-inline: 0.35rem;
   
     border-radius: var(--ayw-radius-pill);
   
     background: var(--ayw-bg-muted);
     color: var(--ayw-text-muted);
   
     font-size: var(--ayw-font-size-xs);
     font-weight: var(--ayw-font-weight-semibold);
     line-height: 1;
   
     white-space: nowrap;
   }
   
   .ayw-feed-tab.is-active .ayw-feed-tab-count,
   .ayw-feed-tab[aria-selected="true"] .ayw-feed-tab-count {
     background: var(--ayw-surface);
     color: var(--ayw-primary);
   }
   
   
   /* ==========================================================
      PAINÉIS
      ========================================================== */
   
   .ayw-feed-panels,
   .ayw-feed-panel {
     width: 100%;
     min-width: 0;
     max-width: 100%;
   }
   
   .ayw-feed-panels {
     display: flex;
     flex-direction: column;
   
     gap: var(--ayw-space-3);
   }
   
   .ayw-feed-panel {
     display: block;
   }
   
   .ayw-feed-panel[hidden] {
     display: none;
   }
   
   
   /* ==========================================================
      CABEÇALHO DO PAINEL
      ========================================================== */
   
   .ayw-feed-panel-header {
     display: flex;
     align-items: center;
     justify-content: space-between;
   
     width: 100%;
     min-width: 0;
   
     gap: var(--ayw-space-3);
   
     margin-bottom: var(--ayw-space-3);
   }
   
   .ayw-feed-panel-title {
     min-width: 0;
   
     margin: 0;
   
     overflow: hidden;
   
     color: var(--ayw-text);
   
     font-size: var(--ayw-font-size-lg);
     font-weight: var(--ayw-font-weight-semibold);
     line-height: var(--ayw-line-height-tight);
   
     text-overflow: ellipsis;
     white-space: nowrap;
   }
   
   .ayw-feed-panel-meta {
     flex: 0 0 auto;
   
     color: var(--ayw-text-muted);
   
     font-size: var(--ayw-font-size-xs);
     line-height: var(--ayw-line-height-normal);
   
     white-space: nowrap;
   }
   
   
   /* ==========================================================
      LISTA DO FEED
      ========================================================== */
   
   .ayw-feed-list {
     display: flex;
     flex-direction: column;
   
     width: 100%;
     min-width: 0;
     max-width: 100%;
   
     gap: var(--ayw-space-3);
   }
   
   .ayw-feed-list > * {
     width: 100%;
     min-width: 0;
     max-width: 100%;
   }
   
   
   /* ==========================================================
      PAGINAÇÃO
      ========================================================== */
   
   .ayw-feed-pagination {
     display: flex;
     align-items: center;
     justify-content: center;
   
     width: 100%;
     min-width: 0;
   
     margin-top: var(--ayw-space-2);
   }
   
   
   /* ==========================================================
      GERENCIADOR DE NOTÍCIAS
      ========================================================== */
   
   .ayw-news-manager {
     width: 100%;
     min-width: 0;

     margin-bottom: var(--ayw-space-4);
   }
   
   .ayw-news-manager > summary {
     flex-direction: row;
     align-items: center;
     justify-content: space-between;

     padding-block: var(--ayw-space-3);

     cursor: pointer;
   
     list-style: none;
   
     -webkit-tap-highlight-color: transparent;
   }
   
   .ayw-news-manager > summary::-webkit-details-marker {
     display: none;
   }
   
   .ayw-news-manager > summary::marker {
     content: "";
   }
   
   .ayw-news-manager-heading {
     display: flex;
     flex-wrap: wrap;
     align-items: baseline;
     gap: var(--ayw-space-2);
     min-width: 0;
   }

   .ayw-news-manager-action {
     display: inline-flex;
     align-items: center;
     gap: var(--ayw-space-2);
     color: var(--ayw-primary);
     font-size: var(--ayw-font-size-sm);
     font-weight: var(--ayw-font-weight-semibold);
   }

   .ayw-news-manager-action > [aria-hidden="true"] {
     flex: 0 0 auto;
   
     color: var(--ayw-text-muted);
   
     transition:
       color var(--ayw-transition-fast),
       transform var(--ayw-transition-fast);
   }
   
   .ayw-news-manager > summary:hover .ayw-news-manager-action > [aria-hidden="true"] {
     color: var(--ayw-primary);
   }
   
   .ayw-news-manager[open] > summary .ayw-news-manager-action > [aria-hidden="true"] {
     transform: rotate(180deg);
   }
   
   .ayw-news-manager[open] > summary {
     margin-bottom: 0;
   }
   
   
   /* ==========================================================
      FORMULÁRIOS DO GERENCIADOR
      ========================================================== */
   
   .ayw-news-manager .ayw-form-stack {
     display: grid;
   
     grid-template-columns:
       minmax(0, 1fr);
   
     align-items: end;
   
     width: 100%;
     min-width: 0;
   
     gap: var(--ayw-space-3);
   }
   
   .ayw-news-manager section {
     min-width: 0;
   
     margin-top: var(--ayw-space-4);
   }
   
   
   /* ==========================================================
      SUGESTÕES DE FEED
      ========================================================== */
   
   .ayw-feed-page .ayw-chip-group {
     display: flex;
     align-items: center;
   
     width: 100%;
     min-width: 0;
   
     gap: var(--ayw-space-2);
   
     padding-bottom: var(--ayw-space-1);
   
     overflow-x: auto;
     overflow-y: hidden;
   
     scrollbar-width: none;
   
     -webkit-overflow-scrolling: touch;
   }
   
   .ayw-feed-page .ayw-chip-group::-webkit-scrollbar {
     display: none;
   }
   
   .ayw-feed-page .ayw-chip-group form {
     flex: 0 0 auto;
   
     margin: 0;
   }
   
   
   /* ==========================================================
      FEED CADASTRADO
      ========================================================== */
   
   .ayw-feed-page .ayw-card-heading {
     display: flex;
     flex-wrap: wrap;
     align-items: center;
   
     min-width: 0;
   
     gap: var(--ayw-space-2);
   }
   
   .ayw-feed-page .ayw-card-heading > strong {
     min-width: 0;
   
     overflow-wrap: anywhere;
   }
   
   .ayw-feed-page .ayw-card-actions {
     display: flex;
     flex-wrap: wrap;
     align-items: center;
   
     min-width: 0;
   
     gap: var(--ayw-space-2);
   
     margin-top: var(--ayw-space-3);
   }
   
   .ayw-feed-page .ayw-card-actions form {
     margin: 0;
   }

   .ayw-news-feed-grid {
     display: grid;
     grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
     gap: var(--ayw-space-3);
   }
   
   
   /* ==========================================================
      NOTÍCIA
      ========================================================== */
   
   .ayw-news-card {
     display: grid;
   
     grid-template-columns:
       minmax(0, 1fr);
   
     width: 100%;
     min-width: 0;
   
     overflow: hidden;
   }

   .ayw-news-list {
     display: grid;
     grid-template-columns: minmax(0, 1fr);
     gap: var(--ayw-space-3);
   }

   .ayw-news-results-header {
     display: flex;
     flex-wrap: wrap;
     align-items: flex-start;
     justify-content: space-between;
     gap: var(--ayw-space-3);
     margin-bottom: var(--ayw-space-3);
   }
   
   .ayw-news-image {
     display: block;
   
     width: 100%;
     min-width: 0;
   
     aspect-ratio: 16 / 9;
   
     overflow: hidden;
   
     background: var(--ayw-bg-muted);
   }
   
   .ayw-news-image img {
     display: block;
   
     width: 100%;
     height: 100%;
   
     object-fit: cover;
   
     transition:
       transform var(--ayw-transition-fast);
   }

   .ayw-news-image-placeholder {
     display: grid;
     place-items: center;
     background: linear-gradient(135deg, var(--ayw-primary-soft), var(--ayw-bg-muted));
     color: var(--ayw-primary);
     font-size: var(--ayw-font-size-sm);
     font-weight: var(--ayw-font-weight-bold);
     letter-spacing: 0.12em;
   }
   
   .ayw-news-image:hover img {
     transform: scale(1.025);
   }
   
   .ayw-news-card .ayw-card-title {
     margin-top: var(--ayw-space-3);

     overflow-wrap: anywhere;
   }

   .ayw-news-meta {
     display: flex;
     flex-wrap: wrap;
     align-items: center;
     gap: var(--ayw-space-2);
   }
   
   .ayw-news-card .ayw-card-title a {
     color: inherit;
   
     text-decoration: none;
   }
   
   .ayw-news-card .ayw-card-title a:hover {
     color: var(--ayw-primary);
   
     text-decoration: none;
   }
   
   .ayw-news-summary {
     display: -webkit-box;
   
     margin:
       var(--ayw-space-2)
       0
       0;
   
     overflow: hidden;
   
     color: var(--ayw-text-muted);
   
     font-size: var(--ayw-font-size-sm);
     line-height: var(--ayw-line-height-relaxed);
   
     -webkit-box-orient: vertical;
     -webkit-line-clamp: 3;
   }
   
   .ayw-news-actions {
     display: flex;
     flex-wrap: wrap;
     align-items: center;
     justify-content: flex-end;
   
     min-width: 0;
   
     gap: var(--ayw-space-2);

     margin-top: var(--ayw-space-4);
   }
   
   
   /* ==========================================================
      NOTEBOOK E TABLET
      ========================================================== */
   
   @media (
     min-width: 48rem
   ) and (
     max-width: 74.999rem
   ) {
     .ayw-feed-tab {
       padding-inline: var(--ayw-space-2);
     }
   
     .ayw-feed-tab-icon {
       display: none;
     }
   
     .ayw-feed-description {
       max-width: 36rem;
     }
   }
   
   
   /* ==========================================================
      CELULAR
      ========================================================== */
   
   @media (max-width: 47.999rem) {
     .ayw-feed-tabs {
       justify-content: flex-start;
     }
   
     .ayw-feed-tab {
       flex: 0 0 auto;
   
       min-height: 2.5rem;
   
       padding-inline: var(--ayw-space-3);
     }
   
     .ayw-feed-panel-header {
       margin-bottom: var(--ayw-space-2);
     }
   
     .ayw-feed-list {
       gap: var(--ayw-space-3);
     }
   
     .ayw-feed-page .ayw-card-actions {
       align-items: stretch;
       flex-direction: column;
     }
   
     .ayw-feed-page .ayw-card-actions > *,
     .ayw-feed-page .ayw-card-actions form,
     .ayw-feed-page .ayw-card-actions .ayw-btn {
       width: 100%;
     }

     .ayw-news-results-header {
       align-items: flex-start;
       flex-direction: column;
     }

     .ayw-news-actions .ayw-btn {
       width: 100%;
     }
   
     .ayw-feed-pagination .ayw-btn {
       width: 100%;
     }
   }
   
   
   /* ==========================================================
      CELULAR COMPACTO
      ========================================================== */
   
   @media (max-width: 23.4375rem) {
     .ayw-feed-page,
     .ayw-feed-main,
     .ayw-feed-column,
     .ayw-feed-list,
     .ayw-feed-panels {
       gap: var(--ayw-space-2);
     }
   
     .ayw-feed-tabs {
       padding: 0.1875rem;
     }
   
     .ayw-feed-tab {
       min-height: 2.375rem;
   
       padding-inline: var(--ayw-space-3);
     }
   
     .ayw-feed-panel-header {
       align-items: flex-start;
       flex-direction: column;
   
       gap: var(--ayw-space-1);
     }
   
     .ayw-feed-panel-meta {
       white-space: normal;
     }
   }
   
   
   /* ==========================================================
      TABLET E DESKTOP
      ========================================================== */
   
   @media (min-width: 48rem) {
     .ayw-feed-header {
       flex-direction: row;
       align-items: flex-start;
       justify-content: space-between;
   
       gap: var(--ayw-space-4);
     }
   
     .ayw-feed-header-actions {
       flex: 0 0 auto;
   
       justify-content: flex-end;
     }
   
     .ayw-news-manager .ayw-form-stack {
       grid-template-columns:
         minmax(0, 0.7fr)
         minmax(0, 1.3fr)
         auto;
     }
   
     .ayw-feed-page .ayw-chip-group {
       flex-wrap: wrap;
   
       overflow: visible;
     }
   
     .ayw-news-card:has(.ayw-news-image) {
       grid-template-columns:
         12rem
         minmax(0, 1fr);
     }
   
     .ayw-news-image {
       height: 100%;

       min-height: 13rem;
   
       aspect-ratio: auto;
     }

     .ayw-news-card .ayw-card-body {
       display: flex;
       flex-direction: column;
     }

     .ayw-news-actions {
       margin-top: auto;
       padding-top: var(--ayw-space-4);
     }
   }
   
   
   /* ==========================================================
      MOVIMENTO REDUZIDO
      ========================================================== */
   
   @media (prefers-reduced-motion: reduce) {
     .ayw-feed-tab,
     .ayw-news-manager > summary > [aria-hidden="true"],
     .ayw-news-image img {
       transition: none;
     }
   
     .ayw-news-image:hover img {
       transform: none;
     }
   }
