/*
Theme Name: TechDifferent Minimal Dark
Theme URI: https://techdifferent.it
Author: TechDifferent
Author URI: https://techdifferent.it
Description: Tema minimal, scuro, SEO-friendly e ottimizzato per velocità. Font di sistema, lazy-load, zero Google Fonts. Colori e logo TechDifferent.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.7
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: techdifferent-minimal
Tags: dark, minimal, blog, news, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, seo, performance
*/

/* ========== CSS Variables (stessi colori del sito) ========== */
:root {
  --td-bg: #151515;
  --td-surface: #1e1e1e;
  --td-surface-2: #27272a;
  --td-border: #333338;
  --td-text: #e8e8e8;
  --td-text-muted: #a0a0a0;
  --td-accent: #00c853;
  --td-accent-hover: #00e676;
  --td-accent-dim: rgba(0, 200, 83, 0.15);
  --td-link: #00c853;
  --td-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  --td-font-heading: var(--td-font);
  --td-radius: 8px;
  --td-max-width: 1200px;
  --td-content-width: 720px;
  --td-header-height: 70px;
  --td-transition: 0.2s ease;
}

/* ========== Reset & Base ========== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--td-font);
  background-color: var(--td-bg);
  color: var(--td-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a {
  color: var(--td-link);
  text-decoration: none;
  transition: color var(--td-transition);
}

a:hover,
a:focus {
  color: var(--td-accent-hover);
  outline: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--td-font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
  margin-bottom: 0.6em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

p { margin-bottom: 1.25em; }

ul, ol {
  margin-bottom: 1.25em;
  padding-left: 1.5em;
}

/* ========== Skip link (accessibilità + SEO) ========== */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--td-accent);
  color: #000;
  padding: 0.5rem 1rem;
  z-index: 10000;
  border-radius: var(--td-radius);
  font-weight: 600;
}

.skip-link:focus {
  top: 1rem;
}

/* ========== Header ========== */
.site-header {
  background: var(--td-surface);
  border-bottom: 1px solid var(--td-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--td-header-height);
}

.header-inner {
  max-width: var(--td-max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-branding {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.site-branding .custom-logo-link img,
.site-branding .custom-logo {
  max-height: 48px;
  width: auto;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.site-title a {
  color: inherit;
}

.site-description {
  font-size: 0.8rem;
  color: var(--td-text-muted);
  margin: 0;
}

/* Navigation */
.main-navigation {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.main-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}

.main-navigation a {
  display: block;
  padding: 0.5rem 0.85rem;
  color: var(--td-text);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 6px;
  transition: background var(--td-transition), color var(--td-transition);
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a {
  background: var(--td-accent-dim);
  color: var(--td-accent);
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--td-border);
  color: var(--td-text);
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

.menu-toggle:hover {
  border-color: var(--td-accent);
  color: var(--td-accent);
}

/* ========== Main content ========== */
.site-main {
  flex: 1;
  width: 100%;
  max-width: var(--td-max-width);
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

/* ========== Posts grid (home / archive) ========== */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.75rem;
}

.post-card {
  background: var(--td-surface);
  border: 1px solid var(--td-border);
  border-radius: var(--td-radius);
  overflow: hidden;
  transition: border-color var(--td-transition), transform var(--td-transition);
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  border-color: var(--td-accent);
  transform: translateY(-2px);
}

.post-card .post-thumbnail {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--td-surface-2);
}

.post-card .post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.post-card:hover .post-thumbnail img {
  transform: scale(1.03);
}

.post-card .post-content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-card .entry-title {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.post-card .entry-title a {
  color: #fff;
}

.post-card .entry-title a:hover {
  color: var(--td-accent);
}

.post-card .entry-meta {
  font-size: 0.8rem;
  color: var(--td-text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.post-card .entry-summary {
  font-size: 0.95rem;
  color: var(--td-text-muted);
  flex: 1;
  margin-bottom: 1rem;
}

.post-card .read-more {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--td-accent);
  margin-top: auto;
}

.post-card .read-more:hover {
  color: var(--td-accent-hover);
}

/* ========== Single post / page ========== */
.single-post,
.page-content {
  max-width: var(--td-content-width);
  margin: 0 auto;
}

.entry-header {
  margin-bottom: 1.75rem;
}

.entry-header .entry-title {
  font-size: 2.1rem;
  margin-bottom: 0.75rem;
}

.entry-header .entry-meta {
  font-size: 0.9rem;
  color: var(--td-text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.entry-header .entry-meta a {
  color: var(--td-text-muted);
}

.entry-header .entry-meta a:hover {
  color: var(--td-accent);
}

.featured-image {
  margin-bottom: 1.75rem;
  border-radius: var(--td-radius);
  overflow: hidden;
}

.entry-content {
  font-size: 1.05rem;
  line-height: 1.75;
}

.entry-content h2,
.entry-content h3 {
  margin-top: 1.75em;
}

.entry-content a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.entry-content img {
  border-radius: var(--td-radius);
  margin: 1.5rem 0;
}

.entry-content blockquote {
  border-left: 3px solid var(--td-accent);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--td-accent-dim);
  border-radius: 0 var(--td-radius) var(--td-radius) 0;
  color: var(--td-text);
}

.entry-content pre,
.entry-content code {
  font-family: "SF Mono", "Fira Code", Consolas, monospace;
  background: var(--td-surface-2);
  border-radius: 4px;
}

.entry-content code {
  padding: 0.15em 0.4em;
  font-size: 0.9em;
}

.entry-content pre {
  padding: 1rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.entry-content pre code {
  padding: 0;
  background: none;
}

.entry-footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--td-border);
  font-size: 0.9rem;
  color: var(--td-text-muted);
}

.entry-footer .cat-links,
.entry-footer .tags-links {
  display: block;
  margin-bottom: 0.5rem;
}

.entry-footer a {
  color: var(--td-accent);
}

/* ========== Pagination ========== */
.pagination,
.nav-links {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 2.5rem 0 1rem;
  flex-wrap: wrap;
}

.pagination a,
.pagination span,
.nav-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.75rem;
  background: var(--td-surface);
  border: 1px solid var(--td-border);
  border-radius: 6px;
  color: var(--td-text);
  font-size: 0.9rem;
  font-weight: 500;
}

.pagination a:hover,
.nav-links a:hover {
  border-color: var(--td-accent);
  color: var(--td-accent);
}

.pagination .current {
  background: var(--td-accent);
  border-color: var(--td-accent);
  color: #000;
  font-weight: 700;
}

/* ========== Comments ========== */
.comments-area {
  max-width: var(--td-content-width);
  margin: 3rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--td-border);
}

.comment-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
}

.comment {
  padding: 1.25rem;
  background: var(--td-surface);
  border: 1px solid var(--td-border);
  border-radius: var(--td-radius);
  margin-bottom: 1rem;
}

.comment-author {
  font-weight: 600;
  color: #fff;
}

.comment-meta {
  font-size: 0.8rem;
  color: var(--td-text-muted);
  margin-bottom: 0.75rem;
}

.comment-form label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  color: var(--td-text-muted);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: var(--td-surface-2);
  border: 1px solid var(--td-border);
  border-radius: 6px;
  color: var(--td-text);
  font-family: inherit;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--td-accent);
}

.comment-form .submit {
  background: var(--td-accent);
  color: #000;
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--td-transition);
}

.comment-form .submit:hover {
  background: var(--td-accent-hover);
}

/* ========== Footer ========== */
.site-footer {
  background: var(--td-surface);
  border-top: 1px solid var(--td-border);
  padding: 2rem 1.25rem;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--td-max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.site-info {
  font-size: 0.9rem;
  color: var(--td-text-muted);
}

.site-info a {
  color: var(--td-accent);
}

.footer-social {
  display: flex;
  gap: 0.75rem;
}

.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--td-surface-2);
  border-radius: 50%;
  color: var(--td-text);
  transition: background var(--td-transition), color var(--td-transition);
}

.footer-social a:hover {
  background: var(--td-accent);
  color: #000;
}

/* ========== Widgets / Sidebar (optional) ========== */
.widget {
  background: var(--td-surface);
  border: 1px solid var(--td-border);
  border-radius: var(--td-radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.widget-title {
  font-size: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--td-border);
}

.widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.widget li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--td-border);
}

.widget li:last-child {
  border-bottom: none;
}

/* ========== Search form ========== */
.search-form {
  display: flex;
  gap: 0.5rem;
}

.search-form .search-field {
  flex: 1;
  padding: 0.6rem 0.9rem;
  background: var(--td-surface-2);
  border: 1px solid var(--td-border);
  border-radius: 6px;
  color: var(--td-text);
  font-size: 0.95rem;
}

.search-form .search-submit {
  background: var(--td-accent);
  color: #000;
  border: none;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

/* ========== Archive / Category title ========== */
.archive-header,
.page-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--td-border);
}

.archive-header .page-title,
.page-header .page-title {
  font-size: 1.75rem;
  margin-bottom: 0.35rem;
}

.archive-description {
  color: var(--td-text-muted);
  font-size: 0.95rem;
}

/* ========== 404 ========== */
.error-404 {
  text-align: center;
  padding: 4rem 1rem;
}

.error-404 .page-title {
  font-size: 3rem;
  color: var(--td-accent);
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .main-navigation {
    position: absolute;
    top: var(--td-header-height);
    left: 0;
    right: 0;
    background: var(--td-surface);
    border-bottom: 1px solid var(--td-border);
    padding: 1rem;
    display: none;
  }

  .main-navigation.toggled {
    display: block;
  }

  .main-navigation ul {
    flex-direction: column;
    align-items: stretch;
  }

  .main-navigation a {
    padding: 0.75rem 1rem;
  }

  .posts-grid {
    grid-template-columns: 1fr;
  }

  .entry-header .entry-title {
    font-size: 1.6rem;
  }

  h1 { font-size: 1.6rem; }
}

@media (min-width: 769px) {
  .main-navigation {
    display: flex !important;
  }
}

/* ========== Print (SEO / accessibility) ========== */
@media print {
  .site-header,
  .site-footer,
  .menu-toggle,
  .comments-area {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }

  a {
    color: #000;
    text-decoration: underline;
  }
}
