/**
 * Edify Blog - Stile Aery, Soft ed Editoriale
 */
:root {
  --bg-page: #faf9f6;
  --bg-card: #ffffff;
  --bg-card-subtle: #f5f4f0;
  --text-main: #1e2329;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --border-soft: rgba(0, 0, 0, 0.07);
  --border-focus: #3b82f6;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --accent-hover: #1d4ed8;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 9999px;
  --shadow-soft: 0 4px 20px -2px rgba(0, 0, 0, 0.04), 0 2px 6px -1px rgba(0, 0, 0, 0.02);
  --shadow-hover: 0 10px 25px -4px rgba(0, 0, 0, 0.07), 0 4px 10px -2px rgba(0, 0, 0, 0.03);
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "Newsreader", "Playfair Display", "Georgia", "Cambria", serif;
  --container-max: 1140px;
  --reading-max: 760px;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.7;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

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

/* Layout */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.reading-container {
  max-width: var(--reading-max);
  margin-left: auto;
  margin-right: auto;
}

/* Header */
.site-header {
  background: rgba(250, 249, 246, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  z-index: 50;
  transition: all 0.25s ease;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-dot {
  width: 9px;
  height: 9px;
  background-color: var(--accent);
  border-radius: 50%;
  display: inline-block;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--text-main);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-toggle,
.btn-icon {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  color: var(--text-muted);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-toggle:hover,
.btn-icon:hover {
  background: #ffffff;
  color: var(--text-main);
  box-shadow: var(--shadow-soft);
}

.btn-admin {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-soft);
  background: var(--bg-card);
  transition: all 0.2s;
}

.btn-admin:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Hero Section */
.hero-section {
  padding: 3.5rem 0 2.5rem;
}

.featured-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.featured-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.featured-img-wrap {
  position: relative;
  min-height: 380px;
  overflow: hidden;
}

.featured-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.featured-card:hover .featured-img-wrap img {
  transform: scale(1.03);
}

.featured-content {
  padding: 3rem 3rem 3rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card-category {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  width: fit-content;
  margin-bottom: 1.25rem;
}

.featured-title {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.featured-excerpt {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.65;
  margin-bottom: 1.75rem;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.post-meta .author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-card-subtle);
}

.meta-dot {
  font-size: 0.8rem;
  opacity: 0.6;
}

/* Category Filter Bar */
.category-filter-wrap {
  padding: 1.5rem 0 2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-filter-wrap::-webkit-scrollbar {
  display: none;
}

.category-pill {
  padding: 0.5rem 1.15rem;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  color: var(--text-muted);
  white-space: nowrap;
  transition: all 0.2s ease;
}

.category-pill:hover,
.category-pill.active {
  background: var(--text-main);
  color: #ffffff;
  border-color: var(--text-main);
}

/* Posts Grid */
.main-layout {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 3rem;
  padding-bottom: 5rem;
}

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

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.card-img-wrap {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-card-subtle);
}

.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

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

.card-body {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-title {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0.6rem 0 0.8rem;
  letter-spacing: -0.015em;
}

.card-excerpt {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

/* Sidebar */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.widget {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-soft);
}

.widget-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-form {
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2.75rem;
  font-size: 0.95rem;
  font-family: inherit;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-full);
  background: var(--bg-page);
  color: var(--text-main);
  outline: none;
  transition: all 0.2s ease;
}

.search-input:focus {
  background: #ffffff;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
}

.popular-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-soft);
}

.popular-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.popular-item:first-child {
  padding-top: 0;
}

.popular-img {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.popular-title {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tag-badge {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  background: var(--bg-page);
  border: 1px solid var(--border-soft);
  color: var(--text-muted);
  transition: all 0.2s;
}

.tag-badge:hover {
  background: var(--text-main);
  color: #ffffff;
  border-color: var(--text-main);
}

.newsletter-card {
  background: linear-gradient(145deg, #f0f7ff, #faf5ff);
  border-color: rgba(99, 102, 241, 0.15);
}

.newsletter-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 1.25rem;
}

.newsletter-btn {
  width: 100%;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-full);
  background: var(--text-main);
  color: #ffffff;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}

.newsletter-btn:hover {
  opacity: 0.9;
}

/* Single Post Page */
.post-header {
  padding: 3rem 0 2.5rem;
  text-align: center;
}

.post-breadcrumbs {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.post-headline {
  font-family: var(--font-serif);
  font-size: 2.75rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.post-standfirst {
  font-size: 1.25rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 2rem;
}

.post-featured-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 3rem;
  box-shadow: var(--shadow-soft);
}

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

/* Article Typography */
.article-body {
  font-size: 1.15rem;
  line-height: 1.85;
  color: #272c33;
}

.article-body p {
  margin-bottom: 1.65rem;
}

.article-body h2 {
  font-family: var(--font-serif);
  font-size: 1.95rem;
  font-weight: 700;
  margin: 2.75rem 0 1.15rem;
  letter-spacing: -0.015em;
}

.article-body h3 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 2rem 0 0.85rem;
}

.article-body ul,
.article-body ol {
  margin: 0 0 1.75rem 1.75rem;
}

.article-body li {
  margin-bottom: 0.65rem;
}

.article-body blockquote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.35rem;
  line-height: 1.6;
  padding: 1.5rem 2rem;
  margin: 2.5rem 0;
  border-left: 3px solid var(--accent);
  background: var(--bg-card);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  box-shadow: var(--shadow-soft);
  color: #1f2937;
}

.article-body code {
  background: var(--bg-card-subtle);
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.callout {
  padding: 1.5rem;
  border-radius: var(--radius-md);
  margin: 2rem 0;
  border-left: 4px solid;
}

.callout-info {
  background: #eff6ff;
  border-color: #3b82f6;
}

.callout-success {
  background: #f0fdf4;
  border-color: #22c55e;
}

.callout h4 {
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.post-footer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 3rem 0 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-soft);
}

.author-box {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 2rem;
  display: flex;
  gap: 1.5rem;
  align-items: center;
  margin: 3rem 0;
  box-shadow: var(--shadow-soft);
}

.author-box-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-card-subtle);
  flex-shrink: 0;
}

.author-box-name {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.author-box-bio {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

/* Related Posts */
.related-section {
  padding: 4rem 0;
  border-top: 1px solid var(--border-soft);
}

.related-title {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 700;
  margin-bottom: 2rem;
  text-align: center;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 3.5rem;
}

.page-btn {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-soft);
  background: var(--bg-card);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
  transition: all 0.2s;
}

.page-btn:hover,
.page-btn.active {
  background: var(--text-main);
  color: #ffffff;
  border-color: var(--text-main);
}

/* Footer */
.site-footer {
  background: #ffffff;
  border-top: 1px solid var(--border-soft);
  padding: 4rem 0 2.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.85rem;
}

.footer-col h5 {
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 1.15rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.65rem;
}

.footer-col a:hover {
  color: var(--text-main);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 900px) {
  .featured-card {
    grid-template-columns: 1fr;
  }
  .featured-img-wrap {
    min-height: 240px;
  }
  .main-layout {
    grid-template-columns: 1fr;
  }
  .posts-grid {
    grid-template-columns: 1fr;
  }
  .post-headline {
    font-size: 2.15rem;
  }
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}
