/* nav-core-ext.css — Discover & Navigation Extensions */

.button-sub {
  margin: 0; padding: var(--space-2, 8px) var(--space-4, 16px);
  min-height: 44px; min-width: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-card, #ffffff); color: var(--text-muted, #757575);
  border: 1px solid var(--border-subtle, rgba(0,0,0,0.06)); border-radius: var(--fv-radius-pill, 9999px);
  font-size: var(--step--1, 0.875rem); font-weight: 500; cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: background 180ms cubic-bezier(0.16, 1, 0.3, 1), border-color 180ms cubic-bezier(0.16, 1, 0.3, 1), color 180ms cubic-bezier(0.16, 1, 0.3, 1), transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
.button-sub:hover {
  color: var(--text-main, var(--text-main, #0f172a));
  border-color: var(--border-strong, var(--border-strong, #cbd5e1));
}
.button-sub:focus-visible {
  outline: 2px solid var(--color-brand-primary, #0d9488);
  outline-offset: 2px;
}
.button-sub:active {
  transform: scale(0.97);
}
.button-sub.active {
  color: var(--color-brand-text, #0d7360);
  background: var(--fv-surface-teal-hover, rgba(0, 150, 136, 0.08));
  border-color: var(--border-brand, var(--color-brand-primary, #0d9488));
}

.hi { padding: 0; }
.hj {
  border-radius: 0;
  background: transparent;
  border: none;
}

#sub-nav { contain: layout style; margin-bottom: var(--space-6, 24px); }

/* Content Tiles (Emoji/Symbol buttons) */
:where(.button-content) {
  box-sizing: border-box; width: 100%; height: 100%; min-height: 44px;
  padding: var(--space-2, 8px) var(--space-3, 12px); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  -webkit-box-align: center; -webkit-box-pack: center;
  align-items: center; justify-content: center;
  border-radius: var(--radius-xl, 28px);
  font-size: var(--step-0, 1rem); line-height: 1.3;
  background: var(--surface-card, #ffffff); color: var(--text-main, var(--text-main, #0f172a));
  border: 1px solid var(--border-subtle, rgba(0,0,0,0.06));
  cursor: pointer; text-align: center; word-break: break-word;
  overflow: hidden; text-overflow: ellipsis;
  touch-action: manipulation;
  transition: border-color 180ms cubic-bezier(0.16, 1, 0.3, 1), background 180ms cubic-bezier(0.16, 1, 0.3, 1), color 180ms cubic-bezier(0.16, 1, 0.3, 1), transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
:where(.button-content:hover) {
  border-color: var(--color-brand-primary, var(--color-brand-primary, #0d9488));
  box-shadow: none;
}
:where(.button-content:focus-visible) {
  outline: 2px solid var(--color-brand-primary, #0d9488);
  outline-offset: 2px;
}
:where(.button-content:active),
:where(.button-content.active) {
  background: var(--fv-surface-teal-hover, rgba(0, 150, 136, 0.08));
  border-color: var(--color-brand-primary, var(--color-brand-primary, #0d9488));
  color: var(--color-brand-text, #0d7360);
  transform: scale(0.97);
}

/* Feed Cards */
:where(.card) {
  display: flex; flex-direction: column; align-items: stretch;
  width: 100%; height: 100%; min-height: 220px;
  border-radius: var(--radius-xl, 28px);
  overflow: hidden;
  background: var(--surface-card, #ffffff); border: 1px solid var(--border-subtle, rgba(0,0,0,0.06));
  box-shadow: none;
  touch-action: manipulation;
  contain: layout style; 
  transition: border-color 180ms cubic-bezier(0.16, 1, 0.3, 1), transform 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
:where(.card:hover) {
  border-color: var(--color-brand-primary, var(--color-brand-primary, #0d9488));
  box-shadow: none;
}
:where(.card:focus-visible) {
  outline: 2px solid var(--color-brand-primary, #0d9488);
  outline-offset: 2px;
}
:where(.card:active) { opacity: 0.9; transform: scale(0.98); }

.card-image { 
  width: 100%; height: 120px; aspect-ratio: 16 / 9; 
  object-fit: cover; display: block; background-color: var(--surface-hover, #f0f0f0); 
  image-rendering: -webkit-optimize-contrast; 
  border-radius: var(--radius-xl, 28px) var(--radius-xl, 28px) 0 0;
}
.card-content { padding: var(--space-3, 12px); display: flex; flex-direction: column; flex: 1; overflow: hidden; }

.card-title {
  font-size: var(--step-0, 1rem); font-weight: 600;
  color: var(--text-main, var(--text-main, #0f172a));
  margin-bottom: var(--space-1, 4px); line-height: 1.4; overflow: hidden;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
}
.card-description {
  font-size: var(--step--1, 0.875rem); color: var(--text-muted, #757575); line-height: 1.5; overflow: hidden;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
}

#main-buttons-container, #sub-buttons-container {
  display: flex; overflow-x: auto; white-space: nowrap;
  scrollbar-width: none; -ms-overflow-style: none;
  overscroll-behavior-x: contain; touch-action: pan-x; -webkit-overflow-scrolling: touch;
  contain: layout style;
}

#sub-buttons-container {
  gap: var(--space-2, 8px);
  padding: var(--space-1, 4px) 0;
  border-radius: 0;
  border: none;
  background: transparent;
}
#main-buttons-container::-webkit-scrollbar,
#sub-buttons-container::-webkit-scrollbar { display: none; }

/* Section Headers (Teal accent discipline) */
.group-header {
  padding: var(--space-2, 8px) 0 var(--space-3, 12px) 0;
  width: 100%;
  flex-basis: 100%;
  grid-column: 1 / -1;
}
.group-header-text {
  font-size: var(--step-1, 1.125rem);
  font-weight: 600;
  color: var(--color-brand-text, var(--color-brand-primary, #0d9488));
  line-height: 1.3;
}
.group-header-description {
  margin: var(--space-1, 4px) 0 0;
  font-size: var(--step--1, 0.875rem);
  color: var(--text-muted, #757575);
  line-height: 1.4;
}

/* Unboxed Group Containers */
.cm-group {
  margin-bottom: var(--space-8, 32px);
  contain: layout style;
  isolation: isolate;
}

.button-content-container,
.ure-btn-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 64px), 1fr));
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  background: transparent; 
  border-radius: 0;
  border: none;
  gap: var(--space-2, 8px);
  contain: layout style;
}

@media (min-width: 600px) {
  .button-content-container,
  .ure-btn-row {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 88px), 1fr));
  }
}

@media (min-width: 1024px) {
  .button-content-container,
  .ure-btn-row {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 100px), 1fr));
  }
}

.ure-btn-row--only,
.ure-btn-row--first,
.ure-btn-row--mid,
.ure-btn-row--last {
  border-radius: 0;
  padding: 0;
  margin: 0;
}

.card-content-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
  align-items: stretch;
  margin-bottom: var(--space-8, 32px);
  padding: 0;
  background: transparent; 
  border-radius: 0;
  border: none;
  gap: var(--space-4, 16px);
  contain: layout style;
}

@media (max-width: 600px) {
  .card-content-container { 
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: var(--space-3, 12px); 
    padding: 0;
  }
  .card { width: 100%; min-height: 200px; }
}
@media (max-width: 450px) {
  .container { padding-left: var(--space-3); padding-right: var(--space-3); }
}

::-webkit-scrollbar { height: var(--space-2, 8px); width: var(--space-2, 8px); background: var(--surface-hover, var(--surface-hover, #f1f5f9)); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb { background: var(--border-subtle, var(--border-strong, #cbd5e1)); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong, var(--text-faint, #94a3b8)); }

.img-d1 { padding: 0 var(--space-8, 32px); max-width: 800px; width: 100%; margin: 0 auto; display: flex; justify-content: center; }
.img-d1 picture { display: block; width: 100%; max-width: 100%; }
.img-d1 img { width: 100%; max-width: 100%; aspect-ratio: 16 / 9; background-color: var(--surface-hover, #f0f0f0); height: auto; object-fit: contain; border-radius: var(--radius-md, 8px); display: block; }

@media (prefers-reduced-motion: reduce) {
  :where(.button-content), :where(.card), .button-sub { transition: none !important; transform: none !important; }
}

#content-loading, #content-area {
  overflow-anchor: auto;
}
