:root {
  --bg: #f3f4f8;
  --surface: #ffffff;
  --surface-soft: #f9fafc;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #d6d9e5;
  --brand: #113a7f;
  --brand-soft: #eaf1ff;
  --accent: #c39a63;
  --shadow: 0 20px 45px rgba(16, 24, 40, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 90% -10%, #dbe6ff 0%, transparent 35%), var(--bg);
  line-height: 1.55;
}

h1, h2, h3 {
  font-family: "Playfair Display", serif;
  letter-spacing: 0.2px;
}

.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.site-header {
  background: #eef1f8;
  border-bottom: 1px solid #dde2ee;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 0;
  gap: 1rem;
}

.brand {
  text-decoration: none;
  color: var(--brand);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-icon {
  width: 26px;
  height: 26px;
}

.nav-links {
  display: flex;
  gap: 1.1rem;
  overflow: hidden;
  white-space: nowrap;
  align-items: center;
  flex-wrap: nowrap;
  position: relative;
  z-index: 70;
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.tools-toggle {
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  min-height: auto;
  padding: 0;
}

.tools-toggle::after {
  content: " \25BE";
  font-size: 0.9em;
}

.locale-switcher {
  width: 86px;
  min-height: 38px;
  padding: 0.2rem 0.5rem;
  border: 1px solid #cbd5e8;
  border-radius: 8px;
  background: #fff;
  font-weight: 700;
  color: #1f2937;
}

.tools-dropdown {
  position: relative;
}

.tools-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 320px;
  height: auto;
  border: 1px solid #d7deef;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 0.45rem;
  display: none;
  z-index: 120;
}

.tools-dropdown:hover .tools-menu,
.tools-dropdown:focus-within .tools-menu {
  display: block;
}

.tools-dropdown.open .tools-menu {
  display: block;
}

.tools-menu a {
  display: block;
  text-decoration: none;
  color: #0f4a68;
  font-weight: 700;
  padding: 0.55rem 0.6rem;
  border-radius: 8px;
}

.tools-menu a:hover {
  background: #eaf1ff;
}

.hero {
  padding: 4rem 0 2rem;
}

.hero-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr 320px;
  align-items: start;
}

.eyebrow {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--brand);
  font-weight: 700;
  letter-spacing: 1.4px;
}

h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 0.2rem 0 0.6rem;
}

.lead {
  max-width: 60ch;
  color: var(--muted);
  margin: 0;
}

.hero-stat {
  background: linear-gradient(145deg, #122f64 0%, #0f2550 100%);
  color: #fff;
  border-radius: 16px;
  padding: 1.2rem;
  box-shadow: var(--shadow);
}

.stat-label {
  color: #b7c5e6;
  margin: 0;
}

.stat-value {
  margin: 0.45rem 0 0;
  font-weight: 700;
}

.calculator-wrap {
  padding: 1rem 0 2rem;
}

.calc-layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr 320px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 1.3rem;
}

.card h2, .card h3 {
  margin-top: 0;
}

.card-note {
  color: var(--muted);
  margin-top: -0.25rem;
}

.field-grid {
  display: grid;
  gap: 0.9rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field span {
  font-weight: 700;
  font-size: 0.95rem;
}

input, select, button {
  font-family: inherit;
}

input, select, textarea {
  width: 100%;
  border: 1px solid #c7d3f5;
  background: #fff;
  border-radius: 10px;
  min-height: 46px;
  padding: 0.65rem 0.75rem;
  font-size: 1rem;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid #6f95f6;
  border-color: #2d62db;
}

.dimension-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem;
}

.length-row {
  grid-template-columns: 1fr 1fr auto;
}

.dimension-row select {
  width: 190px;
}

.dimension-row input.hidden {
  display: none;
}

.measure-input {
  position: relative;
}

.measure-input input {
  padding-right: 2.4rem;
}

.measure-tag {
  position: absolute;
  right: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
  pointer-events: none;
}

#lengthSubWrap.hidden {
  display: none;
}

.output input {
  background: var(--surface-soft);
  font-weight: 700;
}

.cost-card {
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.8rem;
  background: #fcfcff;
}

.cost-card summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--brand);
}

.cost-grid {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.9rem;
}

.inline-combo {
  display: grid;
  grid-template-columns: 1fr 100px;
  gap: 0.45rem;
}

.action-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-top: 1rem;
}

button {
  border: 1px solid var(--line);
  background: #fff;
  min-height: 46px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  border-color: #8ea7e6;
}

#shareBtn {
  background: linear-gradient(145deg, #f44d6e 0%, #d7335a 100%);
  color: #fff;
  border-color: #cf2f56;
}

.helper-card ol {
  margin: 0.25rem 0 0.7rem;
  padding-left: 1.1rem;
}

.content-section {
  padding: 2.5rem 0;
}

.content-section.alt {
  background: linear-gradient(180deg, rgba(17, 58, 127, 0.06), transparent);
}

.formula {
  background: var(--brand-soft);
  border: 1px solid #bdd0ff;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  font-weight: 800;
}

.tool-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, 1fr);
}

.mini-tool {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  background: #fff;
}

.mini-tool label {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.mini-tool p {
  font-weight: 800;
  margin: 0.2rem 0 0;
}

.mini-tool h3 a,
.mini-tool p a {
  color: var(--brand);
  text-decoration: none;
}

.mini-tool h3 a:hover,
.mini-tool p a:hover {
  text-decoration: underline;
}

.tool-desc {
  color: var(--muted);
  font-weight: 400 !important;
  font-size: 0.92rem;
  margin: 0.1rem 0 0.5rem !important;
}

/* ─── Tables ─── */
.table-wrap {
  overflow-x: auto;
  margin: 1rem 0 1.4rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  font-size: 0.97rem;
}

thead {
  background: var(--brand);
  color: #fff;
}

th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 700;
  letter-spacing: 0.3px;
}

td {
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--line);
}

tbody tr:nth-child(even) {
  background: var(--surface-soft);
}

tbody tr:hover {
  background: var(--brand-soft);
}

/* ─── Key Facts ─── */
.key-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1.4rem 0;
}

.fact-item {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.1rem;
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.04);
}

.fact-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.fact-item p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

/* ─── Step Cards ─── */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.4rem 0;
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.3rem;
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.05);
  position: relative;
}

.step-number {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, var(--brand) 0%, #0d2e66 100%);
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
  border-radius: 10px;
  margin-bottom: 0.8rem;
}

.step-card h4 {
  margin: 0 0 0.4rem;
  font-family: "Playfair Display", serif;
  font-size: 1.05rem;
}

.step-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.55;
}

/* ─── Benefits Grid ─── */
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1.2rem 0;
}

.benefit-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.3rem;
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.benefit-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(16, 24, 40, 0.1);
}

.benefit-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.6rem;
}

.benefit-card h4 {
  margin: 0 0 0.35rem;
  font-family: "Playfair Display", serif;
  font-size: 1.05rem;
}

.benefit-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
}

/* ─── Persona Grid ─── */
.persona-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin: 1.2rem 0;
}

.persona-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.4rem;
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.05);
}

.persona-icon {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 0.5rem;
}

.persona-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
}

.persona-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.55;
}

/* ─── Pro Tip ─── */
.pro-tip {
  background: #fef9ee;
  border: 1px solid #f0dca6;
  border-left: 4px solid var(--accent);
  padding: 0.8rem 1rem;
  border-radius: 0 10px 10px 0;
  font-size: 0.95rem;
  margin: 1rem 0;
}

/* ─── FAQ Details ─── */
details {
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 0.7rem;
  background: var(--surface);
  overflow: hidden;
}

details summary {
  cursor: pointer;
  font-weight: 700;
  padding: 0.85rem 1.1rem;
  font-size: 1rem;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.15s ease;
}

details summary:hover {
  background: var(--brand-soft);
}

details summary::after {
  content: "+";
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--brand);
  flex-shrink: 0;
  margin-left: 0.8rem;
  transition: transform 0.2s ease;
}

details[open] summary::after {
  content: "−";
}

details summary::-webkit-details-marker {
  display: none;
}

details p {
  padding: 0 1.1rem 1rem;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

/* ─── CTA Section ─── */
.cta-section {
  padding: 3rem 0;
  background: linear-gradient(145deg, #122f64 0%, #0f2550 100%);
  color: #fff;
}

.cta-inner {
  text-align: center;
  max-width: 680px;
}

.cta-inner h2 {
  color: #fff;
  margin-top: 0;
}

.cta-inner p {
  color: #c0cfe8;
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}

.cta-button {
  display: inline-block;
  background: linear-gradient(145deg, #f44d6e 0%, #d7335a 100%);
  color: #fff;
  border: none;
  padding: 0.9rem 2.2rem;
  border-radius: 12px;
  font-weight: 800;
  font-size: 1.1rem;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 6px 20px rgba(244, 77, 110, 0.35);
}

.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(244, 77, 110, 0.45);
}

/* ─── Cost card overrides (inside calc) ─── */
.cost-card details,
.cost-card {
  border-radius: 14px;
}

.cost-card summary {
  padding: 0;
}

/* ─── Hero CTA ─── */
.hero-cta {
  display: inline-block;
  margin-top: 1.2rem;
  background: linear-gradient(145deg, #f44d6e 0%, #d7335a 100%);
  color: #fff;
  padding: 0.75rem 1.8rem;
  border-radius: 12px;
  font-weight: 800;
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(244, 77, 110, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(244, 77, 110, 0.4);
}

/* ─── Diagram Card ─── */
.diagram-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.4rem;
  margin: 1.4rem 0;
  box-shadow: var(--shadow);
}
.diagram-card h3 { margin-top: 0; }
.diagram-wrap { max-width: 540px; margin: 0 auto; }
.diagram-wrap svg { width: 100%; height: auto; }

/* ─── Formula Visualizer ─── */
.formula-viz {
  overflow-x: auto;
  padding: 0.5rem 0;
}
.fv-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  min-width: 500px;
}
.fv-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 0.6rem 1rem;
  min-width: 72px;
  background: var(--surface-soft);
  transition: border-color 0.3s ease, background 0.3s ease;
}
.fv-box.fv-length { border-color: var(--brand); }
.fv-box.fv-width { border-color: #c39a63; }
.fv-box.fv-thick { border-color: #d7335a; }
.fv-box.fv-div { border-color: var(--muted); background: #f0f0f5; }
.fv-box.fv-result {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.fv-box.fv-result .fv-label,
.fv-box.fv-result .fv-unit { color: #c0cfe8; }
.fv-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  color: var(--muted);
}
.fv-value {
  font-size: 1.35rem;
  font-weight: 800;
}
.fv-unit {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
}
.fv-op {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--muted);
}

/* ─── Comparison Bars ─── */
.comp-bars { margin: 1rem 0; }
.comp-row {
  display: grid;
  grid-template-columns: 150px 1fr 90px;
  gap: 0.7rem;
  align-items: center;
  margin-bottom: 0.7rem;
}
.comp-label {
  font-weight: 700;
  font-size: 0.92rem;
}
.comp-label small {
  display: block;
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--muted);
}
.comp-track {
  height: 32px;
  background: #edf1fa;
  border-radius: 10px;
  overflow: hidden;
}
.comp-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.6s ease;
}
.comp-bf { background: linear-gradient(90deg, var(--brand), #2d62db); }
.comp-lf { background: linear-gradient(90deg, #c39a63, #d4a056); }
.comp-sf { background: linear-gradient(90deg, #d7335a, #f44d6e); }
.comp-val {
  font-weight: 800;
  font-size: 0.95rem;
  text-align: right;
}

/* ─── Doyle Calculator ─── */
.doyle-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-bottom: 1rem;
}
.doyle-viz { max-width: 420px; margin: 0 auto; }
.doyle-viz svg { width: 100%; height: auto; }

@media (max-width: 680px) {
  .comp-row { grid-template-columns: 1fr; gap: 0.3rem; }
  .doyle-controls { grid-template-columns: 1fr; }
  .fv-row { min-width: auto; gap: 0.4rem; }
  .fv-box { min-width: 56px; padding: 0.5rem 0.6rem; }
  .fv-value { font-size: 1.1rem; }
}

.site-footer {
  margin-top: 2.2rem;
  background: #ffffff;
  color: #1f2937;
  border-top: 1px solid #d6d9e5;
}

.footer-grid {
  padding: 2.2rem 0 1.4rem;
  display: grid;
  grid-template-columns: 1.3fr 0.9fr 0.9fr 1.1fr;
  gap: 1.3rem;
}

.footer-logo {
  margin: 0;
  font-weight: 800;
  color: #113a7f;
  font-size: 1.55rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.footer-logo-icon {
  width: 26px;
  height: 26px;
}

.footer-logo span {
  color: #25c8ff;
}

.footer-desc {
  margin: 0.35rem 0 0;
  color: #6b7280;
}

.social-row {
  margin-top: 0.9rem;
  display: flex;
  gap: 0.55rem;
}

.social-row a {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #113a7f;
  border: 1px solid #d6d9e5;
  border-radius: 12px;
  font-weight: 800;
  background: #f7f9ff;
}

.footer-title {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #1f2937;
  font-weight: 800;
  font-size: 0.88rem;
}

.footer-list,
.footer-contact {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.45rem;
}

.footer-list a,
.footer-contact a {
  text-decoration: none;
  color: #1f2937;
  font-weight: 600;
}

.lang-grid {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(5, minmax(44px, 1fr));
  gap: 0.45rem;
}

.lang-grid a {
  text-decoration: none;
  color: #4b5563;
  border: 1px solid #d6d9e5;
  border-radius: 9px;
  text-align: center;
  padding: 0.35rem 0.25rem;
  font-weight: 800;
  font-size: 0.85rem;
  background: #f9fbff;
}

.lang-grid a.active {
  color: #113a7f;
  border-color: #7ea4ff;
  background: #eaf1ff;
}

.footer-bottom {
  border-top: 1px solid #d6d9e5;
  padding: 1rem 0 1.4rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.scroll-top {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid #7ea4ff;
  background: #eaf1ff;
  color: #113a7f;
  font-size: 1.15rem;
  font-weight: 800;
}

/* ─── Blog Listing ─── */
.blog-hero {
  text-align: center;
  padding: 2.5rem 0 1rem;
}
.blog-hero h1 { margin-bottom: 0.4rem; }
.blog-hero .lead { margin: 0 auto 1.8rem; }

.blog-search {
  max-width: 520px;
  margin: 0 auto 1.6rem;
  position: relative;
}
.blog-search input {
  width: 100%;
  padding: 0.85rem 1.1rem 0.85rem 3rem;
  border-radius: 14px;
  border: 2px solid var(--line);
  font-size: 1rem;
  background: var(--surface);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.blog-search input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(17,58,127,0.08);
}
.blog-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.15rem;
  color: var(--muted);
  pointer-events: none;
}

.category-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 2rem;
}
.cat-pill {
  padding: 0.5rem 1.2rem;
  border: 2px solid var(--line);
  border-radius: 50px;
  background: var(--surface);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.cat-pill:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}
.cat-pill.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}

.blog-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(16,24,40,0.1);
}

.blog-thumb {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: linear-gradient(135deg, #dce6ff, #eaf1ff);
  display: block;
}
.blog-thumb-svg {
  width: 100%;
  height: 180px;
  overflow: hidden;
  background: linear-gradient(135deg, #f0f4ff, #eaf1ff);
}
.blog-thumb-svg svg {
  width: 100%;
  height: 100%;
}

.blog-card-body {
  padding: 1.1rem;
}
.blog-card-body h3 {
  margin: 0.3rem 0 0.5rem;
  font-size: 1.08rem;
  line-height: 1.4;
}
.blog-card-body h3 a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s ease;
}
.blog-card-body h3 a:hover { color: var(--brand); }
.blog-card-body > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.blog-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
}
.cat-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.blog-date {
  color: var(--muted);
  font-size: 0.85rem;
}
.blog-read-time {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}
.meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

/* ─── Pagination ─── */
.blog-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  margin-top: 2.5rem;
  padding-bottom: 1rem;
}
.page-btn {
  min-width: 42px;
  min-height: 42px;
  padding: 0.4rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  color: var(--text);
  transition: all 0.2s ease;
}
.page-btn:hover:not(:disabled) {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}
.page-btn.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.blog-no-results {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  grid-column: 1 / -1;
}
.blog-no-results span { font-size: 2.5rem; display: block; margin-bottom: 0.6rem; }

/* ─── Blog Post Layout ─── */
.blog-post-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  align-items: start;
}

.blog-article { min-width: 0; }

.blog-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.2rem;
  font-size: 0.88rem;
  color: var(--muted);
  flex-wrap: wrap;
}
.blog-breadcrumb a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}
.blog-breadcrumb a:hover { text-decoration: underline; }
.blog-breadcrumb .sep { color: var(--line); }

.blog-article-header {
  margin-bottom: 1.5rem;
}
.blog-article-header h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  line-height: 1.25;
  margin: 0.5rem 0 0.7rem;
}
.blog-header-meta {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.blog-featured-img {
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 1.8rem;
  border: 1px solid var(--line);
}
.blog-featured-img svg { width: 100%; height: auto; display: block; }

.blog-content h2 {
  font-size: 1.4rem;
  margin: 2rem 0 0.7rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--brand-soft);
}
.blog-content h3 {
  font-size: 1.15rem;
  margin: 1.5rem 0 0.6rem;
}
.blog-content p {
  line-height: 1.75;
  color: #374151;
  margin: 0 0 1rem;
}
.blog-content ul, .blog-content ol {
  margin: 0.5rem 0 1.2rem;
  padding-left: 1.3rem;
  line-height: 1.75;
  color: #374151;
}
.blog-content li { margin-bottom: 0.3rem; }
.blog-content .formula {
  margin: 1.2rem 0;
  text-align: center;
  font-size: 1.05rem;
}

.blog-example-box {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 0 12px 12px 0;
  padding: 1.1rem 1.2rem;
  margin: 1.2rem 0;
}
.blog-example-box h4 {
  margin: 0 0 0.5rem;
  color: var(--brand);
  font-size: 0.95rem;
}
.blog-example-box p { margin: 0.3rem 0; }

.blog-cta-block {
  background: linear-gradient(145deg, #122f64 0%, #0f2550 100%);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  margin: 2.5rem 0;
}
.blog-cta-block h3 { color: #fff; margin: 0 0 0.5rem; font-size: 1.3rem; }
.blog-cta-block p { color: #b7c5e6; margin: 0 0 1.2rem; }

/* ─── Sidebar ─── */
.blog-sidebar {
  display: grid;
  gap: 1.2rem;
  position: sticky;
  top: 1.5rem;
}

.sidebar-widget {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.2rem;
  box-shadow: 0 4px 14px rgba(16,24,40,0.04);
}
.sidebar-widget h3 {
  font-size: 1rem;
  margin: 0 0 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--brand-soft);
}

.sidebar-search input {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: 0.92rem;
}

.sidebar-post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar-post-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #eef1f6;
}
.sidebar-post-list li:last-child { border-bottom: none; }
.sidebar-post-list a {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.45;
  display: block;
  transition: color 0.15s ease;
}
.sidebar-post-list a:hover { color: var(--brand); }
.sidebar-post-list .s-date {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.sidebar-cats {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar-cats li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid #eef1f6;
  transition: color 0.15s ease;
}
.sidebar-cats li:last-child a { border-bottom: none; }
.sidebar-cats li a:hover { color: var(--brand); }
.sidebar-cats .cat-count {
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
}

/* Sidebar Calculator Widget */
.sidebar-calc .sc-field {
  display: grid;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}
.sidebar-calc .sc-field span {
  font-weight: 700;
  font-size: 0.82rem;
}
.sidebar-calc input {
  min-height: 38px;
  font-size: 0.9rem;
  padding: 0.4rem 0.6rem;
}
.sidebar-calc .sc-result {
  background: var(--brand);
  color: #fff;
  text-align: center;
  padding: 0.7rem;
  border-radius: 10px;
  font-weight: 800;
  font-size: 1rem;
  margin-top: 0.5rem;
}
.sidebar-calc button {
  width: 100%;
  margin-top: 0.5rem;
  background: linear-gradient(145deg, var(--brand) 0%, #0d2e66 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  min-height: 40px;
  font-weight: 700;
}

/* Newsletter Widget */
.sidebar-newsletter p {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 0.7rem;
  line-height: 1.5;
}
.sidebar-newsletter input[type="email"] {
  margin-bottom: 0.5rem;
  min-height: 40px;
  font-size: 0.9rem;
}
.sidebar-newsletter button {
  width: 100%;
  background: linear-gradient(145deg, #f44d6e 0%, #d7335a 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  min-height: 42px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease;
}
.sidebar-newsletter button:hover {
  transform: translateY(-1px);
}

/* ─── Responsive ─── */
@media (max-width: 980px) {
  .hero-grid, .calc-layout {
    grid-template-columns: 1fr;
  }
  .tool-grid {
    grid-template-columns: 1fr;
  }
  .blog-grid {
    grid-template-columns: 1fr 1fr;
  }
  .blog-post-layout {
    grid-template-columns: 1fr;
  }
  .blog-sidebar {
    position: static;
    grid-template-columns: 1fr 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .nav-links {
    display: none;
  }
  .header-row {
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .locale-switcher {
    width: 100%;
  }
  .tools-menu {
    width: 280px;
  }
  .action-row {
    grid-template-columns: 1fr;
  }
  .dimension-row {
    grid-template-columns: 1fr;
  }
  .length-row {
    grid-template-columns: 1fr;
  }
  .dimension-row select {
    width: 100%;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .lang-grid {
    grid-template-columns: repeat(4, minmax(44px, 1fr));
  }
  .blog-grid {
    grid-template-columns: 1fr;
  }
  .blog-sidebar {
    grid-template-columns: 1fr;
  }
  .category-filters {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.5rem;
  }
  .cat-pill { white-space: nowrap; flex-shrink: 0; }
  .calc-grid { grid-template-columns: 1fr; }
}

/* ═══════════ RELATED CALCULATORS GRID ═══════════ */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.calc-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  padding: 2rem 1.5rem 1.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  text-decoration: none;
  color: var(--text);
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.calc-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(17,58,127,0.04) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.calc-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(17,58,127,0.12);
  border-color: var(--brand);
}

.calc-card:hover::before { opacity: 1; }

.calc-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #edf1fa 0%, #dce3f3 100%);
  border-radius: 14px;
  color: var(--brand);
  transition: background 0.25s ease, transform 0.25s ease;
}

.calc-icon svg {
  width: 32px;
  height: 32px;
}

.calc-card:hover .calc-icon {
  background: linear-gradient(135deg, var(--brand) 0%, #1a4fa5 100%);
  color: #fff;
  transform: scale(1.08);
}

.calc-card h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand);
  transition: color 0.2s;
}

.calc-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}

.calc-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-soft, #f3f5fa);
  color: var(--brand);
  font-weight: 700;
  font-size: 1.1rem;
  margin-top: 0.25rem;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.calc-card:hover .calc-arrow {
  background: var(--brand);
  color: #fff;
  transform: translateX(4px);
}

@media (max-width: 900px) {
  .calc-grid { grid-template-columns: repeat(2, 1fr); }
}

