/* Mobile completion layer for AMERICAFIRST.WATCH.
   Keeps the desktop HTML intact while giving phone viewports a finished,
   dense editorial layout based on the mobile mockup review. */

.afw-mobile-home-brief,
.afw-mobile-tabbar {
  display: none;
}

@media (max-width: 767px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  body.afw-mobile-ready {
    background: #f8f9fa;
    color: #191c1d;
  }

  body.afw-mobile-ready *,
  body.afw-mobile-ready *::before,
  body.afw-mobile-ready *::after {
    box-sizing: border-box;
  }

  body.afw-mobile-ready main,
  body.afw-mobile-ready section,
  body.afw-mobile-ready article,
  body.afw-mobile-ready aside,
  body.afw-mobile-ready div,
  body.afw-mobile-ready p,
  body.afw-mobile-ready a,
  body.afw-mobile-ready span,
  body.afw-mobile-ready h1,
  body.afw-mobile-ready h2,
  body.afw-mobile-ready h3,
  body.afw-mobile-ready h4,
  body.afw-mobile-ready li,
  body.afw-mobile-ready td,
  body.afw-mobile-ready th,
  body.afw-mobile-ready code,
  body.afw-mobile-ready pre {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  body.afw-mobile-ready .fixed.top-0,
  body.afw-mobile-ready .fixed.inset-x-0.top-0 {
    height: 34px !important;
    display: grid !important;
    grid-template-columns: 102px minmax(0, 1fr) !important;
    align-items: center !important;
    overflow: hidden !important;
  }

  body.afw-mobile-ready .fixed.top-0 > .absolute.left-0,
  body.afw-mobile-ready .fixed.inset-x-0.top-0 > .absolute.left-0 {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    grid-column: 1 !important;
    width: 102px !important;
    height: 34px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    box-shadow: none !important;
  }

  body.afw-mobile-ready .fixed.top-0 > .absolute.left-0 span,
  body.afw-mobile-ready .fixed.inset-x-0.top-0 > .absolute.left-0 span {
    font-size: 10px !important;
    letter-spacing: .12em !important;
  }

  body.afw-mobile-ready #dynamic-ticker-scroll {
    grid-column: 2 !important;
    min-width: 0 !important;
    width: max-content !important;
    margin-left: 0 !important;
    padding-left: 12px !important;
    padding-right: 24px !important;
    gap: 22px !important;
    font-size: 10px !important;
    letter-spacing: .02em !important;
    animation-duration: var(--afw-ticker-duration, 130s) !important;
    animation-play-state: paused !important;
  }

  body.afw-mobile-ready #dynamic-ticker-scroll.afw-ticker-ready {
    animation-play-state: running !important;
  }

  body.afw-mobile-ready nav.fixed {
    top: 34px !important;
    max-width: 100vw !important;
    overflow: hidden !important;
  }

  body.afw-mobile-ready nav.fixed > div {
    height: 64px !important;
    padding-left: 14px !important;
    padding-right: 12px !important;
    gap: 8px !important;
  }

  body.afw-mobile-ready nav.fixed a[href="index.html"] {
    display: inline-flex !important;
    align-items: center;
    max-width: calc(100vw - 166px) !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    font-size: 17px !important;
    line-height: 1 !important;
    letter-spacing: -.01em !important;
  }

  body.afw-mobile-ready nav.fixed > div > div:last-child,
  body.afw-mobile-ready nav.fixed .flex.shrink-0,
  body.afw-mobile-ready nav.fixed .flex.items-center.gap-4 {
    gap: 7px !important;
    flex-shrink: 0 !important;
  }

  body.afw-mobile-ready nav.fixed > div > div:last-child > span.material-symbols-outlined:first-child {
    display: inline-flex !important;
  }

  body.afw-mobile-ready nav.fixed span.material-symbols-outlined,
  body.afw-mobile-ready nav.fixed button.material-symbols-outlined,
  body.afw-mobile-ready nav.fixed button[id$="AuthLink"] {
    width: 38px !important;
    height: 38px !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1px solid #d7d9df !important;
    background: #ffffff !important;
    color: #101c2e !important;
    font-size: 24px !important;
    line-height: 1 !important;
  }

  body.afw-mobile-ready nav.fixed button[id$="AuthLink"] span.material-symbols-outlined {
    width: auto !important;
    height: auto !important;
    border: 0 !important;
    background: transparent !important;
    font-size: 21px !important;
  }

  body.afw-mobile-ready main {
    width: 100% !important;
    max-width: 100% !important;
    padding: 112px 14px 108px !important;
    margin: 0 auto !important;
  }

  body.afw-mobile-ready footer {
    padding-bottom: 108px !important;
  }

  body.afw-mobile-ready main > header,
  body.afw-mobile-ready main > div > header,
  body.afw-mobile-ready main > div:first-child {
    max-width: 100% !important;
  }

  body.afw-mobile-ready h1 {
    font-size: 34px !important;
    line-height: 1.02 !important;
    letter-spacing: 0 !important;
  }

  body.afw-mobile-ready h2 {
    font-size: 22px !important;
    line-height: 1.1 !important;
    letter-spacing: 0 !important;
  }

  body.afw-mobile-ready h3 {
    line-height: 1.15 !important;
    letter-spacing: 0 !important;
  }

  body.afw-mobile-ready .grid,
  body.afw-mobile-ready [class*="grid-cols-12"],
  body.afw-mobile-ready [class*="md:grid-cols"],
  body.afw-mobile-ready [class*="lg:grid-cols"],
  body.afw-mobile-ready [class*="xl:grid-cols"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.afw-mobile-ready [class*="col-span"] {
    grid-column: 1 / -1 !important;
  }

  body.afw-mobile-ready table {
    width: 100%;
  }

  body.afw-mobile-ready .overflow-x-auto,
  body.afw-mobile-ready table {
    -webkit-overflow-scrolling: touch;
  }

  body.afw-mobile-ready .rounded-lg,
  body.afw-mobile-ready .rounded-xl,
  body.afw-mobile-ready .rounded-2xl,
  body.afw-mobile-ready .rounded-3xl {
    border-radius: 4px !important;
  }

  .afw-mobile-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 58;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    padding: 9px 8px calc(9px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255,255,255,.08);
    background: #071426;
    box-shadow: 0 -10px 24px rgba(7, 20, 38, .28);
  }

  .afw-mobile-tabbar a,
  .afw-mobile-tabbar button {
    appearance: none;
    border: 0;
    background: transparent;
    color: rgba(255,255,255,.86);
    text-decoration: none;
    display: flex;
    min-height: 50px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font: 800 10px/1 Inter, Arial, sans-serif;
    letter-spacing: .06em;
    text-transform: uppercase;
  }

  .afw-mobile-tabbar .material-symbols-outlined {
    font-size: 24px;
    line-height: 1;
  }

  .afw-mobile-tabbar [aria-current="page"] {
    color: #fd5a65;
  }

  .afw-mobile-tabbar button {
    cursor: pointer;
  }

  /* Home */
  body.page-home main > header.relative {
    display: block !important;
    height: clamp(472px, 72svh, 560px) !important;
    min-height: 472px !important;
    margin: 0 0 16px !important;
    overflow: hidden !important;
    border: 1px solid #cfd2d8 !important;
    border-radius: 4px !important;
    background: #071426 !important;
  }

  body.page-home main > header.relative img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center top !important;
  }

  body.page-home main > header.relative > .absolute.inset-0 {
    background: linear-gradient(180deg, rgba(7, 20, 38, .1) 0%, rgba(7, 20, 38, .34) 38%, rgba(5, 9, 15, .96) 100%) !important;
    opacity: 1 !important;
  }

  body.page-home main > header.relative > .absolute.bottom-0 {
    padding: 18px !important;
  }

  body.page-home main > header.relative span.bg-secondary {
    margin-bottom: 12px !important;
    padding: 5px 8px !important;
    font-size: 9px !important;
    line-height: 1 !important;
    letter-spacing: .16em !important;
  }

  body.page-home main > header.relative h1 {
    max-width: 330px !important;
    margin: 0 0 18px !important;
    color: #ffffff !important;
    font-size: 46px !important;
    line-height: .86 !important;
    letter-spacing: 0 !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
  }

  body.page-home main > header.relative .flex.flex-wrap {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px !important;
    padding-top: 14px !important;
    border-top-color: rgba(255, 255, 255, .28) !important;
  }

  body.page-home main > header.relative .flex.flex-wrap > div {
    min-width: 0 !important;
  }

  body.page-home main > header.relative .flex.flex-wrap p:first-child {
    margin-bottom: 4px !important;
    color: rgba(255, 255, 255, .62) !important;
    font-size: 9px !important;
    line-height: 1.1 !important;
    letter-spacing: .12em !important;
  }

  body.page-home main > header.relative .flex.flex-wrap p:last-child {
    color: #ffffff !important;
    font-size: 14px !important;
    line-height: 1.12 !important;
    letter-spacing: 0 !important;
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
  }

  body.page-home main > header.relative .flex.flex-wrap > div:last-child p:last-child {
    color: #ffd4a3 !important;
    font-size: 13px !important;
  }

  body.page-home main > .grid {
    gap: 14px !important;
  }

  body.page-home main section {
    padding: 16px !important;
    border-right: 0 !important;
    border: 1px solid #d8dadf !important;
    background: #fff !important;
  }

  body.page-home main section .sticky {
    position: static !important;
  }

  body.page-home #top-debates-container,
  body.page-home #truth-social-feed-container,
  body.page-home .custom-scrollbar {
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    padding-right: 0 !important;
  }

  body.page-home #intelligence-feed-container > div,
  body.page-home #top-debates-container > a,
  body.page-home .truth-social-card,
  body.page-home [id^="video-container-"] {
    border-color: #d8dadf !important;
  }

  body.page-home #intelligence-feed-container .md\:flex-row {
    flex-direction: column !important;
  }

  body.page-home section.bg-primary-container {
    margin-left: -14px !important;
    margin-right: -14px !important;
    border-left: 0 !important;
    border-right: 0 !important;
    background: #101c2e !important;
  }

  /* News */
  body.page-news main > div:first-child,
  body.page-media main > header {
    align-items: stretch !important;
    margin-bottom: 18px !important;
    padding-bottom: 16px !important;
  }

  body.page-news main > div:first-child > div:last-child,
  body.page-media main > header > div:last-child {
    align-items: stretch !important;
    width: 100% !important;
  }

  body.page-news main > div:first-child .flex.gap-1,
  body.page-media main > header .flex.gap-1 {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }

  body.page-news main > div:first-child button,
  body.page-media main > header button {
    width: 100% !important;
    padding: 10px 8px !important;
    font-size: 10px !important;
  }

  body.page-news main > .grid,
  body.page-media main > .grid {
    gap: 16px !important;
  }

  body.page-news main section,
  body.page-news #rss-feed-container > div,
  body.page-news #ai-summary-container > div {
    border: 1px solid #d8dadf !important;
    background: #fff !important;
    box-shadow: none !important;
  }

  body.page-news #ai-summary-container {
    max-height: 560px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    border-bottom: 1px solid #d8dadf;
  }

  body.page-news #ai-summary-container::after {
    content: "Scroll briefing";
    display: block;
    position: sticky;
    bottom: 0;
    padding: 8px 10px;
    background: linear-gradient(to top, #fff 70%, rgba(255,255,255,.82));
    color: #b42435;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .12em;
    text-align: right;
    text-transform: uppercase;
  }

  body.page-news main section {
    padding: 16px !important;
  }

  body.page-news #summary-tabs {
    margin-left: -16px !important;
    margin-right: -16px !important;
    padding: 0 16px 10px !important;
    border-bottom: 1px solid #d8dadf !important;
  }

  body.page-news #feed-stats-container {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  body.page-news #rss-feed-container {
    gap: 12px !important;
  }

  body.page-news #rss-feed-container > div > div {
    margin-bottom: 10px !important;
  }

  body.page-news .news-card-title {
    font-size: 20px !important;
    line-height: 1.14 !important;
    white-space: normal !important;
  }

  body.page-news .news-card-summary {
    font-size: 14px !important;
    line-height: 1.55 !important;
  }

  /* Debate */
  body.page-discussion main > div > header {
    margin-bottom: 18px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  body.page-discussion #categoryTabs {
    width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding-bottom: 8px !important;
  }

  body.page-discussion .folder-tab {
    flex: 0 0 auto !important;
    border: 0 !important;
    border-bottom: 3px solid transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    color: #101c2e !important;
    padding: 10px 12px !important;
    margin: 0 !important;
    transform: none !important;
    opacity: 1 !important;
  }

  body.page-discussion .folder-tab.active {
    color: #b42435 !important;
    border-bottom-color: #b42435 !important;
  }

  body.page-discussion main .px-2.md\:px-8 {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  body.page-discussion main .flex.justify-between.items-center.mb-6,
  body.page-discussion main .flex.justify-between.items-center.mb-6 > .flex {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  body.page-discussion #newTopicBtn {
    width: 100% !important;
    background: #b42435 !important;
    color: #fff !important;
    padding: 13px 16px !important;
  }

  body.page-discussion #discussions-list {
    display: grid;
    gap: 12px;
  }

  body.page-discussion #discussions-list > div {
    display: block !important;
    padding: 16px !important;
    border: 1px solid #d8dadf !important;
    background: #fff !important;
    transform: none !important;
  }

  body.page-discussion #discussions-list h2,
  body.page-discussion #discussions-list .truncate {
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
  }

  body.page-discussion #discussions-list > div > div:last-child {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px 16px !important;
    margin-top: 12px !important;
    color: #4b5563 !important;
  }

  body.page-discussion #discussions-list > div > div:last-child > div {
    width: auto !important;
    margin-top: 0 !important;
  }

  body.page-discussion #newTopicModal > div,
  body.page-discussion #viewTopicModal > div {
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    max-height: calc(100dvh - 20px) !important;
    padding: 20px !important;
  }

  body.page-discussion #viewTopicModal > div {
    height: calc(100dvh - 20px) !important;
  }

  /* Presidential hub */
  body.page-president main > div:first-child {
    margin-bottom: 18px !important;
    padding-bottom: 16px !important;
  }

  body.page-president main > .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 10px !important;
    padding: 0 !important;
  }

  body.page-president .president-link h3 {
    margin-top: 8px !important;
    font-size: 13px !important;
    letter-spacing: .06em !important;
  }

  body.page-president .president-link p {
    font-size: 8px !important;
    line-height: 1.2 !important;
    letter-spacing: .06em !important;
  }

  body.page-president .president-link > div {
    padding: 5px !important;
    box-shadow: none !important;
  }

  body.page-president #sub-categories-layer {
    margin-top: 20px !important;
    padding: 14px !important;
    border: 1px solid #d8dadf !important;
    border-top: 4px solid #b42435 !important;
  }

  body.page-president #sub-categories-layer > div:first-child {
    align-items: flex-start !important;
    gap: 10px !important;
    margin-bottom: 14px !important;
  }

  body.page-president #sub-categories-layer > div:first-child > span {
    display: none !important;
  }

  body.page-president #sub-categories-layer .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.page-president #sub-category-content-container {
    padding: 16px !important;
    margin-top: 16px !important;
    overflow-x: auto;
  }

  /* Detail reader pages */
  body.page-detail main > div,
  body.page-support main > div {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  body.page-detail main header {
    padding-top: 22px !important;
    padding-bottom: 18px !important;
    margin-bottom: 16px !important;
  }

  body.page-detail main header h1 {
    font-family: Georgia, "Times New Roman", serif !important;
    font-size: 34px !important;
  }

  body.page-detail .source-tab {
    flex: 0 0 auto !important;
    border-radius: 2px !important;
    padding: 10px 12px !important;
    font-size: 10px !important;
  }

  body.page-detail #section-nav {
    padding: 14px !important;
    border-radius: 4px !important;
  }

  body.page-detail #biography-content {
    font-size: 16px !important;
    line-height: 1.7 !important;
  }

  body.page-detail #biography-content table,
  body.page-detail article table,
  body.page-detail main table {
    display: block !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    white-space: nowrap;
  }

  body.page-detail .p-12.border-2.border-dashed {
    padding: 28px 18px !important;
    border-radius: 4px !important;
  }

  /* Media archive */
  body.page-media main {
    margin-top: 0 !important;
  }

  body.page-media main > header {
    margin-bottom: 18px !important;
  }

  body.page-media #date-selector {
    gap: 8px !important;
  }

  body.page-media main > .bg-surface-container-lowest {
    padding: 14px !important;
    border-radius: 4px !important;
    margin-bottom: 28px !important;
  }

  body.page-media #timeline-scroll-container {
    height: 276px !important;
    padding-left: 18px !important;
    padding-right: 18px !important;
    margin-top: 26px !important;
    margin-bottom: 112px !important;
    align-items: center !important;
  }

  body.page-media #timeline-content {
    gap: 20px !important;
    align-items: center !important;
  }

  body.page-media #timeline-content > div {
    width: 132px !important;
  }

  body.page-media .yt-thumb {
    max-width: 132px !important;
    transform: translateX(-50%) !important;
  }

  body.page-media .yt-thumb:hover {
    transform: translateX(-50%) !important;
  }

  body.page-media .yt-timeline-time {
    display: inline-flex !important;
    align-items: center !important;
    min-height: 18px !important;
    line-height: 1 !important;
    border: 1px solid currentColor !important;
    background: #ffffff !important;
    z-index: 40 !important;
  }

  body.page-media .yt-inline-time {
    display: none !important;
  }

  body.page-media #timeline-content .yt-thumb.bottom-\[calc\(50\%\+20px\)\] {
    bottom: calc(50% + 38px) !important;
  }

  body.page-media #timeline-content .yt-thumb.top-\[calc\(50\%\+20px\)\] {
    top: calc(50% + 38px) !important;
  }

  body.page-media #timeline-content .yt-thumb[class*="bottom-[calc"] {
    bottom: calc(50% + 38px) !important;
  }

  body.page-media #timeline-content .yt-thumb[class*="top-[calc"] {
    top: calc(50% + 38px) !important;
  }

  body.page-media #timeline-content .absolute.bottom-\[50\%\],
  body.page-media #timeline-content .absolute.top-\[50\%\] {
    height: 34px !important;
  }

  body.page-media #timeline-content .yt-timeline-time[class*="top-[calc"] {
    top: auto !important;
    bottom: calc(50% + 14px) !important;
  }

  body.page-media #timeline-content .yt-timeline-time[class*="bottom-[calc"] {
    top: calc(50% + 14px) !important;
    bottom: auto !important;
  }

  body.page-media main > .grid {
    gap: 34px !important;
  }

  body.page-media [id$="-comments-list"] {
    max-height: 320px !important;
  }

  body.page-media .w-full.bg-surface-container-lowest.p-6.flex.flex-col.h-\[550px\] {
    height: 420px !important;
    padding: 14px !important;
  }

  body.page-media .marquee-container {
    mask-image: none !important;
    -webkit-mask-image: none !important;
  }

  /* Support and contact */
  body.page-support main {
    align-items: stretch !important;
    justify-content: flex-start !important;
  }

  body.page-support main > div {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 18px !important;
    border-top-width: 4px !important;
    box-shadow: none !important;
  }

  body.page-support main > div > .flex:first-child {
    align-items: flex-start !important;
    gap: 12px !important;
  }

  body.page-support main .prose {
    font-size: 15px !important;
    line-height: 1.65 !important;
  }

  body.page-support main .grid {
    gap: 14px !important;
  }

  body.page-support main .font-mono,
  body.page-support main textarea,
  body.page-support main input,
  body.page-support main select {
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }

  body.page-support footer .flex.gap-8 {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 14px !important;
  }
}
