/* Article styles for the ten guides under /tips/.
   Load alongside tips-shared.css, which carries the breadcrumb bar,
   buttons, reg-plate CTA form, FAQ accordion, legal note and the
   overflow hardening. Nothing here is duplicated in an inline
   <style> block — every tips page links these two files instead. */

/* Article-level overflow clamps. The global hardening (including the
   `body > *` min-width rule that stops a flex item dragging the mobile
   viewport wide) lives in tips-shared.css. */
.page-layout { overflow: hidden; max-width: 100%; }
.content-layout { max-width: 100%; overflow: hidden; }
.article-card { overflow: hidden; max-width: 100%; }
.article-body { overflow-wrap: break-word; word-wrap: break-word; }
.article-body table { max-width: 100%; }
.article-body td, .article-body th { word-break: break-word; }
.cta-banner-top, .cta-mid, .cta-bottom, .related-block { max-width: 100%; overflow: hidden; }
.sidebar-card { max-width: 100%; overflow: hidden; }

/* Article hero */
.article-hero {
    padding: 0.88rem 2rem 0.75rem;
    text-align: center;
    background: linear-gradient(135deg, rgba(255,107,0,0.08) 0%, rgba(37,99,235,0.06) 100%);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.article-hero-inner { max-width: 960px; margin: 0 auto; }
.hero-badge {
    display: inline-block;
    background: rgba(255,107,0,0.15);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 0.3rem 0.9rem;
    border-radius: 20px;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(255,107,0,0.25);
}
.article-hero h1 {
    font-size: clamp(1.9rem, 4.5vw, 2.8rem);
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.25;
    margin-bottom: 1rem;
}
.article-hero .hero-desc {
    color: var(--text-dim);
    font-size: 1.15rem;
    max-width: 700px;
    margin: 0 auto 1.5rem;
    line-height: 1.7;
}
.hero-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.4);
    flex-wrap: wrap;
}
.hero-meta span { display: flex; align-items: center; gap: 5px; }

/* Page layout */
.page-layout { max-width: 1400px; margin: 2.5rem auto; padding: 0 2rem; }
.content-layout { display: grid; grid-template-columns: 1fr 340px; gap: 3rem; align-items: start; }
.article-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(20px);
}

/* CTA banner top (inside card) */
.cta-banner-top {
    background: linear-gradient(90deg, rgba(255,107,0,0.08) 0%, rgba(37,99,235,0.06) 100%);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 1.25rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.cta-banner-top p { font-size: 1rem; color: var(--text-dim); margin: 0; }
.cta-banner-top p strong { color: var(--text-main); }
.cta-btns { display: flex; gap: 10px; flex-wrap: wrap; }

/* Article body */
.article-body { padding: 2.5rem 2.5rem 3rem; }

.article-body h2 {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    line-height: 1.3;
}

.article-body p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #cbd5e1;
    margin-bottom: 1.1rem;
}

.article-body strong {
    color: var(--text-main);
    font-weight: 600;
}

.article-body a {
    color: var(--primary);
    text-decoration: none;
}
.article-body a:hover {
    text-decoration: underline;
}

.article-body ul,
.article-body ol {
    margin: 0 0 1.25rem 1.5rem;
    color: #cbd5e1;
    font-size: 1.05rem;
    line-height: 1.8;
}
.article-body li {
    margin-bottom: 0.5rem;
}

/* Justified body prose — live on all ten guides. No media query: this
   applies at every width, phones included.

   Hyphenation is not optional here: justifying a ~340px mobile column
   without it opens rivers of white space between words. Only the article's
   own prose is justified — callouts, CTAs, list items and the legal note
   stay ragged-right, where short or centred blocks read better unjustified.
   The hub equivalent of this rule lives in tips-hub.css. */
.article-body > p:not(.legal-note) {
    text-align: justify;
    -webkit-hyphens: auto;
    hyphens: auto;
}

/* Tables */
.article-table-wrap {
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border-radius: 12px;
}
.article-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
}
.article-body th {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    font-weight: 600;
    padding: 0.75rem 1rem;
    text-align: left;
    white-space: nowrap;
}
.article-body td {
    padding: 0.65rem 1rem;
    color: var(--text-dim);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Pro tip / callout */
.pro-tip {
    background: rgba(255, 107, 0, 0.08);
    border-left: 3px solid var(--primary);
    border-radius: 0 12px 12px 0;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    font-size: 0.95rem;
    color: var(--text-dim);
    line-height: 1.7;
}
.pro-tip strong {
    color: var(--primary);
}

/* CTA banner */
.cta-banner {
    background: linear-gradient(135deg, rgba(255, 107, 0, 0.12) 0%, rgba(37, 99, 235, 0.1) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    margin: 2.5rem 0;
}
.cta-banner p {
    color: var(--text-main) !important;
    font-size: 1.05rem !important;
    margin-bottom: 0.75rem !important;
}
.cta-banner .cta-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}
.cta-banner .cta-links a {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    border-radius: 980px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: var(--transition);
}
.cta-banner .cta-links a.cta-primary {
    background: linear-gradient(135deg, #ff7a1a, #ff6b00);
    color: #fff;
}
.cta-banner .cta-links a.cta-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.cta-banner .cta-links a:hover {
    transform: translateY(-2px);
}

/* Say this / Not this boxes */
.say-box {
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    font-size: 0.95rem;
    line-height: 1.7;
}
.say-box.good {
    background: rgba(34, 197, 94, 0.08);
    border-left: 3px solid #22c55e;
    color: var(--text-dim);
}
.say-box.bad {
    background: rgba(239, 68, 68, 0.08);
    border-left: 3px solid #ef4444;
    color: var(--text-dim);
}
.say-box strong {
    color: var(--text-main);
}

/* Warning callout */
.warning-callout {
    background: rgba(234, 179, 8, 0.08);
    border-left: 3px solid #eab308;
    border-radius: 0 12px 12px 0;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
}
.warning-callout .warning-title {
    font-weight: 700;
    color: #eab308;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}
.warning-callout ul {
    margin: 0 0 0 1.25rem;
    font-size: 0.95rem;
    color: var(--text-dim);
    line-height: 1.7;
}

/* FAQ section wrapper (the item chrome lives in tips-shared.css) */
.faq-section {
    margin-top: 2.5rem;
}

/* Sidebar */
.sidebar-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.sidebar-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-card ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.sidebar-card li {
    font-size: 0.92rem;
    color: var(--text-dim);
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.5;
}
.sidebar-card li:last-child { border-bottom: none; }
.sidebar-card li::before {
    content: "\2713";
    color: #4ade80;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
}
.sidebar-card.figures li::before {
    content: none;
}
.sidebar-card.figures li {
    padding: 0.4rem 0;
}
.sidebar-card.related-articles li::before {
    content: none;
}
.sidebar-card.related-articles a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
.sidebar-card.related-articles a::before {
    content: "\2192";
    flex-shrink: 0;
    color: var(--primary);
    margin-top: 1px;
}
.sidebar-card.related-articles a:hover { text-decoration: underline; }

/* Continue reading */
.continue-reading {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.continue-reading h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}
.continue-reading ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.continue-reading li {
    margin-bottom: 0.5rem;
}
.continue-reading a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.95rem;
}
.continue-reading a:hover {
    text-decoration: underline;
}

/* Mid-article CTA */
.cta-mid {
    background: linear-gradient(135deg, rgba(255,107,0,0.1), rgba(37,99,235,0.08));
    border: 1px solid rgba(255,107,0,0.2);
    border-radius: 16px;
    padding: 1.75rem;
    margin: 2.5rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.cta-mid-text h3 { font-size: 1.15rem; font-weight: 700; color: var(--text-main); margin-bottom: 0.3rem; }
.cta-mid-text p { font-size: 0.95rem; color: var(--text-dim); margin: 0; }

/* Bottom CTA */
.cta-bottom {
    background: linear-gradient(135deg, rgba(255,107,0,0.12) 0%, rgba(37,99,235,0.08) 100%);
    border: 1px solid rgba(255,107,0,0.2);
    border-radius: 16px;
    padding: 2.25rem 2rem;
    text-align: center;
    margin-top: 2.5rem;
}
.cta-bottom h3 { font-size: 1.4rem; font-weight: 800; color: var(--text-main); margin-bottom: 0.6rem; }
.cta-bottom p { color: var(--text-dim); font-size: 1.05rem; margin-bottom: 1.5rem; }
.cta-bottom-btns { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

/* Related block */
.related-block {
    margin-top: 1.75rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 1.5rem 1.75rem;
}
.related-block h3 { font-size: 1.1rem; font-weight: 700; color: var(--text-main); margin-bottom: 1rem; }
.related-list { list-style: none; padding: 0; margin: 0; }
.related-list li { margin-bottom: 0.75rem; }
.related-list li a {
    font-size: 0.95rem; color: var(--primary); font-weight: 500; line-height: 1.5;
    display: flex; align-items: flex-start; gap: 8px; text-decoration: none;
}
.related-list li a::before { content: "\2192"; flex-shrink: 0; color: var(--primary); margin-top: 1px; }
.related-list li a:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 900px) {
    .content-layout { grid-template-columns: 1fr; }
}
/* 640px, not 600px: this used to be a 600px block shadowed by a near-identical
   640px block full of `!important` — the same rules written twice to force
   mobile padding. One query at the wider breakpoint covers both. */
@media (max-width: 640px) {
    .article-body { padding: 1rem 0.75rem; }
    .cta-banner-top { flex-direction: column; align-items: flex-start; padding: 0.75rem; }
    .cta-mid { flex-direction: column; padding: 1.25rem 0.75rem; }
    .article-hero { padding: 0.5rem 1rem 0.38rem; }
    .cta-bottom { padding: 1.5rem 0.75rem; }
    .breadcrumb-bar { padding: 2px 0.75rem; }
    .page-layout { padding: 0 0.5rem; max-width: 100vw; overflow: hidden; }
    .content-layout { grid-template-columns: 1fr; gap: 1rem; }
    .article-card { border-radius: 10px; }
    .related-block { padding: 1rem; }
    .sidebar-card { padding: 1rem; }
}

/* Tables: narrow screens shrink the type and let headers wrap, so a wide
   table compresses instead of being clipped. The table stays a real
   table at every width. It used to carry `display: block` up in the
   mobile-overflow block, which handed its rows to an anonymous
   shrink-to-fit table inside a full-width background box — that gap
   between the rows and the edge of the panel was issue #112. The
   horizontal scroll `display: block` was meant to enable never worked
   anyway: the later `.article-body table { overflow: hidden }` won on
   source order. Kept last in the stylesheet so it outranks that rule. */
@media (max-width: 640px) {
    .article-body table { font-size: 0.82rem; }
    .article-body th { white-space: normal; }
}
