/* ============================================================
   DIYtalk — Global Custom Styles
   Applied site-wide (all pages)
   ============================================================ */

:root {
  --dt-primary: #005C6E;
  --dt-primary-hover: #004A59;
  --dt-bg: #ffffff;
  --dt-surface: #f8f8f8;
  --dt-text: #1a1a1a;
  --dt-text-muted: #666666;
  --dt-text-faint: #999999;
  --dt-divider: #e2e2e2;
  --dt-border: #d6d6d6;
  --dt-footer-bg: #1a1e24;
  --dt-font-display: 'Instrument Serif', Georgia, serif;
  --dt-font-body: 'General Sans', 'Helvetica Neue', system-ui, sans-serif;
  --dt-ease: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --dt-shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --dt-shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --dt-radius-sm: 0.25rem;
  --dt-radius-md: 0.375rem;
  --dt-radius-lg: 0.5rem;

  /* Category tag colors */
  --dt-tag-projects: #005C6E;
  --dt-tag-decor: #3A8A7A;
  --dt-tag-outdoor: #2E7D32;
  --dt-tag-recalls: #C62828;
  --dt-tag-pro: #455A64;
  --dt-tag-news: #1565C0;
  --dt-tag-tools: #5D4037;
  --dt-tag-plumbing: #0277BD;
  --dt-tag-electrical: #E65100;
  --dt-tag-painting: #6A1B9A;
  --dt-tag-renovation: #BF360C;
  --dt-tag-flooring: #2E7D32;
  --dt-tag-woodworking: #5D4037;
}

/* ── Global body overrides ── */
body {
  font-family: var(--dt-font-body);
  color: var(--dt-text);
  background: var(--dt-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Typography overrides for block theme ── */
h1, h2, h3, h4, h5, h6,
.wp-block-post-title,
.wp-block-heading {
  font-family: var(--dt-font-display);
  font-weight: 400;
  line-height: 1.2;
  color: var(--dt-text);
}

.wp-block-site-title a {
  font-family: var(--dt-font-body);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.04em;
  text-decoration: none;
  color: var(--dt-text);
}

/* ── Links ── */
a {
  color: var(--dt-primary);
  transition: color var(--dt-ease);
}
a:hover {
  color: var(--dt-primary-hover);
}

/* Article content links */
.entry-content a,
.wp-block-post-content a {
  color: var(--dt-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Navigation overrides ── */
.wp-block-navigation a {
  font-family: var(--dt-font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dt-text);
  text-decoration: none;
}
.wp-block-navigation a:hover {
  color: var(--dt-primary);
}

/* ── Buttons ── */
.wp-block-button__link,
.wp-element-button {
  font-family: var(--dt-font-body);
  font-weight: 600;
  font-size: 0.875rem;
  background: var(--dt-primary);
  color: #fff;
  border-radius: var(--dt-radius-md);
  padding: 0.625rem 1.5rem;
  transition: background var(--dt-ease), transform var(--dt-ease);
}
.wp-block-button__link:hover,
.wp-element-button:hover {
  background: var(--dt-primary-hover);
  color: #fff;
  transform: translateY(-1px);
}

/* ── Post/article content styling ── */
.wp-block-post-content {
  font-family: var(--dt-font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--dt-text);
}

.wp-block-post-title {
  font-family: var(--dt-font-display);
  font-weight: 400;
  line-height: 1.15;
}

/* Post meta (date, author, categories) */
.wp-block-post-date,
.wp-block-post-author-name,
.wp-block-post-terms {
  font-family: var(--dt-font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--dt-text-muted);
}

.wp-block-post-terms a {
  background: var(--dt-tag-projects);
  color: #fff;
  padding: 3px 10px;
  border-radius: var(--dt-radius-sm);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  display: inline-block;
}
.wp-block-post-terms a:hover {
  opacity: 0.85;
  color: #fff;
}

/* ── Featured image ── */
.wp-block-post-featured-image img {
  border-radius: var(--dt-radius-lg);
}

/* ── Blockquote ── */
.wp-block-quote {
  font-family: var(--dt-font-display);
  font-size: 1.5rem;
  font-style: italic;
  border-left: 3px solid var(--dt-primary);
  padding-left: 1.5rem;
  color: var(--dt-text);
}

/* ── Separator ── */
.wp-block-separator {
  border-color: var(--dt-divider);
}

/* ── Footer area ── */
.wp-block-template-part[data-area="footer"] {
  background: var(--dt-footer-bg);
  color: rgba(255,255,255,0.6);
}

/* ── Category badge utility classes ── */
.dt-badge {
  display: inline-block;
  font-family: var(--dt-font-body);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: var(--dt-radius-sm);
  color: #fff;
  line-height: 1.4;
}

/* ── Comment form ── */
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  font-family: var(--dt-font-body);
  border: 1px solid var(--dt-border);
  border-radius: var(--dt-radius-md);
  padding: 0.75rem 1rem;
}

.comment-form input[type="submit"] {
  background: var(--dt-primary);
  color: #fff;
  border: none;
  border-radius: var(--dt-radius-md);
  padding: 0.75rem 2rem;
  font-family: var(--dt-font-body);
  font-weight: 600;
  cursor: pointer;
}
.comment-form input[type="submit"]:hover {
  background: var(--dt-primary-hover);
}

/* ── Pagination ── */
.wp-block-query-pagination-numbers .page-numbers {
  font-family: var(--dt-font-body);
}
.wp-block-query-pagination-numbers .page-numbers.current {
  background: var(--dt-primary);
  color: #fff;
}

/* ── TOP BAR ── */
.dt-top-bar {
  background: var(--dt-primary);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: center;
  padding: 0.5rem 1rem;
}
.dt-top-bar a {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  color: #fff;
}
.dt-top-bar a:hover { opacity: 0.8; }

/* ── HEADER ── */
.dt-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--dt-bg);
  transition: box-shadow var(--dt-ease);
}
.dt-header.scrolled {
  box-shadow: var(--dt-shadow-md);
}
.dt-header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

/* Logo (text only) */
.dt-logo {
  font-family: var(--dt-font-body);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  text-decoration: none;
  color: var(--dt-text);
}
.dt-logo-diy { color: var(--dt-primary); }
.dt-logo-talk { color: var(--dt-text); }

/* Search box */
.dt-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--dt-border);
  border-radius: var(--dt-radius-md);
  color: var(--dt-text-muted);
  font-size: 0.875rem;
  cursor: pointer;
  transition: border-color var(--dt-ease);
  font-weight: 500;
  text-decoration: none;
}
.dt-search:hover { border-color: var(--dt-text-faint); color: var(--dt-text-muted); }
.dt-search svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ── NAV BAR ── */
.dt-nav {
  background: var(--dt-bg);
  border-top: 1px solid var(--dt-divider);
  border-bottom: 1px solid var(--dt-divider);
}
.dt-nav-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.dt-nav-inner::-webkit-scrollbar { display: none; }

.dt-nav a {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--dt-text);
  padding: 0.75rem 1rem;
  white-space: nowrap;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: color var(--dt-ease);
  position: relative;
}
.dt-nav a:hover { color: var(--dt-primary); }
.dt-nav a.dt-subscribe {
  color: var(--dt-primary);
  font-weight: 700;
  margin-left: auto;
}

/* ── CUSTOM FOOTER ── */
.dt-footer {
  background: var(--dt-footer-bg);
  color: rgba(255,255,255,0.6);
}
.dt-footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 4rem clamp(1rem, 4vw, 2.5rem);
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 4rem;
  align-items: start;
}
.dt-footer-logo {
  font-family: var(--dt-font-body);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  text-decoration: none;
  color: #fff;
}
.dt-footer-logo .dt-logo-diy { color: #4db8c7; }
.dt-footer-tagline {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.35);
  font-style: italic;
  margin-top: 1.25rem;
}
.dt-footer-social {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.25rem;
}
.dt-footer-social a {
  width: 34px;
  height: 34px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--dt-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 800;
  color: rgba(255,255,255,0.4);
  text-decoration: none;
  transition: background var(--dt-ease), color var(--dt-ease);
}
.dt-footer-social a:hover {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.75);
}

.dt-footer-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}
.dt-footer-col-title {
  font-family: var(--dt-font-body);
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}
.dt-footer-col a {
  display: block;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.35);
  text-decoration: none;
  padding: 0.25rem 0;
  transition: color var(--dt-ease);
}
.dt-footer-col a:hover { color: rgba(255,255,255,0.7); }

.dt-footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.06);
  max-width: 1240px;
  margin: 0 auto;
  padding: 1.25rem clamp(1rem, 4vw, 2.5rem);
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.2);
}

/* ── GLOBAL RESPONSIVE — shared components ── */
@media (max-width: 900px) {
  .dt-footer-inner {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

@media (max-width: 768px) {
  .dt-nav a:not(.dt-subscribe) { display: none; }
  .dt-footer-nav { grid-template-columns: repeat(2, 1fr); }
  .dt-footer-bottom { flex-direction: column; gap: 0.5rem; text-align: center; }
  .dt-header-inner { height: 56px; }
}

@media (max-width: 480px) {
  .dt-footer-nav { grid-template-columns: 1fr 1fr; }
}

/* ── Single Post Styles ── */
.single .wp-block-post-content {
  font-size: 1.0625rem;
  line-height: 1.8;
}

.single .wp-block-post-content h2 {
  font-size: 1.75rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.single .wp-block-post-content h3 {
  font-size: 1.375rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.single .wp-block-post-content p {
  margin-bottom: 1.25rem;
}

.single .wp-block-post-content img {
  border-radius: var(--dt-radius-lg);
}

.single .wp-block-post-content ul,
.single .wp-block-post-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.single .wp-block-post-content li {
  margin-bottom: 0.5rem;
}

/* Related articles grid on single posts */
.single .wp-block-query .wp-block-post-template {
  gap: 1.25rem;
}

.single .wp-block-post-featured-image img {
  border-radius: var(--dt-radius-lg);
  aspect-ratio: 16/10;
  object-fit: cover;
}
