/* ══════════════════════════════════════════════
   MoneyWise UK - Main Stylesheet
   Clean, professional finance site design
   Inspired by MoneySupermarket's layout
   ══════════════════════════════════════════════ */

:root {
    /* Brand Colours */
    --mwuk-primary: #0d6e3f;
    --mwuk-primary-light: #e8f5ee;
    --mwuk-primary-dark: #094d2c;
    --mwuk-navy: #0d2137;
    --mwuk-navy-light: #1a3a5c;

    /* Neutrals */
    --mwuk-text: #1a1a2e;
    --mwuk-text-secondary: #4a5568;
    --mwuk-text-light: #718096;
    --mwuk-border: #e2e8f0;
    --mwuk-bg: #ffffff;
    --mwuk-bg-light: #f7f8fa;
    --mwuk-bg-warm: #fafbfc;

    /* Accents */
    --mwuk-link: #1a73e8;
    --mwuk-link-hover: #1558b0;
    --mwuk-success: #16a34a;
    --mwuk-warning: #f59e0b;
    --mwuk-error: #dc2626;

    /* Typography */
    --mwuk-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mwuk-font-size: 1.0625rem;
    --mwuk-line-height: 1.75;

    /* Layout */
    --mwuk-content-width: 760px;
    --mwuk-wide-width: 1200px;
    --mwuk-radius: 10px;
    --mwuk-radius-sm: 6px;
    --mwuk-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --mwuk-shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
    --mwuk-shadow-lg: 0 10px 25px rgba(0,0,0,0.1), 0 4px 10px rgba(0,0,0,0.05);
}

/* ── Reset & Base ── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: var(--mwuk-font);
    font-size: var(--mwuk-font-size);
    line-height: var(--mwuk-line-height);
    color: var(--mwuk-text);
    background: var(--mwuk-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--mwuk-link);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--mwuk-link-hover);
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--mwuk-font);
    color: var(--mwuk-navy);
    line-height: 1.3;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

h1 { font-size: 2rem; font-weight: 800; margin-top: 0; }
h2 { font-size: 1.5rem; padding-bottom: 0.5rem; border-bottom: 2px solid var(--mwuk-primary-light); }
h3 { font-size: 1.2rem; font-weight: 600; }
h4 { font-size: 1.1rem; font-weight: 600; }

p {
    margin-bottom: 1.25rem;
    color: var(--mwuk-text);
}

/* ── Layout Containers ── */
.mwuk-container {
    max-width: var(--mwuk-wide-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.mwuk-article {
    max-width: var(--mwuk-content-width);
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
}

/* ── Breadcrumbs ── */
.mwuk-breadcrumbs {
    max-width: var(--mwuk-content-width);
    margin: 0 auto;
    padding: 1rem 1.5rem;
}

.mwuk-breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.85rem;
    color: var(--mwuk-text-light);
}

.mwuk-breadcrumbs li + li::before {
    content: '>';
    margin: 0 0.5rem;
    color: var(--mwuk-text-light);
}

.mwuk-breadcrumbs a {
    color: var(--mwuk-text-secondary);
}

.mwuk-breadcrumbs a:hover {
    color: var(--mwuk-primary);
    text-decoration: none;
}

/* ── Buttons ── */
.mwuk-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--mwuk-radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.mwuk-btn-primary {
    background: var(--mwuk-primary);
    color: #fff;
}

.mwuk-btn-primary:hover {
    background: var(--mwuk-primary-dark);
    color: #fff;
    text-decoration: none;
}

/* ── Tables (article content) ── */
.mwuk-article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
    border-radius: var(--mwuk-radius);
    overflow: hidden;
    box-shadow: var(--mwuk-shadow);
}

.mwuk-article-body table thead tr {
    background: var(--mwuk-navy);
    color: #fff;
}

.mwuk-article-body table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.mwuk-article-body table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--mwuk-border);
}

.mwuk-article-body table tbody tr:nth-child(even) {
    background: var(--mwuk-bg-light);
}

.mwuk-article-body table tbody tr:hover {
    background: var(--mwuk-primary-light);
}

/* ── Lists ── */
.mwuk-article-body ul,
.mwuk-article-body ol {
    margin: 1rem 0 1.5rem;
    padding-left: 1.5rem;
}

.mwuk-article-body li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    :root {
        --mwuk-font-size: 1rem;
    }

    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.3rem; }
    h3 { font-size: 1.1rem; }

    .mwuk-article {
        padding: 0 1rem 2rem;
    }

    /* Tables scroll horizontally on mobile */
    .mwuk-article-body table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 0.85rem;
    }

    /* Inline styled divs (boxes, calculators) */
    .mwuk-article-body div[style*="display:flex"],
    .mwuk-article-body div[style*="display: flex"] {
        flex-direction: column !important;
        gap: 1rem !important;
    }

    .mwuk-article-body div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    /* Calculator inputs side by side on mobile */
    .mwuk-article-body div[style*="display:grid"][style*="repeat(2"] {
        grid-template-columns: 1fr !important;
    }

    /* Prevent any horizontal overflow */
    .mwuk-article-body {
        overflow-x: hidden;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .mwuk-article-body img {
        max-width: 100% !important;
        height: auto !important;
    }

    /* Author box stacks vertically */
    .mwuk-article-body > div[style*="display:flex"][style*="gap"] {
        flex-direction: column !important;
        text-align: center !important;
        align-items: center !important;
    }

    /* Share buttons wrap */
    .mwuk-article-body div[style*="display:flex"][style*="gap:10px"] {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
    }

    /* Inline styled boxes should fit screen - only target article body */
    .mwuk-article-body > div[style*="padding:24px"],
    .mwuk-article-body > div[style*="padding:20px"] {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}
