/* ===========================================
   BITCOINS.COM.BR - Responsive Styles
   Mobile-First Approach
   =========================================== */

/* ===== Small Tablets (640px+) ===== */
@media (min-width: 640px) {
  .crypto-grid__cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .featured__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .related__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .about-values {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== Tablets (768px+) ===== */
@media (min-width: 768px) {
  .ticker__inner {
    gap: var(--space-10);
  }

  .hero__inner {
    grid-template-columns: 1fr 1fr;
  }

  .hero__visual {
    display: block;
  }

  .hub-hero__inner {
    grid-template-columns: 1fr 1fr;
  }

  .faq__inner {
    grid-template-columns: 1fr 1.5fr;
    gap: var(--space-16);
    text-align: left;
  }

  .faq__header {
    text-align: left;
  }

  .footer__grid {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
  }

  .footer__bottom {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }

  .toc {
    position: sticky;
    top: calc(var(--header-total) + var(--space-6));
  }

  .article__layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: var(--space-10);
    align-items: start;
  }

  .article__sidebar {
    order: 2;
  }

  .article__main {
    order: 1;
  }
}

/* ===== Desktop (1024px+) ===== */
@media (min-width: 1024px) {
  .menu-toggle {
    display: none;
  }

  .nav {
    display: flex;
  }

  .mobile-nav {
    display: none !important;
  }

  .crypto-grid__cards {
    grid-template-columns: repeat(4, 1fr);
  }

  .featured__header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .featured__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .hub-articles__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .related__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .about-values {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ===== Large Desktop (1200px+) ===== */
@media (min-width: 1200px) {
  .hero__title {
    font-size: var(--text-6xl);
  }

  .article__layout {
    grid-template-columns: 1fr 300px;
  }

  .hub-articles__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
  }
}

/* ===== Hover Media Query (non-touch devices) ===== */
@media (hover: hover) {
  .crypto-card:hover .crypto-card__icon {
    transform: scale(1.05);
  }

  .crypto-card__icon {
    transition: transform var(--duration-normal) var(--ease-smooth);
  }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .hero__btc-circle {
    animation: none;
  }

  .hero__orbit {
    animation: none;
  }
}

/* ===== Print Styles ===== */
@media print {
  .ticker,
  .header,
  .mobile-nav,
  .disclaimer-banner,
  .footer,
  .toc,
  .btn {
    display: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }

  .article__content {
    max-width: 100%;
  }

  a {
    color: #000;
    text-decoration: underline;
  }

  .disclaimer-box {
    border: 1px solid #000;
    padding: 10pt;
    margin: 20pt 0;
  }
}

/* ===== High Contrast Mode ===== */
@media (prefers-contrast: high) {
  :root {
    --color-btc-orange: #D97706;
    --color-gray-600: #374151;
  }

  .btn--primary {
    background: var(--color-btc-orange);
    box-shadow: none;
  }

  .crypto-card,
  .article-card {
    border-width: 2px;
  }
}

/* ===== Dark Mode Support (Optional) ===== */
@media (prefers-color-scheme: dark) {
  /* Uncomment to enable auto dark mode */
  /*
  :root {
    --color-white: #1A1715;
    --color-off-white: #1E1B19;
    --color-cream: #252220;
    --color-gray-50: #1E1B19;
    --color-gray-100: #252220;
    --color-gray-200: #3D3835;
    --color-gray-300: #5C554D;
    --color-gray-400: #7D756B;
    --color-gray-500: #A89F94;
    --color-gray-600: #D4CBC0;
    --color-gray-700: #E8E2D9;
    --color-gray-800: #F5F1EB;
    --color-gray-900: #FFFCF7;
    --color-charcoal: #0D0C0B;
  }

  .header {
    background: rgba(26, 23, 21, 0.92);
  }

  .crypto-card,
  .article-card,
  .toc,
  .info-box {
    background: var(--color-gray-100);
  }
  */
}

/* ===== Small Mobile Adjustments ===== */
@media (max-width: 380px) {
  .ticker__inner {
    justify-content: flex-start;
    gap: var(--space-4);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .ticker__inner::-webkit-scrollbar {
    display: none;
  }

  .ticker__divider {
    display: none;
  }

  .hero__actions {
    flex-direction: column;
  }

  .hero__actions .btn {
    width: 100%;
    justify-content: center;
  }

  .logo__text {
    font-size: var(--text-lg);
  }
}

/* ===== Landscape Mobile ===== */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    padding: var(--space-8) 0;
  }

  .section {
    padding: var(--space-10) 0;
  }
}

/* ===== Safe Area Insets (Notch phones) ===== */
@supports (padding: env(safe-area-inset-bottom)) {
  .footer {
    padding-bottom: calc(var(--space-8) + env(safe-area-inset-bottom));
  }

  .mobile-nav {
    padding-bottom: env(safe-area-inset-bottom);
  }
}
