/* Hand-written fixes on top of the Tailwind build (output.css), so they need no rebuild.
   Linked after output.css on every page. */

/* --- Newsletter -------------------------------------------------------------------------- */
.nl-hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; opacity: 0; }
.nl-note {
  position: absolute; left: 0; top: 100%; margin-top: 4px; white-space: nowrap;
  font-size: 11px; line-height: 1.3; color: #404040; background: rgba(255, 255, 255, .92);
  padding: 1px 6px; border-radius: 4px;
}
.nl-note a { text-decoration: underline; }
/* Wide screens: the popup image has its own line under the field; sit below it. */
@media (min-width: 1024px) { .nl-note { margin-top: 30px; font-size: 12px; } }

/* The /newsletter page */
.nl-page { width: 100%; max-width: 640px; margin: 0 auto; padding: 1rem 16px 2rem; font-family: Roboto, system-ui, sans-serif; user-select: text; }
.nl-page h1 { font-family: "Jersey 10", system-ui, sans-serif; font-size: 2.6rem; text-align: center; margin: 0 0 .5rem; }
.nl-page h2 { font-family: "Jersey 10", system-ui, sans-serif; font-size: 1.7rem; margin: 0 0 .6rem; }
.nl-lead { text-align: center; color: #404040; line-height: 1.55; margin: 0 0 1.5rem; }
.nl-card { border: 1px solid #e5e5e5; border-radius: 10px; padding: 1.1rem 1.2rem; margin-bottom: 1.25rem; background: #fff; }
.nl-card label { display: block; font-size: .9rem; color: #404040; margin-bottom: .35rem; }
.nl-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.nl-row input { flex: 1 1 220px; min-width: 0; font: inherit; padding: .55rem .7rem; border: 1px solid #d4d4d4; border-radius: 6px; }
.nl-row input:focus { outline: 2px solid #f59e0b; outline-offset: 1px; }
.nl-row button { font: inherit; font-weight: 600; padding: .55rem 1.1rem; border-radius: 6px; border: 0; background: #f59e0b; color: #fff; cursor: pointer; }
.nl-row button:hover { background: #b45309; }
.nl-row button:disabled { opacity: .6; cursor: progress; }
.nl-status { min-height: 1.3em; margin: .5rem 0 0; font-size: .92rem; }
.nl-status[data-state="ok"] { color: #15803d; }
.nl-status[data-state="error"] { color: #b42318; }
.nl-small { font-size: .8rem; color: #737373; line-height: 1.5; margin: .4rem 0 0; }
.nl-small a, .nl-lead a { color: #b45309; text-decoration: underline; }

/* --- Articles and guides: one layout for every post -------------------------------------
   Header (title, banner, author row) on a 1100 px column; under it the text in a centred
   720 px column with an ad column either side on wide screens. The ad columns never decide
   the text's position or width. Phones: one column, ads after the text. */
main.article-page { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; display: block; }

#article-header.article-header { padding: 2rem 0 0; gap: 2rem; max-width: 1100px; margin: 0 auto; }
#article-header > div:first-of-type { max-width: 46rem !important; width: 100%; padding: 1rem 0 0; gap: 1.25rem; }
#article-header > div:first-of-type h2 { padding-left: 0 !important; padding-right: 0 !important; }
#article-header > img { width: 100%; max-width: 1100px; }

#article-author {
  display: grid !important; grid-template-columns: 1fr; justify-items: center; gap: 1rem;
  padding: 1rem 0 1.5rem !important; border-bottom: 1px solid #e5e5e5;
}
#article-author p { font-size: .9rem; }
#article-author p.text-gray-500 { font-size: .8rem; }
#article-author nav { font-size: .8rem; }
#article-author #tags { justify-content: center !important; margin: 0 !important; }
@media (min-width: 900px) {
  #article-author { grid-template-columns: auto 1fr auto; justify-items: stretch; align-items: center; gap: 1.5rem; }
  #article-author nav { justify-self: center; }
  #article-author #tags { justify-content: flex-end !important; }
}
.article-tag { width: auto !important; min-width: 72px; padding: 0 .75rem; font-size: .8rem !important; white-space: nowrap; }

/* top banner ad: as wide as there is room for, never wider */
#topbar-adsense.ad-top { width: 100%; max-width: 970px; margin: 1.5rem auto 0; text-align: center; overflow: hidden; }

.article-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; margin-top: 2rem; align-items: start; }
.article-layout > .article-main {
  order: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 0 !important; min-width: 0;
}
.article-layout > .sidebar { order: 2; width: 100%; min-width: 0; max-width: 336px; margin: 0 auto; }
.article-layout > .sidebar-right { order: 3; }
@media (min-width: 1100px) {
  .article-layout { grid-template-columns: minmax(160px, 1fr) minmax(0, 720px) minmax(160px, 1fr); gap: 2.5rem; }
  .article-layout > .sidebar-left { order: 1; }
  .article-layout > .article-main { order: 2; }
  .article-layout > .sidebar-right { order: 3; }
  .article-layout > .sidebar { position: sticky; top: 1rem; max-width: 300px; }
  .article-layout > .sidebar-left { justify-self: end; }
  .article-layout > .sidebar-right { justify-self: start; }
}

/* ads: never wider than their box; an ad Google could not fill leaves no gap */
ins.adsbygoogle { max-width: 100%; }
.sidebar ins.adsbygoogle { display: block; width: 100%; }
ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }

/* text column contents */
.article-main img, .article-main video, .article-main iframe { max-width: 100%; height: auto; }
.article-main .table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.article-main .table-scroll > table { min-width: 100%; }
.article-main pre { overflow-x: auto; }
.article-main { overflow-wrap: break-word; }

/* the same line spacing on every post (pages had leading-6 to leading-8) */
.article-main p { line-height: 1.75 !important; }

/* --- Home page: the guides block (one card per published guide) --- */
.home-guides { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem; padding: 1.5rem 16px 2rem; }
.home-guide-card {
  display: flex; align-items: center; gap: 1.25rem; max-width: 560px; width: 100%;
  border: 2px solid #b45309; border-radius: 6px; padding: 1rem 1.25rem; background: #fff;
  transition: transform .15s ease, box-shadow .15s ease;
}
.home-guide-card:hover { transform: scale(1.02); box-shadow: 0 6px 18px rgba(180, 83, 9, .15); }
.home-guide-card img { width: 80px; height: auto; flex: none; }
.home-guide-title { font-size: 1.35rem; line-height: 1.2; }
.home-guide-text { font-size: .8rem; color: rgba(0, 0, 0, .7); margin-top: .35rem; font-family: Roboto, system-ui, sans-serif; }

/* --- Contact page: image and form side by side only when there is room --- */
@media (max-width: 899px) {
  div:has(> #contact-us-img) { flex-direction: column; align-items: center; gap: 1.5rem; padding: 0 16px; }
  #contact-us-img img { width: min(260px, 70vw); height: auto; }
  form#contact { width: 100%; max-width: 400px; }
  form#contact input, form#contact select, form#contact textarea { width: 100%; max-width: 100%; box-sizing: border-box; }
}


/* --- Footer: room for the three link columns (Content, Contact Us, Legal) --- */
footer ul li { white-space: nowrap; }
@media (min-width: 1024px) {
  footer > div:first-child { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.5fr) !important; column-gap: 2rem; }
  footer > div:first-child > div:last-child { gap: 2.5rem; justify-content: flex-end; }
}
@media (max-width: 1023px) {
  footer > div:first-child > div:last-child { gap: 1.5rem; flex-wrap: wrap; }
}
