/* Parrocchia S. Giuseppe - Modern CSS Stylesheet */

/* ===== CSS Reset & Base Styles ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f9f9f9;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
  color: #c17a1a;
  margin-top: 1.2em;
  margin-bottom: 0.6em;
  font-weight: 600;
}

h1 {
  font-size: 2.2em;
  border-bottom: 3px solid #c17a1a;
  padding-bottom: 0.4em;
}

h2 {
  font-size: 1.8em;
  margin-top: 1.5em;
}

h3 {
  font-size: 1.4em;
}

p {
  margin-bottom: 1em;
  text-align: justify;
}

a {
  color: #c17a1a;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #8b5a12;
  text-decoration: underline;
}

strong {
  color: #c17a1a;
  font-weight: 600;
}

/* ===== Header & Logo ===== */
header {
  background: url('../images/header.jpg') center/cover no-repeat;
  background-attachment: fixed;
  color: white;
  padding: 0;
  text-align: center;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
  color: white;
  border: none;
  font-size: 2.8em;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  margin: 0;
}

header p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1em;
  margin: 0;
  text-align: center;
}

/* ===== Navigation Bar ===== */
nav {
  background-color: #8b5a12;
  padding: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

nav .nav-toggle {
  display: none;
}

nav ul {
  list-style: none;
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
}

nav li {
  flex: 1;
  min-width: 150px;
}

nav a {
  display: block;
  color: white;
  padding: 15px 20px;
  text-align: center;
  font-weight: 500;
  transition: background-color 0.3s ease;
  border-bottom: 3px solid transparent;
}

nav a:hover {
  background-color: #c17a1a;
  color: white;
  text-decoration: none;
  border-bottom-color: #fff;
}

nav a.active {
  background-color: #c17a1a;
  border-bottom-color: #ffc107;
}

/* ===== Main Container ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  gap: 20px;
  min-height: calc(100vh - 400px);
}

/* ===== Sidebar ===== */
.sidebar {
  width: 250px;
  flex-shrink: 0;
}

.sidebar-section {
  background: white;
  border-left: 4px solid #c17a1a;
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.sidebar-section h3 {
  color: #c17a1a;
  font-size: 1.2em;
  margin-top: 0;
  margin-bottom: 15px;
  border-bottom: 2px solid #c17a1a;
  padding-bottom: 10px;
}

.sidebar-section ul {
  list-style: none;
}

.sidebar-section li {
  margin-bottom: 10px;
}

.sidebar-section a {
  display: block;
  padding: 8px 0;
  color: #c17a1a;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
  padding-left: 8px;
}

.sidebar-section a:hover {
  border-left-color: #c17a1a;
  padding-left: 12px;
  font-weight: 500;
}

/* ===== Main Content ===== */
main {
  flex: 1;
  background: white;
  padding: 30px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

main h1 {
  margin-top: 0;
}

/* ===== Content with Images ===== */
.content-with-image {
  display: flex;
  gap: 20px;
  margin: 20px 0;
  align-items: flex-start;
}

.content-with-image.float-right {
  flex-direction: row;
}

.content-with-image.float-left {
  flex-direction: row-reverse;
}

.content-image {
  flex-shrink: 0;
  max-width: 350px;
}

.content-image img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.content-text {
  flex: 1;
}

/* ===== Schedule Styles ===== */
.schedule-section {
  background-color: #fdf5e6;
  border-left: 5px solid #c17a1a;
  padding: 20px;
  margin: 20px 0;
  border-radius: 4px;
}

.schedule-section h3 {
  color: #c17a1a;
  margin-top: 0;
}

.schedule-section ul {
  list-style: none;
  padding-left: 0;
}

.schedule-section li {
  padding: 10px 0;
  border-bottom: 1px solid rgba(193, 122, 26, 0.2);
}

.schedule-section li:last-child {
  border-bottom: none;
}

.schedule-section strong {
  color: #8b5a12;
}

/* ===== Photo Gallery ===== */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.3s ease;
}

.gallery-item:hover {
  transform: scale(1.05);
}

.gallery-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.gallery-item-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(180, 120, 30, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-item-overlay {
  opacity: 1;
}

.gallery-item-overlay::before {
  content: '🔍';
  font-size: 2em;
  color: white;
}

/* ===== Lightbox ===== */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 85vh;
  border-radius: 4px;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  color: white;
  font-size: 2em;
  cursor: pointer;
  transition: color 0.3s ease;
}

.lightbox-close:hover {
  color: #c17a1a;
}

/* ===== Contact Section ===== */
.contact-info {
  background-color: #fdf5e6;
  border-left: 5px solid #c17a1a;
  padding: 30px;
  border-radius: 4px;
  max-width: 500px;
  margin: 20px 0;
}

.contact-info p {
  margin-bottom: 15px;
  text-align: left;
  font-size: 1.05em;
}

.contact-info strong {
  display: block;
  color: #8b5a12;
  margin-top: 20px;
  margin-bottom: 5px;
}

.contact-info a {
  color: #c17a1a;
  font-weight: 500;
}

/* ===== Footer ===== */
footer {
  background-color: #8b5a12;
  color: white;
  text-align: center;
  padding: 30px 20px;
  margin-top: 40px;
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
}

footer p {
  margin: 10px 0;
  text-align: center;
}

footer a {
  color: #f0c674;
  transition: color 0.3s ease;
}

footer a:hover {
  color: white;
}

/* ===== Biography Styles ===== */
.biography {
  background-color: #f9f9f9;
  border-left: 4px solid #c17a1a;
  padding: 20px;
  margin: 20px 0;
  border-radius: 4px;
}

.biography h3 {
  color: #c17a1a;
  margin-top: 0;
  margin-bottom: 15px;
}

.biography p {
  text-align: justify;
}

/* ===== Utility Classes ===== */
.text-center {
  text-align: center;
}

.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}

.highlight {
  background-color: #fff3cd;
  padding: 20px;
  border-left: 4px solid #c17a1a;
  border-radius: 4px;
  margin: 20px 0;
}

/* ===== Hamburger Menu Button ===== */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.8em;
  cursor: pointer;
  padding: 10px 15px;
  line-height: 1;
  transition: background-color 0.3s ease;
}

.nav-toggle:hover {
  background-color: #c17a1a;
}

/* ===== Mobile-friendly Tables ===== */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
  /* Hamburger menu */
  .nav-toggle,
  .main-nav .nav-toggle {
    display: block;
  }

  nav ul,
  .main-nav ul {
    display: none;
    flex-direction: column;
  }

  nav.nav-open ul,
  .main-nav.nav-open ul {
    display: flex;
  }

  nav li,
  .main-nav li {
    min-width: auto;
  }

  nav a,
  .main-nav a {
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 4px solid transparent;
    font-size: 1.05em;
  }

  nav a:hover,
  .main-nav a:hover {
    border-left-color: #ffc107;
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }

  nav a.active,
  .main-nav a.active {
    border-left-color: #ffc107;
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }

  /* Layout */
  .container {
    flex-direction: column;
    gap: 15px;
    padding: 15px;
  }

  .sidebar {
    width: 100%;
    order: 2;
  }

  main,
  .content {
    padding: 20px;
    order: 1;
  }

  /* Header */
  header {
    min-height: auto;
    padding: 30px 15px;
  }

  header h1 {
    font-size: 1.6em;
  }

  /* Content */
  .content-with-image {
    flex-direction: column !important;
  }

  .content-image {
    max-width: 100%;
  }

  /* Gallery */
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }

  /* Typography */
  h1 {
    font-size: 1.6em;
  }

  h2 {
    font-size: 1.3em;
  }

  h3 {
    font-size: 1.1em;
  }

  p {
    text-align: left;
  }

  /* Tables */
  table {
    width: 100% !important;
    font-size: 0.95em;
  }

  td {
    padding: 8px 5px;
  }

  /* Schedule sections */
  .schedule-section {
    padding: 15px;
  }

  /* Contact */
  .contact-info {
    max-width: 100%;
  }

  /* Sidebar sections - more compact */
  .sidebar-section {
    padding: 15px;
  }

  .sidebar-section a {
    padding: 10px 0;
    padding-left: 8px;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* Footer */
  footer {
    padding: 20px 15px;
    margin-top: 20px;
  }
}

@media (max-width: 480px) {
  /* Nav */
  nav a,
  .main-nav a {
    padding: 14px 15px;
    font-size: 1em;
  }

  /* Header */
  header {
    padding: 20px 10px;
  }

  header h1 {
    font-size: 1.3em;
  }

  /* Content */
  main,
  .content {
    padding: 15px;
  }

  /* Gallery */
  .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  /* Contact */
  .contact-info {
    padding: 15px;
  }

  /* Reduce spacing */
  .container {
    padding: 10px;
  }

  .schedule-section {
    padding: 12px;
  }
}

/* ===== Print Styles ===== */
@media print {
  nav,
  .sidebar,
  footer {
    display: none;
  }

  .container {
    flex-direction: column;
    min-height: auto;
  }

  main {
    box-shadow: none;
    padding: 0;
    margin: 0;
  }

  body {
    background: white;
  }

  header {
    page-break-after: avoid;
  }

  h1, h2, h3 {
    page-break-after: avoid;
  }

  p {
    orphans: 3;
    widows: 3;
  }

  .gallery {
    display: none;
  }
}
/* Gallery and Lightbox Styles */

/* ===== Gallery Grid ===== */
.gallery-grid,
.gallery-container {
  margin: 20px 0;
}

.gallery-grid-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: block;
  text-decoration: none;
  aspect-ratio: 4/3;
}

.gallery-item:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s ease;
}

.gallery-item:hover img {
  opacity: 0.85;
}

.gallery-card {
  display: block;
  background: white;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
  text-align: center;
}

.gallery-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.gallery-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.gallery-card h3 {
  padding: 15px;
  margin: 0;
  color: #c17a1a;
  font-size: 1.1em;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

/* ===== Lightbox Modal ===== */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox.active {
  display: flex;
}

.lightbox-image {
  max-width: 90%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 3em;
  font-weight: 300;
  cursor: pointer;
  transition: color 0.3s ease;
  line-height: 1;
  padding: 0;
  background: none;
  border: none;
}

.lightbox-close:hover {
  color: #c17a1a;
}

.lightbox-nav {
  position: absolute;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  pointer-events: none;
}

.lightbox-prev,
.lightbox-next {
  font-size: 3em;
  color: white;
  cursor: pointer;
  transition: color 0.3s ease, text-shadow 0.3s ease;
  user-select: none;
  pointer-events: all;
  padding: 10px 20px;
  line-height: 1;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  color: #c17a1a;
  text-shadow: 0 0 10px rgba(193, 122, 26, 0.5);
}

.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 1.1em;
  background: rgba(0, 0, 0, 0.5);
  padding: 10px 20px;
  border-radius: 4px;
}

.lightbox-current {
  font-weight: 600;
  color: #c17a1a;
}

.lightbox-total {
  opacity: 0.8;
}

/* ===== Back Link ===== */
.back-link {
  display: inline-block;
  padding: 8px 16px;
  background-color: #fdf5e6;
  border: 2px solid #c17a1a;
  border-radius: 4px;
  color: #c17a1a;
  font-weight: 500;
  transition: all 0.3s ease;
  margin-bottom: 20px;
}

.back-link:hover {
  background-color: #c17a1a;
  color: white;
  text-decoration: none;
}

/* ===== Inline Images ===== */
.inline-image {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 15px;
}

/* ===== Header with Image ===== */
.site-header {
  position: relative;
  overflow: hidden;
  min-height: 250px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.site-header img {
  display: block;
  width: 100%;
  height: auto;
}

.header-title {
  position: absolute;
  top: 10px;
  right: 30px;
  text-align: right;
  z-index: 1;
}

.header-title h1 {
  color: #1a6b3c;
  border: none;
  font-size: 2.4em;
  font-variant: small-caps;
  font-weight: 700;
  margin: 0;
  line-height: 1.1;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
}

.header-title p {
  color: #1a6b3c;
  font-size: 1.2em;
  font-variant: small-caps;
  font-weight: 600;
  margin: 0;
  text-align: right;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.5);
}

.main-nav {
  background-color: #8b5a12;
  padding: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.main-nav .nav-toggle {
  display: none;
}

.main-nav ul {
  list-style: none;
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.main-nav li {
  flex: 1;
  min-width: 150px;
}

.main-nav a {
  display: block;
  color: white;
  padding: 15px 20px;
  text-align: center;
  font-weight: 500;
  transition: background-color 0.3s ease;
  border-bottom: 3px solid transparent;
}

.main-nav a:hover {
  background-color: #c17a1a;
  color: white;
  text-decoration: none;
  border-bottom-color: #fff;
}

.main-nav a.active {
  background-color: #c17a1a;
  border-bottom-color: #ffc107;
}

.content {
  flex: 1;
  background: white;
  padding: 30px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.content h1 {
  margin-top: 0;
}

/* ===== Responsive Design for Gallery & Header ===== */
@media (max-width: 768px) {
  .gallery-grid-items {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
  }

  .gallery-card img {
    height: 150px;
  }

  .lightbox-image {
    max-width: 95%;
    max-height: 80vh;
  }

  .lightbox-prev,
  .lightbox-next {
    font-size: 2em;
    padding: 10px 15px;
  }

  .lightbox-close {
    font-size: 2.2em;
    top: 10px;
    right: 15px;
    padding: 10px;
  }

  .lightbox-counter {
    font-size: 0.95em;
    padding: 8px 15px;
  }

  /* Site header */
  .site-header {
    min-height: auto;
  }

  .site-header img {
    width: 100%;
    height: auto;
  }

  .header-title {
    position: relative;
    top: auto;
    right: auto;
    text-align: center;
    background: rgba(239, 184, 32, 0.9);
    padding: 10px 15px;
  }

  .header-title h1 {
    font-size: 1.4em;
  }

  .header-title p {
    font-size: 0.95em;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .gallery-grid-items {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }

  .gallery-card img {
    height: 120px;
  }

  .lightbox-image {
    max-width: 100%;
    max-height: 75vh;
  }

  .lightbox-prev,
  .lightbox-next {
    font-size: 1.8em;
    padding: 10px;
  }

  .lightbox-close {
    font-size: 2em;
    top: 5px;
    right: 10px;
    padding: 10px;
  }

  .lightbox-nav {
    padding: 0 5px;
  }

  .lightbox-counter {
    font-size: 0.85em;
    padding: 6px 12px;
  }

  .header-title h1 {
    font-size: 1.2em;
  }

  .header-title p {
    font-size: 0.85em;
  }
}
