html {
  scroll-behavior: smooth;
  font-family: 'Work Sans', sans-serif;
}

body {
  width: 100vw;
  height: 100vh;
  margin: 0;
  overflow-x: hidden;
  overflow-y: visible;
  background: #1e222a;
  position: relative;
}

#loading-screen {
  overflow: hidden;
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #f5f0e1;
  opacity: 1;
  transition: 1s opacity;
}

#loading-screen.fade-out {
  opacity: 0;
}

#om-loader {
  font-size: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  transform: translate(-50%, -50%);
  left: 50%;
  top: 50%;
  width: 150px;
  height: 150px;
  color: #660000;
}

#loader {
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 150px;
  height: 150px;
  margin: -75px 0 0 -75px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: #33adff;
  -webkit-animation: spin 2s linear infinite;
  animation: spin 2s linear infinite;
}

#loader:before {
  content: "";
  position: absolute;
  top: 5px;
  left: 5px;
  right: 5px;
  bottom: 5px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: #ffad33;
  -webkit-animation: spin 3s linear infinite;
  animation: spin 3s linear infinite;
}

#loader:after {
  content: "";
  position: absolute;
  top: 15px;
  left: 15px;
  right: 15px;
  bottom: 15px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: #ffd333;
  -webkit-animation: spin 1.5s linear infinite;
  animation: spin 1.5s linear infinite;
}

@-webkit-keyframes spin {
  0% {
    -webkit-transform: rotate(0deg);
    -ms-transform: rotate(0deg);
    transform: rotate(0deg);
  }

  100% {
    -webkit-transform: rotate(360deg);
    -ms-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}

@keyframes spin {
  0% {
    -webkit-transform: rotate(0deg);
    -ms-transform: rotate(0deg);
    transform: rotate(0deg);
  }

  100% {
    -webkit-transform: rotate(360deg);
    -ms-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}

#canvas {
  width: 100%;
  height: 100%;
  position: fixed;
  z-index: -1;
}



#website-content {
  z-index: 10;
  display: block;
  font-size: clamp(14px, 1.1vw, 18px);
  /* Responsive font scaling with limits */
}

#content {
  z-index: 10;
  width: calc(50vw - 130px);
  background: #f5f0e1;
  border-top-right-radius: 50vw;
  color: #1e222a;
  padding: 40vh 50px 16px 80px;
  transition: border-radius .5s;
}

#om-container {
  position: relative;
  height: 60vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#om {
  height: 80%;
}

a.anchor {
  display: block;
  position: relative;
  top: -60px;
  visibility: hidden;
}

.page {
  margin: 0;
  padding: 0;
}

.page>h1 {
  font-weight: 500;
  margin-top: 18vh;
}

.page>h2 {
  font-weight: 400;
}

.page>p {
  font-weight: 300;
  line-height: 1.3;
}

a:link {
  color: #660000;
}

#front-page {
  height: 200vh;
  color: #1e222a;
}

#front-page>#title-logo {
  width: 33vw;
  position: absolute;
  bottom: 50px;
  left: 60px;
}

.arrow {
  position: absolute;
  bottom: 30px;
  left: 50%;
  margin-left: -15px;
  width: 30px;
  height: 30px;
  filter: invert(1);
  background-image: url(assets/arrow.svg);
  background-size: contain;
  /*z-index: -10;*/
}

.bounce {
  animation: bounce 2s infinite;
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-15px);
  }
}

#menus {
  top: 0px;
  position: sticky;
  background-color: #f5f0e1;
  /* border-bottom: #cccccc 1px solid; */
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 130px;
  z-index: 10;
}

#menus>ul {
  display: flex;
  font-size: 16px;
  /* Fixed readable size */
  clear: left;
  float: left;
  list-style: none;
  margin: 0;
  padding: 1em 0;
  left: 50%;
  text-align: center;
  align-items: center;
  justify-content: center;
}

#menus>ul>li {
  display: block;
  float: left;
  list-style: none;
  margin: 0;
  padding: 0 0.53em;
  position: relative;
  text-align: center;
}

#menus>ul>li>a {
  display: block;
}

/* #menus>ul>li+li {
  border-left: 1px solid #CCCCCC;
} */

button {
  color: #1e222a;
  font-style: italic;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
}

.add-row,
.remove-row {
  display: inline-block;
  border: solid #1e222a 1px;
  border-radius: 5px;
  padding: 5px;
  opacity: 50%;
}


#savebutton {
  visibility: hidden;
}

#menus a:link,
#menus a:visited {
  text-decoration: none;
}

#menus>ul>li>a:hover,
#menus>ul>li>a:active {
  text-decoration: underline;
}

#menus>ul>li>a:hover {
  color: #1e222a;
}

#menus>ul>li>a:active {
  color: #660000;
}

#menus>ul>li>a:visited {
  color: #660000;
}

#menus>ul li:hover>ul {
  display: block;
}

#menus>ul ul>li>a {
  color: #600000;
  width: 100%;
  display: block;
  border-bottom: 2px solid black;
  padding: 2px 0;
  text-indent: 5px;
}

a {
  color: #600000;
}

table {
  border-spacing: 1vw 3vh;
  font-size: 1vw;
  text-align: center;
}

table img {
  max-width: 100%;
  height: auto;
}

#notice {
  opacity: .8;
  font-size: 1.125em;
}

.circular--portrait {
  position: relative;
  width: 10vw;
  height: 10vw;
  overflow: hidden;
  border-radius: 50%;
}

.circular--portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sanskrit-text {
  font-family: 'Tiro Devanagari Sanskrit', serif;
}

/* Simplified responsive design */
@media all and (max-width: 1024px) {
  #content {
    width: 95%;
    padding: calc(10vh + 60px) 30px 16px 50px;
  }

  .circular--portrait {
    width: clamp(150px, 20vw, 200px);
    height: clamp(150px, 20vw, 200px);
  }
}

/* Mobile styles - conservative approach */
@media all and (max-width: 768px) {
  #website-content {
    font-size: 14px;
    /* Fixed small base */
    max-width: 100vw;
    overflow-x: hidden;
  }

  #content {
    width: 95%;
    max-width: calc(100vw - 20px);
    padding: calc(10vh + 40px) 10px 16px 10px;
    box-sizing: border-box;
  }

  .page>p {
    font-size: 16px;
    /* Fixed readable paragraph size */
    line-height: 1.5;
  }

  .page>h1 {
    font-size: 24px;
    /* Fixed heading sizes */
  }

  .page>h2 {
    font-size: 20px;
  }

  .circular--portrait {
    width: 100px;
    height: 100px;
  }

  #menus>ul {
    font-size: 12px;
    /* Even smaller for better mobile wrapping */
    flex-wrap: wrap;
    justify-content: center;
    gap: 3px;
    padding: 0 5px;
  }

  #menus>ul>li {
    margin: 0 2px;
    line-height: 1.2;
  }

  table {
    font-size: 12px;
    /* Smaller for mobile readability */
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
  }

  table td {
    padding: 6px;
    text-align: center;
    vertical-align: top;
    word-wrap: break-word;
  }

  table th {
    padding: 5px;
    text-align: center;
    font-weight: bold;
    font-size: 11px;
  }

  .sanskrit-text {
    font-size: 15px;
    /* Slightly smaller Sanskrit text */
    line-height: 1.5;
  }

  /* Improve mobile spacing and fix image layout */
  .page {
    margin-bottom: 20px;
    padding: 0 5px;
  }

  /* Fix photo gallery layout on mobile */
  .circular--portrait {
    display: block;
    margin: 5px auto;
  }
}

/* Very small screens - prevent clipping */
@media all and (max-width: 480px) {
  #content {
    padding: calc(10vh + 30px) 8px 16px 8px;
    max-width: calc(100vw - 16px);
  }

  .circular--portrait {
    width: 70px;
    height: 70px;
  }

  /* Smaller table fonts for very small screens */
  table {
    font-size: 10px;
  }

  table th {
    font-size: 9px;
    padding: 3px;
  }

  table td {
    padding: 3px;
  }

  /* Better photo gallery layout for small screens */
  #PHOTOS table td {
    width: 33.33%;
    padding: 2px;
  }

  /* Stack officer tables vertically on very small screens */
  #OFFICERS table tr {
    display: block;
    margin-bottom: 1em;
    text-align: center;
  }

  #OFFICERS table td {
    display: block;
    padding: 3px 0;
    font-size: 11px;
  }
}