/*
  07-responsive.css
  All breakpoints in one place, loaded last so these rules win.
  Covers tablets, phones and very narrow foldable screens down to
  about 280px wide. Edit here when a layout breaks at a small width.
*/

@media (max-width: 1024px) {
  .tm-trust-grid { grid-template-columns: repeat(2, 1fr); }
  .tm-usecases-grid { grid-template-columns: repeat(2, 1fr); }
  .tm-post-grid { grid-template-columns: repeat(2, 1fr); }
  .tm-security-grid { grid-template-columns: 1fr; gap: 26px; }
  .tm-whatis-grid { grid-template-columns: 1fr; gap: 26px; }
  .tm-policy-grid { grid-template-columns: 200px minmax(0, 1fr); gap: 28px; }
  .tm-footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
  .tm-footer-grid-no-recent { grid-template-columns: 1fr 1fr; }
  .tm-footer-brand { grid-column: 1 / -1; }
}

/* Article layout: the right rail drops below the text column and
   its cards sit side by side instead of squeezing the article */
@media (max-width: 1150px) {
  .tm-article-layout { grid-template-columns: minmax(0, 1fr); }
  .tm-article-layout.tm-has-toc { grid-template-columns: 230px minmax(0, 1fr); }
  .tm-article-rail {
    position: static; grid-column: 1 / -1;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    align-items: start;
  }
}

/* Article layout: the contents sidebar stacks above the text.
   The no rail variant is named here too: its base rule in 04-blog.css
   stacks three classes, which would otherwise outrank this stack. */
@media (max-width: 900px) {
  .tm-article-layout, .tm-article-layout.tm-has-toc, .tm-article-layout.tm-has-toc.tm-no-rail { grid-template-columns: 1fr; }
  .tm-toc { position: static; }
  .tm-article-rail { display: flex; }
}

@media (max-width: 768px) {
  .tm-container { padding-left: 16px; padding-right: 16px; }
  .tm-band.tm-band-blog { padding: 28px 0 44px; }
  .tm-band.tm-band-article { padding: 20px 0 44px; }
  .tm-article-hero img { height: auto; }
  .tm-article-layout { margin-top: 26px; }
  /* Phone gutters around the tool: the band and the plugin wrap each
     carried 20px of side padding, which stacked into a wide empty
     margin on phones. Tighten both so the tool uses the screen. */
  .tm-tool-band { padding-left: 6px; padding-right: 6px; }
  .tm-tool-slot .tm-wrap { padding-left: 10px; padding-right: 10px; }
  .tm-band { padding: 52px 0; }
  .tm-band-trust { padding: 26px 0 4px; }
  .tm-steps { grid-template-columns: 1fr; }
  .tm-why-grid { grid-template-columns: 1fr; }
  .tm-tips-grid { grid-template-columns: 1fr; }
  .tm-blog-grid { grid-template-columns: 1fr; }
  .tm-post-grid { grid-template-columns: 1fr; }
  .tm-policy-grid { grid-template-columns: 1fr; }
  .tm-policy-toc { position: static; }
  .tm-footer-grid { grid-template-columns: 1fr 1fr; gap: 24px 20px; padding-bottom: 32px; }
  .tm-footer-brand { grid-column: 1 / -1; }
  .tm-footer-recent { grid-column: 1 / -1; }
  .tm-footer-list li { margin-bottom: 9px; }
  .tm-footer-blurb { max-width: none; }
  .tm-footer-bottom { flex-direction: column; align-items: flex-start; gap: 6px; }
  .tm-author-box { flex-direction: column; text-align: center; }
  .tm-menu-toggle-item { margin-left: 4px; }
}

@media (max-width: 480px) {
  .tm-container { padding-left: 14px; padding-right: 14px; }
  .tm-trust-grid { grid-template-columns: 1fr; }
  .tm-usecases-grid { grid-template-columns: 1fr; }
  .tm-trust-card { padding: 18px; }
  .tm-feature-card { padding: 22px; }
  .tm-step { padding: 24px 20px; }
  .tm-security-card { padding: 26px 22px; }
  .tm-faq-q { padding: 16px 18px; font-size: 0.96rem; }
  .tm-faq-a { padding: 0 18px 18px; }
  .tm-btn { padding: 13px 22px; font-size: 0.95rem; }
  .tm-section-head { margin-bottom: 32px; }
}

/* Mobile header bar theme toggle: theme.js clones the menu toggle
   into the phone header bar next to the hamburger button. The clone
   only shows at phone widths. Astra's fixed scroll to top button is
   hidden at these widths because it kept covering the end of lines
   while scrolling. */
.tm-theme-toggle-bar { display: none; }

@media (max-width: 921px) {
  .tm-theme-toggle-bar { display: inline-flex; margin-right: 8px; align-self: center; }
  #ast-scroll-top { display: none !important; }
}

/* Very narrow foldable screens, around 280px wide */
@media (max-width: 340px) {
  .tm-container { padding-left: 12px; padding-right: 12px; }
  .tm-band { padding: 40px 0; }
  .tm-icon-tile { width: 44px; height: 44px; border-radius: 13px; }
  .tm-icon-tile-lg { width: 52px; height: 52px; }
  .tm-trust-card { flex-direction: column; gap: 12px; }
  .tm-social-links { flex-wrap: wrap; justify-content: center; }
  .tm-compare th, .tm-compare td { padding: 11px 13px; font-size: 0.9rem; }
  h1 { font-size: 1.65rem; }
}
