/*
Theme Name: The Ten Stack
Theme URI: https://ten-stack.com
Author: The Ten Stack
Description: Editorial block theme for The Ten Stack, independent top-ten software rankings for small business. Built for readability, E-E-A-T signals and fast Core Web Vitals.
Version: 1.0.2
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tenstack
*/

/* ---------- Base refinements not expressible in theme.json ---------- */

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6, .wp-block-post-title, .wp-block-query-title, .wp-block-site-title {
  text-wrap: pretty;
  letter-spacing: -0.015em;
}

h1, .wp-block-post-title.is-style-ts-display, .wp-block-query-title {
  letter-spacing: -0.025em;
}

p, li, blockquote { text-wrap: pretty; }

a { text-underline-offset: 0.14em; text-decoration-thickness: 1px; }

.wp-block-button__link { border-radius: 0; }

hr.wp-block-separator { border: 0; border-top: 1px solid var(--wp--preset--color--rule); }
hr.wp-block-separator.is-style-ts-ink { border-top-color: var(--wp--preset--color--contrast); }

/* ---------- Utility classes used by templates and patterns ---------- */

.ts-eyebrow {
  font-family: var(--wp--preset--font-family--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--wp--preset--color--accent);
}
.ts-eyebrow.is-muted { color: var(--wp--preset--color--muted); }
.ts-eyebrow.is-mint { color: var(--wp--preset--color--mint); }

.ts-meta {
  font-family: var(--wp--preset--font-family--sans);
  font-size: 13px;
  color: var(--wp--preset--color--muted);
}
.ts-meta a { color: inherit; }

.ts-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--wp--preset--color--contrast);
  color: var(--wp--preset--color--base);
  font-family: var(--wp--preset--font-family--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.ts-card {
  background: var(--wp--preset--color--white);
  border: 1px solid var(--wp--preset--color--rule);
}

.ts-panel { background: var(--wp--preset--color--panel); }

/* Rank numerals: the signature motif */
.ts-rank {
  font-family: var(--wp--preset--font-family--serif);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  line-height: 0.85;
  letter-spacing: -0.04em;
  color: var(--wp--preset--color--contrast);
}
.ts-rank.is-large { font-size: 96px; min-width: 96px; }
.ts-rank.is-medium { font-size: 40px; }
.ts-rank.is-small { font-size: 26px; }
.ts-rank.is-muted { color: var(--wp--preset--color--muted); }

/* Numbered entry headings inside ranking posts (fallback for legacy content) */
.ts-ranking .entry-content > h2:not(.ts-plain) {
  border-top: 1px solid var(--wp--preset--color--rule);
  padding-top: var(--wp--preset--spacing--50);
  margin-top: var(--wp--preset--spacing--70);
}
.ts-ranking .entry-content > h2:first-of-type { border-top-color: var(--wp--preset--color--contrast); }

/* Comparison table */
.ts-table table { border-collapse: collapse; width: 100%; font-size: 15px; }
.ts-table th {
  text-align: left; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--wp--preset--color--muted); font-weight: 600; padding: 10px 14px;
  border-bottom: 1px solid var(--wp--preset--color--contrast);
}
.ts-table td { padding: 14px; border-bottom: 1px solid var(--wp--preset--color--rule); vertical-align: top; }
.ts-table td:first-child { font-family: var(--wp--preset--font-family--serif); font-size: 20px; line-height: 1; width: 48px; }
.ts-table figure { margin: 0; }

/* Strengths / limitations lists */
.ts-strengths h4 { color: var(--wp--preset--color--accent); }
.ts-limitations h4 { color: var(--wp--preset--color--caution); }
.ts-strengths h4, .ts-limitations h4 {
  font-family: var(--wp--preset--font-family--sans);
  font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; margin: 0 0 10px;
}
.ts-strengths ul, .ts-limitations ul { margin: 0; padding-left: 18px; }
.ts-strengths li, .ts-limitations li { margin: 4px 0; }

/* FAQ */
.ts-faq .wp-block-details { border-top: 1px solid var(--wp--preset--color--rule); padding: 18px 0; margin: 0; }
.ts-faq .wp-block-details:last-child { border-bottom: 1px solid var(--wp--preset--color--rule); }
.ts-faq summary { font-weight: 600; font-size: 18px; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.ts-faq summary::-webkit-details-marker { display: none; }
.ts-faq summary::after { content: "+"; color: var(--wp--preset--color--muted); font-weight: 400; }
.ts-faq details[open] summary::after { content: "–"; }
.ts-faq .wp-block-details > *:not(summary) { color: var(--wp--preset--color--body); margin-top: 10px; }

/* Nav */
.wp-block-navigation a:where(:not(.wp-element-button)) { text-decoration: none; }
.wp-block-navigation .current-menu-item > a { color: var(--wp--preset--color--accent); box-shadow: inset 0 -2px 0 var(--wp--preset--color--accent); padding-bottom: 2px; }

/* Search form */
.wp-block-search__input { border: 1px solid var(--wp--preset--color--rule2); border-radius: 0; background: transparent; font-family: var(--wp--preset--font-family--sans); font-size: 14px; }
.wp-block-search__button { border-radius: 0; }

/* Post cards in query loops */
.ts-card-list .wp-block-post { display: flex; }
.ts-card-list .wp-block-post > .wp-block-group { flex-grow: 1; }
.ts-card .wp-block-post-title a { text-decoration: none; }
.ts-card .wp-block-post-title a:hover { color: var(--wp--preset--color--accent); }

/* Hero stats */
.ts-stat { font-family: var(--wp--preset--font-family--serif); font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }

/* Small screens */
@media (max-width: 781px) {
  .ts-rank.is-large { font-size: 64px; min-width: 64px; }
  .ts-hide-mobile { display: none !important; }
}

/* Reduce motion respect */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

/* Separators span their container by default in this theme */
hr.wp-block-separator:not(.is-style-wide):not(.is-style-dots) { width: 100%; max-width: none; height: 0; }

.wp-block-post-author-name a { text-decoration: none; }
.wp-block-post-author-name a:hover { text-decoration: underline; }
footer .wp-block-categories { margin-top: 10px; }

/* Comparison table: horizontal rules only */
.ts-table td, .ts-table th { border-left: 0; border-right: 0; }
.ts-table .wp-block-table table { border-collapse: collapse; }
.wp-block-button__link { white-space: nowrap; }
