:root {
  --bg-page: #d7be9b;
  --bg-parchment: #f8edd9;
  --bg-parchment-light: #fcf6ea;
  --bg-card: rgba(255, 250, 240, 0.85);
  --bg-nav: #241911;
  --bg-nav-hover: #3c2a1e;
  --text-main: #2b1d12;
  --text-muted: #5e4735;
  --accent-crimson: #7a1c1c;
  --accent-gold: #b8860b;
  --border-ornate: #cbb089;
  --shadow-parchment: 0 12px 36px rgba(43, 29, 18, 0.25), 0 2px 8px rgba(43, 29, 18, 0.15);
  --radius-sm: 6px;
  --radius-md: 10px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-page);
  background-image: url('../images/bg.jpg');
  color: var(--text-main);
  font-family: 'Georgia', 'Times New Roman', Times, serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* Modern Web Guidance: text-wrap balance for headings, pretty for body copy */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, 'Georgia', serif;
  color: var(--accent-crimson);
  line-height: 1.3;
  margin-top: 1.5em;
  margin-bottom: 0.6em;
  text-wrap: balance;
}

p, li, blockquote, dd {
  text-wrap: pretty;
}

a {
  color: var(--accent-crimson);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

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

/* Main Parchment Container */
.page-wrapper {
  max-width: 960px;
  margin: 2rem auto;
  background-color: var(--bg-parchment);
  background-image: url('../images/bg_c.jpg');
  background-repeat: repeat-y;
  background-size: 100% auto;
  border: 1px solid var(--border-ornate);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-parchment);
  overflow: hidden;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem 2.5rem;
  background: linear-gradient(180deg, rgba(235, 213, 179, 0.6) 0%, rgba(248, 237, 217, 0.2) 100%);
  border-bottom: 2px solid var(--border-ornate);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  text-decoration: none;
  color: inherit;
  flex-wrap: wrap;
}

.brand-icon {
  width: 96px;
  height: 94px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--accent-gold);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  object-fit: cover;
  flex-shrink: 0;
}

.brand-title-group {
  display: flex;
  flex-direction: column;
}

.brand-calligraphy {
  max-width: 100%;
  height: auto;
  display: block;
}

.brand-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  font-style: italic;
}

/* Navigation Bar */
.main-nav {
  background-color: var(--bg-nav);
  border-bottom: 3px solid var(--accent-gold);
  padding: 0 1.5rem;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.nav-item a {
  display: inline-block;
  padding: 0.85rem 1.25rem;
  color: #f3e5ab;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  border-bottom: 3px solid transparent;
  margin-bottom: -3px;
  transition: all 0.2s ease;
}

.nav-item a:hover,
.nav-item a.active {
  background-color: var(--bg-nav-hover);
  color: #ffffff;
  border-bottom-color: var(--accent-crimson);
}

.nav-item.nav-fb {
  margin-left: auto;
}

.nav-item.nav-fb a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #9ec5fe;
}

.nav-item.nav-fb a:hover {
  color: #ffffff;
}

/* Sub-navigation (Internal Jump Links) */
.sub-nav {
  background-color: rgba(203, 176, 137, 0.25);
  border-bottom: 1px solid var(--border-ornate);
  padding: 0.65rem 2.5rem;
  font-size: 0.9rem;
}

.sub-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

.sub-nav a {
  text-decoration: none;
  font-weight: 600;
  color: var(--accent-crimson);
}

.sub-nav a:hover {
  text-decoration: underline;
}

/* Main Content Area */
.main-content {
  padding: 2rem 2.5rem 2.5rem;
}

.page-title {
  margin-top: 0;
  font-size: 2rem;
  border-bottom: 1px solid var(--border-ornate);
  padding-bottom: 0.5rem;
}

/* Hero Banner on Landing Page */
.hero-banner {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 2rem;
  border: 1px solid var(--border-ornate);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.hero-banner img {
  width: 100%;
  height: 410px;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.hero-caption {
  background: linear-gradient(0deg, rgba(28, 18, 10, 0.9) 0%, rgba(28, 18, 10, 0.65) 70%, transparent 100%);
  color: #fdf8f0;
  padding: 2.5rem 1.75rem 1.25rem;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
}

.hero-caption h1 {
  color: #fdf8f0;
  margin: 0 0 0.35rem 0;
  font-size: 1.75rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.hero-caption p {
  margin: 0;
  font-size: 1rem;
  color: #ebd9c0;
}

/* Content Grid & Cards */
.intro-grid {
  display: grid;
  grid-template-columns: 1fr 250px;
  gap: 2rem;
  align-items: start;
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-ornate);
  border-radius: var(--radius-sm);
  padding: 1.35rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.founder-card {
  text-align: center;
  font-size: 0.92rem;
}

.founder-card img {
  max-width: 150px;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-ornate);
  margin-bottom: 0.75rem;
  background-color: #fff;
}

.founder-card h3 {
  font-size: 1.05rem;
  margin: 0.25rem 0 0.5rem;
}

/* Info Grid (Hramuri, Program, Contact) */
.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.info-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-ornate);
  border-top: 3px solid var(--accent-crimson);
  border-radius: var(--radius-sm);
  padding: 1.35rem;
}

.info-card h2, .info-card h3 {
  margin-top: 0;
  font-size: 1.25rem;
}

/* Relics / Moaste List */
.relics-list {
  columns: 2;
  column-gap: 2.5rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-ornate);
  border-radius: var(--radius-sm);
  padding: 1.5rem 1.5rem 1.5rem 2.75rem;
  margin: 1.25rem 0;
}

.relics-list li {
  margin-bottom: 0.45rem;
  break-inside: avoid;
  font-size: 0.95rem;
}

/* Full-width Responsive Video Container */
.video-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 1.75rem 0;
  border: 2px solid var(--border-ornate);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(43, 29, 18, 0.15);
  background-color: #1a120b;
}

.video-container iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Image Thumbnails Row & Grids */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.gallery-item {
  background-color: var(--bg-parchment-light);
  border: 1px solid var(--border-ornate);
  border-radius: var(--radius-sm);
  padding: 0.6rem;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.gallery-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(43, 29, 18, 0.15);
}

.gallery-item img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}

.gallery-item.tall img {
  height: 260px;
  object-fit: contain;
  background-color: #1c130c;
}

.gallery-caption {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  display: block;
}

/* Floating Content Images */
.float-left-img {
  float: left;
  margin: 0.35rem 1.5rem 1rem 0;
  border: 2px solid var(--border-ornate);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  max-width: 190px;
  height: auto;
}

.center-figure {
  text-align: center;
  margin: 2rem auto;
}

.center-figure img {
  max-width: 100%;
  height: auto;
  border: 2px solid var(--border-ornate);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.center-figure figcaption {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.5rem;
}

/* Collapsible Details / Accordion for Long Liturgical Texts */
details.liturgical-accordion {
  background-color: var(--bg-card);
  border: 1px solid var(--border-ornate);
  border-radius: var(--radius-sm);
  margin: 1.5rem 0;
  overflow: hidden;
}

details.liturgical-accordion summary {
  padding: 1.1rem 1.5rem;
  font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--accent-crimson);
  background-color: rgba(203, 176, 137, 0.25);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  user-select: none;
}

details.liturgical-accordion summary::-webkit-details-marker {
  display: none;
}

details.liturgical-accordion summary::after {
  content: "+ Afișează textul complet";
  font-size: 0.85rem;
  font-family: 'Georgia', serif;
  font-weight: normal;
  color: var(--text-muted);
  border: 1px solid var(--border-ornate);
  padding: 0.25rem 0.65rem;
  border-radius: 4px;
  background-color: var(--bg-parchment-light);
}

details.liturgical-accordion[open] summary::after {
  content: "− Restrânge textul";
}

.accordion-body {
  padding: 1.5rem;
  border-top: 1px solid var(--border-ornate);
}

/* Ornamental Divider */
.ornament-divider {
  height: 22px;
  background-image: url('../images/bg_d.gif');
  background-repeat: repeat-x;
  background-position: center;
  margin: 2.5rem 0 1.5rem;
  border: 0;
}

/* Map & Contact Layout */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
  margin: 1.5rem 0;
}

.map-container {
  border: 2px solid var(--border-ornate);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background-color: #e5dec9;
}

.map-container iframe {
  width: 100%;
  height: 360px;
  border: 0;
  display: block;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--accent-crimson);
  color: #ffffff !important;
  text-decoration: none;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid #5a1212;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.btn:hover {
  background-color: #5a1212;
  transform: translateY(-1px);
}

.btn-facebook {
  background-color: #1877f2;
  border-color: #145dbf;
}

.btn-facebook:hover {
  background-color: #145dbf;
}

.btn-outline {
  background-color: var(--bg-parchment-light);
  color: var(--accent-crimson) !important;
  border: 1px solid var(--border-ornate);
}

.btn-outline:hover {
  background-color: #efe0c4;
}

/* Back to Top link */
.back-to-top {
  text-align: right;
  margin-top: 1.5rem;
  font-size: 0.9rem;
}

/* Footer */
.site-footer {
  padding: 0 2.5rem 2rem;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

/* Lightbox Modal Dialog (following modern-web-guidance light-dismiss-a-dialog) */
dialog.lightbox-dialog {
  padding: 0;
  border: 2px solid var(--accent-gold);
  border-radius: var(--radius-md);
  background-color: #1a120b;
  color: #f8edd9;
  max-width: 90vw;
  max-height: 90vh;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

dialog.lightbox-dialog::backdrop {
  background-color: rgba(15, 10, 6, 0.75);
  backdrop-filter: blur(3px);
}

.lightbox-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  position: relative;
}

.lightbox-inner img {
  max-width: 85vw;
  max-height: 76vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-caption {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  text-align: center;
  color: #ebd9c0;
}

.lightbox-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  border: 1px solid var(--border-ornate);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close:hover {
  background: var(--accent-crimson);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .page-wrapper {
    margin: 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .site-header {
    padding: 1.25rem;
  }

  .sub-nav,
  .main-content,
  .site-footer {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .intro-grid,
  .contact-layout {
    grid-template-columns: 1fr;
  }

  .relics-list {
    columns: 1;
  }

  .hero-banner img {
    height: 240px;
  }

  .hero-caption h1 {
    font-size: 1.35rem;
  }

  .float-left-img {
    float: none;
    display: block;
    margin: 0 auto 1.25rem;
  }

  .nav-item.nav-fb {
    margin-left: 0;
  }
}
