/* =============================================
   Con San Giuseppe — consangiuseppe.it
   Foglio di stile principale
   ============================================= */

/* ===== RESET & ROOT ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --terra:        #7A4F2D;
  --terra-mid:    #9B6540;
  --terra-light:  #C4956A;
  --terra-dark:   #4A2D14;
  --terra-deeper: #2E1A0A;
  --cream:        #F7F0E6;
  --cream-mid:    #EDE0CC;
  --cream-dark:   #D9C8AE;
  --parchment:    #F2E8D5;
  --gold:         #B8892A;
  --gold-light:   #D4AF5A;
  --gold-pale:    #EDD98A;
  --text-dark:    #2C1A08;
  --text-mid:     #4A2E12;   /* darkened from #5C3A1E for contrast */
  --text-light:   #6B4A2E;   /* darkened from #8B6245 — now passes AA on white */
  --text-faint:   #8A6040;   /* darkened from #B89070 — usable on light bg */
  --text-on-dark: #D9C8AE;   /* cream for text on dark backgrounds */
  --border:       rgba(184,137,42,0.25);
  --border-mid:   rgba(184,137,42,0.45);
  --shadow:       rgba(44,26,8,0.12);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'EB Garamond', Georgia, serif;
  background: var(--cream);
  color: var(--text-dark);
  font-size: 18px;
  line-height: 1.8;
}

/* ===== ORNAMENTS ===== */
.orn { color: var(--gold); font-size: 1.1em; letter-spacing: 0.2em; }
.orn-hr {
  display: flex; align-items: center; gap: 1rem;
  margin: 2rem 0; color: var(--gold);
}
.orn-hr::before, .orn-hr::after {
  content: ''; flex: 1;
  height: 0.5px; background: var(--border-mid);
}

/* ===== NAV ===== */
#topbar {
  background: var(--terra-deeper);
  border-bottom: 1px solid var(--gold);
  position: sticky; top: 0; z-index: 100;
}
.topbar-inner {
  max-width: 1100px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 2rem; height: 60px;
}
.topbar-inner nav { display: flex; justify-content: center; }
.topbar-inner .nav-lang { display: flex; justify-content: flex-end; }
.nav-logo {
  font-family: 'Cinzel', serif;
  color: var(--gold-light);
  font-size: 1.05rem;
  letter-spacing: 0.12em;
  text-decoration: none;
  white-space: nowrap;
}
.nav-links { display: flex; gap: 0; list-style: none; }
.nav-links a {
  color: var(--cream-dark); font-size: 0.78rem;
  letter-spacing: 0.10em; text-transform: uppercase;
  text-decoration: none; padding: 0 0.85rem; height: 60px;
  display: flex; align-items: center; white-space: nowrap;
  border-right: 0.5px solid rgba(255,255,255,0.06);
  transition: color 0.2s, background 0.2s;
  font-family: 'Cinzel', serif;
}
.nav-links a:hover { color: var(--gold-light); background: rgba(255,255,255,0.04); }
.nav-lang { display: flex; gap: 6px; align-items: center; }
.lang-btn {
  font-family: 'Cinzel', serif;
  background: transparent; border: 0.5px solid rgba(212,175,90,0.4);
  color: var(--cream-dark); font-size: 0.75rem;
  padding: 5px 11px; cursor: pointer;
  letter-spacing: 0.08em; border-radius: 2px;
  transition: all 0.2s;
}
.lang-btn.active, .lang-btn:hover {
  background: var(--gold); border-color: var(--gold);
  color: var(--terra-deeper);
}
.lang-select {
  font-family: 'Cinzel', serif;
  background: var(--terra-deeper);
  border: 0.5px solid rgba(212,175,90,0.4);
  color: var(--cream-dark); font-size: 0.75rem;
  padding: 5px 8px; cursor: pointer;
  letter-spacing: 0.08em; border-radius: 2px;
  outline: none; transition: border-color 0.2s;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23D4AF5A'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 24px;
}
.lang-select:hover, .lang-select:focus {
  border-color: var(--gold);
}
.lang-select option {
  background: var(--terra-deeper);
  color: var(--cream-dark);
}

/* ===== HERO ===== */
#hero {
  background: var(--terra-deeper);
  position: relative; overflow: hidden;
  padding: 6rem 2rem 5rem;
  text-align: center;
}
.hero-texture {
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 59px, rgba(184,137,42,0.06) 60px),
    repeating-linear-gradient(90deg, transparent, transparent 59px, rgba(184,137,42,0.04) 60px);
  pointer-events: none;
}
.hero-glow {
  position: absolute; top: -80px; left: 50%; transform: translateX(-50%);
  width: 600px; height: 400px;
  background: radial-gradient(ellipse, rgba(184,137,42,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero-cross {
  font-family: 'Cinzel', serif;
  font-size: 2rem; color: var(--gold);
  display: block; margin-bottom: 1.5rem;
  letter-spacing: 0.3em; opacity: 0.8;
}
.hero-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(2rem, 5vw, 3.4rem);
  color: var(--cream); line-height: 1.2;
  font-weight: 400; letter-spacing: 0.04em;
  margin-bottom: 0.4rem; position: relative;
}
.hero-title em {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic; color: var(--gold-light); font-size: 1.15em;
}
.hero-sub {
  font-family: 'Cinzel', serif;
  font-size: 0.78rem; letter-spacing: 0.18em;
  color: var(--cream-dark); text-transform: uppercase;
  margin-bottom: 2.5rem; position: relative;
}
.hero-quote-box {
  max-width: 600px; margin: 0 auto 3rem;
  border-left: 2px solid var(--gold);
  border-right: 2px solid var(--gold);
  padding: 1.5rem 2rem; position: relative;
  background: rgba(255,255,255,0.03);
}
.hero-quote-box::before, .hero-quote-box::after {
  content: '✦'; position: absolute; color: var(--gold);
  font-size: 0.8rem; opacity: 0.6;
}
.hero-quote-box::before { top: -0.6rem; left: 50%; transform: translateX(-50%); }
.hero-quote-box::after  { bottom: -0.6rem; left: 50%; transform: translateX(-50%); }
.hero-quote-text {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic; font-size: 1.2rem;
  color: var(--cream); line-height: 1.7; margin-bottom: 0.5rem;
}
.hero-quote-cite {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem; color: var(--gold-light);
  letter-spacing: 0.12em; text-transform: uppercase;
}
.hero-ctas { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; position: relative; }

/* ===== BUTTONS ===== */
.btn-gold {
  font-family: 'Cinzel', serif;
  background: var(--gold); color: var(--terra-deeper);
  border: none; padding: 13px 32px;
  font-size: 0.8rem; letter-spacing: 0.12em;
  text-transform: uppercase; cursor: pointer;
  text-decoration: none; display: inline-block;
  border-radius: 2px; font-weight: 700;
  transition: background 0.2s;
}
.btn-gold:hover { background: var(--gold-light); }
.btn-outline {
  font-family: 'Cinzel', serif;
  background: transparent; color: var(--cream);
  border: 1px solid rgba(237,217,138,0.5); padding: 13px 32px;
  font-size: 0.8rem; letter-spacing: 0.12em;
  text-transform: uppercase; cursor: pointer;
  text-decoration: none; display: inline-block;
  border-radius: 2px; transition: all 0.2s;
}
.btn-outline:hover { border-color: var(--gold-light); color: var(--gold-light); }

/* ===== SECTION NAV ===== */
#sections-nav {
  display: grid; grid-template-columns: repeat(5, 1fr);
  border-top: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  background: var(--parchment);
}
.snav-item {
  padding: 2rem 1rem; text-align: center;
  border-right: 0.5px solid var(--border);
  cursor: pointer; transition: background 0.2s;
  text-decoration: none; display: block; color: inherit;
}
.snav-item:last-child { border-right: none; }
.snav-item:hover { background: var(--cream-mid); }
.snav-icon {
  width: 40px; height: 40px; margin: 0 auto 0.75rem;
  border: 0.5px solid var(--border-mid); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--terra-dark); color: var(--gold-light); font-size: 1rem;
}
.snav-label {
  font-family: 'Cinzel', serif; font-size: 0.75rem;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--terra-dark); display: block; margin-bottom: 0.25rem; font-weight: 600;
}
.snav-desc { font-size: 0.85rem; color: var(--text-mid); line-height: 1.45; }

/* ===== MAIN LAYOUT ===== */
.page-section { padding: 4rem 2rem; }
.section-inner { max-width: 860px; margin: 0 auto; }
.section-inner-wide { max-width: 1060px; margin: 0 auto; }
.section-eyebrow {
  font-family: 'Cinzel', serif; font-size: 0.75rem;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--terra); margin-bottom: 0.5rem; font-weight: 600;
}
.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 400; color: var(--terra-dark);
  line-height: 1.25; margin-bottom: 0.3rem;
}
.section-title em { font-style: italic; color: var(--terra-mid); }

/* ===== BIOGRAPHY ===== */
.bio-grid {
  display: grid; grid-template-columns: 1fr 280px;
  gap: 3rem; align-items: start;
}
.bio-text p { margin-bottom: 1.1rem; color: var(--text-mid); font-size: 1.05rem; }
.bio-text p:first-child::first-letter {
  font-family: 'Cinzel', serif; font-size: 3.5rem; font-weight: 600;
  float: left; line-height: 0.8; margin-right: 0.1em; margin-top: 0.15em;
  color: var(--terra); padding-right: 4px;
}
.bio-sidebar {
  background: var(--terra-dark); padding: 1.5rem;
  border-top: 2px solid var(--gold); border-bottom: 2px solid var(--gold);
}
.bio-sidebar h4 {
  font-family: 'Cinzel', serif; font-size: 0.75rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold-light); margin-bottom: 1rem; font-weight: 600;
}
.bio-fact { padding: 0.5rem 0; border-bottom: 0.5px solid rgba(255,255,255,0.08); }
.bio-fact:last-child { border-bottom: none; }
.bio-fact-label {
  font-size: 0.75rem; color: var(--gold-pale);
  letter-spacing: 0.06em; text-transform: uppercase; font-family: 'Cinzel', serif; font-weight: 600;
}
.bio-fact-value { font-size: 0.95rem; color: var(--cream); line-height: 1.45; margin-top: 0.15rem; }

/* ===== PREGHIERE ===== */
.prayer-tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--border-mid);
  margin-bottom: 2rem; overflow-x: auto;
}
.prayer-tab {
  font-family: 'Cinzel', serif; font-size: 0.78rem;
  letter-spacing: 0.10em; text-transform: uppercase;
  padding: 0.75rem 1.25rem; cursor: pointer;
  border: none; background: transparent; color: var(--text-mid);
  border-bottom: 2px solid transparent; white-space: nowrap;
  transition: all 0.2s; margin-bottom: -1px;
}
.prayer-tab.active { color: var(--terra-dark); border-bottom-color: var(--gold); }
.prayer-tab:hover { color: var(--terra); }
.prayer-content { display: none; }
.prayer-content.active { display: block; }
.prayer-card {
  background: white; border-left: 3px solid var(--gold);
  padding: 2rem 2.5rem; margin-bottom: 1.5rem;
  box-shadow: 0 2px 16px var(--shadow);
}
.prayer-name {
  font-family: 'Cinzel', serif; font-size: 0.85rem;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--terra); margin-bottom: 1.25rem;
  padding-bottom: 0.75rem; border-bottom: 0.5px solid var(--border); font-weight: 600;
}
.prayer-latin {
  font-family: 'Cormorant Garamond', serif; font-style: italic;
  font-size: 1.1rem; color: var(--text-dark); line-height: 1.9;
  margin-bottom: 1.25rem; padding: 1rem 1.25rem;
  background: var(--parchment); border-radius: 2px;
}
.prayer-latin-label {
  font-family: 'Cinzel', serif; font-size: 0.72rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-light); display: block; margin-bottom: 0.5rem; font-weight: 600;
}
.prayer-translation { font-size: 1rem; color: var(--text-mid); line-height: 1.85; }
.prayer-translation-label {
  font-family: 'Cinzel', serif; font-size: 0.72rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-light); display: block; margin-bottom: 0.4rem; font-weight: 600;
}

/* ===== NOVENA ===== */
.novena-days { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.novena-day-btn {
  font-family: 'Cinzel', serif; font-size: 0.75rem;
  letter-spacing: 0.08em; border: 1px solid var(--border-mid);
  background: transparent; color: var(--text-mid);
  padding: 7px 15px; cursor: pointer; border-radius: 2px; transition: all 0.2s;
}
.novena-day-btn.active, .novena-day-btn:hover {
  background: var(--terra-dark); color: var(--gold-light); border-color: var(--terra-dark);
}
.novena-day { display: none; }
.novena-day.active { display: block; }

/* ===== CALENDARIO ===== */
.calendar-intro {
  font-size: 0.95rem; color: var(--text-mid); margin-bottom: 2rem;
  padding: 1rem 1.25rem; background: var(--parchment);
  border-left: 3px solid var(--terra-light); font-style: italic;
}
.calendar-month { margin-bottom: 2.5rem; }
.month-title {
  font-family: 'Cinzel', serif; font-size: 0.82rem;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--terra-dark); padding: 0.5rem 0;
  border-bottom: 0.5px solid var(--border-mid); margin-bottom: 0.75rem; font-weight: 600;
}
.feast-row {
  display: flex; align-items: baseline; gap: 1rem;
  padding: 0.55rem 0; border-bottom: 0.5px solid rgba(0,0,0,0.05);
}
.feast-row:last-child { border-bottom: none; }
.feast-date {
  font-family: 'Cinzel', serif; font-size: 0.78rem;
  color: var(--text-light); min-width: 65px; letter-spacing: 0.04em;
}
.feast-rank {
  font-size: 0.72rem; font-family: 'Cinzel', serif;
  padding: 2px 8px; border-radius: 2px;
  letter-spacing: 0.06em; white-space: nowrap; flex-shrink: 0; font-weight: 600;
}
.rank-duplex-1 { background: var(--gold); color: var(--terra-deeper); }
.rank-duplex-2 { background: var(--terra-light); color: white; }
.rank-duplex   { background: var(--cream-dark); color: var(--text-mid); }
.rank-semiduplex { background: var(--cream-dark); color: var(--text-light); }
.feast-name { font-size: 1rem; color: var(--text-dark); flex: 1; }
.feast-name em { color: var(--terra-mid); font-style: italic; }
.feast-note { font-size: 0.85rem; color: var(--text-light); display: block; }

/* ===== SANTI E PAPI ===== */
.quotes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.quote-block {
  background: white; padding: 1.75rem;
  border-top: 2px solid var(--gold);
  box-shadow: 0 1px 8px var(--shadow);
}
.quote-author-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.quote-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--terra-dark); display: flex;
  align-items: center; justify-content: center;
  font-family: 'Cinzel', serif; font-size: 0.78rem;
  color: var(--gold-light); flex-shrink: 0;
  overflow: hidden;
}
.quote-avatar img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.quote-author-name {
  font-family: 'Cinzel', serif; font-size: 0.82rem;
  color: var(--terra-dark); letter-spacing: 0.05em; line-height: 1.3; font-weight: 600;
}
.quote-author-role { font-size: 0.78rem; color: var(--text-light); }
.quote-text {
  font-family: 'Cormorant Garamond', serif; font-style: italic;
  font-size: 1.1rem; color: var(--text-mid); line-height: 1.8;
}
.quote-source {
  font-size: 0.75rem; color: var(--text-light); margin-top: 0.75rem;
  font-style: normal; font-family: 'Cinzel', serif; letter-spacing: 0.05em;
}

/* ===== GALLERY ===== */
.gallery-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--border);
}
.gallery-item {
  aspect-ratio: 3/4; background: var(--cream-mid);
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 1.5rem;
  cursor: pointer; transition: background 0.2s; border: none;
}
.gallery-item:hover { background: var(--parchment); }
.gallery-item img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.4s ease;
}
.gallery-item:hover img { transform: scale(1.04); }
.gallery-item-icon { font-size: 2rem; color: var(--terra-light); margin-bottom: 0.75rem; position: relative; z-index: 1; }
.gallery-item-label {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 0.6rem 0.75rem;
  background: linear-gradient(transparent, rgba(40,20,10,0.72));
  font-family: 'Cinzel', serif; font-size: 0.72rem;
  letter-spacing: 0.08em; color: var(--cream); text-transform: uppercase; font-weight: 600;
  z-index: 1;
}

/* ===== CONTATTO ===== */
#contatto {
  background: var(--terra-deeper);
}
#contatto .section-eyebrow {
  color: var(--gold-light);
}
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.contact-text { color: var(--cream-dark); font-size: 1.05rem; line-height: 1.85; }
.contact-text p { margin-bottom: 1rem; }
.contact-form { display: flex; flex-direction: column; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.3rem; }
.form-label {
  font-family: 'Cinzel', serif; font-size: 0.75rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-light); font-weight: 600;
}
.form-input, .form-textarea {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(212,175,90,0.35);
  color: var(--cream); font-family: 'EB Garamond', serif;
  font-size: 1rem; padding: 0.75rem 1rem;
  border-radius: 2px; outline: none; transition: border-color 0.2s;
}
.form-input::placeholder, .form-textarea::placeholder {
  color: rgba(217,200,174,0.45);
}
.form-input:focus, .form-textarea:focus { border-color: var(--gold); }
.form-textarea { resize: vertical; min-height: 120px; }

/* ===== QUOTE BANNER ===== */
.full-quote-banner {
  background: var(--terra-dark); padding: 4rem 2rem; text-align: center;
  border-top: 1px solid var(--gold); border-bottom: 1px solid var(--gold);
}
.full-quote-banner blockquote {
  font-family: 'Cormorant Garamond', serif; font-style: italic;
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  color: var(--cream); max-width: 700px; margin: 0 auto; line-height: 1.7;
}
.full-quote-banner cite {
  display: block; margin-top: 1rem; font-style: normal;
  font-family: 'Cinzel', serif; font-size: 0.78rem;
  color: var(--gold-light); letter-spacing: 0.14em; text-transform: uppercase;
}

/* ===== FOOTER ===== */
footer {
  background: var(--terra-deeper);
  border-top: 2px solid var(--gold);
  padding: 3rem 2rem 2rem; text-align: center;
}
.footer-logo {
  font-family: 'Cinzel', serif; font-size: 1.3rem;
  color: var(--gold-light); letter-spacing: 0.1em;
  display: block; margin-bottom: 0.25rem;
}
.footer-domain { font-size: 0.78rem; color: var(--cream-dark); letter-spacing: 0.10em; margin-bottom: 1.5rem; }
.footer-links { display: flex; gap: 1.5rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1.5rem; }
.footer-links a {
  font-family: 'Cinzel', serif; font-size: 0.75rem;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--cream-dark); text-decoration: none; transition: color 0.2s;
}
.footer-links a:hover { color: var(--gold-light); }
.footer-copy { font-size: 0.78rem; color: var(--cream-dark); }
.footer-dedication {
  font-family: 'Cormorant Garamond', serif; font-style: italic;
  font-size: 0.95rem; color: var(--terra-light); margin-bottom: 1rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 800px) {
  #sections-nav { grid-template-columns: repeat(3, 1fr); }
  .bio-grid, .contact-grid, .quotes-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
  #sections-nav { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: 1fr; }
}
