/* Define local EB Garamond variable fonts */
@font-face {
  font-family: 'EB Garamond Local';
  src: url('caligraphy/EBGaramond-VariableFont_wght.woff2') format('woff2');
  font-weight: 100 900; /* Variable font range: 100 to 900 */
  font-style: normal;
}

@font-face {
  font-family: 'EB Garamond Local';
  src: url('caligraphy/EBGaramond-Italic-VariableFont_wght.woff2') format('woff2');
  font-weight: 100 900; /* Variable font range: 100 to 900 */
  font-style: italic;
}

/* Fallback to static fonts if variable fonts are unsupported */
@font-face {
  font-family: 'EB Garamond Local';
  src: url('caligraphy/EBGaramond-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'EB Garamond Local';
  src: url('caligraphy/EBGaramond-Italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
}

@font-face {
  font-family: 'EB Garamond Local';
  src: url('caligraphy/EBGaramond-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: 'EB Garamond Local';
  src: url('caligraphy/EBGaramond-MediumItalic.woff2') format('woff2');
  font-weight: 500;
  font-style: italic;
}

@font-face {
  font-family: 'EB Garamond Local';
  src: url('caligraphy/EBGaramond-SemiBold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
}

@font-face {
  font-family: 'EB Garamond Local';
  src: url('caligraphy/EBGaramond-SemiBoldItalic.woff2') format('woff2');
  font-weight: 600;
  font-style: italic;
}

@font-face {
  font-family: 'EB Garamond Local';
  src: url('caligraphy/EBGaramond-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'EB Garamond Local';
  src: url('caligraphy/EBGaramond-BoldItalic.woff2') format('woff2');
  font-weight: 700;
  font-style: italic;
}

@font-face {
  font-family: 'EB Garamond Local';
  src: url('caligraphy/EBGaramond-ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
}

@font-face {
  font-family: 'EB Garamond Local';
  src: url('caligraphy/EBGaramond-ExtraBoldItalic.woff2') format('woff2');
  font-weight: 800;
  font-style: italic;
}

/*Font for the big title */
@font-face {
  font-family: 'Libre Baskerville';
  src: url('caligraphy/LibreBaskerville-Bold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
}

/* Font-face declaration for Lasance Initials */
@font-face {
  font-family: 'Lasance Initials';
  src: url('caligraphy/LasanceInitials.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* Existing styles */
body {
  font-family: 'EB Garamond Local', serif;
  font-size: 14pt;
  font-weight: 400; /* Regular weight for body text */
  line-height: 1.4;
  margin: 0 auto;
  max-width: 900px; /* Better use of screen width */
  padding: 20px;
  background-color: #ffffff;
  color: #000000;
  font-feature-settings: "calt" 1, "liga" 1, "dlig" 1, "pnum" 1, "onum" 1, "ss05" 1, "ss06" 1; /* Supported features */
  text-align: justify; /* Added to justify body text */
}
/* Header Styles */
/* Header Styles */
header {
    background-color: #000000;
    color: #d4b038;
    padding: 15px;
    text-align: center;
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    margin-top: -20px;
}
header h1 {
    font-family: 'Libre Baskerville', serif;
}
header h1 a {
    text-decoration: none !important; /* Override WebKit underline */
    color: #d4b038 !important; /* Override WebKit color */
    cursor: default !important; /* Override WebKit cursor */
    background-color: #000000;
    border: 2px solid #000000;
    border-radius: 5px;
    display: inline-block;
    padding: 10px 20px;
    transition: background-color 0.3s;
}
header h1 a:hover {
    background-color: #000000;
}
nav ul {
    list-style: none;
    padding: 0;
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    justify-content: center;
}
nav li:first-child {
    position: absolute;
    left: 0;
}
nav li:last-child {
    position: absolute;
    right: 0;
}
nav li:not(:first-child):not(:last-child) {
    margin: 0 15px;
}
nav li {
    display: inline;
}
header nav ul li a {
    color: #d4b038 !important; /* Override WebKit color */
    text-decoration: none !important; /* Override WebKit underline */
    cursor: default !important; /* Override WebKit cursor */
    font-weight: bold;
    background-color: #000000 !important;
    padding: 8px 15px;
    border: 2px solid #000000 !important;
    border-radius: 5px;
    transition: background-color 0.3s;
}
header nav ul li a:hover {
    text-decoration: none !important; /* Ensure no underline on hover */
    background-color: #524e4e;
}
main {
    margin-top: 20px;
    width: 100%;
    max-width: 100%;
}
section {
    margin-bottom: 30px;
}
h1, h2 {
    font-weight: normal;
    text-align: center;
}

.versicle, .response {
    color: #DC143C;
}

.hora {
    font-variant: small-caps;
    font-size: 1.5em;
    text-transform: lowercase;
}

.rubrica {
    color: #DC143C;

}

.rubric {
    color: #DC143C;

}

.rubric asterisk {
    color: #DC143C;

}

.rubric dagger{
    color: #DC143C;
}

.red {
    color: #DC143C;
}

.response-symbol{
    color: #DC143C;
}

.versicle-symbol{
    color: #DC143C;
}

.subtitulus {
    font-style: italic;
    font-size: 1em;
    font-feature-settings: "swsh" 1;
}

.psalmus {
    color: #DC143C;
}

.fons {
  font-style: italic;
  font-size: 0.8em;
}

p.dropcap:first-letter {
  float: left;
  font-size: 2.5em;
  line-height: 0.8em;
  margin-right: 0.05em;
  margin-top: 0.1em;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 10px auto;
}

.math {
  color: #1a5276;
}

footer {
  background-color: #000000;
  color: white;
  padding: 30px 20px;
  text-align: center;
  width: 100vw; /* Full viewport width */
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw; /* Center by offsetting half viewport */
  margin-right: -50vw;
  margin-top: 40px;
  margin-bottom: -20px;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.footer-branding {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-logo {
  height: 40px;
  width: auto;
}

.footer-brand-name {
  font-size: 1.2em;
  font-weight: bold;
  color: white;
}

.footer-links {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  color: white;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: #ccc;
}

/* Two-column layout for liturgical content */
.paracol {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin: 1em 0;
  align-items: start;
}

.latin-column, .english-column {
  padding: 0;
}

.paracol p {
  margin: 0.5em 0;
}

/* Center class for section headings */
.center {
  text-align: center;
  margin: 1.5em 0;
}

.center p {
  margin: 0;
}

/* Styling for liturgical content */
.smallcaps {
  font-variant: small-caps;
}

.lettrine {
  font-family: 'Lasance Initials', serif;
  float: left;
  font-size: 3.5em;
  line-height: 0.8em;
  margin-right: 0.08em;
  margin-top: 0.1em;
  margin-bottom: -0.1em;
  font-weight: bold;
  color: #DC143C;
}

/* Prayer selection dropdown styling */
.prayer-selection {
  margin: 2em 0;
  text-align: center;
}

.prayer-selection label {
  font-weight: bold;
  margin-right: 10px;
  color: #DC143C;
}

.prayer-selection select {
  padding: 8px 12px;
  font-size: 1em;
  font-family: 'EB Garamond Local', serif;
  border: 2px solid #DC143C;
  border-radius: 4px;
  background-color: white;
  color: #333;
  min-width: 300px;
}

.prayer-selection select:focus {
  outline: none;
  border-color: #B22222;
  box-shadow: 0 0 5px rgba(139, 0, 0, 0.3);
}

.prayer-content {
  margin-top: 2em;
}

.prayer-option {
  display: none;
}

.prayer-option.active {
  display: block;
}

/* Responsive design */
@media (max-width: 768px) {
  body {
    padding: 15px;
    max-width: 100%;
    font-size: 10pt;
  }
  main {
    margin-top: 15px;
  }
  .footer-branding {
    flex-direction: column;
    gap: 10px;
  }
  .footer-links {
    flex-direction: column;
    gap: 10px;
  }
  .paracol {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .paracol p:nth-child(odd) {
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.5em;
    margin-bottom: 0.5em;
  }
  .prayer-selection select {
    min-width: 250px;
    font-size: 0.9em;
  }
}

@media (max-width: 480px) {
  body {
    padding: 10px;
    font-size: 9pt;
  }
}

/* Additional liturgical and page styles */
.subtitle, .psalm-title, .section-title, .lesson-title, .prayer-title {
  text-align: center;
  margin: 1.5em 0 1em 0;
  color: #DC143C;
}

.source {
  text-align: center;
  font-style: italic;
  font-size: 0.9em;
  margin: 0.5em 0;
}

.section-break {
  margin: 40px 0;
  border-bottom: 1px solid #ddd;
}

.decorative-break {
  text-align: center;
  margin: 40px 0;
  font-size: 2em;
  color: #DC143C;
}

.page-image-top, .page-image-bottom {
  text-align: center;
  margin: 20px 0 30px 0;
}

.decorative-image {
  max-width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: contain;
}

.crucifixion-image {
  max-width: 100%;
  height: auto;
  max-height: 450px; /* Slightly larger than decorative-image */
  object-fit: contain;
  border: 2px solid #ffffff; /* Matches liturgical red */
  border-radius: 4px; /* Consistent with other elements */
  margin: 10px auto; /* Center with spacing */
}

/* Responsive adjustment */
@media (max-width: 768px) {
  .crucifixion-image {
    max-height: 180px; /* Slightly larger than decorative-image on mobile */
  }
}

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

.next-page-link {
  display: inline-block;
  padding: 12px 24px;
  background-color: #DC143C;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.next-page-link:hover {
  background-color: #A52A2A;
  color: white;
}

header nav:not(nav ul) {
  display: flex;
  justify-content: space-around;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 900px;
  margin: 0 auto;
}

header nav:not(nav ul) a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  padding: 8px 12px;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

header nav:not(nav ul) a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .decorative-image {
    max-height: 150px;
  }
  .next-page-link {
    padding: 10px 20px;
    font-size: 0.9em;
  }
  header nav:not(nav ul) {
    flex-direction: column;
    gap: 5px;
  }
  header nav:not(nav ul) a {
    padding: 6px 10px;
    font-size: 0.9em;
  }
}

/* Purchase Page Styles */
.purchase-hero {
    text-align: center;
    margin-bottom: 40px;
}

.purchase-title {
    font-size: 3em;
    font-weight: normal;
    margin: 20px 0;
    line-height: 1.1;
}

.officium, .defunctorum {
    display: block;
    letter-spacing: 0.1em;
}

.collaboration-subtitle {
    font-style: italic;
    font-size: 1.2em;
    color: #666;
    margin-bottom: 30px;
}

.section-title {
    font-size: 2em;
    font-weight: bold;
    text-align: center;
    margin: 40px 0 30px 0;
    letter-spacing: 0.05em;
    color: red;
}

.commission-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 50px;
}

.commission-text {
    padding-right: 20px;
}

.stipend-info {
    background-color: #f9f9f9;
    padding: 20px;
    border-left: 4px solid red;
    margin-top: 20px;
}

.stipend-info p {
    margin: 10px 0;
}

.commission-form {
    background-color: #f5f5f5;
    padding: 30px;
    border-radius: 8px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

.required {
    color: red;
    font-weight: normal;
}

.name-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-family: 'EB Garamond', serif;
    font-size: 1em;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: red;
}

.amount-input {
            position: relative;
            display: inline-block;
            width: 120px;
}

.currency {
    position: relative;
    display: inline-block; /* Ensures currency symbol stays inline with input */
    color: #000000;
    font-weight: bold;
    font-size: 14px;
    line-height: 1;
    font-family: Arial, sans-serif;
    pointer-events: none; /* Prevent interaction */
    z-index: 2; /* Ensure above input */
    margin-right: -20px; /* Pulls currency symbol into the input field */
    vertical-align: middle; /* Aligns with input text */
}

.amount-input input {
    width: 100%;
    box-sizing: border-box;
    padding-left: 24px; /* Space for $ symbol */
    font-size: 14px;
    line-height: 1;
    font-family: Arial, sans-serif;
    height: 32px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.amount-input input::placeholder {
    color: #666;
    font-weight: bold;
    font-size: 14px;
    line-height: 1;
    font-family: Arial, sans-serif;
    padding-left: 24px; /* Space for $ symbol */
}

.checkbox-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 10px;
    width: auto;
}

.submit-btn {
    background-color: #120b0b;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 4px;
    font-family: 'EB Garamond', serif;
    font-size: 1.1em;
    font-weight: bold;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.submit-btn:hover {
    background-color: #1e3119;
}

.book-content {
    max-width: 800px;
    margin: 0 auto;
}

.book-description {
    margin-bottom: 40px;
}

.amazon-links {
    text-align: center;
}

.amazon-links h3 {
    font-size: 1.3em;
    font-weight: normal;
    margin: 20px 0;
    letter-spacing: 0.05em;
}

.amazon-stores {
    margin-top: 20px;
}

.store-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.store-link {
    display: inline-block;
    padding: 8px 16px;
    text-decoration: none;
    font-weight: bold;
    border: 2px solid;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.store-link.us { border-color: #4CAF50; color: #4CAF50; }
.store-link.uk { border-color: #2196F3; color: #2196F3; }
.store-link.canadian { border-color: #FF9800; color: #FF9800; }
.store-link.spanish { border-color: #9C27B0; color: #9C27B0; }
.store-link.french { border-color: #00BCD4; color: #00BCD4; }
.store-link.italian { border-color: #795548; color: #795548; }
.store-link.german { border-color: #607D8B; color: #607D8B; }
.store-link.dutch { border-color: #FF5722; color: #FF5722; }
.store-link.polish { border-color: #E91E63; color: #E91E63; }
.store-link.swedish { border-color: #F57F17; color: #F57F17; }

.store-link:hover {
    background-color: currentColor;
    color: white;
}

/* Responsive Design for Purchase Page */
@media (max-width: 768px) {
    .commission-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .commission-text {
        padding-right: 0;
    }
    
    .name-fields {
        grid-template-columns: 1fr;
    }
    
    .purchase-title {
        font-size: 2.5em;
    }
    
    .store-links {
        gap: 10px;
    }
    
    .store-link {
        padding: 6px 12px;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .purchase-title {
        font-size: 2em;
    }
    
    .section-title {
        font-size: 1.5em;
    }
    
    .commission-form {
        padding: 20px;
    }
}