/*
Theme Name: Minimal Column
Theme URI: https://example.com/minimal-column
Author: Minimal Column Theme
Author URI: https://example.com
Description: Un tema WordPress minimalista a colonna singola, senza widget, con supporto immagini in evidenza e anteprima articoli in archivio. Ispirato all'estetica Google Material Design.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: minimal-column
Tags: blog, minimal, one-column, no-sidebar, featured-images, translation-ready
*/

/* ============================================================
   CSS CUSTOM PROPERTIES
   ============================================================ */
:root {
  --color-bg:          #ffffff;
  --color-surface:     #f8f9fa;
  --color-border:      #e8eaed;
  --color-text:        #202124;
  --color-text-muted:  #5f6368;
  --color-text-light:  #9aa0a6;
  --color-accent:      #1a73e8;
  --color-accent-hover:#1557b0;
  --color-tag-bg:      #e8f0fe;
  --color-tag-text:    #1a73e8;

  --font-display:      'Google Sans', 'Product Sans', 'Segoe UI', sans-serif;
  --font-body:         'Roboto', 'Helvetica Neue', Arial, sans-serif;
  --font-mono:         'Roboto Mono', 'Courier New', monospace;

  --size-content:      680px;
  --size-wide:         960px;

  --radius-sm:         4px;
  --radius-md:         8px;
  --radius-lg:         12px;

  --shadow-card:       0 1px 3px rgba(60,64,67,.15), 0 1px 2px rgba(60,64,67,.10);
  --shadow-card-hover: 0 4px 12px rgba(60,64,67,.20), 0 2px 6px rgba(60,64,67,.12);

  --transition:        all .2s cubic-bezier(.4,0,.2,1);
}

/* ============================================================
   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(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

a:hover { color: var(--color-accent-hover); }

ul, ol { padding-left: 1.5rem; }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.3;
  color: var(--color-text);
  letter-spacing: -.01em;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.25rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.75rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.35rem); }
h4 { font-size: 1.1rem; }

p { margin-bottom: 1.4rem; }
p:last-child { margin-bottom: 0; }

blockquote {
  border-left: 3px solid var(--color-accent);
  margin: 2rem 0;
  padding: .75rem 0 .75rem 1.5rem;
  color: var(--color-text-muted);
  font-size: 1.05rem;
  font-style: italic;
}

code {
  font-family: var(--font-mono);
  font-size: .875rem;
  background: var(--color-surface);
  padding: .15em .4em;
  border-radius: var(--radius-sm);
  color: #c0392b;
}

pre {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

pre code { background: none; padding: 0; color: var(--color-text); }

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2.5rem 0;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: var(--size-content);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container--wide {
  max-width: var(--size-wide);
}

main {
  flex: 1;
  padding: 2rem 0 4rem;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}

.site-header__inner {
  max-width: var(--size-wide);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

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

.site-branding a {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: var(--color-text);
}

.site-branding a:hover { color: var(--color-accent); }

.site-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.site-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 500;
  letter-spacing: -.01em;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.site-nav {
  display: flex;
  align-items: center;
  gap: .25rem;
}

.site-nav ul {
  display: flex;
  list-style: none;
  padding: 0;
  gap: .25rem;
}

.site-nav a {
  font-family: var(--font-display);
  font-size: .875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  padding: .5rem .75rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.site-nav a:hover,
.site-nav .current-menu-item a,
.site-nav .current_page_item a {
  color: var(--color-accent);
  background: var(--color-tag-bg);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: .5rem;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
}

.nav-toggle:hover { background: var(--color-surface); }

.nav-toggle svg { display: block; }

/* ============================================================
   ARCHIVE / HOME — ARTICLE CARDS
   ============================================================ */
.archive-header,
.page-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.archive-header__label {
  font-size: .75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--color-accent);
  margin-bottom: .5rem;
}

.archive-header__title,
.page-header__title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 400;
}

.archive-header__description {
  margin-top: .5rem;
  color: var(--color-text-muted);
}

/* Posts list */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Article card */
.post-card {
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: var(--transition);
}

.post-card:first-child { border-top: none; }

.post-card--with-image {
  display: grid;
  grid-template-columns: 1fr 200px;
  grid-template-rows: auto;
  gap: 1.25rem;
  align-items: start;
}

.post-card__body {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.post-card__meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  font-size: .75rem;
  color: var(--color-text-light);
}

.post-card__meta a {
  color: var(--color-text-light);
}

.post-card__meta a:hover { color: var(--color-accent); }

.post-card__meta-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--color-border);
  display: inline-block;
}

.post-card__category {
  font-size: .7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--color-accent);
}

.post-card__title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -.01em;
}

.post-card__title a {
  color: var(--color-text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card__title a:hover { color: var(--color-accent); }

.post-card__excerpt {
  font-size: .9375rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card__read-more {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .8125rem;
  font-weight: 500;
  color: var(--color-accent);
  margin-top: .25rem;
}

.post-card__read-more:hover { color: var(--color-accent-hover); }

.post-card__read-more svg {
  transition: transform .2s ease;
}

.post-card__read-more:hover svg {
  transform: translateX(3px);
}

/* Featured image in card */
.post-card__thumbnail {
  grid-column: 2;
  grid-row: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 4/3;
}

.post-card__thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}

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

/* ============================================================
   SINGLE POST
   ============================================================ */
.single-post {
  padding-top: 1rem;
}

.post-header {
  margin-bottom: 2rem;
}

.post-header__category {
  font-size: .75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--color-accent);
  margin-bottom: .75rem;
}

.post-header__title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -.02em;
  margin-bottom: 1rem;
}

.post-header__meta {
  display: flex;
  align-items: center;
  gap: .625rem;
  flex-wrap: wrap;
  font-size: .8125rem;
  color: var(--color-text-muted);
  padding: 1rem 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.post-header__meta a {
  color: var(--color-text-muted);
  font-weight: 500;
}

.post-header__meta a:hover { color: var(--color-accent); }

.post-header__meta-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--color-border);
}

/* Featured image — single post */
.post-featured-image {
  margin: 2rem 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16/9;
}

.post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-featured-image figcaption {
  padding: .625rem .75rem;
  font-size: .8125rem;
  color: var(--color-text-light);
  text-align: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Post content */
.post-content {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--color-text);
}

.post-content h2,
.post-content h3,
.post-content h4 {
  margin-top: 2.25rem;
  margin-bottom: .75rem;
}

.post-content p { margin-bottom: 1.5rem; }

.post-content ul,
.post-content ol {
  margin-bottom: 1.5rem;
}

.post-content li { margin-bottom: .4rem; }

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

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

/* Tags */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 2.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--color-border);
}

.post-tags__label {
  font-size: .8125rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-right: .25rem;
  align-self: center;
}

.post-tag {
  font-size: .75rem;
  font-weight: 500;
  padding: .3rem .75rem;
  background: var(--color-tag-bg);
  color: var(--color-tag-text);
  border-radius: 100px;
  transition: var(--transition);
}

.post-tag:hover {
  background: var(--color-accent);
  color: #fff;
}

/* Back link */
.post-back {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  font-size: .8125rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
  transition: var(--transition);
}

.post-back:hover { color: var(--color-accent); }

.post-back svg { flex-shrink: 0; }

/* Post navigation */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.post-nav__item {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.post-nav__item:hover {
  border-color: var(--color-accent);
  background: var(--color-tag-bg);
}

.post-nav__item--next { text-align: right; }

.post-nav__label {
  font-size: .7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--color-text-light);
}

.post-nav__title {
  font-size: .9rem;
  font-weight: 500;
  color: var(--color-text);
  font-family: var(--font-display);
  line-height: 1.35;
}

.post-nav__item:hover .post-nav__title { color: var(--color-accent); }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .375rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 .75rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  border: 1px solid transparent;
  transition: var(--transition);
}

.page-numbers:hover {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
}

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

.page-numbers.dots {
  border-color: transparent;
  background: none;
}

/* ============================================================
   COMMENTS
   ============================================================ */
.comments-area {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.comments-title,
.comment-reply-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.comment-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

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

.comment-author-name {
  font-weight: 500;
  font-size: .9375rem;
}

.comment-metadata {
  font-size: .8125rem;
  color: var(--color-text-light);
  margin-bottom: .75rem;
}

.comment-content { font-size: .9375rem; }

.comment-reply-link {
  font-size: .8125rem;
  font-weight: 500;
  color: var(--color-accent);
}

/* Comment form */
.comment-form-wrap { margin-top: 2rem; }

.comment-form label {
  display: block;
  font-size: .8125rem;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: .375rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: .625rem .875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .9375rem;
  color: var(--color-text);
  background: var(--color-bg);
  transition: var(--transition);
  margin-bottom: 1rem;
}

.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(26,115,232,.1);
}

.comment-form textarea { min-height: 130px; resize: vertical; }

.comment-form input[type="submit"],
.wp-block-button__link {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .625rem 1.5rem;
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: .01em;
}

.comment-form input[type="submit"]:hover,
.wp-block-button__link:hover {
  background: var(--color-accent-hover);
  box-shadow: 0 2px 8px rgba(26,115,232,.3);
}

/* ============================================================
   SEARCH FORM
   ============================================================ */
.search-form {
  display: flex;
  gap: .5rem;
  margin-bottom: 2rem;
}

.search-field {
  flex: 1;
  padding: .625rem .875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .9375rem;
  color: var(--color-text);
  background: var(--color-bg);
  transition: var(--transition);
}

.search-field:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(26,115,232,.1);
}

.search-submit {
  padding: .625rem 1.25rem;
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.search-submit:hover {
  background: var(--color-accent-hover);
}

/* ============================================================
   PAGES
   ============================================================ */
.page-content {
  font-size: 1.0625rem;
  line-height: 1.8;
}

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

.error-404__code {
  font-family: var(--font-display);
  font-size: clamp(5rem, 15vw, 9rem);
  font-weight: 300;
  color: var(--color-border);
  line-height: 1;
  margin-bottom: .5rem;
}

.error-404__title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.error-404__description {
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 1.75rem 0;
  background: var(--color-surface);
}

.site-footer__inner {
  max-width: var(--size-wide);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-footer__copy {
  font-size: .8125rem;
  color: var(--color-text-light);
}

.site-footer__copy a {
  color: var(--color-text-muted);
}

.site-footer__copy a:hover { color: var(--color-accent); }

.footer-nav ul {
  display: flex;
  list-style: none;
  padding: 0;
  gap: 1.25rem;
}

.footer-nav a {
  font-size: .8125rem;
  color: var(--color-text-muted);
}

.footer-nav a:hover { color: var(--color-accent); }

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

.no-results {
  text-align: center;
  padding: 3rem 0;
  color: var(--color-text-muted);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 720px) {
  .post-card--with-image {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  .post-card__thumbnail {
    grid-column: 1;
    grid-row: 1;
    aspect-ratio: 16/9;
  }

  .post-card__body {
    grid-row: 2;
  }

  .post-nav {
    grid-template-columns: 1fr;
  }

  .post-nav__item--next { text-align: left; }

  .site-footer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: .75rem;
  }
}

@media (max-width: 600px) {
  .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: .75rem 1.5rem 1rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav ul {
    flex-direction: column;
    width: 100%;
  }

  .site-nav a {
    padding: .625rem .5rem;
    width: 100%;
    display: block;
  }

  .nav-toggle { display: flex; }

  .post-header__title { font-size: 1.75rem; }
}

/* ============================================================
   GOOGLE FONTS IMPORT (fallback: system fonts defined above)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@300;400;500;700&family=Roboto:ital,wght@0,300;0,400;0,500;1,400&family=Roboto+Mono:wght@400&display=swap');
