:root {
  --primary-color: #0275d8;
  --primary-dark: rgba(13, 65, 100);

  --secondary-color: #5bce8b91;
  --secondary-dark: #449d44;

  --text-color: #333;
  --light-text: #657477;

  --dialog-text-highlight: #bcd9df;
  --dialog-background: #0a0c0ca7;

  --background: #f8f9fa;
  --card-bg: whitesmoke;
  --border-radius: 10px;
  --box-shadow: 0 4px 12px #00000153;
  --transition: all 0.3s ease;
  --link-bg: rgba(13, 65, 100, 0.3);

  --bannerAndFooter-bg: #6494ed23;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background);
  padding-top: 20px;
}

header {
  padding: 2rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  background-color: var(--bannerAndFooter-bg);
  box-shadow: var(--box-shadow);
}

header h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
  font-weight: 700;
}

header p {
  font-size: 1.1rem;
  color: var(--light-text);
  margin-bottom: 1.5rem;
}

.fullbar {
  padding: .25rem 2rem .3rem;
  margin: 0 auto;
  position: relative;
  max-width: 1200px;
}

.fullbar a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}
.fullbar a:link {
  color: var(--primary-dark);
}
.fullbar a:visited {
  color: var(--primary-color);
}
.fullbar a:hover {
  color: var(--secondary-dark);
  background-color: var(--link-bg);
  border-radius: 25%;
  box-decoration-break: clone;
}
.fullbar a:active {
  color: var(--secondary-dark);
}
.fullbar a:focus {
  color: var(--secondary-color);
}
/* ===================================
   Logo, phone, and banner STYLES
                                    ~Refer to navMenu.css for nav menu~
=================================== */
@font-face {
    font-family: manuscript;
    src: url(../anvil/font.ttf);
}
.logos {
    color: var(--light-text);
    /* Light text color */
    font-family: manuscript;
    position: relative;
    /* For potential absolute positioning of elements inside */
    overflow: hidden;
    /* To contain any potential animations */
}

.logos span {
    font-weight: bold;
    letter-spacing: 2px;
    /* Add some letter spacing */
    text-shadow: 1px 1px 2px (var(--secondary-dark));
    /* Text shadow for depth */
}

.logos span:first-child {
    color: var(--primary-dark);
    /* Highlight the "LA" part with a vibrant color */
}

.logos span:nth-child(2) {
    color: var(--primary-dark);
    /* Highlight the "tinos" part with another color */
}

.logos small {
    display: block;
    /* Make the small text appear on a new line */
    font-size: 0.5em;
    color: var(--light-text);
    /* Muted color for the small text */
    font-style: italic;
    padding-right: 10%;
}

header .logo {
    font-size: calc(3vw + 3vh);
    display: inline;
    float: left;
    width: 100%;
}

header small.rtl {
    margin:4px 4px 16px 0;
    float:right;
    max-width: 100%;
}

.phone {
    color: var(--secondary-dark);
    position: absolute;
    top: 0;
    z-index: 1;
    right: 5%
}
/* ===================================
   IMAGES STYLES
=================================== */
img {
    background-color: var(--background);
    padding: 10px;
    border: 1px solid #b7b7b7;
}
.fl {
  margin: 4px 16px 4px 0;
  float: left;
}
.img_fl {
  margin: 4px 16px 4px 0;
  float: left;
  padding-right: 1%;
}

.rtl {
  margin: 4px 4px 16px 0;
  float: right;
}
.img_rtl {
  margin: 4px 4px 16px 0;
  float: right;
  padding-left: 1%;
}

/* ===================================
   TEXT-DIALOG STYLES
=================================== */

.multi-link-container {
  display: inline-block;
  position: relative;
}

.multi-link-container:hover {
  background-color: var(--dialog-text-highlight);
}

.linked-text {
  cursor: pointer;
}

.link-dialog {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--background);
  padding: 20px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  z-index: 1000;
  max-width: 95%;
  overflow-y: auto;
  /* Ensure smooth scrolling within dialog */
  -webkit-overflow-scrolling: touch;
  /* Prevent content from overflowing dialog bounds */
  word-wrap: break-word;
  overflow-wrap: break-word;
  pointer-events: auto;
  /* Isolate the dialog from parent container interactions */
  isolation: isolate;
  /* Ensure dialog stays in place */
  will-change: transform;
}

.link-dialog.visible {
  display: block;
}

.link-dialog p {
    margin-bottom: 1rem;
    display: inline-block;
}

.link-dialog p:hover,
.link-dialog p:focus {
  background: var(--dialog-text-highlight);
  position: relative;
  display: inline-block;
}

.dialog-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--dialog-background);
  z-index: 999;
}

.dialog-backdrop.active {
  display: block;
}

/* ===================================
   IMAGE-DIALOG STYLES
=================================== */
/* Ensure template is hidden */
template {
  display: none !important;
}
/* Hide carousel items in image-dialog until dialog is opened */
.image-dialog .carousel-item {
  display: none;
}

/* Show carousel items only when dialog is visible */
.image-dialog.visible .carousel-item {
  display: block;
}

/* Show only the active carousel item */
.image-dialog.visible .carousel-item.active {
  display: block;
}

.image-dialog.visible .carousel-item:not(.active) {
  display: none;
}

/* Dialog modal styling */
.image-dialog {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  cursor: pointer; /* Show pointer cursor on background */
}

.image-dialog.visible {
  display: flex;
}

.image-dialog .carousel-item {
  text-align: center;
  color: var(--card-bg);
  cursor: default; /* Reset cursor for content area */
  pointer-events: auto; /* Allow interactions with content */
}

.image-dialog .carousel-item img {
  max-width: 90%;
  max-height: 80vh;
  object-fit: contain;
  cursor: default; /* Normal cursor on image */
}

.image-dialog .carousel-item p {
  margin-top: 10px;
  cursor: default; /* Normal cursor on text */
  text-align: center;
}

.image-dialog .carousel-item p a{
  background-color: var(--dialog-background);
  padding: 5px;
}
/* ===================================
   FOOTER STYLES
=================================== */
footer p {
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
    background-color: var(--bannerAndFooter-bg);
    color: var(--secondary-dark);
    box-shadow: var(--box-shadow);
}

.footer-link-content {
  text-decoration:none;
color: inherit;
}
.footer-link-content:visited  {
  color: inherit;
}


/* ===================================
   ANIMATIONS
=================================== */
@keyframes changePosition {
    0% {
        position: absolute;
    }

    100% {
        position: fixed;
    }
}


/* ===================================
   TARGET TEXT STYLES
=================================== */
::target-text {
  background-color: yellow;
  color: black;
  text-decoration: underline;
}

/* ===================================
   Breadcrumb Navigation Styles
=================================== */
  .crumbs {
      border-radius: 7px;
      border-right: 4px solid var(--primary-color);
      padding-top: -20px;
  }

  .bread-crumbs {
      display: flex;
      font-family: manuscript;
      gap: 10px;
      justify-content: flex-end;
  }

  .crumb-link {
      padding: 10px;
  }

  .crumb-link b {
      text-decoration: underline;
  }


/* ===================================
   RESPONSIVE STYLES
=================================== */
@media (max-width: 900px) {
  .homepage-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .homepage-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  header, .intro {
    padding: 1.5rem 1rem;
  }

  header h1 {
    font-size: 2rem;
  }
}

/* Mobile-specific styles for better dialog display */
@media (max-width: 768px) or (max-height: 500px) {
  .link-dialog {
    min-width: 80%;
    max-width: 95%;
    max-height: 85vh;
    padding: 15px;
    top: 10%;
    transform: translateX(-50%);
    /* Remove vertical centering on mobile for better space usage */
    /* Ensure content doesn't overflow on small screens */
    font-size: 0.9rem;
    line-height: 1.4;
  }

  .link-dialog p {
    margin-bottom: 0.8rem;
  }

  .link-dialog figcaption {
    font-size: .9rem;
    padding: 0;
  }

  .link-dialog img {
    width: fit-content;
    height: auto;
    max-width: 80vw;
  }

  .link-dialog figure {
    padding: 0;
  }

  .bread-crumbs {
        font-size: .7rem;
        gap: 0;

    }

    .crumbs {
        border-right: none;
    }
}

@media (max-width: 500px) {
    .bread-crumbs {
        font-size: .5rem;
        gap: 0;

    }
}