<?xml version="1.0" encoding="utf-8"?>
<xbrl
  xmlns="http://www.xbrl.org/2003/instance"
  xmlns:dei="http://xbrl.sec.gov/dei/2025"
  xmlns:link="http://www.xbrl.org/2003/linkbase"
  xmlns:xlink="http://www.w3.org/1999/xlink">
    <link:schemaRef xlink:href="cffi-20260423.xsd" xlink:type="simple"/>
    <context id="Duration_4_23_2026_To_4_23_2026_8VcUfMSoCkC6sFRNHF0Tzw">
        <entity>
            <identifier scheme="http://www.sec.gov/CIK">0000913341</identifier>
        </entity>
        <period>
            <startDate>2026-04-23</startDate>
            <endDate>2026-04-23</endDate>
        </period>
    </context>
    <dei:EntityCentralIndexKey
      contextRef="Duration_4_23_2026_To_4_23_2026_8VcUfMSoCkC6sFRNHF0Tzw"
      id="Tc_rsV3NqxCUUWMm9HoVzP2qQ_2_1">0000913341</dei:EntityCentralIndexKey>
    <dei:AmendmentFlag
      contextRef="Duration_4_23_2026_To_4_23_2026_8VcUfMSoCkC6sFRNHF0Tzw"
      id="Tc_wXpGbTiGEESANejfN8wrIg_3_1">false</dei:AmendmentFlag>
    <dei:EntityRegistrantName
      contextRef="Duration_4_23_2026_To_4_23_2026_8VcUfMSoCkC6sFRNHF0Tzw"
      id="Hidden_RGeTdWVJckCnF8C0IBiOYw">C &amp; F FINANCIAL CORPORATION</dei:EntityRegistrantName>
    <dei:DocumentType
      contextRef="Duration_4_23_2026_To_4_23_2026_8VcUfMSoCkC6sFRNHF0Tzw"
      id="Narr_E72PVBTXH0Cxz9krdm-XbA">8-K</dei:DocumentType>
    <dei:DocumentPeriodEndDate
      contextRef="Duration_4_23_2026_To_4_23_2026_8VcUfMSoCkC6sFRNHF0Tzw"
      id="Narr_zeJs9lkKs0KF5BuOSH9eww">2026-04-23</dei:DocumentPeriodEndDate>
    <dei:EntityIncorporationStateCountryCode
      contextRef="Duration_4_23_2026_To_4_23_2026_8VcUfMSoCkC6sFRNHF0Tzw"
      id="Tc_Fef7DesZiUy1DAil0JPqBg_1_0">VA</dei:EntityIncorporationStateCountryCode>
    <dei:EntityFileNumber
      contextRef="Duration_4_23_2026_To_4_23_2026_8VcUfMSoCkC6sFRNHF0Tzw"
      id="Tc_te41wZW5SkaEbAQOPL1lOg_1_2">000-23423</dei:EntityFileNumber>
    <dei:EntityTaxIdentificationNumber
      contextRef="Duration_4_23_2026_To_4_23_2026_8VcUfMSoCkC6sFRNHF0Tzw"
      id="Tc_PjhWmDasxU2ePUnTkMUGpQ_1_4">54-1680165</dei:EntityTaxIdentificationNumber>
    <dei:EntityAddressAddressLine1
      contextRef="Duration_4_23_2026_To_4_23_2026_8VcUfMSoCkC6sFRNHF0Tzw"
      id="Narr_BIzDTIh61ke_uaJo5m8C7Q">3600 La Grange Parkway</dei:EntityAddressAddressLine1>
    <dei:EntityAddressCityOrTown
      contextRef="Duration_4_23_2026_To_4_23_2026_8VcUfMSoCkC6sFRNHF0Tzw"
      id="Narr_M-1DHl9zWk6kbfjVSeN93Q">Toano</dei:EntityAddressCityOrTown>
    <dei:EntityAddressStateOrProvince
      contextRef="Duration_4_23_2026_To_4_23_2026_8VcUfMSoCkC6sFRNHF0Tzw"
      id="Narr_yaO_DKwPTUKRFYN2uPXy1A">VA</dei:EntityAddressStateOrProvince>
    <dei:EntityAddressPostalZipCode
      contextRef="Duration_4_23_2026_To_4_23_2026_8VcUfMSoCkC6sFRNHF0Tzw"
      id="Tc_V4E16kJzcUaK-Hk4JcWFRQ_1_2">23168</dei:EntityAddressPostalZipCode>
    <dei:CityAreaCode
      contextRef="Duration_4_23_2026_To_4_23_2026_8VcUfMSoCkC6sFRNHF0Tzw"
      id="Narr_l-Oq4wV6OkCeTTNtlE6lvg">804</dei:CityAreaCode>
    <dei:LocalPhoneNumber
      contextRef="Duration_4_23_2026_To_4_23_2026_8VcUfMSoCkC6sFRNHF0Tzw"
      id="Narr_mibkMPzK7kuxQzgmbVMNUQ">843-2360</dei:LocalPhoneNumber>
    <dei:WrittenCommunications
      contextRef="Duration_4_23_2026_To_4_23_2026_8VcUfMSoCkC6sFRNHF0Tzw"
      id="Narr_D8Z4ndClZ0W4hXNm2buYYg">false</dei:WrittenCommunications>
    <dei:SolicitingMaterial
      contextRef="Duration_4_23_2026_To_4_23_2026_8VcUfMSoCkC6sFRNHF0Tzw"
      id="Narr_ipkLhNcZXEafzgMUtk_wig">false</dei:SolicitingMaterial>
    <dei:PreCommencementTenderOffer
      contextRef="Duration_4_23_2026_To_4_23_2026_8VcUfMSoCkC6sFRNHF0Tzw"
      id="Narr_RdEonNE0w0mS0yWs555LZw">false</dei:PreCommencementTenderOffer>
    <dei:PreCommencementIssuerTenderOffer
      contextRef="Duration_4_23_2026_To_4_23_2026_8VcUfMSoCkC6sFRNHF0Tzw"
      id="Narr_Q3YpCNkQT0-Qi0VuOO-GTA">false</dei:PreCommencementIssuerTenderOffer>
    <dei:Security12bTitle
      contextRef="Duration_4_23_2026_To_4_23_2026_8VcUfMSoCkC6sFRNHF0Tzw"
      id="Tc_YfGCIqCFHESsS4i3I-YBHg_2_0">Common Stock, $1.00 par value per share</dei:Security12bTitle>
    <dei:TradingSymbol
      contextRef="Duration_4_23_2026_To_4_23_2026_8VcUfMSoCkC6sFRNHF0Tzw"
      id="Tc_ZM6is4bHxE2Hysp2KXQlIg_2_1">CFFI</dei:TradingSymbol>
    <dei:SecurityExchangeName
      contextRef="Duration_4_23_2026_To_4_23_2026_8VcUfMSoCkC6sFRNHF0Tzw"
      id="Tc_xIQLz3BBzUulPywf365Jmw_2_2">NASDAQ</dei:SecurityExchangeName>
    <dei:EntityEmergingGrowthCompany
      contextRef="Duration_4_23_2026_To_4_23_2026_8VcUfMSoCkC6sFRNHF0Tzw"
      id="Tc_6sBltpXw5kWofeO_FGhx_A_1_1">false</dei:EntityEmergingGrowthCompany>
</xbrl>