/*
Theme Name: HomeCalc
Theme URI: https://homecalc.guslok.com/
Author: GUSLOK
Description: Fast, responsive WordPress theme created for HomeCalc, a site of free home improvement calculators and project planning tools.
Version: 3.2.0
Requires at least: 6.2
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: homecalc
License: GPL-2.0-or-later
*/

:root {
  --hc-bg: #f5f7fb;
  --hc-surface: #ffffff;
  --hc-surface-2: #eef4ff;
  --hc-text: #172033;
  --hc-muted: #657084;
  --hc-border: #dde3ec;
  --hc-primary: #1468e8;
  --hc-primary-dark: #0c51b8;
  --hc-primary-soft: #eaf2ff;
  --hc-success: #16845b;
  --hc-warning: #b96b0a;
  --hc-max: 1180px;
  --hc-radius: 18px;
  --hc-shadow: 0 18px 50px rgba(28, 44, 73, .08);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--hc-bg);
  color: var(--hc-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--hc-primary);
  text-decoration-thickness: .08em;
  text-underline-offset: .16em;
}

a:hover {
  color: var(--hc-primary-dark);
}

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

button,
input,
select,
textarea {
  font: inherit;
}

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.screen-reader-text:focus {
  clip: auto !important;
  width: auto;
  height: auto;
  margin: 8px;
  padding: 10px 14px;
  background: #fff;
  color: #111;
  z-index: 99999;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(221, 227, 236, .9);
}

.admin-bar .site-header {
  top: 32px;
}

.header-inner {
  max-width: var(--hc-max);
  margin: 0 auto;
  min-height: 74px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-branding {
  min-width: 0;
}

.site-logo-link,
.site-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--hc-text);
  text-decoration: none;
  font-weight: 900;
  letter-spacing: -.035em;
  font-size: 24px;
  line-height: 1;
}

.homecalc-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(145deg, #1468e8, #14a8d8);
  color: #fff;
  font-size: 15px;
  letter-spacing: -.05em;
  box-shadow: 0 8px 20px rgba(20, 104, 232, .2);
}

.site-title .calc-accent {
  color: var(--hc-primary);
}

.site-tagline {
  display: none;
}

.primary-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.primary-nav li {
  margin: 0;
}

.primary-nav a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--hc-text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 750;
}

.primary-nav a:hover,
.primary-nav .current-menu-item > a,
.primary-nav .current_page_item > a {
  background: var(--hc-primary-soft);
  color: var(--hc-primary-dark);
}

.menu-toggle {
  display: none;
  width: 46px;
  height: 46px;
  border: 1px solid var(--hc-border);
  border-radius: 12px;
  background: #fff;
  color: var(--hc-text);
  cursor: pointer;
}

/* Main shell */
.site-main {
  min-height: 60vh;
}

.content-wrap {
  max-width: var(--hc-max);
  margin: 0 auto;
  padding: 44px 22px 64px;
}

.content-narrow {
  max-width: 900px;
  margin: 0 auto;
}

/* Homepage */
.home-hero {
  overflow: hidden;
  position: relative;
  padding: clamp(44px, 7vw, 86px) 0 42px;
  background:
    radial-gradient(circle at 88% 8%, rgba(20,168,216,.14), transparent 28%),
    radial-gradient(circle at 10% 70%, rgba(20,104,232,.10), transparent 30%),
    linear-gradient(180deg, #fff, #f5f7fb);
  border-bottom: 1px solid var(--hc-border);
}

.home-hero-inner {
  max-width: var(--hc-max);
  margin: 0 auto;
  padding: 0 22px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(330px, .75fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 7px 11px;
  border: 1px solid #cfe0ff;
  border-radius: 999px;
  background: #f4f8ff;
  color: var(--hc-primary-dark);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.hero-title {
  max-width: 780px;
  margin: 0;
  font-size: clamp(42px, 6.3vw, 78px);
  line-height: .98;
  letter-spacing: -.055em;
  font-weight: 950;
}

.hero-title span {
  color: var(--hc-primary);
}

.hero-copy {
  max-width: 720px;
  margin: 22px 0 0;
  color: var(--hc-muted);
  font-size: clamp(18px, 2vw, 21px);
  line-height: 1.55;
}

.hero-actions {
  margin-top: 28px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hc-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 17px;
  border: 1px solid transparent;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 850;
  line-height: 1.2;
}

.hc-button--primary {
  background: var(--hc-primary);
  color: #fff;
  box-shadow: 0 10px 28px rgba(20, 104, 232, .20);
}

.hc-button--primary:hover {
  background: var(--hc-primary-dark);
  color: #fff;
}

.hc-button--secondary {
  border-color: var(--hc-border);
  background: #fff;
  color: var(--hc-text);
}

.hero-preview {
  position: relative;
  background: #fff;
  border: 1px solid var(--hc-border);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--hc-shadow);
}

.preview-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.preview-badge {
  color: var(--hc-success);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.preview-title {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -.03em;
}

.preview-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.preview-field {
  background: var(--hc-bg);
  border: 1px solid var(--hc-border);
  border-radius: 11px;
  padding: 11px 12px;
}

.preview-field span {
  display: block;
  color: var(--hc-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.preview-field strong {
  display: block;
  margin-top: 3px;
  font-size: 17px;
}

.preview-result {
  margin-top: 12px;
  border-radius: 14px;
  background: var(--hc-primary-soft);
  padding: 17px;
}

.preview-result span {
  color: var(--hc-muted);
  font-size: 12px;
  font-weight: 750;
}

.preview-result strong {
  display: block;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -.04em;
}

/* Sections */
.home-section {
  padding: 58px 0;
}

.home-section--white {
  background: #fff;
  border-top: 1px solid var(--hc-border);
  border-bottom: 1px solid var(--hc-border);
}

.home-section-inner {
  max-width: var(--hc-max);
  margin: 0 auto;
  padding: 0 22px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 26px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.08;
  letter-spacing: -.04em;
}

.section-heading p {
  max-width: 560px;
  margin: 0;
  color: var(--hc-muted);
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.tool-card {
  min-width: 0;
  min-height: 230px;
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--hc-border);
  border-radius: var(--hc-radius);
  background: #fff;
  padding: 22px;
  color: var(--hc-text);
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(28,44,73,.04);
}

.tool-card:hover {
  transform: translateY(-2px);
  border-color: #bfd2f2;
  color: var(--hc-text);
  box-shadow: 0 15px 38px rgba(28,44,73,.09);
}

.tool-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--hc-primary-soft);
  font-size: 24px;
  margin-bottom: 18px;
}

.tool-card h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -.025em;
}

.tool-card p {
  margin: 9px 0 18px;
  color: var(--hc-muted);
  font-size: 15px;
  line-height: 1.55;
}

.tool-card-meta {
  margin-top: auto;
  color: var(--hc-primary-dark);
  font-size: 14px;
  font-weight: 850;
}

.tool-card--soon {
  opacity: .72;
  cursor: default;
}

.tool-card--soon:hover {
  transform: none;
  border-color: var(--hc-border);
  box-shadow: 0 8px 24px rgba(28,44,73,.04);
}

.soon-pill {
  align-self: flex-start;
  margin-top: auto;
  padding: 6px 9px;
  border-radius: 999px;
  background: #f1f3f6;
  color: var(--hc-muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 18px;
}

.feature-item {
  padding: 18px 0;
}

.feature-item strong {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
}

.feature-item p {
  margin: 0;
  color: var(--hc-muted);
  font-size: 15px;
}

/* Pages and posts */
.article-shell {
  max-width: 940px;
  margin: 0 auto;
}

.entry-header {
  margin-bottom: 30px;
}

.entry-kicker {
  display: inline-flex;
  margin-bottom: 12px;
  color: var(--hc-primary-dark);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .09em;
}

.entry-title {
  margin: 0;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1.04;
  letter-spacing: -.045em;
  font-weight: 950;
}

.entry-meta {
  margin-top: 12px;
  color: var(--hc-muted);
  font-size: 14px;
}

.entry-content {
  background: #fff;
  border: 1px solid var(--hc-border);
  border-radius: 22px;
  padding: clamp(22px, 4vw, 46px);
  box-shadow: 0 12px 38px rgba(28,44,73,.05);
}

.entry-content > :first-child {
  margin-top: 0;
}

.entry-content > :last-child {
  margin-bottom: 0;
}

.entry-content h2 {
  margin: 44px 0 14px;
  font-size: clamp(26px, 3.5vw, 36px);
  line-height: 1.15;
  letter-spacing: -.035em;
}

.entry-content h3 {
  margin: 30px 0 10px;
  font-size: 23px;
  line-height: 1.25;
}

.entry-content p {
  margin: 0 0 18px;
}

.entry-content ul,
.entry-content ol {
  padding-left: 1.4em;
}

.entry-content li {
  margin-bottom: 8px;
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
}

.entry-content th,
.entry-content td {
  padding: 11px 12px;
  border: 1px solid var(--hc-border);
  text-align: left;
}

.entry-content th {
  background: var(--hc-bg);
}

.entry-content .wp-block-table {
  overflow-x: auto;
}

/* Existing GUSLOK/HomeCalc boxes */
.guslok-main-box {
  margin: 24px 0;
  padding: 17px 18px;
  border: 1px solid #cfe0fb;
  border-left: 5px solid var(--hc-primary);
  border-radius: 13px;
  background: #f5f9ff;
}

.guia-juego {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--hc-border);
}

/* Archives */
.archive-header {
  max-width: 760px;
  margin-bottom: 28px;
}

.archive-title {
  margin: 0;
  font-size: clamp(36px, 5vw, 54px);
  letter-spacing: -.04em;
}

.archive-description {
  color: var(--hc-muted);
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 18px;
}

.post-card {
  border: 1px solid var(--hc-border);
  border-radius: 16px;
  background: #fff;
  padding: 20px;
}

.post-card h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.25;
}

.post-card h2 a {
  color: var(--hc-text);
  text-decoration: none;
}

.post-card p {
  color: var(--hc-muted);
  font-size: 15px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--hc-border);
  background: #111827;
  color: #d7deea;
}

.footer-inner {
  max-width: var(--hc-max);
  margin: 0 auto;
  padding: 44px 22px 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.35fr .65fr .65fr;
  gap: 34px;
}

.footer-brand .site-title {
  color: #fff;
}

.footer-brand p {
  max-width: 520px;
  color: #aeb8c8;
  font-size: 14px;
}

.footer-title {
  margin: 0 0 12px;
  color: #fff;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin: 8px 0;
}

.footer-links a {
  color: #cbd4e2;
  text-decoration: none;
  font-size: 14px;
}

.footer-links a:hover {
  color: #fff;
}

.footer-bottom {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.10);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: #8f9bad;
  font-size: 13px;
}

.footer-bottom p {
  margin: 0;
}

/* 404 */
.not-found {
  max-width: 760px;
  margin: 60px auto;
  text-align: center;
}

.not-found-code {
  font-size: clamp(80px, 15vw, 160px);
  line-height: .8;
  color: var(--hc-primary-soft);
  font-weight: 950;
  letter-spacing: -.06em;
}

.not-found h1 {
  font-size: 40px;
  margin: 24px 0 8px;
}

/* Pagination */
.navigation.pagination {
  margin-top: 30px;
}

.nav-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.page-numbers {
  min-width: 40px;
  min-height: 40px;
  display: inline-grid;
  place-items: center;
  padding: 6px 10px;
  border: 1px solid var(--hc-border);
  border-radius: 9px;
  background: #fff;
  color: var(--hc-text);
  text-decoration: none;
}

.page-numbers.current {
  background: var(--hc-primary);
  border-color: var(--hc-primary);
  color: #fff;
}

/* WordPress alignment */
.alignwide {
  width: min(1100px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.alignfull {
  width: 100%;
}

@media (max-width: 920px) {
  .home-hero-inner {
    grid-template-columns: 1fr;
  }
  .hero-preview {
    max-width: 620px;
  }
  .tool-grid,
  .feature-grid,
  .post-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  body {
    font-size: 16px;
  }

  .admin-bar .site-header {
    top: 46px;
  }

  .header-inner {
    min-height: 66px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .menu-toggle {
    display: inline-grid;
    place-items: center;
  }

  .primary-nav {
    display: none;
    position: absolute;
    left: 12px;
    right: 12px;
    top: calc(100% + 8px);
    padding: 10px;
    border: 1px solid var(--hc-border);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--hc-shadow);
  }

  .primary-nav.is-open {
    display: block;
  }

  .primary-nav ul {
    display: block;
  }

  .primary-nav a {
    padding: 12px;
  }

  .content-wrap {
    padding: 30px 16px 48px;
  }

  .home-hero-inner,
  .home-section-inner {
    padding-left: 16px;
    padding-right: 16px;
  }

  .home-section {
    padding: 44px 0;
  }

  .section-heading {
    display: block;
  }

  .section-heading p {
    margin-top: 10px;
  }

  .tool-grid,
  .feature-grid,
  .post-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .entry-content {
    border-radius: 16px;
    padding: 22px 18px;
  }

  .footer-bottom {
    display: block;
  }

  .footer-bottom p + p {
    margin-top: 8px;
  }
}

@media (max-width: 420px) {
  .site-title {
    font-size: 21px;
  }

  .homecalc-mark {
    width: 34px;
    height: 34px;
  }

  .hero-title {
    font-size: 43px;
  }

  .hero-actions .hc-button {
    width: 100%;
  }

  .preview-form {
    grid-template-columns: 1fr;
  }
}


/* Paint Calculator SEO landing */
.paint-landing .entry-header {
  max-width: 860px;
}

.paint-landing .entry-subtitle {
  max-width: 780px;
  margin: 16px 0 0;
  color: var(--hc-muted);
  font-size: 19px;
  line-height: 1.6;
}

.paint-landing .landing-tool-wrap {
  margin: 28px 0 34px;
}

.paint-landing .landing-tool-wrap .homecalc-tool {
  margin-top: 0;
  margin-bottom: 0;
}

.hc-toc {
  margin: 28px 0 34px;
  padding: 18px 20px;
  border: 1px solid var(--hc-border);
  border-radius: 14px;
  background: var(--hc-bg);
}

.hc-toc strong {
  display: block;
  margin-bottom: 8px;
}

.hc-toc ul {
  margin: 0;
  padding-left: 1.2em;
  columns: 2;
  column-gap: 32px;
}

.hc-toc li {
  break-inside: avoid;
  margin: 5px 0;
}

.hc-formula {
  margin: 22px 0;
  padding: 20px;
  border-radius: 14px;
  background: #111827;
  color: #fff;
}

.hc-formula small {
  display: block;
  margin-bottom: 7px;
  color: #aeb8c8;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.hc-formula code {
  color: #fff;
  background: transparent;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(15px, 2vw, 18px);
  white-space: normal;
}

.hc-data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0 26px;
  font-size: 15px;
}

.hc-data-table th,
.hc-data-table td {
  border: 1px solid var(--hc-border);
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
}

.hc-data-table th {
  background: var(--hc-bg);
}

.hc-note {
  margin: 22px 0;
  padding: 16px 18px;
  border: 1px solid #f0d39a;
  border-radius: 12px;
  background: #fff9ec;
  color: #66400d;
}

.hc-source-list {
  margin: 12px 0 0;
  padding-left: 1.2em;
  font-size: 14px;
  color: var(--hc-muted);
}

.hc-source-list li {
  margin-bottom: 8px;
}

.hc-faq {
  border-top: 1px solid var(--hc-border);
}

.hc-faq details {
  border-bottom: 1px solid var(--hc-border);
  padding: 0;
}

.hc-faq summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 2px;
  font-weight: 850;
  color: var(--hc-text);
}

.hc-faq summary::-webkit-details-marker {
  display: none;
}

.hc-faq summary::after {
  content: "+";
  float: right;
  color: var(--hc-primary);
  font-size: 22px;
  line-height: 1;
}

.hc-faq details[open] summary::after {
  content: "−";
}

.hc-faq details > div {
  padding: 0 2px 18px;
  color: var(--hc-muted);
}

.hc-related-card {
  margin-top: 34px;
  padding: 20px;
  border: 1px solid var(--hc-border);
  border-radius: 14px;
  background: var(--hc-primary-soft);
}

@media (max-width: 700px) {
  .hc-toc ul {
    columns: 1;
  }
}


/* HomeCalc v2 grouped calculator library */
.tool-group + .tool-group {
  margin-top: 42px;
}
.tool-group-title {
  margin: 0 0 16px;
  font-size: 22px;
  letter-spacing: -.02em;
}
.tool-grid--4 {
  grid-template-columns: repeat(4, minmax(0,1fr));
}
.tool-grid--4 .tool-card {
  min-height: 210px;
}
@media (max-width: 1050px) {
  .tool-grid--4 { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 820px) {
  .tool-grid--4 { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 560px) {
  .tool-grid--4 { grid-template-columns: 1fr; }
}


/* HomeCalc v3 language switcher */
.language-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid #dfe5ec;
  border-radius: 999px;
  background: #fff;
  margin-left: 12px;
}
.language-switcher a {
  min-width: 38px;
  padding: 7px 10px;
  border-radius: 999px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  color: #5f6b7b;
}
.language-switcher a.is-current {
  background: #111827;
  color: #fff;
}
.home-language-choice {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.home-language-choice a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.10);
  color: inherit;
  font-weight: 800;
  text-decoration: none;
}
.home-language-choice a.is-current {
  background: #fff;
  color: #111827;
}
body.homecalc-spanish .entry-kicker {
  text-transform: none;
}
@media (max-width: 880px) {
  .language-switcher {
    margin-left: auto;
    margin-right: 8px;
  }
}
