:root {
  --header-height: 3rem;
  --footer-height: 4rem;
  --gap-above-content: 2rem;
  --gap-below-content: 2rem;
  --max-content-width: 600px;
}

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

html, body {
  height: 100%;
  font-family: "Playfair Display", serif;
  background-color: #fdf9f0;
  color: #1a1a1a;
  overflow-x: hidden;
}

header.site-header {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: var(--header-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1rem;
  background-color: #fdf9f0;
  z-index: 1000;
}

.header-left a,
.header-right a {
  font-size: 0.875rem;
  color: #1a1a1a;
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}
.header-left a:hover,
.header-right a:hover {
  opacity: 1;
}

.header-right {
  display: flex;
  gap: 1.5rem;
}

footer {
  position: fixed;
  bottom: 0; left: 0;
  width: 100%;
  height: var(--footer-height);
  border-top: 1px solid #ccc;
  background-color: #fdf9f0;
  padding: 1rem 0;
  z-index: 1000;
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 2rem;
}

nav ul li a {
  text-decoration: none;
  color: #1a1a1a;
  font-size: 1rem;
  transition: color 0.2s ease;
}
nav ul li a:hover {
  color: #555;
}


main {
  width: 100%;
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding-top: calc(var(--header-height) + var(--gap-above-content));
  padding-bottom: calc(var(--footer-height) + var(--gap-below-content));
  padding-left: 1rem;
  padding-right: 1rem;

  text-align: left;
  line-height: 1.6;
}


main h1 {
  margin-top: 0;
  margin-bottom: 1rem;
}
main p {
  margin-bottom: 1rem;
}
main p:last-child {
  margin-bottom: 0;
}

.hero {
  height: calc(100vh - var(--header-height) - var(--footer-height));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 1rem;
}
.hero h1 {
  font-size: 2.5rem;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 0.5rem;
  color: #1a1a1a;
}
.hero h2 {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  color: #1a1a1a;
}
.hero .btn {
  padding: 0.75rem 1.5rem;
  border: 2px solid #1a1a1a;
  background: transparent;
  color: #1a1a1a;
  text-decoration: none;
  font-size: 1rem;
  transition: background 0.2s, color 0.2s;
}
.hero .btn:hover {
  background: #1a1a1a;
  color: #fdf9f0;
}

@media (min-width: 768px) {
  .hero h1, .hero h2 {
    font-size: 3rem;
  }
  .hero .btn {
    font-size: 1.125rem;
  }
  nav ul li a {
    font-size: 1.125rem;
  }
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.post-excerpt h2 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}
.post-excerpt time {
  display: block;
  font-size: 0.875rem;
  color: #555;
  margin-bottom: 0.5rem;
}
.post-excerpt a {
  text-decoration: none;
  color: #1a1a1a;
}
.post-excerpt a:hover {
  text-decoration: underline;
}

.pagination {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  font-size:0.95rem;
}
.pagination a {
  font-size: 1rem;
  color: #1a1a1a;
  text-decoration: none;
  opacity: 0.75;
  transition: opacity 0.2s;
}
.pagination a:hover {
  opacity: 1;
}
.pagination .is-disabled { visibility: hidden; pointer-events:none; }

.post-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  font-size: 0.875rem;
}
.post-nav a {
  color: #1a1a1a;
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.post-nav a:hover {
  opacity: 1;
}
h1 i {
  font-size: 1.2em;
  margin-right: 0.4rem;
  vertical-align: upper;
  color: #222; 
}

h2 i {
  font-size: 1.1em;
  margin-right: 0.4rem;
  vertical-align: upper;
  color: #666;
}
h1, h1 i {
  color: #666; 
}

.scritto-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
}
.scritto-nav a {
  font-size: 1rem;
  color: #1a1a1a;
  text-decoration: none;
  opacity: 0.75;
  transition: opacity 0.2s;
}
.scritto-nav a:hover {
  opacity: 1;
}

.scritto-nav .is-disabled { visibility: hidden; pointer-events:none; }

h2 {
  color: #999;   
}
a {
  color: #666;
  text-decoration: none;
  transition: color 0.2s ease, border-bottom 0.2s ease;
}

a:hover, a:focus {
  color: #333;
  border-bottom: 1px solid #333; 
}

a:visited {
  color: #666; 
}

.hero p.microdesc {
  font-size: 0.9em;     
  color: #666;         
  margin-top: 1.5em;      
  text-align: center; 
  line-height: 1.4;
}

a:hover.book-cover-link , a:focus.book-cover-link{
  border-bottom: none;
}

.metrics {
  margin: .75rem 0 1.5rem;
  opacity: .85;
  text-wrap: balance;            
}

.book-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
  margin-top: 1rem;
}
@media (min-width: 700px) {
  .book-grid { grid-template-columns: repeat(3, 1fr); }
}

.book-card h2 {
  font-size: 1.3rem;
  line-height: 1.25;
  margin: 1rem 0 .5rem;
}

.book-card figure { margin: .25rem 0 0; }
.book-cover {
  display: block;
  width: 100%;
  height: auto;                    
  border-radius: 6px;
}

.book-cover-link { display: inline-block; transition: opacity .2s ease; }
.book-cover-link:hover,
.book-cover-link:focus { opacity: .85; }

.book-card figcaption {
  font-size: .95rem;
  line-height: 1.35;
  margin-top: .5rem;
}

.trilogia h1 { margin-bottom: 1rem; }