
559 N.W.2d 846 (1997)
1997 ND 36
NODAK MUTUAL INSURANCE COMPANY, Plaintiff and Appellee,
v.
Maurus HEIM, Alan Heim and Corey Heim, Defendants and Appellants.
Civil No. 960187.
Supreme Court of North Dakota.
February 27, 1997.
*847 Duane Ilvedson (argued), of Nilles, Hansen & Davies, Ltd., Fargo, and William M. Hart (on brief) and Randy A. Sharbono (on brief), of Meagher & Geer, Minneapolis, MN, for plaintiff and appellee. Appearance by Paul Traynor of Nodak Mutual, Fargo.
Jon R. Brakke, of Vogel, Kelly, Knutson, Weir, Bye & Hunke, Ltd., Fargo, for defendant and appellant Maurus Heim.
Robert Snyder (no appearance), of Snyder Coles Lawyers, Bismarck, for defendants and appellants Alan Heim and Corey Heim.
VANDE WALLE, Chief Justice.
[¶ 1] Maurus Heim appealed from a summary judgment declaring Nodak Mutual Insurance Company had no duty to defend or indemnify him in an underlying lawsuit brought by his nephews, Alan and Corey Heim. We hold Nodak's insurance policies and public policy preclude coverage for Maurus's continuous pattern of intentional molestation of his nephews. We affirm.
*848 [¶ 2] In February 1994 the State charged Maurus with two counts of gross sexual imposition for sexual contact with Alan and Corey when they were less than 15 years old and two counts of sexual assault for sexual contact with them when they were older than 15. See N.D.C.C. §§ 12.1-20-03 and 12.1-20-07.
[¶ 3] In a deposition for the criminal action, Alan testified to seven different instances in which Maurus engaged in sexual contact with him. According to Alan, on each occasion Maurus entered a bedroom after Alan was in bed and fondled his genitals. Corey also testified by deposition in the criminal action that Maurus engaged in two different instances of sexual contact with him. According to Corey, on each occasion Maurus entered a bedroom after Corey was in bed and fondled his genitals.
[¶ 4] Corey also testified:
"Q. You discussed the fact that there were some other times when you were touched over the clothing by Maurus?
"A. Yes.
"Q. About how many times did that happen?
"A. I would have to50 plus.
"Q. And you talked about it being in the pickup. Were there other places where that happened?
"A. It happened in the yard of his farm, in the shop, the machine shop.
* * * * * *
"Q. I want to make sure we have clarified what it was he was doing. You talked about that the contact wasn't as long as it was during these other two incidents you talked about. Is that right?
"A. Right.
"Q. Was he touchingtell me what part of your body he was touching when he did that.
"A. The penis. And testicles.
"Q. Would he say anything to you when he was doing that?
"A. When it happened in the vehicle it was when he would go to shift for a gear and he'dhe would say, `I grabbed the wrong stick.'
* * * * * *
"Q. Do you have any estimate of the amount of seconds or minutes that that type of conduct lasted on any of those occasions?
"A. I would have to say three to five seconds. To the best of my knowledge that's what they were."
[¶ 5] Maurus pled guilty to one count of gross sexual imposition and two counts of sexual assault. At his sentencing, Maurus admitted he had had sexual contact with his nephews by fondling their genitals directly and through their clothing.
[¶ 6] In August 1994 Corey and Alan sued Maurus for assault and battery, intentional infliction of emotional distress, negligent infliction of emotional distress, and invasion of privacy. For each claim, Corey and Alan sought damages sustained as a result of Maurus's "wrongful actions" and "sexual abuse," which they alleged consisted of "fondling [their] genitals" and other "frequent inappropriate touching."
[¶ 7] Nodak insured Maurus under a Farm and Ranch Policy and a Bonanza Umbrella Policy. Nodak brought this declaratory judgment action seeking a determination that, under those insurance policies, Nodak had no duty to defend or indemnify Maurus for his nephews' claims. The trial court granted summary judgment for Nodak, concluding the nephews' claims all were for intentional sexual abuse by Maurus although framed as different causes of action. The court ruled that public policy and the insurance policies precluded coverage for those claims and held Nodak had no duty to defend or to indemnify Maurus.
[¶ 8] We review this case under the summary judgment standards of N.D.R.Civ.P. 56. Summary judgment is a procedure for deciding an action without a trial if, after viewing the evidence in the light most favorable to the party opposing the motion and giving that party the benefit of all favorable inferences which can reasonably be drawn from the evidence, there is no genuine dispute as to either the material facts or the inferences to be drawn from the undisputed facts, or if only a question of law is involved. Northwest G.F. Mut. Ins. Co. v. Norgard, 518 N.W.2d 179 (N.D.1994).
*849 [¶ 9] Maurus asserts the trial court erred in deciding this declaratory judgment action. He argues Nodak's action was premature, because there are factual disputes about whether his nephews' underlying claims are based solely on intentional sexual misconduct. His argument misconstrues the requirements for assessing an insurer's duty to defend in the context of a declaratory judgment action.
[¶ 10] Section 32-23-06, N.D.C.C., says a "court shall render ... a declaratory judgment... in an action brought by or against an insurance company to determine liability of the insurance company to the insured to defend, or duty to defend, although the insured's liability for the loss may not have been determined." In Blackburn, Nickels & Smith, Inc. v. National Farmers Union Property & Cas. Co., 452 N.W.2d 319 (N.D. 1990), we construed that language to require a court to render a declaratory judgment on both coverage and duty to defend, even if the insured's underlying liability has not been decided.
[¶ 11] Ordinarily, an insurer has a duty to defend an underlying action against its insured if the allegations in the complaint give rise to potential liability or a possibility of coverage under the insurance policy. National Farmers Union Property & Cas. Co. v. Kovash, 452 N.W.2d 307 (N.D.1990); Applegren v. Milbank Mut. Ins. Co., 268 N.W.2d 114 (N.D.1978); Kyllo v. Northland Chem. Co., 209 N.W.2d 629 (N.D.1973). Any doubt about whether a duty to defend exists is resolved in favor of the insured. Hart Const. Co. v. American Family Mut. Ins. Co., 514 N.W.2d 384 (N.D.1994). When several claims are made against the insured, the insurer has a duty to defend the entire lawsuit if there is potential liability or a possibility of coverage for one of the claims. Rolette Cty. v. Western Cas. & Sur. Co., 452 F.Supp. 125 (D.C.N.D.1978); Horace Mann Ins. Co. v. Barbara B., 4 Cal.4th 1076, 17 Cal.Rptr.2d 210, 846 P.2d 792 (1993). In that framework, the issue is not the timing of the declaratory judgment action. Rather, the issue is whether the nephews' claims give rise to potential liability or a possibility of coverage under the insurance policies.
[¶ 12] We thus consider the language of Nodak's insurance policies with Maurus. In Norgard, 518 N.W.2d at 181 (citations omitted), we outlined our framework for construing insurance policies:
"The interpretation of an insurance policy is a question of law, fully reviewable on appeal.... Our goal when interpreting insurance policies, as when construing other contracts, is to give effect to the mutual intention of the parties as it existed at the time of contracting.... Generally, we attempt to ascertain the intent of the parties through the language of the contract itself.... To the extent practicable, we give effect to every provision of the contract.... Unambiguous language will be given its clear meaning ...; we will not rewrite a contract to impose liability on an insurer if the policy unambiguously precludes coverage....
"We regard insurance policies as adhesion contracts, ... and therefore, in applying the rules to resolve ambiguities, we balance the equities against the insurer, i.e., in favor of providing coverage to the insured.... Furthermore, if the rules for interpreting a written contract do not remove uncertainty, the language of the contract is to be construed most strongly against the party who drafted the contract.... The determination of whether a contract is ambiguous is a question of law.... Contract language is ambiguous if it can be reasonably construed as having at least two alternative meanings.... We consider whether a person not trained in the law or in the insurance business can clearly understand the language."
[¶ 13] Maurus contends the trial court erred in concluding Nodak did not have a duty to defend or to indemnify him under its umbrella policy, which provides:
"The company will indemnify the insured for ultimate net loss in excess of the applicable underlying or retained limit hereinafter stated which the insured may sustain by reason of liability imposed upon the insured by law for damages because of
"(a) Personal Injury
"(b) Property Damage. Caused by or arising out of an occurrence happening anywhere in the world."
*850 The umbrella policy does not specifically exclude coverage for intentional acts by the insured, and, instead, defines "occurrence" as "an accident ... which results in personal injury or property damage neither expected nor intended from the standpoint of the insured."
[¶ 14] Maurus argues that, when construed in favor of the insured and against the insurer, the term "occurrence" modifies "property damage," but does not modify "personal injury."[1] Maurus thus contends Nodak's umbrella policy provides coverage for "personal injury" resulting from intentional acts by the insured.
[¶ 15] We construe insurance contracts as a whole to give meaning and effect to each clause, if possible. Kief Farmers Coop. Elevator Co. v. Farmland Mut. Ins. Co., 534 N.W.2d 28 (N.D.1995); Norgard; N.D.C.C. § 9-07-06. If there is a conflict between the provisions of an insurance policy and an endorsement, the endorsement prevails. Johnson v. Center Mut. Ins. Co., 529 N.W.2d 568 (N.D.1995).
[¶ 16] An endorsement to the umbrella policy provides coverage for "personal injury or property damage"[2] but specifically excludes coverage for "any act committed by or at the direction of the insured with intent to cause personal injury."
[¶ 17] When construed as a whole to give meaning to each phrase and clause, Nodak's umbrella policy and the endorsement manifest an intent to exclude coverage for intentional acts by the insured. The endorsement, which controls if there is any uncertainty between the policy and the endorsement, clearly excludes coverage for acts done by the "insured with intent to cause personal injury." We hold Nodak's umbrella policy, when read as a whole, excludes coverage for intentional acts by the insured.
[¶ 18] Maurus also asserts Nodak's farm policy provides coverage for his intentional acts.
[¶ 19] Section II of Nodak's farm policy provides coverage for "bodily injury or property damage ... caused by an occurrence." Contrary to the umbrella policy, the definition of occurrence in the farm policy does not specifically exclude coverage for acts intended by the insured.[3] However, Section II of the farm policy includes a specific exclusion which says the policy does not apply to "bodily injury" or "property damage" intended by the insured. An endorsement to the farm policy extends Section II coverage to "personal injury,"[4] and says the exclusions from Section II do not apply to that "personal injury" coverage. Instead, the personal-injury endorsement lists its own exclusions, including "injury caused by a violation of a penal law or ordinance committed by or with the knowledge or consent of any insured."
[¶ 20] Nodak's farm policy has different exclusions from coverage for "personal injury" and for "bodily injury." At a minimum, *851 Nodak's farm policy and endorsement expressly exclude coverage for "personal injury" caused by a violation of penal laws by the insured and for "bodily injury" intended by the insured.
[¶ 21] Any uncertainty about the precise scope of coverage and those exclusions is clarified by our public policy precluding insurance coverage for acts intended by an insured. See N.D.C.C. §§ 9-08-02 and 26.1-32-04. Those statutes manifest a public policy precluding an insured from being indemnified for losses caused by the insured's intentional or willful conduct. Continental Cas. Co. v. Kinsey, 499 N.W.2d 574 (N.D.1993); Hins v. Heer, 259 N.W.2d 38 (N.D.1977); Haser v. Maryland Cas. Co., 78 N.D. 893, 53 N.W.2d 508 (1952).
[¶ 22] In Haser this court held any insurance contract to indemnify the insured, a cab driver, for the consequences of his rape of a passenger in the taxicab was against public policy. In Hins this court said the predecessor to N.D.C.C. § 26.1-32-04 prohibited indemnification for loss caused by an insured's willful acts of assault and battery.
[¶ 23] In Kinsey we considered whether public policy under N.D.C.C. §§ 9-08-02 and 26.1-32-04 exempted an insurer from complying with its express contractual promise to pay punitive damages awarded against the insured. We held the insurer was obligated, under the express terms of its insurance policy, to pay punitive damages awarded against the insured, but the insurer could seek indemnity from the insured, who was prohibited by those statutes from being either indemnified or exonerated for injury caused by the insured's own fraud or deceit.
[¶ 24] Here, Nodak's farm policy does not expressly provide coverage for intentional acts by the insured. Compare Kinsey (insurer's express contractual promise to pay punitive damages). We construe Nodak's farm policy in light of the public policy expressed in N.D.C.C. §§ 9-08-02 and 26.1-32-04. See Hughes v. State Farm Mut. Auto. Ins. Co., 236 N.W.2d 870 (N.D.1975) [statutory minimum coverage requirements express State's public policy and are deemed implicit in every automobile or motor vehicle liability insurance policy issued in State]. We hold Nodak's farm policy excludes coverage for intentional acts by the insured.
[¶ 25] Maurus nevertheless contends some of the acts alleged in his nephews' underlying complaint do not involve intentional acts and, instead, involve negligent or accidental touching which is covered by Nodak's insurance policies and is not precluded from coverage by public policy.
[¶ 26] It is well established an insured's sexual molestation of a child is precluded from coverage under public policy and intentional-act exclusions of insurance policies. E.g., J.C. Penney Cas. Ins. Co. v. M.K., 52 Cal.3d 1009, 278 Cal.Rptr. 64, 804 P.2d 689 , cert. denied, 502 U.S. 902, 112 S.Ct. 280, 116 L.Ed.2d 232 (1991); Auto-Owners Ins. Co. v. Brubaker, 93 Ohio App.3d 211, 638 N.E.2d 124 (1994); American Family Mut. Ins. Co. v. Purdy, 483 N.W.2d 197 (S.D.), cert. denied, 506 U.S. 870, 113 S.Ct. 202, 121 L.Ed.2d 144 (1992). The essence of a child molestation case is the gratification of sexual desire, and an intent to harm is inferred from the act. Penney; Brubaker; Purdy.
[¶ 27] Maurus concedes there is no coverage for his criminal acts of sexual molestation, but argues his nephews' complaint alleges other inadvertent and negligent touchings. In his affidavit, Maurus averred
"that these touchings were far fewer and of a different nature than claimed by Corey Heim and that there was no sexual motive behind the same. Your affiant would joke with Corey and Alan and might occasionally touch them on the knee or the leg. If there was any brief, through the clothing touching of the genitals, this was accidental and your affiant never wished to harm or injure Corey or Alan."
Maurus argues Nodak's insurance policies cover those inadvertent and negligent touchings.
[¶ 28] In Barbara B., the California Supreme Court considered a similar issue. In that case, a teacher, the insured under an educator's liability policy, pled nolo contendre to criminal charges arising out of the molestation of a student. The student and her parents sued the teacher, alleging intentional and negligent conduct by the teacher. *852 The teacher's insurer sought a determination of its duty to defend or indemnify the teacher, and the trial court ruled the insurer had no duty to defend the teacher.
[¶ 29] The California Supreme Court reversed, concluding there were unresolved factual disputes about the teacher's conduct apart from his criminal molestation of the student, and because of those disputes, there was potential liability under the insurance policy. The court said the student's complaint evinced a possibility of liability for negligent nonsexual conduct and said "neither precedent nor logic dictates that a molester cannot also be liable for torts of negligence against the victim [of molestation] which are apart from, and not integral to, the molestation." Barbara B., 17 Cal.Rptr.2d 210, 846 P.2d at 797. The court recognized the record was devoid of evidence showing the teacher's "acts of public embarrassment of [the student] occurred in such close temporal and spatial proximity to the molestation as to compel the conclusion that they are inseparable from it for purposes of determining whether [the insurer] owed a duty to defend" the insured. Id. (Emphasis in original).
[¶ 30] The import of Barbara B. is if an insured's alleged negligent acts are inseparably linked and a continuous part of the insured's intentional molestation, the insurer has no duty to defend the insured for any of the intertwined acts. To the extent Barbara B. may be read to hold an insurer has a duty to defend an insured's alleged negligent acts that are intertwined with the insured's continuing pattern of intentional molestation, we decline to follow that decision. Instead, we agree with the well-reasoned dissent that "the facts must be viewed in their entirety, not antiseptically separated and microscopically examined." Barbara B., 17 Cal.Rptr.2d 210, 846 P.2d at 803 (Arabian, J., dissenting). We believe logic dictates that if an insured's alleged negligent acts are inextricably linked with a continuous pattern of intentional molestation, an intent to harm is inferred from the insured's alleged negligent acts. We do not hold an insurer never has a duty to defend an insured for totally separate torts allegedly committed against victims of the insured's previous or contemporaneous intentional molestation. If, however, the insured's alleged negligent acts represent a continuing pattern and are inextricably linked with the intentional molestation, we hold the insurer has no duty to defend against those allegations.
[¶ 31] This record discloses the allegations of "inadvertent" and "negligent" touching and the intentional molestation in this case represent a continuous pattern of inextricably linked misconduct. In our view, no reasonable person could conclude Maurus's conduct, consisting of more than fifty claimed inadvertent or negligent touchings all directed towards his nephews' genitals, was not a continuing pattern of sexual misconduct. Compare D.E.M. v. Allickson, 555 N.W.2d 596 (N.D.1996) [insurer estopped from raising insufficiency of notice of bodily injury claim in action for pastor's alleged sexual exploitation of member of church]; Barbara B. [alleged public embarrassment in front of other students, consisting of allowing student to sit on lap, kissing, hugging, and putting arm around, affected different interest than sexual molestation of student]. Relabeling Maurus's conduct as inadvertent or negligent does not alter its true nature, nor withstand informed scrutiny. Although framed in terms of negligent infliction of emotional distress and invasion of privacy, the duty to defend does not depend on the nomenclature of the claim. Rather, the focus is on the basis for the injury. Norgard; National Union Fire Ins. Co. v. Gates, 530 N.W.2d 223 (Minn.Ct.App.1995).
[¶ 32] We conclude the alleged inadvertent or negligent acts by Maurus are a continuous pattern of conduct which are inextricably linked with his intentional molestation, and his intent to harm therefore may be inferred from his conduct. We hold the trial court did not err in concluding Nodak had no duty to defend or indemnify Maurus in the underlying action by his nephews.
[¶ 33] Maurus also contends the trial court erred in denying his request for attorney fees from Nodak for this declaratory judgment action. Because Nodak has no duty to defend or indemnify Maurus, we hold he is *853 not entitled to attorney fees for this action. See State Farm Mut. Auto. Ins. Co. v. Estate of Gabel, 539 N.W.2d 290 (N.D.1995). State Farm Fire & Cas. Co. v. Sigman, 508 N.W.2d 323 (N.D.1993).
[¶ 34] We affirm the district court judgment.
[¶ 35] SANDSTROM, NEUMANN, MARING and MESCHKE, JJ., concur.
NOTES
[1]  The umbrella policy defined "personal injury" to mean

"(1) bodily injury, sickness, disease, disability or shock, including death at anytime arising therefrom, and, if arising out of the foregoing, mental anguish and mental injury; (2) false arrest, false imprisonment, wrongful eviction, wrongful entry, wrongful detention, or malicious prosecution; (3) libel, slander, defamation of character, humiliation, or invasion of the rights of privacy, unless arising out of advertising activities; ... which occurs during the policy period."
[2]  The endorsement defined "personal injury" to mean

"(1) bodily injury, sickness, disease, disability, shock, mental anguish and mental injury;
"(2) false arrest, false imprisonment, wrongful eviction, wrongful detention, malicious prosecution or humiliation.
"(3) libel, slander, defamation of character or invasion of rights of privacy; and
"(4) assault and battery not committed by or at the direction of the insured...."
[3]  The farm policy defines occurrence to mean "an accident ... which results ... in bodily injury or property damage."
[4]  The endorsement defined "personal injury" to mean:

"injury arising out of one or more of the following offenses:
"1. false arrest, detention or imprisonment, or malicious prosecution;
"2. libel, slander or defamation of character; or
"3. invasion of privacy, wrongful eviction or wrongful entry."
