/* XLsheetAI blog — self-contained, no external fonts or frameworks. */
:root {
  --green: #16a34a;
  --green-dark: #15803d;
  --ink: #111827;
  --body: #374151;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #ffffff;
  --bg-soft: #f9fafb;
  --max: 760px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--body);
  background: var(--bg);
  line-height: 1.7;
  font-size: 17px;
}
a { color: var(--green-dark); }
img, svg { max-width: 100%; height: auto; }

.site-header {
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
  font-size: 17px;
  letter-spacing: -0.3px;
}
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.nav-cta {
  background: var(--green);
  color: #fff !important;
  text-decoration: none;
  padding: 8px 15px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

/* Official store badges — same artwork as the homepage, self-hosted so the
   articles have no external image requests. Google's badge PNG carries its
   own transparent padding, hence the different heights. */
.store-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
/* Badge sizing lives inline on the elements (immune to stale cached CSS);
   only layout lives here. */
.store-row a { transition: transform 0.15s ease; }
.store-row a:hover { transform: scale(1.04); }
.cta-box .store-row { justify-content: center; }

main { max-width: var(--max); margin: 0 auto; padding: 0 20px 64px; }
main.hub { max-width: 1140px; }

h1 {
  font-size: 39px;
  line-height: 1.18;
  letter-spacing: -1px;
  color: var(--ink);
  margin: 30px 0 14px;
}
h2 {
  font-size: 27px;
  line-height: 1.28;
  letter-spacing: -0.5px;
  color: var(--ink);
  margin: 46px 0 12px;
}
h3 {
  font-size: 20px;
  color: var(--ink);
  margin: 32px 0 8px;
}
p { margin: 0 0 18px; }
ul, ol { margin: 0 0 18px; padding-left: 22px; }
li { margin-bottom: 8px; }

.byline {
  color: var(--muted);
  font-size: 14.5px;
  margin: 0 0 26px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.tldr {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 12px;
  padding: 18px 20px;
  margin: 0 0 32px;
}
.tldr strong { color: var(--ink); display: block; margin-bottom: 8px; font-size: 15px; letter-spacing: 0.3px; text-transform: uppercase; }
.tldr ul { margin: 0; }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 22px 0 26px;
  font-size: 15.5px;
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}
@media (min-width: 640px) { table { display: table; white-space: normal; } }
th, td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
th { background: var(--bg-soft); color: var(--ink); font-weight: 700; }
code {
  background: #f3f4f6;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14.5px;
  color: #b91c1c;
  white-space: nowrap;
}
figure { margin: 26px 0; }
figcaption { color: var(--muted); font-size: 14px; margin-top: 8px; text-align: center; }

.chart-wrap { overflow-x: auto; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }

.cta-box {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  color: #fff;
  border-radius: 16px;
  padding: 26px 24px;
  margin: 38px 0;
  text-align: center;
}
.cta-box h3 { color: #fff; margin: 0 0 8px; font-size: 21px; }
.cta-box p { color: rgba(255,255,255,0.92); margin: 0 0 16px; font-size: 15.5px; }
/* Text-button links only — store badges must stay unstyled (no white pill). */
.cta-box a:not(.store-row a) {
  display: inline-block;
  background: #fff;
  color: var(--green-dark) !important;
  text-decoration: none;
  font-weight: 700;
  padding: 11px 26px;
  border-radius: 10px;
}
.cta-box .store-row a {
  background: none;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
}

.faq h3 { font-size: 18px; margin-bottom: 6px; }

/* Article grid — wider than the reading column so cards breathe. */
.hub { max-width: 1140px; }
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
  margin: 30px 0 8px;
  padding: 0;
  list-style: none;
}
/* The whole card is one <a> (see index.html) so the entire area is
   tappable, not just the title — text-decoration/color reset because a
   plain <a> would otherwise underline and re-color all its contents. */
.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.09);
  border-color: rgba(22, 163, 74, 0.45);
}
.card-art {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  padding: 26px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 168px;
}
.card-art svg { width: 100%; max-width: 210px; height: auto; display: block; }
.card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.card-kicker {
  color: var(--green);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  margin-bottom: 9px;
}
.card h2 { margin: 0 0 10px; font-size: 20px; line-height: 1.3; letter-spacing: -0.4px; color: var(--ink); }
.card:hover h2 { color: var(--green-dark); }
.card p { margin: 0 0 16px; font-size: 15px; line-height: 1.6; color: var(--body); }
.card .meta {
  margin-top: auto;
  color: var(--muted);
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 14px;
}
.site-footer .wrap { max-width: var(--max); margin: 0 auto; padding: 26px 20px; display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; }
.site-footer a { color: var(--muted); }

@media (max-width: 640px) {
  body { font-size: 16.5px; }
  h1 { font-size: 31px; }
  h2 { font-size: 23px; }
}

/* ---------------------------------------------------------------------------
   Quick tips sidebar — short auto-published articles beside the main grid.
   Two columns on desktop, stacked below the grid on narrower screens.
   --------------------------------------------------------------------------- */
.hub-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 34px;
  align-items: start;
}
/* The grid column must be allowed to shrink, otherwise its min-content width
   pushes the sidebar off-screen instead of wrapping. */
.hub-main { min-width: 0; }
.hub-main .card-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.tips-rail {
  position: sticky;
  top: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 18px 18px 8px;
}
.tips-rail h2 {
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #6b7280;
  margin: 0 0 4px;
  border: 0;
  padding: 0;
}
.tips-rail .rail-sub { font-size: 13px; color: #6b7280; margin: 0 0 14px; }
.tip-item {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.tip-item:first-of-type { border-top: 0; padding-top: 4px; }
.tip-item h3 {
  font-size: 15px;
  line-height: 1.35;
  margin: 0 0 5px;
  font-weight: 600;
  color: #0b0b0f;
}
.tip-item p {
  font-size: 13.5px;
  line-height: 1.45;
  margin: 0 0 6px;
  color: #4b5563;
}
.tip-meta { display: flex; gap: 8px; align-items: center; font-size: 11.5px; color: #9ca3af; }
.tip-topic {
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 5px;
}
.tip-topic.excel   { color: #16a34a; background: rgba(22,166,75,.12); }
.tip-topic.sql     { color: #0a84ff; background: rgba(10,132,255,.12); }
.tip-topic.powerbi { color: #b45309; background: rgba(245,158,11,.15); }
.tip-topic.other   { color: #6b7280; background: rgba(107,114,128,.12); }
.tips-empty { font-size: 13.5px; color: #6b7280; padding: 4px 0 14px; }

@media (max-width: 960px) {
  .hub-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .tips-rail { position: static; }
}

@media (prefers-color-scheme: dark) {
  .tips-rail { background: #111827; }
  .tip-item h3 { color: #f3f4f6; }
  .tip-item p { color: #cbd5e1; }
}
