/* =======================================================
   Base styles (shared by all screen sizes)
   ======================================================= */

@media only screen and (min-width: 750px) {
  html { font-size: 17px; }
}
@media only screen and (max-width: 750px) {
  html { font-size: 15px; }
}

* {
  margin: 0;
  padding: 0;
  font-family: Georgia, serif;
  box-sizing: border-box;
  text-align: justify;
}

body {
  margin: 0;
  font-weight: 350;
  line-height: 1.5;
}

.tab { padding-left: 0.75rem; }
.listtext { margin: 0 0 0.5rem 1rem; }

p { margin: 0 0 0.5rem 0; }

.mycentredparent {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.mycentredchild { margin: auto; }

.mright { text-align: right; }
.mcenter { text-align: center; }
.sc { font-variant: small-caps; }
.dsc { font-size: 75%; }

.mainbody h1,
.mainbody h2 {
  color: #002146; /* Real Oxford blue is #002146 */
}

.circularimage { border-radius: 50%; }

.centerimage {
  display: inline-block;
  margin: 0 auto;
  height: 15rem;
  width: auto;
  padding: 1rem;
}

.borderimage {
  border-style: solid;
  border-color: #1c1c1c;
  border-width: 0.1rem;
}

.links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 1rem auto;
  flex-wrap: wrap;
}

.links a {
  color: #002146; /* Real Oxford blue is #002146 */
  text-align: justify;
  text-align-last: justify;
}
.links a:hover {
  color: #e30613;
}

a {
  text-decoration: none;
  color: #002146; /* Real Oxford blue is #002146 */
  font-weight: bold;
  transition: color 0.3s ease;
}
a:hover {
  color: #e30613;
}
header p {
  width: 16rem;
  margin: 0.5rem auto;
}
header .bio {
  text-align: justify;
  max-width: 20rem;
  margin: 0 auto;
}

header nav {
  width: 100%;
  margin: 2rem auto;
  border: 0.15rem solid black;
  border-radius: 0.75rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

header nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
  border-radius: 0.75rem;
  overflow: hidden;
}

header nav li a {
  display: block;
  padding: 0.8rem 1.2rem;
  text-align: center;
  color: #1a1a1a;
  background-color: #f4f7fb;
  border-bottom: 1px solid #ccc;
  transition: background-color 0.3s ease;
}

header nav li a:hover {
  background-color: #dde7f0;
}

header nav li a.active {
  background-color: #e0f0ff;
  font-weight: bold;
  border-left: 4px solid #e30613;
}

header nav a {
  padding: 1rem;
  display: block;
  font-weight: bold;
}

/* =======================================================
   Mobile styles (phones, <700px)
   ======================================================= */

@media only screen and (max-width: 700px) {
  .topbar,
  .oxford-footer {
    position: static;
    height: 3rem;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    display: flex;
    text-align: center;
    justify-content: center;
    align-items: center;
    background-color: #002146; /* Real Oxford blue is #002146 */
    color: white;
  }

  .oxford-footer p { margin: 0; }

  header {
    width: 100%;
    padding: 2rem;
    background-color: #e0ebf5;
    position: static;
  }

  .rightsideimage,
  .leftsideimage {
    display: block;
    width: 10rem;
    height: auto;
    margin: 1rem auto;
  }

  .container {
    display: block;
    margin: 0;
  }

  .mainbody {
    width: 100%;
    padding: 2rem;
    font-size: 100%;
    background-color: #f7faff;
  }
}

/* =======================================================
   Desktop styles (>=700px)
   ======================================================= */

@media only screen and (min-width: 700px) {
  .topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3rem;
    background-color: #002147;
    color: white;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .oxford-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2.5rem;
    background-color: #002147;
    color: #f0f0f0;
    display: flex;
    justify-content: center;
    line-height: 2.5rem;
    font-size: 0.9rem;
    z-index: 1000;
  }

  .oxford-footer p { margin: 0; }

  .container {
    display: flex;
    height: calc(100vh - 5.5rem);
    margin-top: 3rem;
    margin-bottom: 2.5rem;
  }

  header {
    width: 21rem;
    padding: 2rem;
    font-size: 90%;
    position: fixed;
    bottom: 2.5rem;
    left: 0;
    top: 3rem;
    overflow-y: auto;
    background-color: #e0ebf5;
  }

  .mainbody {
    padding: 4rem;
    width: calc(100% - 21rem);
    margin-left: 21rem;
    overflow-y: auto;
    background-color: #f7faff;
  }

  .rightsideimage {
    float: right;
    height: auto;
    width: 15rem;
    margin: 0 0 15px 20px;
  }

  .leftsideimage {
    display: block;
    height: 14rem;
    width: auto;
    margin: 0 0 15px 50px;
  }
}

/* =======================================================
   Projects section (responsive grid)
   ======================================================= */

@media only screen and (min-width: 750px) {
  .projgrid {
    margin-top: 1rem;
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(27rem, 1fr));
  }
}

@media only screen and (max-width: 750px) {
  .projgrid {
    margin-top: 1rem;
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  }
}

.proj {
  padding: 0.2rem;
  border: 0.1rem solid #1c1c1c;
  border-radius: 10px;
  transition: all 250ms;
}

.proj:hover {
  transform: translate(-5px, -5px);
  box-shadow: 5px 5px #1c1c1c;
}

.proj hr {
  margin: auto;
  width: 95%;
  border-top: 0.1rem dotted #1c1c1c;
}

.projhead {
  padding: 0.5rem;
  color: #FCF5EE;
  background-color: #1c1c1c;
  border-top-right-radius: 6px;
  border-top-left-radius: 6px;
}

.projtitle {
  text-align: center;
  min-height: 7.5rem;
  padding: 1rem;
  border: 0.1rem solid black;
  background-position: left center;
  background-size: cover;
}

.projtitle h3 {
  text-shadow:
    -1.5px -1.5px 0 #FCF5EE,
    0 -1.5px 0 #FCF5EE,
    1.5px -1.5px 0 #FCF5EE,
    1.5px 0 0 #FCF5EE,
    1.5px 1.5px 0 #FCF5EE,
    0 1.5px 0 #FCF5EE,
    -1.5px 1.5px 0 #FCF5EE,
    -1.5px 0 0 #FCF5EE;
}

.projbody { padding: 0.75rem 1rem; }

.projlinks ul {
  width: 100%;
  list-style-type: none;
}

.projlinks a {
  padding: 0.75rem 1rem;
  display: block;
}

.projlinks a:hover {
  color: black !important;
  background-color: #e0ebf5 !important;
}

.projlinks a.bottom {
  border-bottom-left-radius: 0.5rem;
  border-bottom-right-radius: 0.5rem;
}