/* =============================================
   OFFSETCALCULATOR.COM.AU
   Yellow #F7B733 + Green #2E7D32 + White Cards
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=DM+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --yellow: #F7B733;
  --yellow-dark: #e5a520;
  --yellow-light: #fdd26a;
  --yellow-pale: #fff8e1;
  --green: #2E7D32;
  --green-mid: #43A047;
  --green-light: #66BB6A;
  --red: #E53935;
  --red-light: #EF9A9A;
  --ink: #1a1a2e;
  --ink-soft: #2d2d44;
  --muted: #6b6b80;
  --border: #ffe082;
  --white: #ffffff;
  --card-shadow: 0 4px 20px rgba(0,0,0,0.08);
  --card-shadow-hover: 0 8px 32px rgba(0,0,0,0.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; color-scheme: light; }
body { background: var(--yellow); color: var(--ink); font-family: 'DM Sans', sans-serif; font-size: 17px; line-height: 1.7; -webkit-font-smoothing: antialiased; }

/* NAV */
nav { background: var(--yellow-dark); padding: 0 2rem; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; height: 68px; box-shadow: 0 2px 12px rgba(0,0,0,0.15); }
.nav-logo { font-family: 'Playfair Display', serif; color: var(--white); font-size: 1.15rem; font-weight: 700; text-decoration: none; }
.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a { color: rgba(255,255,255,0.85); text-decoration: none; font-size: 0.85rem; font-weight: 500; transition: color 0.2s; }
.nav-links a:hover { color: var(--white); }
.nav-cta { background: var(--green) !important; color: var(--white) !important; padding: 0.45rem 1.1rem; border-radius: 20px; font-weight: 600 !important; }
.nav-cta:hover { background: var(--green-mid) !important; }

/* HERO */
.hero { background: var(--yellow); padding: 5rem 2rem 4rem; text-align: center; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; top: -100px; left: 50%; transform: translateX(-50%); width: 600px; height: 600px; background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%); border-radius: 50%; pointer-events: none; }
.hero-eyebrow { font-family: 'JetBrains Mono', monospace; color: var(--green); font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 1.2rem; position: relative; background: rgba(255,255,255,0.5); display: inline-block; padding: 0.3rem 1rem; border-radius: 20px; }
.hero h1 { font-family: 'Playfair Display', serif; font-size: clamp(2.2rem, 6vw, 4rem); font-weight: 900; color: var(--ink); line-height: 1.1; position: relative; max-width: 780px; margin: 0 auto 1.5rem; }
.hero h1 em { color: var(--green); font-style: normal; }
.hero-sub { color: var(--ink-soft); font-size: 1.05rem; max-width: 540px; margin: 0 auto 2.5rem; position: relative; font-weight: 400; }
.btn-primary { display: inline-block; background: var(--green); color: var(--white); padding: 0.9rem 2.5rem; border-radius: 25px; font-size: 0.95rem; text-decoration: none; font-weight: 700; transition: background 0.2s, transform 0.1s, box-shadow 0.2s; cursor: pointer; border: none; box-shadow: 0 4px 15px rgba(46,125,50,0.3); }
.btn-primary:hover { background: var(--green-mid); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(46,125,50,0.4); }
.btn-secondary { display: inline-block; background: var(--white); color: var(--green); padding: 0.9rem 2.5rem; border-radius: 25px; font-size: 0.95rem; font-weight: 700; text-decoration: none; border: 2px solid var(--green); transition: all 0.2s; cursor: pointer; box-shadow: 0 4px 15px rgba(0,0,0,0.08); }
.btn-secondary:hover { background: var(--green); color: var(--white); }
.hero-stats { display: flex; justify-content: center; gap: 2rem; margin-top: 3.5rem; position: relative; padding-top: 2.5rem; border-top: 2px solid rgba(255,255,255,0.4); flex-wrap: wrap; }
.hero-stat-box { background: var(--white); border-radius: 16px; padding: 1.25rem 2rem; box-shadow: var(--card-shadow); min-width: 140px; }
.hero-stat-num { font-family: 'Playfair Display', serif; font-size: 1.8rem; color: var(--green); font-weight: 700; }
.hero-stat-label { font-size: 0.72rem; color: var(--muted); letter-spacing: 0.08em; font-family: 'JetBrains Mono', monospace; text-transform: uppercase; margin-top: 0.2rem; }

/* LAYOUT */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.container-sm { max-width: 780px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 4rem 0; }
.section-title { font-family: 'Playfair Display', serif; font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 700; margin-bottom: 0.5rem; color: var(--ink); }
.section-sub { color: var(--muted); font-size: 1rem; margin-bottom: 2.5rem; font-weight: 300; }
.section-white { background: var(--white); }
.section-yellow { background: var(--yellow); }
.section-pale { background: var(--yellow-pale); }
.divider { border: none; border-top: 2px solid rgba(255,255,255,0.4); }

/* CARDS — white floating style */
.card { background: var(--white); border: none; border-radius: 20px; overflow: hidden; transition: transform 0.2s, box-shadow 0.2s; box-shadow: var(--card-shadow); }
.card:hover { transform: translateY(-4px); box-shadow: var(--card-shadow-hover); }
.card-body { padding: 1.5rem; }

/* CALCULATOR INPUTS */
.calc-panel { background: var(--white); border: none; border-radius: 20px; padding: 1.75rem; box-shadow: var(--card-shadow); }
.panel-title { font-size: 0.7rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.25rem; padding-bottom: 0.75rem; border-bottom: 2px solid var(--yellow-pale); font-weight: 700; }
.input-label { display: block; font-size: 0.82rem; font-weight: 700; color: var(--ink); margin-bottom: 0.4rem; }
.input-wrap { display: flex; align-items: center; border: 2px solid #ffe082; border-radius: 12px; overflow: hidden; margin-bottom: 1.1rem; background: var(--yellow-pale); transition: border-color 0.2s; }
.input-wrap:focus-within { border-color: var(--green); background: var(--white); }
.input-prefix { padding: 0.65rem 0.85rem; background: var(--yellow-light); color: var(--ink); font-family: 'JetBrains Mono', monospace; font-size: 0.9rem; border-right: 2px solid #ffe082; font-weight: 700; }
.input-wrap input { border: none; outline: none; background: transparent; padding: 0.65rem 0.85rem; font-family: 'JetBrains Mono', monospace; font-size: 1rem; color: var(--ink); font-weight: 600; width: 100%; }
.input-suffix { padding: 0.65rem 0.85rem; color: var(--muted); font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; font-weight: 600; }
.preset-btn { background: var(--yellow-pale); border: 2px solid var(--yellow-light); border-radius: 10px; padding: 0.55rem; font-size: 0.78rem; cursor: pointer; color: var(--ink-soft); transition: all 0.2s; text-align: center; font-weight: 600; }
.preset-btn:hover, .preset-btn.active { background: var(--green); border-color: var(--green); color: var(--white); font-weight: 700; }

/* STAT CARDS */
.stat-card { background: var(--white); border: none; border-radius: 16px; padding: 1.1rem; border-top: 4px solid var(--yellow); box-shadow: var(--card-shadow); }
.stat-card.blue-top { border-top-color: var(--green-light); }
.stat-card.red-top { border-top-color: var(--red); }
.stat-card.green-top { border-top-color: var(--green); }
.stat-label { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.4rem; }
.stat-value { font-family: 'Playfair Display', serif; font-size: 1.5rem; font-weight: 700; color: var(--ink); }
.stat-value.yellow { color: var(--green); }
.stat-value.red { color: var(--red); }
.stat-value.green { color: var(--green); }

/* BLOG */
.blog-tag { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--green); margin-bottom: 0.5rem; background: #e8f5e9; display: inline-block; padding: 0.2rem 0.6rem; border-radius: 10px; }
.blog-title { font-family: 'Playfair Display', serif; font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; line-height: 1.3; color: var(--ink); margin-top: 0.5rem; }
.blog-excerpt { font-size: 0.88rem; color: var(--muted); line-height: 1.6; font-weight: 400; }
.blog-read { display: inline-block; margin-top: 1rem; font-size: 0.82rem; font-weight: 700; color: var(--white); text-decoration: none; background: var(--green); padding: 0.45rem 1rem; border-radius: 15px; transition: background 0.2s; }
.blog-read:hover { background: var(--green-mid); }
.blog-img { height: 140px; display: flex; align-items: center; justify-content: center; font-size: 3rem; }

/* CARD LINK */
.card-link { text-decoration: none; color: inherit; display: block; }
.card-link .card { height: 100%; }

/* FAQ */
.faq-item { border-bottom: 2px solid rgba(255,255,255,0.5); padding: 1.5rem 0; }
.faq-q { font-weight: 700; font-size: 1.05rem; cursor: pointer; display: flex; justify-content: space-between; align-items: center; color: var(--ink); gap: 1rem; }
.faq-q::after { content: '+'; font-size: 1.5rem; color: var(--green); font-family: 'JetBrains Mono', monospace; flex-shrink: 0; font-weight: 700; }
.faq-q.open::after { content: '−'; }
.faq-a { font-size: 0.95rem; color: var(--ink-soft); margin-top: 0.75rem; font-weight: 400; display: none; line-height: 1.8; background: var(--white); padding: 1rem 1.25rem; border-radius: 12px; }
.faq-a.open { display: block; }

/* TABLE */
.table-wrap { background: var(--white); border: none; border-radius: 16px; overflow: hidden; max-height: 300px; overflow-y: auto; box-shadow: var(--card-shadow); }
table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
thead tr { background: var(--green); position: sticky; top: 0; }
thead th { padding: 0.75rem 1rem; text-align: right; color: var(--white); font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; }
thead th:first-child { text-align: center; }
tbody tr { border-bottom: 1px solid var(--yellow-pale); }
tbody tr:hover { background: var(--yellow-pale); }
tbody td { padding: 0.6rem 1rem; text-align: right; font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; }
tbody td:first-child { text-align: center; color: var(--green); font-weight: 700; }

/* AD SLOTS */
.ad-slot { background: rgba(255,255,255,0.6); border: 2px dashed rgba(255,255,255,0.8); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; font-family: 'JetBrains Mono', monospace; }
.ad-banner { height: 90px; margin: 1.5rem auto; max-width: 728px; }
.ad-sidebar { height: 250px; width: 100%; margin-bottom: 1rem; }
.ad-label { font-size: 0.65rem; color: var(--muted); text-align: center; margin-top: 0.2rem; letter-spacing: 0.1em; }

/* FORM */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-weight: 700; font-size: 0.88rem; margin-bottom: 0.4rem; color: var(--ink); }
.form-input { width: 100%; padding: 0.75rem 1rem; border: 2px solid #ffe082; border-radius: 12px; font-size: 1rem; font-family: 'DM Sans', sans-serif; outline: none; transition: border-color 0.2s; color: var(--ink); background: var(--yellow-pale); }
.form-input:focus { border-color: var(--green); background: var(--white); }
textarea.form-input { resize: vertical; min-height: 120px; }
select.form-input { cursor: pointer; }

/* FOOTER */
footer { background: var(--ink); color: #8888aa; padding: 3.5rem 2rem 2rem; }
.footer-grid { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 3rem; margin-bottom: 2rem; }
.footer-brand { font-family: 'Playfair Display', serif; color: var(--yellow); font-size: 1.3rem; font-weight: 700; margin-bottom: 0.75rem; }
.footer-desc { font-size: 0.88rem; line-height: 1.7; font-weight: 300; color: #7a7a99; }
.footer-col h4 { font-size: 0.72rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--yellow); margin-bottom: 1rem; font-weight: 700; }
.footer-col a { display: block; color: #7a7a99; text-decoration: none; font-size: 0.88rem; margin-bottom: 0.5rem; transition: color 0.2s; }
.footer-col a:hover { color: var(--yellow); }
.footer-bottom { max-width: 1100px; margin: 0 auto; padding-top: 1.5rem; border-top: 1px solid #2a2a3e; font-size: 0.78rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; color: #5a5a7a; }
.disclaimer { max-width: 1100px; margin: 1rem auto 0; font-size: 0.75rem; color: #4a4a6a; line-height: 1.6; padding-top: 1rem; border-top: 1px solid #2a2a3e; }

/* BLOG POST */
.blog-post h2 { font-family: 'Playfair Display', serif; font-size: 1.6rem; font-weight: 700; margin: 2rem 0 0.75rem; color: var(--ink); }
.blog-post h3 { font-family: 'Playfair Display', serif; font-size: 1.25rem; font-weight: 700; margin: 1.5rem 0 0.5rem; color: var(--ink); }
.blog-post p { margin-bottom: 1.25rem; color: var(--ink-soft); line-height: 1.85; }
.blog-post ul, .blog-post ol { margin: 0 0 1.25rem 1.5rem; }
.blog-post li { margin-bottom: 0.5rem; color: var(--ink-soft); line-height: 1.7; }
.blog-post .highlight-box { background: var(--white); border-left: 4px solid var(--green); padding: 1.25rem 1.5rem; border-radius: 0 12px 12px 0; margin: 2rem 0; box-shadow: var(--card-shadow); }
.blog-post .highlight-box p { margin: 0; font-weight: 500; color: var(--ink); }
.blog-post table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.9rem; border-radius: 12px; overflow: hidden; }
.blog-post table th { background: var(--green); color: var(--white); padding: 0.75rem 1rem; text-align: left; font-size: 0.8rem; }
.blog-post table td { padding: 0.65rem 1rem; border-bottom: 1px solid var(--yellow-pale); color: var(--ink-soft); background: var(--white); }
.blog-post table tr:hover td { background: var(--yellow-pale); }

/* PAGE HERO */
.page-hero { background: var(--yellow-dark); padding: 3.5rem 2rem; text-align: center; }
.page-hero h1 { font-family: 'Playfair Display', serif; font-size: clamp(1.8rem, 5vw, 3rem); color: var(--white); font-weight: 900; margin-bottom: 0.75rem; }
.page-hero h1 em { color: var(--ink); font-style: normal; }
.page-hero p { color: rgba(255,255,255,0.85); font-size: 1.05rem; font-weight: 400; max-width: 600px; margin: 0 auto; }

/* BREADCRUMB */
.breadcrumb { padding: 0.75rem 0; font-size: 0.82rem; color: rgba(255,255,255,0.7); }
.breadcrumb a { color: var(--white); text-decoration: none; font-weight: 600; }
.breadcrumb a:hover { text-decoration: underline; }

/* CHART */
.chart-wrap { background: var(--white); border: none; border-radius: 16px; padding: 1.5rem; margin-bottom: 1.25rem; box-shadow: var(--card-shadow); }

/* STEP NUMBERS */
.step-num { width: 56px; height: 56px; background: var(--green); color: var(--white); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: 'Playfair Display', serif; font-size: 1.5rem; font-weight: 900; margin: 0 auto 1rem; box-shadow: 0 4px 15px rgba(46,125,50,0.3); }

/* RESPONSIVE */
@media (max-width: 768px) {
  .nav-links { display: none; }
  nav { padding: 0 1rem; }
  .nav-logo { font-size: 0.88rem; }
  div[style*="grid-template-columns"],
  section[style*="grid-template-columns"] { grid-template-columns: 1fr !important; gap: 1rem !important; }
  .footer-grid { grid-template-columns: 1fr !important; gap: 2rem; }
  .footer-bottom { flex-direction: column; text-align: center; }
  footer { padding: 2rem 1.25rem 1.5rem; }
  .ad-sidebar { display: none !important; }
  .hero { padding: 3rem 1.25rem 2.5rem; }
  .hero h1 { font-size: 2rem; }
  .hero-sub { font-size: 0.95rem; }
  .hero-stats { gap: 1rem; }
  .hero-stat-box { min-width: 100px; padding: 1rem 1.25rem; }
  .hero-stat-num { font-size: 1.4rem; }
  .btn-primary, .btn-secondary { display: block !important; width: 100% !important; text-align: center !important; margin: 0.5rem 0 !important; box-sizing: border-box; }
  .section { padding: 2.5rem 0; }
  .container, .container-sm { padding: 0 1rem; }
  .page-hero { padding: 2rem 1.25rem; }
  .page-hero h1 { font-size: 1.6rem; }
  .section-title { font-size: 1.3rem; }
  .calc-panel { margin-bottom: 1.5rem; }
  .table-wrap { overflow-x: auto; }
  table { min-width: 480px; }
  .stat-value { font-size: 1.1rem !important; }
  .ad-banner { height: 60px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.65rem; }
  .hero-stats { gap: 0.75rem; }
}

/* =============================================
   MOBILE FIXES — Added
   ============================================= */

/* Prevent horizontal overflow on ALL pages */
html, body { overflow-x: hidden; max-width: 100vw; }

/* Fix all sections and containers */
.section, nav, footer, .page-hero, .hero { max-width: 100vw; overflow-x: hidden; }

/* Fix inputs being cut off */
.input-wrap { max-width: 100%; }
.input-wrap input { min-width: 0; }

/* Blog post text — fix overflow */
.blog-post p, .blog-post li, .blog-post h2, .blog-post h3 { word-break: break-word; overflow-wrap: break-word; }

/* Fix all inline grids on mobile */
@media (max-width: 768px) {

  /* CRITICAL — force single column on ALL grid divs */
  div[style*="display:grid"], div[style*="display: grid"] {
    display: block !important;
  }
  div[style*="display:grid"] > *, div[style*="display: grid"] > * {
    width: 100% !important;
    margin-bottom: 1rem;
  }

  /* Calculator inputs full width */
  .calc-panel { width: 100%; max-width: 100%; padding: 1.25rem; }
  .input-wrap { width: 100%; box-sizing: border-box; }

  /* Blog post padding */
  .blog-post { padding: 0; }
  .blog-post p, .blog-post li { font-size: 0.95rem; }

  /* Page hero smaller text */
  .page-hero { padding: 2rem 1rem; }
  .page-hero h1 { font-size: 1.5rem; }
  .page-hero p { font-size: 0.9rem; }

  /* Hero buttons stack */
  .hero { padding: 2.5rem 1rem 2rem; }
  .hero h1 { font-size: 1.8rem; }

  /* Preset buttons full width */
  .preset-btn { width: 100%; font-size: 0.8rem; }

  /* Frequency tabs */
  .freq-tabs { gap: 0.35rem; }
  .freq-tab { font-size: 0.75rem; padding: 0.5rem 0.25rem; }

  /* Stat cards smaller font */
  .stat-card { padding: 0.85rem; }
  .stat-value { font-size: 1rem !important; }
  .stat-label { font-size: 0.62rem; }

  /* Chart wrap */
  .chart-wrap { padding: 1rem; }

  /* Table horizontal scroll */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 420px; font-size: 0.75rem; }
  thead th, tbody td { padding: 0.5rem 0.6rem; }

  /* Footer single column */
  .footer-grid { display: block !important; }
  .footer-col { margin-top: 1.5rem; }

  /* Nav */
  nav { padding: 0 0.85rem; }
  .nav-logo { font-size: 0.82rem; }

  /* Container padding */
  .container, .container-sm { padding: 0 0.85rem; }

  /* Blog post images */
  .blog-img { height: 120px; }

  /* Card body */
  .card-body { padding: 1rem; }

  /* Ad banner */
  .ad-slot.ad-banner { height: 60px; margin: 1rem 0; }

  /* Section padding */
  .section { padding: 2rem 0; }

  /* Highlight box */
  .blog-post .highlight-box { padding: 1rem; margin: 1.25rem 0; }

  /* Hide sidebar content on mobile */
  aside { display: none; }

  /* Two column grids → single */
  .stats-row { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 0.75rem !important; }

  /* Hero stats */
  .hero-stats { gap: 0.75rem; padding-top: 1.5rem; }
  .hero-stat-box { padding: 0.85rem 1rem; min-width: 90px; }
  .hero-stat-num { font-size: 1.3rem; }

  /* Comparison panel in repayment calc */
  .freq-tabs { flex-wrap: nowrap; }

  /* Info cards grid */
  .info-cards { grid-template-columns: 1fr !important; }

  /* Form */
  .form-input { font-size: 0.95rem; }

  /* Step numbers */
  .step-num { width: 44px; height: 44px; font-size: 1.2rem; }
}

@media (max-width: 390px) {
  .nav-logo { font-size: 0.75rem; }
  .hero h1 { font-size: 1.55rem; }
  .hero-stat-box { padding: 0.7rem 0.75rem; }
  .hero-stat-num { font-size: 1.1rem; }
  .freq-tab { font-size: 0.7rem; padding: 0.45rem 0.2rem; }
}
