/* Product pages (layouts/product.js). Standalone: none of the WordPress styles load here. */

:root {
  --text: #1f2328;
  --muted: #5f6670;
  --line: #e6e3de;
  --soft: #f7f5f2;
  --accent: #f7a541;
  --accent-dark: #e08f22;
  --wide: 1040px;
  --narrow: 720px;
  --radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font: 18px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration-color: var(--accent); text-underline-offset: 3px; overflow-wrap: anywhere; }
a:hover { color: var(--accent-dark); }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 0.6em; }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.1rem); font-weight: 700; text-align: center; }
h3 { font-size: 1.1rem; font-weight: 650; }
p, ul, blockquote { margin: 0 0 1em; }

/* Header and footer */

.product-bar { padding: 20px 16px; border-bottom: 1px solid var(--line); }
.product-bar img { width: 220px; margin: 0 auto; }

.product-footer { padding: 40px 16px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: 0.9rem; }
.product-footer p { margin: 0; }

/* Sections. The footer stays at the bottom on short pages. */

body { display: flex; flex-direction: column; min-height: 100vh; }
.product-main { flex: 1; padding-bottom: 72px; }

.product-main > * { max-width: var(--narrow); margin-left: auto; margin-right: auto; padding-left: 16px; padding-right: 16px; }
.product-main > section { padding-top: 72px; padding-bottom: 8px; scroll-margin-top: 16px; }
.product-main > section + section { border-top: 1px solid var(--line); margin-top: 64px; }
.product-main > .hero, .product-main > .video, .product-main > .wide { max-width: var(--wide); }

/* Hero */

.hero { display: grid; grid-template-columns: 300px 1fr; gap: 48px; align-items: center; padding-top: 64px; padding-bottom: 48px; }
.hero h1 { font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 1em; }
.hero .headline { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 800; line-height: 1.08; letter-spacing: -0.02em; margin-bottom: 0.4em; }
.hero .lead { font-size: 1.25rem; color: var(--muted); margin-bottom: 1.6em; }

/* Buttons */

.button {
  display: inline-block; padding: 14px 28px; border-radius: 999px; border: 2px solid var(--accent);
  background: var(--accent); color: var(--text); font-weight: 650; text-decoration: none; transition: background 0.15s, border-color 0.15s;
}
.button:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--text); }
.button-outline { background: transparent; }
.button-outline:hover { background: var(--accent); border-color: var(--accent); }
.center { text-align: center; margin-top: 2em; }

/* Video */

.video > iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius); background: #000; }

/* Lists */

.product-main section > ul:not([class]) { padding: 0; list-style: none; }
.product-main section > ul:not([class]) li { position: relative; padding-left: 32px; margin-bottom: 0.7em; }
.product-main section > ul:not([class]) li::before {
  content: ""; position: absolute; left: 4px; top: 0.55em; width: 14px; height: 8px;
  border-left: 2.5px solid var(--accent-dark); border-bottom: 2.5px solid var(--accent-dark); transform: rotate(-45deg);
}

/* Quotes */

.quote { margin: 0; padding: 28px; background: var(--soft); border-radius: var(--radius); }
.quote blockquote { margin: 0 0 1em; font-size: 1.05rem; }
.quote figcaption { color: var(--muted); font-size: 0.95rem; }
.quote figcaption strong { color: var(--text); }
.product-main > .quote-featured { margin: 48px auto 0; padding: 0 16px; text-align: center; background: none; }
.quote-featured blockquote { font-size: 1.25rem; font-style: italic; }
.quotes { display: grid; gap: 20px; }

/* Table of contents */

.toc { display: grid; grid-template-columns: 1fr 1fr; gap: 0 48px; }
.toc h3 { margin: 1.4em 0 0.4em; font-size: 1rem; }
.toc ul { margin: 0; padding-left: 1.1em; color: var(--muted); font-size: 0.95rem; }
.toc li { margin-bottom: 0.2em; }

/* Getting components */

.product-main > .split { display: grid; grid-template-columns: 1fr 260px; gap: 40px; align-items: center; }
.split h2 { text-align: left; }
.split img { border-radius: var(--radius); }

/* Author */

.author { display: grid; grid-template-columns: 120px 1fr; gap: 28px; align-items: start; }
.author img { border-radius: 50%; aspect-ratio: 1; object-fit: cover; object-position: top; background: var(--soft); }
.author blockquote { margin: 0; padding-left: 20px; border-left: 3px solid var(--accent); color: var(--muted); font-style: italic; }

/* Bonuses */

.bonus { display: grid; grid-template-columns: 96px 1fr; gap: 28px; align-items: start; padding: 28px 0; border-bottom: 1px solid var(--line); }
.bonus:last-of-type { border-bottom: 0; }
.bonus h3 { margin-bottom: 0.4em; }
.bonus p { color: var(--muted); font-size: 1rem; margin: 0; }
.note { color: var(--muted); font-size: 0.9rem; font-style: italic; }

/* Pricing */

.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; align-items: stretch; margin-top: 32px; }
.plan { display: flex; flex-direction: column; padding: 32px 28px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.plan h3 { text-align: center; font-size: 1.2rem; margin-bottom: 1em; }
.plan ul { flex: 1; margin: 0 0 1.6em; padding-left: 1.1em; font-size: 0.98rem; }
.plan li { margin-bottom: 0.4em; }
.plan .button { text-align: center; }
.plan-featured { border: 2px solid var(--accent); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08); }

.guarantee { max-width: var(--narrow); margin: 48px auto 0; padding: 28px 32px; background: var(--soft); border-radius: var(--radius); text-align: center; }
.guarantee p { margin: 0; color: var(--muted); }

/* Featured-in logos */

.product-main > .logos { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px 40px; padding-top: 8px; padding-bottom: 8px; }
.logos p { width: 100%; margin: 0; text-align: center; color: var(--muted); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.logos:not(.logos-gray) img { height: 44px; width: auto; }

/* Cards (the circuits you'll build) */

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 32px; }
.card { padding: 24px; background: var(--soft); border-radius: var(--radius); }
.card img { width: 40px; height: 40px; margin-bottom: 14px; }
.card h3 { margin-bottom: 0.3em; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* Price cards that link as a whole, with a picture and a price */

.plan-link { align-items: center; text-align: center; color: inherit; text-decoration: none; transition: border-color 0.15s, box-shadow 0.15s; }
.plan-link:hover { color: inherit; border-color: var(--accent); }
.plan-link:hover .button-outline { background: var(--accent); }
.plan-link img { height: 160px; width: auto; margin-bottom: 20px; }
.plan-link h3 { margin-bottom: 0.4em; }
.price { flex: 1; font-size: 1.6rem; font-weight: 750; margin-bottom: 1em; }
.price span { font-size: 0.9rem; font-weight: 400; color: var(--muted); }

/* Table of contents in two columns */

.contents { list-style: none; padding-left: 0; columns: 2; column-gap: 48px; }
.contents li { margin-bottom: 0.4em; break-inside: avoid; }

/* Plain page heading (pages without a hero) */

.product-main > .page-head { padding-top: 64px; text-align: center; }
.page-head h1 { font-size: clamp(2.2rem, 5vw, 3rem); font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.product-main > .page-head + section { border-top: 0; margin-top: 0; padding-top: 40px; }

/* Product list (/products/) */

.product-main > .product-list { max-width: 880px; }
.product-item { display: grid; grid-template-columns: 200px 1fr; gap: 40px; align-items: center; padding: 40px 0; border-bottom: 1px solid var(--line); }
.product-item:last-child { border-bottom: 0; }
.product-item img { margin: 0 auto; max-height: 220px; width: auto; }
.product-item h2 { text-align: left; font-size: 1.6rem; }
.product-item p { color: var(--muted); }
.more { font-weight: 650; color: var(--text); }

/* Choice buttons (/products/learn-practical-electronics/) */

.choices { display: grid; gap: 16px; max-width: 480px; margin: 32px auto 0; }
.choice {
  display: block; padding: 20px 24px; border: 2px solid var(--line); border-radius: var(--radius);
  font-weight: 650; font-size: 1.1rem; text-align: center; text-decoration: none; transition: border-color 0.15s, background 0.15s;
}
.choice:hover { border-color: var(--accent); background: var(--soft); color: var(--text); }

/* Site navigation (home page, KiCad tutorial) */

.with-nav .product-bar { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; width: 100%; max-width: var(--wide); margin: 0 auto; border-bottom: 0; }
.with-nav .product-bar img { margin: 0; }
.site-nav { display: flex; align-items: center; gap: 4px 24px; flex-wrap: wrap; font-size: 0.95rem; font-weight: 550; }
.site-nav a { text-decoration: none; padding: 4px 0; }
.site-nav svg { display: block; width: 18px; height: 18px; fill: currentColor; }
.site-nav a[aria-current="page"] { color: var(--accent-dark); }
.nav-dropdown { position: relative; }
.nav-dropdown summary { padding: 4px 0; cursor: pointer; list-style: none; }
.nav-dropdown summary::-webkit-details-marker { display: none; }
.nav-dropdown summary::after { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 2px 3px 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform 0.15s; }
.nav-dropdown[open] summary::after { transform: rotate(-135deg); margin-bottom: -1px; }
.nav-dropdown ul { position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%); z-index: 50; margin: 0; padding: 12px; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12); width: max-content; max-width: calc(100vw - 32px); }
.nav-dropdown ul.two-columns { display: grid; grid-template-columns: 1fr 1fr; column-gap: 8px; }
.nav-dropdown li a { display: block; padding: 7px 12px; border-radius: 8px; font-weight: 500; white-space: nowrap; }
.nav-dropdown li a:hover { background: var(--soft); color: var(--text); }

/* Home page: hero with the picture on the right */

.hero-home { grid-template-columns: 1fr 360px; padding-top: 24px; }
.hero-home h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; color: var(--text); text-transform: none; margin-bottom: 0.5em; }
.hero-home .lead strong { color: var(--text); }

/* Grayscale press logos */

.product-main > .logos-gray { max-width: var(--wide); }
/* Shown at the size in their width and height attributes, chosen to look even. */
.logos-gray img { height: auto; opacity: 0.7; }

/* Home page: tutorial topics */

.topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 32px; }
.topic {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 112px; padding: 16px 8px;
  background: var(--soft); border: 1px solid transparent; border-radius: var(--radius); text-align: center; font-size: 0.92rem; font-weight: 550; line-height: 1.3; text-decoration: none; transition: border-color 0.15s;
}
.topic:hover { border-color: var(--accent); color: var(--text); }
.topic img { height: 36px; width: auto; }

/* Home page: featured resources and latest posts */

.post-cards { list-style: none; padding: 0; margin: 32px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px 28px; }
.post-cards li { display: flex; flex-direction: column; }
.post-cards .more { margin-top: auto; }
.post-cards img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius); background: var(--soft); margin-bottom: 16px; }
.post-cards h3 { font-size: 1.1rem; margin-bottom: 0.4em; }
.post-cards h3 a, .post-cards > li > a { text-decoration: none; }
.post-cards time { display: block; color: var(--muted); font-size: 0.85rem; margin-bottom: 0.4em; }
.post-cards p { color: var(--muted); font-size: 0.95rem; margin-bottom: 0.6em; }

/* Full site footer (home page, KiCad tutorial) */

.site-footer { padding: 56px 16px 32px; background: var(--soft); font-size: 0.95rem; }
.footer-columns { max-width: var(--wide); margin: 0 auto; display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 32px; }
.site-footer .site-logo img { width: 200px; }
.site-footer h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); text-align: left; margin: 0 0 0.8em; }
.site-footer ul { list-style: none; padding: 0; margin: 0 0 1.6em; }
.site-footer li { margin-bottom: 0.4em; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer > p { max-width: var(--wide); margin: 32px auto 0; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; text-align: center; }

/* KiCad tutorial (layouts/tutorial.js) */

.kicker { display: block; font-size: 0.8rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent-dark); }
.product-main > .tutorial-hero { max-width: var(--wide); padding-top: 56px; text-align: center; }
.tutorial-hero h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin-bottom: 0.5em; }
.tutorial-hero h1 .kicker { margin-bottom: 0.8em; }
.tutorial-hero .lead { max-width: var(--narrow); margin: 0 auto 2em; font-size: 1.15rem; color: var(--muted); }
.chapter-cards { list-style: none; padding: 0; margin: 0 0 40px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.chapter-cards a { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; padding: 28px 20px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; transition: border-color 0.15s; }
.chapter-cards a:hover { border-color: var(--accent); color: var(--text); }
.chapter-cards img { width: 64px; height: 64px; object-fit: contain; margin-bottom: 8px; }
.chapter-card-title { font-size: 1.15rem; font-weight: 700; flex: 1; }
.chapter-cards .more { margin-top: 8px; font-size: 0.95rem; }
.download { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px 24px; padding: 24px; background: var(--soft); border-radius: var(--radius); text-align: center; }
.download p { margin: 0; font-weight: 600; }
.product-main > .download { margin-top: 48px; }

.tutorial .chapter-head { text-align: center; margin-bottom: 40px; }
.chapter-head .kicker { margin-bottom: 0.4em; }
.chapter-title { display: block; font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.tutorial-page { padding-top: 24px; margin-bottom: 56px; scroll-margin-top: 16px; }
.tutorial-page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; margin-bottom: 24px; border-top: 2px solid var(--text); border-bottom: 1px solid var(--line); }
.tutorial-page-head p { margin: 0; }
.page-title { font-size: 0.85rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; }
.page-nav { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.9rem; white-space: nowrap; }
.page-nav a, .page-nav span[aria-hidden] { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; text-decoration: none; }
.page-nav a:hover { border-color: var(--accent); color: var(--text); }
.page-nav span[aria-hidden] { opacity: 0.35; }
.tutorial h2 { text-align: left; font-size: 1.6rem; margin-top: 1.4em; }
.tutorial-page > h2:first-of-type { margin-top: 0; }
.tutorial h3 { font-size: 1.2rem; margin-top: 1.4em; }
.tutorial figure { max-width: 100%; margin: 32px 0; }
.tutorial figure img { border-radius: 8px; }
.tutorial figcaption { margin-top: 8px; color: var(--muted); font-size: 0.9rem; }
.tutorial .wp-block-image img, .tutorial p > img { border-radius: 8px; margin: 32px 0; }
.figure-small { display: flex; align-items: center; gap: 20px; padding: 16px 20px; background: var(--soft); border-radius: var(--radius); }
.figure-small img { max-width: 120px; border-radius: 0 !important; }
.figure-small figcaption { margin: 0; }
.figure-small figcaption strong { display: block; color: var(--text); }
.todo { margin: 32px 0; padding: 24px 28px; border-left: 4px solid var(--accent); background: #fff8ee; border-radius: 0 var(--radius) var(--radius) 0; }
.todo-title { margin: 0 0 0.5em; font-weight: 750; }
.todo ol { margin: 0; padding-left: 1.3em; }
.todo li { margin-bottom: 0.3em; }
.todo-note { margin: 0.8em 0 0; color: var(--muted); font-size: 0.95rem; }
.checklist { list-style: none; padding: 20px 24px; margin: 32px 0; border: 1px solid var(--line); border-radius: var(--radius); }
.checklist li { position: relative; padding-left: 34px; margin: 0.5em 0; }
.checklist li::before { content: ""; position: absolute; left: 0; top: 0.2em; width: 20px; height: 20px; border: 2px solid var(--accent-dark); border-radius: 5px; }
.author-box { display: grid; grid-template-columns: 160px 1fr; gap: 28px; align-items: start; margin: 32px 0; padding: 28px; background: var(--soft); border-radius: var(--radius); }
.author-box img { border-radius: var(--radius); margin: 0 !important; }
.author-box h3 { margin-top: 0; }

/* Comments (partials/comments.js, WordPress's markup) */

.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.comment-form-hp { position: absolute; left: -10000px; }
.product-main.comments-wrap { flex: 0; padding-top: 0; }
.comments-area { padding-top: 48px; border-top: 1px solid var(--line); }
.comments-title { text-align: left; font-size: 1.5rem; }
.comment-list, .comment-list .children { list-style: none; padding: 0; margin: 0; }
.comment-list .children { margin-left: 24px; padding-left: 20px; border-left: 2px solid var(--line); }
.comment-body { padding: 20px 0; border-bottom: 1px solid var(--line); }
.comment-author-info { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 8px; }
.comment-author cite { font-style: normal; font-weight: 650; }
.comment-author a { text-decoration: none; }
.comment-metadata { font-size: 0.85rem; color: var(--muted); }
.comment-metadata a { text-decoration: none; }
.comment-author-admin > .comment-body .fn::after { content: "Author"; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--accent); font-size: 0.75rem; font-weight: 650; vertical-align: 2px; }
.comment-content { font-size: 1rem; }
.comment-content p { margin-bottom: 0.6em; }
.comment-reply-link { font-size: 0.9rem; font-weight: 650; text-decoration: none; color: var(--accent-dark); }
.comment-respond { margin-top: 40px; }
.comment-reply-title { font-size: 1.3rem; }
.comment-reply-title small { font-size: 0.85rem; font-weight: 500; margin-left: 8px; }
.comment-form textarea, .comment-form input[type="text"], .comment-form input[type="email"] {
  display: block; width: 100%; margin-bottom: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 1rem; background: #fff; color: var(--text);
}
.comment-form textarea:focus, .comment-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.comment-form-notify { font-size: 0.95rem; color: var(--muted); }
.comment-form .submit { padding: 12px 28px; border: 0; border-radius: 999px; background: var(--accent); color: var(--text); font: inherit; font-weight: 650; cursor: pointer; }
.comment-form .submit:hover { background: var(--accent-dark); }
.form-notice { padding: 12px 16px; background: #fff8ee; border-left: 4px solid var(--accent); border-radius: 0 8px 8px 0; }

/* Article pages (layouts/article.js): the calculator pages and the IC indexes */

/* The page as wide as the home page; text at reading width, calculators and tables full width. */
.product-main.article-page > * { max-width: var(--wide); }
.breadcrumbs { padding-top: 40px; font-size: 0.9rem; color: var(--muted); }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--text); text-decoration: underline; }
.breadcrumbs > span[aria-hidden] { margin: 0 6px; }
.article-page > .breadcrumbs + h1 { padding-top: 12px; }
.article-page > h1 { padding-top: 56px; font-size: clamp(2rem, 4.5vw, 2.8rem); font-weight: 800; letter-spacing: -0.02em; }
.article-body > *:not(#calcWrap):not(.resistor_color_band_tool):not(.calc-cards):not(.ic-table):not(.signup-catcher-container) { max-width: 760px; }
.article-page #comments { max-width: 760px; }
.article-page h2 { text-align: left; margin-top: 1.6em; }
.article-body > p:first-child { font-size: 1.1rem; }
.article-body #calcWrap, .article-body .resistor_color_band_tool { margin: 32px 0 16px; }
.math-display { overflow-x: auto; overflow-y: hidden; }

/* The calculators: the plugin's layout (calculators/style.css), restyled */
.calc-page .calc_inner { max-width: none; padding: 32px; border: 1px solid var(--line); border-radius: var(--radius); font-family: inherit; }
.calc-page .calcType h4 { font-size: 1.1rem; font-weight: 700; }
.calc-page .calc-field { margin-bottom: 16px; }
.calc-page .calc-field .field-label { font-size: 0.95rem; font-weight: 650; }
.calc-page .calc-field-item { grid-template-columns: 1fr 72px; }
.calc-page .calc_inner input.calc_input, .calc-page .calc_inner select.selection, .calc-page .calc_inner .unit-label {
  height: 44px; border: 1px solid var(--line); font: inherit; font-size: 1rem; color: var(--text);
}
.calc-page .calc_inner input.calc_input { padding: 0 12px; border-right: 0; border-radius: 8px 0 0 8px; background: #fff; }
.calc-page .calc_inner input.calc_input[readonly], .calc-page .calc_inner input.calc_input.is-computed { background: var(--soft); font-weight: 650; }
.calc-page .calc_inner select.selection { padding: 0 8px; border-radius: 0 8px 8px 0; background-color: var(--soft); }
.calc-page .calc_inner .unit-label { display: flex; align-items: center; justify-content: center; border-radius: 0 8px 8px 0; background: var(--soft); }
.calc-page .calc-field-item.single select.selection { border-radius: 8px; background-color: #fff; }
.calc-page .calc_inner input:focus, .calc-page .calc_inner select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.calc-page .calc-formula { height: auto; min-height: 44px; border-radius: 8px; background: var(--soft); }
.calc-page .calc-results { border-radius: 8px; background: var(--text); }
.calc-page div.output_diagram svg { height: auto; }
/* The 555 calculator: the plugin sized its form column to the content, which left the diagram little room. */
@media (min-width: 769px) {
  .calc-page .calc_inner:has(#astable-tab) { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
}

/* The calculator listing (<calculator-index/>) */
.calc-cards { list-style: none; margin: 16px 0 2em; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.calc-card { display: flex; align-items: center; gap: 16px; height: 100%; padding: 12px 16px 12px 12px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; transition: border-color 0.15s; }
.calc-card:hover, .calc-card:focus-visible { border-color: var(--accent); color: var(--text); }
.calc-card img { flex: none; width: 96px; height: 72px; object-fit: contain; background: var(--soft); border-radius: 8px; padding: 6px; }
.calc-card__text { display: flex; flex-direction: column; gap: 3px; }
.calc-card__title { font-weight: 650; line-height: 1.3; }
.calc-card__desc { font-size: 0.9rem; line-height: 1.4; color: var(--muted); }

/* About page */

.about-hero img { border-radius: var(--radius); }
.about-hero h1 { font-size: clamp(2rem, 4.5vw, 2.8rem); }
.about-hero p:not(.lead) { color: var(--muted); }
.product-main > .split-left { grid-template-columns: 260px 1fr; align-items: start; }
.split-left > img { border-radius: var(--radius); }
.center-text { text-align: center; color: var(--muted); }
.link-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.link-cards a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px; border: 1px solid var(--line); border-radius: var(--radius); font-weight: 650; text-decoration: none; transition: border-color 0.15s; }
.link-cards a:hover { border-color: var(--accent); color: var(--text); }
.link-cards span { color: var(--accent-dark); }
.narrow-text { max-width: var(--narrow); margin: 0 auto; }
.book-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 32px 0; }
.book-cards a { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 16px; padding: 28px 20px 24px; background: var(--soft); border-radius: var(--radius); font-weight: 650; text-align: center; text-decoration: none; transition: transform 0.15s; }
.book-cards a:hover { transform: translateY(-3px); color: var(--text); }
.book-cards img { height: 200px; width: auto; object-fit: contain; }
.connect { text-align: center; }
.social-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }

/* Contact form (<contact-form/>) */

.contact-form-wrapper { max-width: 600px; margin: 0 auto; }
.contact-intro { text-align: center; color: var(--muted); margin-bottom: 2em; }
.contact-form { padding: 32px; border: 1px solid var(--line); border-radius: var(--radius); }
.contact-form p { margin: 0 0 20px; }
.contact-form label { display: block; margin-bottom: 6px; font-size: 0.95rem; font-weight: 650; }
.contact-form .required { color: var(--accent-dark); }
.contact-form input[type="text"], .contact-form input[type="email"], .contact-form textarea {
  display: block; width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 1rem; color: var(--text); background: #fff;
}
.contact-form textarea { resize: vertical; min-height: 180px; }
.contact-form input:focus, .contact-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.contact-form button { border: 0; font: inherit; font-weight: 650; cursor: pointer; }
.contact-form p:last-of-type { margin-bottom: 0; }
.contact-form__hp { position: absolute; left: -10000px; }
.contact-form-wrapper > .form-notice { text-align: center; }

/* IC index table (<ic-index/>) */

.ic-table { width: 100%; margin: 32px 0; border-collapse: collapse; font-size: 0.98rem; }
.ic-table th { padding: 10px 16px; border-bottom: 2px solid var(--text); text-align: left; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.ic-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ic-table tr:hover td { background: var(--soft); }
.ic-table td:first-child a { font-weight: 700; white-space: nowrap; text-decoration: none; }
.ic-table td:first-child a:hover { text-decoration: underline; }
.ic-table td:nth-child(2) { width: 112px; }
.ic-table img { width: 80px; height: 80px; object-fit: contain; border-radius: 6px; background: #fff; }

/* Signup forms (server/signup.js; the in-page box and the popup) */

.signup-hp { position: absolute; left: -10000px; }
.aftercontent-container, .incontent-container { margin: 48px 0; }
.signup-container { display: flex; align-items: center; gap: 32px; padding: 32px; border-radius: var(--radius); text-align: left; }
.signup-container img { width: 38%; max-width: 280px; flex: none; border-radius: 8px; }
.signup-form h2 { text-align: left; font-size: 1.6rem; margin: 0 0 0.4em; }
.signup-form p { margin-bottom: 1em; }
.signup-form form { display: grid; gap: 10px; }
.signup-form input[type="text"], .signup-form input[type="email"] { width: 100%; padding: 12px 14px; border: 1px solid rgba(0, 0, 0, 0.12); border-radius: 8px; font: inherit; font-size: 1rem; background: #fff; color: var(--text); }
.signup-form button { justify-self: start; padding: 12px 28px; border: 0; border-radius: 999px; color: #fff; font: inherit; font-weight: 650; cursor: pointer; }
.popup-container { display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 999; width: min(720px, calc(100% - 32px)); border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3); }
.popup-close { position: absolute; top: 8px; right: 12px; border: 0; background: none; font-size: 1.6rem; line-height: 1; color: var(--text); cursor: pointer; }

/* Phones */

@media (max-width: 760px) {
  body { font-size: 17px; }
  .hero { grid-template-columns: 1fr; gap: 24px; text-align: center; padding-top: 40px; }
  .hero img { width: 60%; max-width: 240px; margin: 0 auto; }
  .product-main > section { padding-top: 48px; }
  .product-main > section + section { margin-top: 40px; }
  .toc, .pricing, .cards, .product-main > .split { grid-template-columns: 1fr; }
  .contents { columns: 1; }
  .ic-table th, .ic-table td { padding: 10px 8px; }
  .ic-table td:nth-child(2) { width: 64px; }
  .ic-table img { width: 56px; height: 56px; }
  .signup-container { flex-direction: column; gap: 20px; padding: 24px 20px; text-align: center; }
  .signup-container img { width: 60%; }
  .signup-form h2 { text-align: center; }
  .signup-form button { justify-self: stretch; }
  .contact-form { padding: 20px 16px; }
  .product-main > .split-left { grid-template-columns: 1fr; }
  .split-left > img { width: 60%; max-width: 220px; margin: 0 auto; }
  .link-cards { grid-template-columns: 1fr; }
  .book-cards { grid-template-columns: 1fr 1fr; gap: 12px; }
  .book-cards a:last-child { grid-column: span 2; }
  .book-cards img { height: 150px; }
  .calc-page .calc_inner { padding: 20px 16px; }
  .calc-page .calc_config, .calc-page .calc-field, .calc-page .calc-field-item > * { min-width: 0; }
  .calc-page .calc_inner select.selection { width: 100%; }
  .chapter-cards { grid-template-columns: 1fr; gap: 12px; }
  .chapter-cards a { display: grid; grid-template-columns: 48px 1fr; column-gap: 16px; align-items: center; gap: 0 16px; padding: 16px 20px; text-align: left; }
  .chapter-cards img { grid-row: span 2; width: 48px; height: 48px; margin: 0; }
  .chapter-cards .more { display: none; }
  .author-box { grid-template-columns: 1fr; }
  .author-box img { max-width: 160px; }
  .with-nav .product-bar { justify-content: center; }
  .nav-dropdown { position: static; }
  .nav-dropdown ul { top: 100%; left: 16px; right: 16px; transform: none; width: auto; }
  .nav-dropdown li a { white-space: normal; padding: 7px 8px; }
  .site-nav { justify-content: center; gap: 4px 12px; font-size: 0.85rem; }
  .hero-home img { order: -1; width: 70%; max-width: 280px; }
  .topics { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .topic { min-height: 96px; padding: 12px 4px; font-size: 0.8rem; }
  .topic img { height: 28px; }
  .post-cards { grid-template-columns: 1fr; }
  .footer-columns { grid-template-columns: 1fr; text-align: center; }
  .site-footer .site-logo img { margin: 0 auto; }
  .site-footer h2 { text-align: center; }
  .product-item { grid-template-columns: 1fr; gap: 20px; text-align: center; }
  .product-item h2 { text-align: center; }
  .product-item img { max-height: 180px; }
  .logos:not(.logos-gray) img { height: 36px; }
  .split h2 { text-align: center; }
  .plan-featured { order: -1; }
  .bonus { grid-template-columns: 72px 1fr; gap: 20px; }
  .author { grid-template-columns: 1fr; }
  .author img { width: 110px; margin: 0 auto; }
}
