/* The Quiet Orchard - shared site stylesheet */

:root{
  --bg:#f8f5f0;
  --paper:#ffffff;
  --ink:#1f1a17;
  --muted:#6b625a;
  --line:#ddd6cf;
  --accent:#2f3e2f;
  --accent2:#445e44;
  --footer:#eee7df;
  --shadow:0 8px 24px rgba(0,0,0,.06);
  --radius:14px;
  --max:1180px;
}

*{box-sizing:border-box}

html{scroll-behavior:smooth}

body{
  margin:0;
  font-family:Georgia, "Times New Roman", serif;
  background:var(--bg);
  color:var(--ink);
}

a{color:inherit}

header{
  position:sticky;
  top:0;
  background:rgba(255,255,255,.97);
  backdrop-filter:blur(6px);
  border-bottom:1px solid var(--line);
  z-index:1000;
}

.header-inner{
  max-width:var(--max);
  margin:0 auto;
  padding:10px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
}

.logo{
  height:60px;
  width:auto;
  display:block;
}

.menu-group{
  display:flex;
  align-items:center;
  gap:18px;
}

nav{
  display:flex;
  gap:18px;
  align-items:center;
}

nav a{
  text-decoration:none;
  font-weight:600;
  color:#333;
}

.lang-switch{
  display:flex;
  gap:10px;
  align-items:center;
  margin-left:10px;
}

.lang-switch a{
  text-decoration:none;
  font-size:1.1rem;
}

.hero{
  max-width:none;
  width:100%;
  margin:0;
  min-height:520px;
  background-image:
    linear-gradient(rgba(0,0,0,.34),rgba(0,0,0,.24)),
    url("../img/sfondo-home.jpg");
  background-size:cover;
  background-position:center;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:42px 20px;
  color:#fff;
}

.hero-box{
  max-width:850px;
  padding:28px 30px;
  border-radius:16px;
  background:rgba(0,0,0,.12);
}

.hero h1{
  font-size:3rem;
  line-height:1.12;
  margin:0 0 16px;
  text-shadow:2px 2px 8px rgba(0,0,0,.5);
}

.hero p{
  max-width:760px;
  margin:0 auto 22px;
  font-size:1.28rem;
  line-height:1.45;
  text-shadow:1px 1px 5px rgba(0,0,0,.5);
}

.hero-actions{
  display:flex;
  justify-content:center;
  gap:12px;
  flex-wrap:wrap;
}

.btn{
  display:inline-block;
  padding:12px 22px;
  border-radius:8px;
  text-decoration:none;
  font-weight:700;
  transition:.25s ease;
  border:1px solid transparent;
}

.btn-primary{
  background:var(--accent);
  color:#fff;
}

.btn-primary:hover{background:var(--accent2)}

.btn-secondary{
  background:rgba(255,255,255,.92);
  color:#2d2d2d;
  border-color:rgba(0,0,0,.08);
}

.btn-secondary:hover{background:#fff}

section{
  max-width:var(--max);
  margin:0 auto;
  padding:72px 20px;
}

.section-title{
  text-align:center;
  font-size:2.25rem;
  margin:0 0 16px;
}

.section-intro{
  max-width:760px;
  margin:0 auto 34px;
  text-align:center;
  color:var(--muted);
  line-height:1.7;
  font-size:1.08rem;
}

.grid-2{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:24px;
}

.grid-3{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:24px;
}

.book-card{
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:24px;
  display:grid;
  grid-template-columns:180px 1fr;
  gap:22px;
  align-items:start;
}

.book-card .cover{
  width:100%;
  display:block;
  border-radius:6px;
  box-shadow:0 5px 14px rgba(0,0,0,.10);
}

.book-card .text h3{
  margin:0 0 10px;
  font-size:1.85rem;
  line-height:1.15;
}

.book-card .subtitle{
  margin:-4px 0 10px;
  font-size:1.12rem;
  color:#4e4a45;
  font-style:italic;
}

.book-card .author{
  margin:0 0 8px;
  font-size:1.16rem;
}

.book-card .series{
  margin:0 0 10px;
  color:#4e4a45;
  font-weight:700;
}

.book-card .timing,
.book-card .blurb{
  margin:0 0 16px;
  color:var(--muted);
  line-height:1.6;
}

.collections{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:20px;
}

.collection-card{
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:22px 18px;
  text-align:center;
}

.collection-card img{
  width:100%;
  max-width:160px;
  height:100px;
  object-fit:contain;
  display:block;
  margin:0 auto 12px;
}

.collection-card h3{
  margin:0 0 10px;
  font-size:1.55rem;
}

.collection-card p{
  margin:0;
  color:var(--muted);
  line-height:1.65;
  font-size:1rem;
}

.authors{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:24px;
  max-width:1080px;
  margin:0 auto;
}

.author-card{
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  text-align:center;
  overflow:hidden;
}

.author-card img{
  width:100%;
  height:230px;
  object-fit:contain;
  object-position:center;
  background:#f3f1ec;
  padding:12px;
  display:block;
}

.author-card .inner{
  padding:20px 16px 24px;
}

.author-card h3{
  margin:0 0 8px;
  font-size:1.8rem;
}

.author-card p{
  margin:0;
  color:var(--muted);
  line-height:1.6;
  font-size:1.04rem;
}

.page-simple{
  max-width:860px;
  margin:40px auto;
  padding:0 20px;
  line-height:1.75;
}

.page-simple .cover{
  max-width:280px;
  width:100%;
  display:block;
  margin:0 auto 24px;
  border-radius:8px;
  box-shadow:0 6px 16px rgba(0,0,0,.12);
}

.page-simple h1{
  text-align:center;
  font-size:2.4rem;
  margin-bottom:8px;
}

.page-simple .meta{
  text-align:center;
  color:var(--muted);
  margin-bottom:28px;
}

.actions{
  text-align:center;
  margin:30px 0;
}

.page-simple .actions a{
  display:inline-block;
  padding:12px 22px;
  border-radius:8px;
  text-decoration:none;
  font-weight:700;
  margin:0 6px;
  border:1px solid transparent;
  background:var(--accent);
  color:#fff;
}

.page-simple .actions a:hover{
  background:var(--accent2);
  color:#fff;
}

.contact-form{
  display:flex;
  flex-direction:column;
  gap:12px;
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:26px;
}

.contact-form input,
.contact-form textarea{
  padding:12px 14px;
  font-size:1rem;
  border:1px solid #d4cec7;
  border-radius:8px;
  font-family:Georgia, "Times New Roman", serif;
  background:#fff;
}

.contact-form button{
  background:#1e1e1e;
  color:white;
  padding:12px 18px;
  border:none;
  font-size:1rem;
  cursor:pointer;
  border-radius:8px;
  font-weight:700;
}

.contact-form button:hover{background:#333}

.consent-box{
  line-height:1.5;
  color:var(--muted);
}

.newsletter-note{
  font-size:.95rem;
  color:var(--muted);
  line-height:1.6;
  margin:4px 0 0;
  text-align:center;
}

footer{
  text-align:center;
  font-size:.95rem;
  padding:40px 18px 52px;
  background-color:var(--footer);
  border-top:1px solid var(--line);
}

footer .logo{
  height:70px;
  margin:0 auto 12px;
}

.footer-links a{
  color:#2d2d2d;
  text-decoration:none;
  margin:0 8px;
}

/* Cookie banner */

.cookie-banner{
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  z-index:2000;
  padding:16px;
  background:rgba(31,26,23,.96);
  color:#fff;
  box-shadow:0 -6px 24px rgba(0,0,0,.18);
}

.cookie-banner-inner{
  max-width:1180px;
  margin:0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
}

.cookie-banner p{
  margin:0;
  line-height:1.55;
  font-size:.96rem;
}

.cookie-banner a{
  color:#fff;
  text-decoration:underline;
}

.cookie-actions{
  display:flex;
  gap:10px;
  flex-shrink:0;
}

.cookie-actions button{
  border:1px solid rgba(255,255,255,.45);
  border-radius:8px;
  padding:10px 16px;
  cursor:pointer;
  font-family:Georgia, "Times New Roman", serif;
  font-weight:700;
}

#reject-analytics{
  background:transparent;
  color:#fff;
}

#accept-analytics{
  background:#f8f5f0;
  color:#1f1a17;
}

/* Collection identity pages */

.collection-page{
  min-height:100vh;
}

.collection-page .page-simple{
  border-radius:20px;
  box-shadow:0 14px 38px rgba(0,0,0,.12);
  padding:44px 58px;
  background:rgba(255,255,255,.78);
  max-width:920px;
}

.collection-page .page-simple::before{
  content:"";
  display:block;
  width:96px;
  height:3px;
  margin:0 auto 28px;
  background:var(--collection-line, var(--accent));
  border-radius:999px;
}

.collection-page .page-simple h1{
  color:var(--collection-title, var(--ink));
}

.collection-page .page-simple .meta{
  color:var(--collection-muted, var(--muted));
}

.collection-page .page-simple .cover{
  border:1px solid rgba(0,0,0,.08);
}

.collection-page .page-simple p{
  color:var(--ink);
}

.collection-page .page-simple em{
  color:#5A5148;
}

.collection-page .page-simple a:not(.btn){
  color:var(--collection-title, var(--accent));
}

.collection-page .actions a,
.collection-page .actions .btn,
.collection-page .actions .btn-primary{
  background:var(--collection-button, var(--accent));
  color:var(--collection-button-text, #ffffff);
}

.collection-page .actions a:hover,
.collection-page .actions .btn:hover,
.collection-page .actions .btn-primary:hover{
  background:var(--collection-button-hover, var(--accent2));
  color:var(--collection-button-text, #ffffff);
}

/* Palingenesis - softer editorial proposal */

.theme-palingenesis-soft{
  background:
    radial-gradient(circle at top, rgba(201,163,90,.20), transparent 34%),
    linear-gradient(180deg, #f5e9d3 0%, #f8f5f0 54%, #eee1c7 100%);

  --collection-title:#233A5A;
  --collection-muted:#786342;
  --collection-line:#C9A35A;
  --collection-button:#233A5A;
  --collection-button-hover:#2f4e78;
  --collection-button-text:#ffffff;
}

.theme-palingenesis-soft .page-simple{
  border:1px solid rgba(201,163,90,.28);
}

/* Oblivion - historical-scientific thriller */

.theme-oblivion{
  background:
    radial-gradient(circle at top, rgba(49,70,53,.20), transparent 34%),
    linear-gradient(180deg, #d8d0c2 0%, #f8f5f0 54%, #cfc5b6 100%);

  --collection-title:#314635;
  --collection-muted:#6b625a;
  --collection-line:#8E7553;
  --collection-button:#314635;
  --collection-button-hover:#445e44;
  --collection-button-text:#ffffff;
}

.theme-oblivion .page-simple{
  border:1px solid rgba(49,70,53,.25);
}

/* Heritage - historical-biographical thrillers */

.theme-heritage{
  background:
    radial-gradient(circle at top, rgba(166,124,82,.20), transparent 34%),
    linear-gradient(180deg, #efe3cf 0%, #f8f5f0 54%, #e4d4bd 100%);

  --collection-title:#4A5D73;
  --collection-muted:#6D5A4A;
  --collection-line:#A67C52;
  --collection-button:#A67C52;
  --collection-button-hover:#8d6640;
  --collection-button-text:#ffffff;
}

.theme-heritage .page-simple{
  border:1px solid rgba(166,124,82,.28);
}

/* Singularity - scientific essays */

.theme-singularity{
  background:
    radial-gradient(circle at top, rgba(135,168,196,.25), transparent 34%),
    linear-gradient(180deg, #e7eaee 0%, #f8f9fb 54%, #d9e1e8 100%);

  --collection-title:#2E333B;
  --collection-muted:#4C6078;
  --collection-line:#87A8C4;
  --collection-button:#4C6078;
  --collection-button-hover:#2E333B;
  --collection-button-text:#ffffff;
}

.theme-singularity .page-simple{
  border:1px solid rgba(76,96,120,.25);
}

/* Responsive */

@media (max-width:980px){
  .book-card{
    grid-template-columns:1fr;
    text-align:center;
  }

  .book-card .cover{
    max-width:260px;
    margin:0 auto;
  }

  .grid-2,
  .grid-3,
  .collections,
  .authors{
    grid-template-columns:1fr;
  }
}

@media (max-width:760px){
  nav{
    gap:12px;
    flex-wrap:wrap;
    justify-content:flex-end;
  }

  .header-inner{
    padding:10px 14px;
  }

  .logo{
    height:52px;
  }

  .hero{
    min-height:460px;
  }

  .hero-box{
    padding:24px 18px;
  }

  .hero h1{
    font-size:2.25rem;
  }

  .hero p{
    font-size:1.08rem;
  }

  .section-title{
    font-size:1.9rem;
  }

  .cookie-banner-inner{
    flex-direction:column;
    align-items:flex-start;
  }

  .cookie-actions{
    width:100%;
  }

  .cookie-actions button{
    flex:1;
  }

  .collection-page .page-simple{
    padding:34px 24px;
    margin:24px 14px;
  }
}

/* Home book cards: fixed internal structure
   Left column: cover.
   Right column: content area + action area.
   This keeps cover and card dimensions stable while placing buttons consistently. */

#latest .grid-2,
#coming .grid-2{
  align-items:stretch;
}

#latest .book-card,
#coming .book-card{
  height:100%;
  align-items:stretch;
}

#latest .book-card > a,
#coming .book-card > a{
  align-self:start;
}

#latest .book-card .text,
#coming .book-card .text{
  display:grid;
  grid-template-rows:1fr auto;
  height:100%;
  min-height:100%;
}

#latest .book-card .card-main,
#coming .book-card .card-main{
  min-height:0;
}

#latest .book-card .card-action,
#coming .book-card .card-action{
  align-self:end;
  padding-top:18px;
}

@media (max-width:980px){
  #latest .book-card,
  #coming .book-card{
    height:auto;
  }

  #latest .book-card .text,
  #coming .book-card .text{
    display:block;
    height:auto;
    min-height:0;
  }

  #latest .book-card .card-action,
  #coming .book-card .card-action{
    padding-top:16px;
  }
}
