/* Phone-only layout. Desktop rules in main.css stay unchanged. */

@media (max-width: 720px) {
  body {
    padding-bottom: 84px;
  }

  .container {
    width: calc(100% - 20px);
  }

  /* ── Header ── */
  .header-top {
    display: block;
    border-bottom: 1px solid var(--line);
  }

  .header-top-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
  }

  .brand {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: inherit;
    text-decoration: none;
  }

  .brand-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    background: var(--accent);
    color: #fff;
    font: 800 12px/1 Arial, sans-serif;
  }

  .brand-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .brand-copy strong {
    font-size: 15px;
    line-height: 1.1;
  }

  .brand-copy small {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: .06em;
    text-transform: uppercase;
  }

  .header-tools {
    gap: 8px;
  }

  .header-account,
  .header-cart {
    font-size: 10px;
    letter-spacing: .04em;
    white-space: nowrap;
  }

  .theme-switch {
    min-height: 34px;
    padding: 0 8px;
  }

  .theme-switch b {
    display: none;
  }

  .category-nav-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 0 4px;
    overflow: visible;
    padding: 4px 0 8px;
  }

  .category-nav a {
    padding: 8px 10px 8px 0;
    font-size: 11px;
    letter-spacing: .03em;
  }

  .category-nav a.nav-shop {
    margin: 2px 6px 2px 0;
    padding: 8px 14px !important;
    font-size: 11px !important;
    letter-spacing: .1em;
    box-shadow: 0 8px 18px rgba(25, 104, 221, .28);
  }

  .category-nav a[aria-current="page"]::after {
    height: 2px;
  }

  /* ── Homepage hero (magazine / editorial blogs) ── */
  .page-kind-home .home-hero {
    padding: 16px 0 8px;
    background: var(--paper);
  }

  .page-kind-home .home-hero-grid {
    gap: 0;
  }

  .page-kind-home .home-hero-copy h1 {
    margin: 8px 0 10px;
    font-size: clamp(30px, 9vw, 38px);
    line-height: 1.06;
    letter-spacing: -.04em;
  }

  .page-kind-home .home-hero-copy p {
    font-size: 15px;
    line-height: 1.55;
    color: #4d5b70;
  }

  .page-kind-home .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 16px;
  }

  .page-kind-home .hero-actions .button {
    width: 100%;
    min-height: 44px;
  }

  .page-kind-home .hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
  }

  .page-kind-home .hero-stats span {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    font-size: 9px;
    letter-spacing: .1em;
  }

  .page-kind-home .hero-stats b {
    font-size: 20px;
  }

  .page-kind-home .hero-feature {
    display: block;
    width: 100%;
    height: 220px;
    margin-top: 18px;
  }

  /* ── Homepage feed: vertical cards, image on top + title below ── */
  .page-kind-home .content-section {
    padding: 8px 0 32px;
    background: var(--paper);
  }

  .page-kind-home .content-with-sidebar {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .page-kind-home .ranking-sidebar {
    order: 2;
    margin-top: 28px;
  }

  .page-kind-home .section-heading {
    align-items: flex-start;
    margin-bottom: 12px;
  }

  .page-kind-home .section-heading h2 {
    font-size: 28px;
    line-height: 1;
    letter-spacing: -.04em;
  }

  .page-kind-home .section-number {
    font-size: 10px;
  }

  .page-kind-home .post-grid,
  .page-kind-home .section-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  .page-kind-home .post-card {
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .page-kind-home .post-image-wrap {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    height: auto;
    overflow: hidden;
    background: #e9eef4;
  }

  .page-kind-home .post-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .page-kind-home .post-category {
    padding: 8px 10px;
    font-size: 9px;
  }

  .page-kind-home .post-card-body {
    padding: 10px 0 0;
  }

  .page-kind-home .post-meta {
    margin: 0 0 8px;
    font-size: 11px;
    color: #6c7c90;
  }

  .page-kind-home .post-card h3 {
    margin: 0;
    font-size: 17px;
    line-height: 1.35;
    font-weight: 600;
    letter-spacing: -.02em;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
  }

  .page-kind-home .category-break {
    margin: 28px 0 24px;
  }

  .page-kind-home .section-heading-bottom {
    flex-wrap: wrap;
    gap: 8px;
  }

  .page-kind-home .ranking-panel {
    position: static;
    padding: 16px 12px 8px;
  }

  .page-kind-home .ranking-item {
    grid-template-columns: 22px 56px 1fr;
    gap: 10px;
    padding: 10px 0;
  }

  .page-kind-home .ranking-thumb {
    width: 56px;
    height: 42px;
  }

  .page-kind-home .ranking-item h4 {
    font-size: 13px;
  }

  /* ── Archive / list pages ── */
  .archive-shell .post-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .archive-shell .post-card {
    display: block;
    border: 0;
    padding: 0;
    background: transparent;
  }

  .archive-shell .post-image-wrap {
    aspect-ratio: 4 / 3;
    height: auto;
  }

  .archive-shell .post-card h3 {
    font-size: 17px;
    line-height: 1.35;
  }

  /* ── Generic mobile tweaks ── */
  .shop-hero-copy h1 {
    font-size: clamp(28px, 8.4vw, 36px);
  }

  .footer-contact-card {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .footer-contact-copy h2 {
    font-size: 22px;
  }

  .footer-whatsapp-cta {
    width: 100%;
    justify-content: space-between;
  }

  .floating-whatsapp,
  .floating-live-chat {
    right: 12px !important;
    bottom: 12px !important;
    width: 52px;
    height: 52px;
    padding: 0 !important;
    gap: 0 !important;
    justify-content: center;
    border-radius: 50%;
  }

  .floating-whatsapp-copy,
  .floating-live-chat > span:not(.floating-live-chat-icon) {
    display: none !important;
  }

  .floating-whatsapp-icon,
  .floating-live-chat-icon {
    width: 52px;
    height: 52px;
    font-size: 20px;
  }

  .article-shell,
  .archive-shell {
    padding: 8px 0 36px;
  }

  /* Article reading — Medium / Substack style comfort on phone */
  .page-kind-article .article-shell {
    padding: 0 0 28px;
  }

  .page-kind-article .article {
    max-width: none;
    margin: 0;
    padding: 18px 18px 28px;
    border: 0;
    border-radius: 0;
    background: var(--paper);
  }

  .page-kind-article .article-header {
    margin: 0 0 16px;
  }

  .page-kind-article .article-header .eyebrow {
    font-size: 11px;
    letter-spacing: .16em;
  }

  .page-kind-article .article h1 {
    font-size: clamp(26px, 7.2vw, 34px);
    line-height: 1.18;
    letter-spacing: -0.03em;
    margin: 10px 0 12px;
    font-weight: 700;
  }

  .page-kind-article .lede {
    font-size: 16px;
    line-height: 1.55;
    margin: 0 0 10px;
    max-width: none;
  }

  .page-kind-article .article-meta {
    margin-top: 12px;
    font-size: 11px;
    letter-spacing: .08em;
  }

  .page-kind-article .article-hero {
    width: calc(100% + 36px);
    margin: 8px -18px 22px;
    overflow: hidden;
    background: var(--panel);
  }

  .page-kind-article .article-hero img {
    width: 100%;
    max-height: none;
    height: auto;
    max-height: 56vh;
    object-fit: cover;
    object-position: center;
    display: block;
  }

  .page-kind-article .prose {
    font-size: 17px;
    line-height: 1.78;
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
  }

  .page-kind-article .prose p,
  .page-kind-article .prose ul,
  .page-kind-article .prose ol {
    margin: 0 0 1.15em;
  }

  .page-kind-article .prose h2 {
    font-size: 1.35rem;
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin: 1.6em 0 0.55em;
  }

  .page-kind-article .prose h3 {
    font-size: 1.15rem;
    line-height: 1.3;
    margin: 1.35em 0 0.45em;
  }

  .page-kind-article .prose img,
  .page-kind-article .prose figure {
    display: block;
    width: calc(100% + 36px);
    max-width: none;
    margin: 1.35em -18px;
    height: auto;
  }

  .page-kind-article .prose figure img {
    width: 100%;
    margin: 0;
  }

  .page-kind-article .prose figcaption,
  .page-kind-article .prose .local-ref {
    display: block;
    padding: 0 18px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--muted);
  }

  .page-kind-article .prose ul,
  .page-kind-article .prose ol {
    padding-left: 1.2em;
  }

  .page-kind-article .prose li {
    margin: 0 0 0.45em;
  }

  .page-kind-article .prose blockquote {
    margin: 1.2em 0;
    padding: 0.2em 0 0.2em 14px;
    border-left: 3px solid var(--accent);
    color: var(--muted);
  }

  .page-kind-article .prose table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 14px;
  }

  .page-kind-article .prose pre {
    overflow-x: auto;
    padding: 12px;
    font-size: 13px;
    border-radius: 8px;
  }

  .archive-shell {
    padding: 18px 0 40px;
  }

  .archive-header h1 {
    font-size: clamp(26px, 8vw, 34px);
  }

  .account-shell {
    padding: 28px 16px 90px;
  }

  .account-intro h1 {
    font: 800 32px/1.05 Arial, sans-serif !important;
    margin: 10px 0;
  }

  .account-auth {
    padding: 18px !important;
    margin-top: 24px !important;
  }

  .product-page {
    padding: 12px 0 72px !important;
  }

  .product-main-image {
    min-height: 240px !important;
  }

  .product-information h1 {
    font-size: 1.25rem !important;
  }

  .product-detail-price {
    font-size: 1.45rem !important;
  }
}

@media (max-width: 380px) {
  .header-account {
    max-width: 58px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .page-kind-article .article {
    padding: 14px 14px 24px;
  }

  .page-kind-article .article-hero,
  .page-kind-article .prose img,
  .page-kind-article .prose figure {
    width: calc(100% + 28px);
    margin-left: -14px;
    margin-right: -14px;
  }

  .page-kind-article .prose {
    font-size: 16.5px;
  }
}

/* ── Vertical reading guard: articles never pan sideways on phones ── */
@media (max-width: 720px) {
  html, body { overflow-x: hidden; }

  .page-kind-article .article,
  .page-kind-article .prose {
    overflow-x: clip;
  }

  .page-kind-article .prose {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .page-kind-article .prose table {
    display: block;
    width: fit-content;
    max-width: 100%;
    overflow-x: auto;
  }

  .page-kind-article .prose pre {
    white-space: pre-wrap !important;
    overflow-wrap: anywhere;
  }

  .page-kind-article .prose iframe {
    width: 100% !important;
    max-width: 100% !important;
  }
}
