<?xml version='1.0' encoding='utf-8'?>
<FilingSummary>
  <Version>3.26.1</Version>
  <ProcessingTime/>
  <ReportFormat>html</ReportFormat>
  <ContextCount>12</ContextCount>
  <ElementCount>26</ElementCount>
  <EntityCount>1</EntityCount>
  <FootnotesReported>false</FootnotesReported>
  <SegmentCount>1</SegmentCount>
  <ScenarioCount>0</ScenarioCount>
  <TuplesReported>false</TuplesReported>
  <UnitCount>2</UnitCount>
  <MyReports>
    <Report instance="ef20068658_def14a.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R1.htm</HtmlFileName>
      <LongName>000100 - Document - Document and Entity Information</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://fmbonline.com/role/DocumentAndEntityInformation</Role>
      <ShortName>Document and Entity Information</ShortName>
      <MenuCategory>Cover</MenuCategory>
      <Position>1</Position>
    </Report>
    <Report instance="ef20068658_def14a.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R2.htm</HtmlFileName>
      <LongName>060100 - Disclosure - Insider Trading Policies and Procedures</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://fmbonline.com/role/InsiderTradingPoliciesAndProcedures</Role>
      <ShortName>Insider Trading Policies and Procedures</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>2</Position>
    </Report>
    <Report instance="ef20068658_def14a.htm">
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <HtmlFileName>R3.htm</HtmlFileName>
      <LongName>060200 - Disclosure - Pay vs Performance Disclosure</LongName>
      <ReportType>Sheet</ReportType>
      <Role>http://fmbonline.com/role/PayVsPerformanceDisclosure</Role>
      <ShortName>Pay vs Performance Disclosure</ShortName>
      <MenuCategory>Notes</MenuCategory>
      <Position>3</Position>
    </Report>
    <Report>
      <IsDefault>false</IsDefault>
      <HasEmbeddedReports>false</HasEmbeddedReports>
      <LongName>All Reports</LongName>
      <ReportType>Book</ReportType>
      <ShortName>All Reports</ShortName>
    </Report>
  </MyReports>
  <InputFiles>
    <File doctype="DEF 14A" isProxy="true" isUsgaap="true" original="ef20068658_def14a.htm">ef20068658_def14a.htm</File>
    <File>fmcb-20260511.xsd</File>
    <File>fmcb-20260511_lab.xml</File>
    <File>fmcb-20260511_pre.xml</File>
  </InputFiles>
  <SupplementalFiles>
    <File>image00001.jpg</File>
    <File>image00002.jpg</File>
    <File>image00003.jpg</File>
    <File>image00004.jpg</File>
    <File>image00005.jpg</File>
    <File>image00006.jpg</File>
    <File>image00007.jpg</File>
    <File>image00008.jpg</File>
    <File>image00009.jpg</File>
    <File>image00010.jpg</File>
  </SupplementalFiles>
  <BaseTaxonomies>
    <BaseTaxonomy items="5">http://fasb.org/us-gaap/2025</BaseTaxonomy>
    <BaseTaxonomy items="4">http://xbrl.sec.gov/dei/2025</BaseTaxonomy>
    <BaseTaxonomy items="59">http://xbrl.sec.gov/ecd/2025</BaseTaxonomy>
  </BaseTaxonomies>
  <HasPresentationLinkbase>true</HasPresentationLinkbase>
  <HasCalculationLinkbase>false</HasCalculationLinkbase>
</FilingSummary>
