/* eslint-disable */
// Articles page

// ── Set this to your JSONBin Bin ID after admin setup ──────────
const JSONBIN_BIN_ID = "";
// ───────────────────────────────────────────────────────────────

const articlesData = [
  // ESTATE PLANNING
  {
    id: "estate-1",
    category: "Estate Planning",
    image: "photo-1450101499163-c8848c66ca85",
    title: "What a Will Cannot Do: The Limits of Simple Estate Planning",
    date: "May 2026",
    excerpt: "Most people assume that having a will means their affairs are in order. It is an understandable assumption, and a costly one. A will controls far less than most people realize.",
    pullQuote: "A will only governs assets titled in your name alone. That leaves out a significant portion of most people's wealth.",
    takeaways: [
      "A will does not govern retirement accounts, life insurance, or jointly-held assets — those pass by beneficiary designation regardless of what your will says.",
      "A will does nothing to protect you during incapacity. Durable powers of attorney and healthcare directives serve that function.",
      "In Pennsylvania, assets that pass through a will must go through the Register of Wills before distribution — a public, time-consuming process.",
      "A properly structured trust can avoid probate entirely and provide protections a will cannot.",
      "Estate planning is not a single document. It is a coordinated set of instruments, each addressing a distinct gap."
    ],
    body: [
      "Most people assume that having a will means their affairs are in order. It is an understandable assumption, and a costly one.",
      "A will is a powerful instrument. It names who receives your property, designates an executor to administer your estate, and can appoint a guardian for minor children. But it controls far less than most people think, and the gaps it leaves are often discovered at the worst possible moment.",
      "A will only governs assets titled in your name alone with no beneficiary designation attached. That leaves out a significant portion of most people's wealth. Retirement accounts — including 401(k)s and IRAs — pass directly to the named beneficiary on the account, regardless of what your will says. The same is true of life insurance policies. Jointly-held real estate transfers automatically to the surviving co-owner by operation of law. Payable-on-death bank accounts go directly to whoever is named on the account form. If those designations are outdated or inconsistently named, your will cannot correct them.",
      "Consider what this means in practice. A client who named a former spouse as beneficiary on a 401(k) twenty years ago and never updated that designation will have that account pass to the former spouse, not to the children named in the will, regardless of how the will is written. Courts have consistently upheld these outcomes, and they cannot be undone after the fact.",
      "A will also does nothing to address incapacity. If you suffer a stroke, a serious illness, or any condition that leaves you unable to manage your own affairs, your will is irrelevant because a will only speaks at death. A durable power of attorney — which authorizes a trusted person to handle financial and legal matters on your behalf — and an advance healthcare directive — which documents your medical wishes and names someone to make healthcare decisions — are what protect you while you are alive but cannot act. Without these documents, even a spouse has no automatic legal authority to act on your behalf in many situations.",
      "And a will does not avoid probate. Every asset that passes through a Pennsylvania will must go through the Register of Wills before your beneficiaries receive anything. Probate requires filing a petition, paying court fees, publishing notice to creditors, and waiting through the administration period before assets can be distributed. It is a public process, meaning anyone can review what you owned and who received it. In contested estates, it becomes the arena for disputes. A properly structured revocable trust, by contrast, distributes assets to beneficiaries privately and without court involvement.",
      "None of this means a will is unimportant. For most people, it is the essential starting point. But it is only a starting point. The families who avoid the most painful post-death complications are the ones whose estate plans include coordinated beneficiary designations, properly funded trusts where appropriate, and current powers of attorney and healthcare directives — all working together as a system rather than a single document working alone.",
      "Estate planning is not one document. It is a coordinated set of instruments, each addressing a different slice of your circumstances. A will is the foundation, but relying on it alone leaves real gaps that surface at the worst possible time."
    ]
  },
  {
    id: "estate-2",
    category: "Estate Planning",
    image: "photo-1554224155-6726b3ff858f",
    title: "Revocable vs. Irrevocable Trusts: Which Structure Fits Your Situation",
    date: "May 2026",
    excerpt: "The word 'trust' covers a wide range of legal instruments. The most important distinction is one that is often poorly explained: the difference between revocable and irrevocable, and what each actually does.",
    pullQuote: "Because you retain full control of a revocable trust, its assets are still considered yours for purposes of estate taxes, Medicaid eligibility, and creditor claims.",
    takeaways: [
      "A revocable living trust is fully controlled by you during your lifetime and can be amended or revoked at any time.",
      "Revocable trusts avoid probate and keep asset distribution private, but they do not provide asset protection.",
      "Irrevocable trusts remove assets from your taxable estate and can provide creditor protection, but require surrendering control.",
      "Medicaid asset protection trusts typically require assets to be transferred at least five years before applying for long-term care benefits.",
      "Most comprehensive estate plans use a combination of structures tailored to the client's specific goals, not a single off-the-shelf instrument."
    ],
    body: [
      "The word 'trust' covers a wide range of legal instruments, and the most important distinction is one that is often poorly explained: the difference between a revocable and an irrevocable trust.",
      "A revocable living trust is one you control entirely during your lifetime. You can amend it, revoke it, add and remove assets, and change beneficiaries at will. After death, it distributes assets to your beneficiaries without probate and without public disclosure. Because the trust avoids probate, there is no waiting period, no court filing, and no public inventory of what you owned. For most families, a revocable trust is the core planning instrument.",
      "What a revocable trust does not do is protect assets. Because you retain full control, the trust assets are still considered yours for purposes of estate taxes, Medicaid eligibility, and creditor claims. If you are sued and a judgment is entered against you, your creditors can reach assets in your revocable trust just as they could reach assets you hold outright. The revocability that makes this instrument flexible is also what limits its protective value.",
      "An irrevocable trust is a different instrument built around a different premise. Once established, you generally cannot change its terms or reclaim the assets transferred into it. That loss of control is the point. Assets in a properly structured irrevocable trust are no longer part of your taxable estate for federal estate tax purposes, are generally protected from future creditors once the applicable fraudulent transfer period has passed, and may not count toward Medicaid asset limits after the five-year look-back period has elapsed.",
      "For families with long-term care concerns, a Medicaid asset protection trust can be a critical planning tool. If assets are transferred into an irrevocable trust at least five years before the grantor applies for Medicaid, those assets are generally not counted for eligibility purposes. The five-year clock starts at the date of transfer, which is why this planning needs to happen well before a care crisis rather than in response to one.",
      "Irrevocable trusts also play an important role in estate tax planning for larger estates. The current federal estate tax exemption is substantial, but it is scheduled to be reduced significantly at the end of 2025 absent congressional action. For estates that may face exposure, irrevocable gift trusts, spousal lifetime access trusts, and similar structures allow significant wealth transfers while removing assets from the taxable estate.",
      "The tradeoffs are real. Irrevocable trusts require careful planning, proper funding, and ongoing administration. They are not appropriate for everyone, and the wrong structure executed poorly can create more problems than it solves. But for families with significant assets, specific long-term care concerns, or business interests to protect, they can accomplish things a revocable trust cannot.",
      "Most estate plans use some combination of both structures, or neither, depending on the client's specific circumstances. The right choice is not about which trust is better in the abstract. It is about which instrument, or combination of instruments, addresses the actual goals and risks in front of you."
    ]
  },
  {
    id: "estate-3",
    category: "Estate Planning",
    image: "photo-1505664194779-8beaceb93744",
    title: "Powers of Attorney in Pennsylvania: Why They Matter as Much as Your Will",
    date: "May 2026",
    excerpt: "An estate plan without a durable power of attorney has a gap at the most critical moment. Here is what the documents do, why they matter, and what happens without them.",
    pullQuote: "Without a durable power of attorney, no one has automatic legal authority to manage your affairs during incapacity — not your spouse, not your children.",
    takeaways: [
      "A durable power of attorney authorizes a trusted agent to manage your financial and legal affairs if you become incapacitated.",
      "In Pennsylvania, a POA must meet specific statutory requirements — including proper witnesses and notarization — to be valid.",
      "Without these documents in place, a court-supervised guardianship proceeding may be the only option, which is expensive, time-consuming, and public.",
      "A healthcare power of attorney and advance directive are separate instruments that address medical decisions, not financial ones.",
      "Online forms frequently fail Pennsylvania's statutory requirements. Documents prepared without legal review are often unenforceable when needed most."
    ],
    body: [
      "An estate plan without a durable power of attorney is a plan with a gap at the most critical moment.",
      "A power of attorney is a document that authorizes a person you trust — called your agent or attorney-in-fact — to act on your behalf in financial and legal matters. A durable power of attorney remains in effect if you become incapacitated. That distinction is everything. An ordinary power of attorney, by contrast, terminates automatically upon incapacity, which makes it useless for the very situation you are most likely to need it.",
      "Without a durable financial power of attorney in place, if you become unable to manage your own affairs due to illness, injury, or cognitive decline, no one has automatic legal authority to pay your bills, manage your investments, handle your real estate, or run your business. Not your spouse. Not your children. Not your closest family member. The only option is a court-supervised guardianship proceeding, which requires filing a petition, serving notice, scheduling hearings, and having a judge formally appoint a guardian. The process can take months, costs thousands of dollars in legal fees, and becomes a matter of public record.",
      "In Pennsylvania, a power of attorney must comply with specific statutory requirements to be valid. It must be signed before a notary and two witnesses, and must include required statutory notices that the principal and agent must acknowledge. The requirements exist to protect people from being coerced into signing over authority they do not intend to grant. Forms downloaded from the internet or prepared without legal review frequently fail to meet these requirements, and an improperly executed power of attorney is unenforceable precisely when it is most needed.",
      "The scope of the authority granted also requires careful thought. A broad power of attorney that gives an agent unlimited authority over all financial matters may be appropriate for a spouse in a long-term marriage. It may be far too broad for a more distant agent. On the other hand, a power of attorney that is too narrow may leave gaps that require court intervention to fill. The specific powers granted — including whether the agent can make gifts, change beneficiary designations, or engage in Medicaid planning — should be deliberate decisions, not defaults.",
      "Beyond the financial power of attorney, a healthcare power of attorney authorizes your agent to make medical decisions on your behalf when you cannot make them yourself. This includes decisions about treatment, surgery, hospitalization, and end-of-life care. A separate instrument, the advance directive or living will, documents your own wishes regarding life-sustaining treatment, artificial nutrition and hydration, and related matters. These documents work together: the advance directive states your preferences, and the healthcare power of attorney names someone to advocate for those preferences when you cannot do so yourself.",
      "Both the financial and healthcare documents should be reviewed periodically, particularly after major life changes such as marriage, divorce, the death of a named agent, or significant changes in your financial circumstances or health status. An agent who was the right choice ten years ago may no longer be the right choice today.",
      "The practical message is straightforward: if your estate plan addresses what happens when you die but not what happens while you are alive and incapacitated, it is not complete. These documents are among the most cost-effective legal instruments available, and they are invaluable at the moment they are needed."
    ]
  },
  // REAL ESTATE LAW
  {
    id: "realestate-1",
    category: "Real Estate Law",
    image: "photo-1560518883-ce09059eeffa",
    title: "What to Expect at a Real Estate Closing in Pennsylvania",
    date: "May 2026",
    excerpt: "For most buyers and sellers, the closing table is unfamiliar territory. Understanding what happens there, and what each document represents, makes the process significantly less stressful.",
    pullQuote: "Problems discovered at the closing table are far more difficult, and expensive, to resolve than problems caught beforehand. The best closings are ones where there are no surprises.",
    takeaways: [
      "In Pennsylvania, attorneys are not required at residential closings, but legal review before the closing date can prevent costly surprises.",
      "Buyers should review the closing disclosure at least three business days before closing and compare it carefully to the original loan estimate.",
      "Pennsylvania imposes a two percent realty transfer tax, typically split between buyer and seller unless otherwise negotiated.",
      "Title review should be completed well before the closing date — not at the closing table, where options are limited.",
      "Outstanding liens, open permits, easements, and judgment liens should be identified and resolved before closing, not discovered during it."
    ],
    body: [
      "For most buyers and sellers, the closing table is unfamiliar territory. Understanding what happens there, and what each document represents, makes the experience far less stressful.",
      "In Pennsylvania, attorneys are not required to be present at residential closings, but many buyers and sellers choose to bring one. The closing is typically held at the title company's office and involves the buyer, seller, and their respective representatives. Mortgage lenders usually coordinate by mail or send a settlement agent. The entire process typically takes one to two hours for a standard residential transaction, though more complex closings can run longer.",
      "At closing, the buyer will sign a substantial stack of documents: the mortgage note, the deed of trust or mortgage instrument securing the loan, the closing disclosure summarizing all costs and credits, and a series of affidavits and certifications required by the lender. The seller executes the deed transferring title and signs Pennsylvania transfer tax certifications. Pennsylvania imposes a realty transfer tax of two percent of the sale price, typically split equally between buyer and seller unless the contract of sale specifies a different allocation.",
      "Closing costs typically include title insurance premiums, recording fees charged by the county recorder of deeds, lender origination and processing fees, prepaid interest for the remaining days of the closing month, and property tax escrow deposits. Buyers should request an itemized closing disclosure at least three business days before the scheduled closing and review it carefully. Figures often change from the initial loan estimate, sometimes materially, and questions are better raised before the closing date than at the table.",
      "Before the closing takes place, a thorough title review should occur. This means examining the title commitment issued by the title company, checking for outstanding liens — including mortgage liens, judgment liens, and municipal claims — as well as easements, deed restrictions, open building permits, and any matters that could affect the buyer's clear ownership of the property. Problems discovered at the closing table are far more difficult, and expensive, to resolve than problems caught in advance.",
      "Open permits are a common and frequently overlooked issue. If a prior owner pulled a building permit for work that was never inspected or closed out, the municipality may require the current or new owner to complete the permit before allowing future work or transfers. In some municipalities, open permits must be resolved before recording the deed. A search for open permits should be part of every title review.",
      "Judgment liens are another area requiring attention. Any unsatisfied money judgment entered against the seller in the county where the property is located may attach to the property as a lien and must be paid or released before title can transfer clear. The closing agent will typically require that known judgments be satisfied at closing, but the buyer and their counsel should independently verify that the title commitment accounts for all recorded judgments.",
      "The best closings are ones where there are no surprises. That is not accidental. It is the product of preparation, early legal involvement, and careful review of the title work before — not at — the closing table."
    ]
  },
  {
    id: "realestate-2",
    category: "Real Estate Law",
    image: "photo-1582407947304-fd86f028f716",
    title: "Title Insurance in Pennsylvania: What It Covers and What Buyers Often Miss",
    date: "May 2026",
    excerpt: "Title insurance is one of the least understood closing costs and one of the most valuable protections a buyer can have. Here is what it does, what it does not, and why it matters.",
    pullQuote: "A title policy should be the last line of defense, not the first. The real protection is thorough legal review before the closing — the policy exists to catch what that review missed.",
    takeaways: [
      "A lender's title policy protects only the mortgage lender. It does not protect the buyer's equity. A separate owner's policy is required for that.",
      "Title insurance covers defects that occurred before the policy date — errors in the public record, forged deeds, undisclosed heirs, and improperly released liens.",
      "In Pennsylvania, the title premium is paid once at closing and covers the ownership period for the life of the property.",
      "Title insurance does not cover physical conditions on the property, zoning violations, code issues, or defects that arise after the policy date.",
      "Engaging counsel before closing — not just at it — is the most effective way to identify and resolve title issues before they become your problem."
    ],
    body: [
      "Title insurance is one of the least understood closing costs and one of the most valuable protections a buyer can have.",
      "A title insurance policy protects against defects in the chain of title: problems that occurred in the past and were not visible from a standard title search. These include errors in the public record such as miscoded legal descriptions or incorrectly recorded documents, forged deeds that conveyed title without the true owner's authorization, undisclosed heirs who may have a claim to the property that was not captured in a probate proceeding, improperly released liens that appear satisfied in the records but technically remain attached, and in some cases fraud by prior owners in the chain of title. If a covered claim arises, the title company is obligated to defend the insured's title and pay resulting losses up to the policy limit.",
      "There are two types of title insurance policies, and understanding the difference is essential. A lender's policy protects the mortgage lender's interest and is required as a condition of most financing. It insures only up to the outstanding loan balance and only for the benefit of the lender, not the buyer. If a title defect surfaces that renders the buyer's title uninsurable, the lender's policy protects the lender — not the buyer's equity in the property. An owner's policy, which is typically optional in Pennsylvania, protects the buyer's interest and covers the full purchase price. For most buyers, purchasing an owner's policy at closing is a straightforward decision.",
      "In Pennsylvania, the premium for both policies is paid once at closing as a single lump sum. Unlike homeowner's insurance, there is no annual renewal premium. The owner's policy covers the ownership period for the life of the insured's interest in the property, including inheritance or transfer to heirs in certain circumstances. Given the one-time cost and the duration of coverage, the owner's policy premium represents a reasonable investment for the protection it provides.",
      "What title insurance does not cover is equally important to understand. A title policy insures against defects that existed as of the policy date, not problems that arise afterward. It does not cover physical conditions on the property — structural defects, environmental contamination, or encroachments are typically outside the scope of coverage and are addressed by surveys and inspections rather than title insurance. It does not guarantee that the property complies with zoning regulations, building codes, or local ordinances. And it does not substitute for a boundary survey, which is the only reliable way to confirm that improvements are within the legal boundaries of the property and that there are no encroachments affecting the parcel.",
      "Title exceptions — matters excluded from coverage and listed in Schedule B of the title commitment — deserve careful attention. Standard exceptions often include matters that a survey would disclose, rights of parties in possession not shown by the public records, and specific recorded documents. Understanding what is and is not covered requires reading the actual commitment, not just accepting that title insurance exists.",
      "The most common misconception is that purchasing a title policy means the title has been thoroughly examined and cleared. That is not what title insurance does. It shifts the financial risk of undiscovered defects from the buyer to the title company, but it does not prevent defects from existing or from surfacing after closing. The real protection comes from the pre-closing title review conducted by counsel — the title policy exists to catch what that review missed.",
      "The best approach is to engage counsel early enough that a thorough review of the title commitment, open permits, judgment searches, and recorded encumbrances occurs before the closing date. A title policy should be the last line of defense, not the first."
    ]
  },
  {
    id: "realestate-3",
    category: "Real Estate Law",
    image: "photo-1564013799919-ab600027ffc6",
    title: "Key Landlord Obligations Under Pennsylvania Law",
    date: "May 2026",
    excerpt: "Owning rental property in Pennsylvania comes with a set of legal obligations that many landlords do not fully understand until a dispute arises. A practical overview of the baseline requirements.",
    pullQuote: "Self-help eviction is prohibited in Pennsylvania. Changing locks, removing a tenant's belongings, or shutting off utilities to force a tenant out exposes a landlord to significant civil liability.",
    takeaways: [
      "Pennsylvania landlords must maintain rental units in a habitable condition, including functional heat, plumbing, and electrical systems.",
      "Security deposits are capped at two months' rent for the first two years of tenancy and one month's rent thereafter — and must be held in a separate, interest-bearing account.",
      "Landlords have thirty days after move-out to return the deposit or provide a written itemized list of deductions. Failure to comply can result in forfeiting deductions and owing the tenant double the deposit.",
      "Entry into an occupied unit requires reasonable advance notice except in genuine emergencies. Repeated unannounced entry can give the tenant grounds to terminate the lease.",
      "Eviction requires a court filing. There is no lawful shortcut — self-help measures are prohibited and expose landlords to damages."
    ],
    body: [
      "Owning rental property in Pennsylvania comes with a set of legal obligations that many landlords do not fully understand until a dispute arises.",
      "Pennsylvania landlords are required to maintain rental units in a habitable condition throughout the tenancy. This means functioning heat, plumbing, electrical systems, and structural integrity. A unit that falls below the habitability standard gives tenants remedies under state law, including the right to withhold rent through a specific statutory escrow procedure, the right to repair and deduct under limited circumstances, and the right to terminate the lease and vacate. The implied warranty of habitability cannot be waived by lease provision — a tenant cannot contract away the right to a habitable unit.",
      "Security deposits are among the most heavily regulated aspects of the landlord-tenant relationship in Pennsylvania, and among the most common sources of litigation. For tenancies in their first two years, security deposits are capped at two months' rent. After the second year, the cap drops to one month's rent and the landlord must return any amount held above that ceiling within thirty days of the anniversary date, not just at the end of the tenancy. Deposits must be held in a separate escrow account, and for deposits exceeding one hundred dollars, in an insured interest-bearing account at a financial institution. The landlord must provide the tenant with written notice of the name of the institution and the account number.",
      "At the end of the tenancy, the landlord has thirty days from the date the tenant vacates and delivers possession to either return the entire deposit or provide the tenant with a written, itemized list of deductions along with the balance remaining. The itemization must be specific — general references to 'damages' without description are insufficient. Failure to comply with the thirty-day requirement has serious consequences: the landlord forfeits the right to retain any portion of the deposit and becomes liable to the tenant for double the amount wrongfully withheld.",
      "Entry into occupied rental units requires reasonable advance notice under Pennsylvania law, except in genuine emergencies such as fire, flood, or a situation threatening the safety of the occupants. Pennsylvania courts have generally treated twenty-four hours as a reasonable notice period in non-emergency situations, though leases may specify a different period. Repeated unannounced entries into a tenant's unit can constitute a breach of the implied covenant of quiet enjoyment and may give the tenant grounds to terminate the lease.",
      "The eviction process in Pennsylvania requires a court filing in every case, without exception. The process begins with proper written notice to the tenant — the required notice period varies depending on the reason for eviction and the type of tenancy — followed by filing a landlord-tenant complaint in the appropriate Magisterial District Court. The court will schedule a hearing, at which both parties have the right to appear. If a judgment is entered for the landlord, the tenant has ten days to vacate before the landlord can request a writ of possession authorizing the constable or sheriff to remove the tenant.",
      "Self-help eviction is prohibited. This means a landlord may not change the locks, remove or dispose of a tenant's belongings, shut off utilities, or take any other action designed to force a tenant out without going through the court process. Violations of this prohibition expose landlords to civil damages — in some cases significant — regardless of whether the tenant owed rent or was otherwise in breach of the lease.",
      "These are baseline requirements. Many municipalities in Pennsylvania impose additional obligations through local ordinances covering registration, licensing, periodic inspection, and habitability standards that go beyond the state baseline. Philadelphia, Pittsburgh, and many smaller municipalities have their own landlord-tenant codes. Understanding the full legal framework applicable to a specific property before problems arise is almost always less expensive than addressing them afterward."
    ]
  },
  // BUSINESS LAW
  {
    id: "business-1",
    category: "Business Law",
    image: "photo-1542744173-8e7e53415bb0",
    title: "LLC vs. S-Corp in Pennsylvania: Choosing the Right Structure for Your Business",
    date: "May 2026",
    excerpt: "Entity selection is one of the first and most consequential decisions a new business owner faces. For small businesses in Pennsylvania, the choice typically comes down to an LLC or an S-corporation.",
    pullQuote: "An S-corporation allows the owner to separate compensation into salary and distributions. Only the salary is subject to self-employment taxes — a distinction that can produce meaningful savings when the business is profitable.",
    takeaways: [
      "Both LLCs and S-corporations provide limited liability protection, separating personal assets from business debts and judgments.",
      "A single-member LLC is taxed as a disregarded entity by default; all net income is subject to self-employment tax.",
      "An S-corporation allows the owner-employee to take a reasonable salary (subject to payroll taxes) and distributions (not subject to self-employment taxes).",
      "S-corps require corporate formalities, payroll processing, and more complex recordkeeping than most LLCs.",
      "The optimal structure is fact-specific and should be decided in consultation with both a business attorney and a CPA before formation."
    ],
    body: [
      "Entity selection is one of the first and most consequential decisions a new business owner faces. For small businesses in Pennsylvania, the choice typically comes down to a limited liability company or an S-corporation, and the distinction matters more than most founders realize.",
      "Both structures provide limited liability protection, meaning owners are generally not personally responsible for business debts and legal judgments against the company. Without this protection, a judgment creditor could pursue the owner's personal assets — bank accounts, real estate, retirement savings — to satisfy a business debt. Forming any entity at all provides a critical layer of protection between the business and its owners, provided the entity is properly maintained and the owner does not personally guarantee business obligations.",
      "The differences lie primarily in taxation and administration. A single-member LLC is taxed as a disregarded entity by default: profits and losses pass through to the owner's personal tax return, and the owner pays self-employment tax — currently 15.3 percent — on all net income from the business, up to the Social Security wage base. A multi-member LLC is taxed as a partnership by default, with the same pass-through treatment. An LLC may also elect to be taxed as an S-corporation, which allows it to retain the simple operating structure of an LLC while accessing the tax treatment described below.",
      "An S-corporation, whether organized as a corporation or as an LLC with an S-election, allows the owner to separate compensation into two components: a salary paid to the owner-employee, and a distribution of remaining profits. Only the salary is subject to payroll taxes, including the employer and employee portions of Social Security and Medicare. Distributions are not subject to self-employment taxes. When the business generates meaningful profit above a reasonable salary, this structure can produce significant tax savings — in some cases several thousand dollars per year.",
      "The IRS requires that owner-employees of S-corporations receive reasonable compensation for services rendered. The agency scrutinizes S-corporations that pay no salary or unreasonably low salaries, and will reclassify distributions as wages if it concludes the compensation is unreasonable. What constitutes reasonable compensation depends on what someone in a similar role would earn in an arm's-length transaction, and this determination requires judgment rather than a fixed formula.",
      "The tradeoff is administrative complexity. S-corporations require payroll processing, quarterly employment tax filings, annual W-2s, and more rigorous corporate recordkeeping than most single-member LLCs. They also carry restrictions on ownership, including a limit of one hundred shareholders and restrictions on the types of entities and non-resident aliens that may hold shares. These restrictions are generally not relevant for small owner-operated businesses, but they become important if outside investment is ever contemplated.",
      "For many early-stage businesses and sole operators, forming an LLC and making an S-corporation tax election when the business becomes sufficiently profitable is the practical path. The LLC operating structure is flexible and simple; the S-election can be made when the numbers justify the administrative overhead. The exact threshold at which the tax savings outweigh the complexity depends on the specific facts and is a calculation that requires input from both a business attorney and an accountant.",
      "There is no universally correct answer. The right structure depends on the nature of the business, its ownership, its profitability, and its plans for the future. Decisions made at formation are reversible, but conversions can have tax consequences and are more complicated than getting it right the first time."
    ]
  },
  {
    id: "business-2",
    category: "Business Law",
    image: "photo-1507679799987-c73779587ccf",
    title: "Why Every LLC Needs an Operating Agreement, Even in Pennsylvania",
    date: "May 2026",
    excerpt: "Pennsylvania does not require an LLC to have an operating agreement. That leads many business owners to skip it. That is a mistake that tends to surface at the worst possible time.",
    pullQuote: "Without an operating agreement, your LLC is governed by Pennsylvania's default statutory provisions — written for the average business, not yours.",
    takeaways: [
      "Without an operating agreement, Pennsylvania's default LLC statute governs your company — including how profits are split and what happens when a member wants to exit.",
      "For single-member LLCs, an operating agreement reinforces the legal separation between owner and entity, supporting the liability shield.",
      "For multi-member LLCs, a written operating agreement is the primary document for resolving disputes about ownership, authority, and distributions.",
      "The agreement should address what happens when a member dies, becomes incapacitated, wants to sell, or simply stops showing up.",
      "The best time to draft an operating agreement is at formation, before any disputes arise and before members have developed competing expectations."
    ],
    body: [
      "Pennsylvania does not require an LLC to have an operating agreement. That fact leads many business owners to skip it, treating it as optional paperwork. It is not optional — the consequences of not having one surface at the worst possible time, usually when a dispute is already underway.",
      "Without an operating agreement, your LLC is governed by the default provisions of Pennsylvania's Limited Liability Company Law. Those defaults were written for the average business, not yours. They address how profits are split — equally among members, regardless of each member's actual capital contribution or work performed — how the company is managed, what happens when a member wants to withdraw, and what constitutes grounds for dissolution. If those defaults do not match the actual agreement between the members, you need a document that says so. In the absence of a written agreement, members in a dispute will often assert contradictory understandings of what was agreed, and courts are left to determine which version is credible.",
      "An operating agreement is the governing document of your company. A well-drafted agreement covers ownership percentages and how they were calculated, capital contributions already made and any future funding obligations, the voting rights of each member and what decisions require unanimous consent versus majority approval, how profits and losses are allocated and how and when distributions are made, the process for admitting new members, what happens when a member wants to sell their interest or must leave due to death, disability, or dissolution, and the process for selling the company or winding it down.",
      "The buy-sell provisions deserve particular attention. When a multi-member LLC has no written buy-sell arrangement, a departing member's interest creates a serious problem. In many cases, the remaining members do not want an outside party to acquire the departing member's interest, and the departing member may need or expect to be bought out at a fair price. Without documented procedures for valuing and transferring interests, these situations frequently result in litigation.",
      "For single-member LLCs, an operating agreement still serves an important purpose: it reinforces the legal separation between the owner and the entity. Courts evaluating whether to pierce the corporate veil and hold an individual personally responsible for entity debts look for evidence that the owner treated the business as a distinct legal entity — including whether it had governing documents. A single-member LLC with no operating agreement and commingled finances presents a more vulnerable liability posture than one with clear documentation and separate accounts.",
      "For multi-member LLCs, the operating agreement is even more critical. Partner disputes are common in closely held businesses. They arise from misaligned expectations about compensation, disagreements over strategic direction, unequal contributions of time or resources, and the ordinary friction of shared decision-making. A well-drafted operating agreement does not prevent disagreements — it provides the framework for resolving them without resort to litigation.",
      "The time to draft the operating agreement is at formation, before business disputes arise and before any member has invested significant time or capital in the venture. Partners in early-stage agreement are far more likely to make reasonable accommodations than partners in mid-dispute. The operating agreement should be treated as a founding document with the same importance as the articles of organization filed with the state."
    ]
  },
  {
    id: "business-3",
    category: "Business Law",
    image: "photo-1521791136064-7986c2920216",
    title: "Why Written Contracts Matter More Than You Think for Small Businesses",
    date: "May 2026",
    excerpt: "Many small business relationships begin with good faith and a handshake. Most of the time, they work out fine. The problem is not the deals that go well.",
    pullQuote: "A written contract serves two functions a verbal agreement cannot: it records the agreed terms in a form that cannot be misremembered, and it forces both sides to work through the details before performance begins.",
    takeaways: [
      "Verbal agreements are often enforceable, but proving their terms in court is unreliable, expensive, and rarely worth the result.",
      "A well-drafted contract must address scope, payment, timeline, intellectual property ownership, dispute resolution, and governing law.",
      "A master services agreement combined with per-project statements of work is the most efficient structure for businesses with ongoing client relationships.",
      "Boilerplate provisions are not decoration — scope, payment, and IP clauses each address a distinct category of commercial dispute.",
      "The cost of a well-drafted contract is a fraction of the cost of litigating without one."
    ],
    body: [
      "Many small business relationships begin with good faith and a handshake. Most of the time, they work out fine. The problem is not the deals that go well.",
      "A written contract serves two functions that a verbal agreement cannot. First, it records the agreed terms in a form that neither party can later misremember or recharacterize. Second, it forces both sides to work through the details of the deal before performance begins, which is far less expensive than working through them afterward in a dispute. A simple contract negotiation that surfaces a disagreement about scope — before work has started and money has changed hands — is an efficient use of everyone's time. The same disagreement surfacing six months into a project is expensive for everyone.",
      "Verbal agreements are not necessarily unenforceable. Under Pennsylvania law, a contract requires offer, acceptance, and consideration, and those elements can exist without a written document. But proving the terms of a verbal agreement when the parties later disagree requires testimony, which is inherently unreliable, contradicted by the other party, and evaluated by a judge or jury who must decide who is more credible. The outcomes of disputes over verbal contracts are notoriously unpredictable, which is one reason litigation over them is often more expensive than the underlying dispute warrants.",
      "A well-drafted commercial contract addresses, at minimum: the scope of work and what is specifically included and excluded; the payment terms, when each payment is due, and what triggers the obligation to pay; the timeline and what happens if either party causes delay; who owns any intellectual property created during performance; the process for raising and resolving disputes; and which state's law governs the agreement. Each of these provisions addresses a category of dispute that arises regularly in business relationships.",
      "Intellectual property ownership is frequently overlooked by small businesses until a dispute arises. Under federal copyright law, the creator of a work owns the copyright by default, even if they were paid to create it. If a business hires a freelance designer to create a logo, a developer to build a website, or a consultant to develop proprietary training materials, the freelancer owns the copyright unless the contract expressly provides otherwise through a work-for-hire clause or an assignment. Many businesses have discovered this principle only after a dispute made clear that the contractor, not the company, owned the core deliverable.",
      "For businesses that work with the same clients on multiple engagements, the most efficient contracting structure is typically a master services agreement establishing the baseline terms for the relationship combined with project-specific statements of work that describe the deliverables, timeline, and pricing for each individual engagement. This structure avoids re-negotiating fundamental terms on every project while preserving flexibility for project-specific details. The master agreement handles dispute resolution, intellectual property, confidentiality, and other provisions that should be consistent across all engagements; the statement of work handles what is unique to the specific project.",
      "Contracts do not need to be long to be effective. A clear, well-organized agreement of three pages is better than a vague document of ten. The goal is to make the agreement accurately reflect what both parties intend, address the scenarios most likely to arise, and provide clear guidance if something goes wrong. A contract that is hard to understand is almost as problematic as no contract at all.",
      "If a business relationship is worth entering, it is worth documenting. The cost of a well-drafted agreement at the outset is a small fraction of the cost of litigating a dispute over undocumented terms — and a fraction of the value of the relationship itself."
    ]
  },
  // CIVIL LITIGATION
  {
    id: "civil-1",
    category: "Civil Litigation",
    image: "assets/civil-courtroom.jpeg",
    title: "Before You Sue: What You Should Know About Civil Litigation in Pennsylvania",
    date: "May 2026",
    excerpt: "The decision to file a lawsuit is one that most people make with incomplete information. Understanding what litigation actually involves helps clients make better decisions, including whether to litigate at all.",
    pullQuote: "Trial is the exception, not the rule. The overwhelming majority of civil cases settle before reaching a courtroom, and settlement is not a concession of weakness.",
    takeaways: [
      "The statute of limitations for most contract claims in Pennsylvania is four years; for personal injury claims, two years. Missing these deadlines forfeits the right to sue.",
      "Pennsylvania has multiple court levels — the right venue depends on the amount in controversy and the nature of the claims.",
      "Discovery — the formal exchange of documents and testimony — takes months in even moderately complex cases and is often the most expensive phase of litigation.",
      "Most civil cases settle before trial. Knowing your settlement range before filing shapes every strategic decision in the case.",
      "Early legal consultation, before a dispute escalates to filed litigation, almost always produces better outcomes and lower total costs."
    ],
    body: [
      "The decision to file a lawsuit is one that most people make with incomplete information. Understanding what litigation actually involves helps clients make better decisions, including whether to litigate at all.",
      "Civil litigation in Pennsylvania begins with a complaint filed in the appropriate court. The choice of court depends on the amount in dispute and the nature of the claims. Matters under twelve thousand dollars are heard in Magisterial District Courts, which provide a relatively quick and informal process without attorneys required. Claims between twelve thousand and two hundred fifty thousand dollars are typically filed in the Court of Common Pleas, which also handles claims above that threshold. Federal court is available for certain categories of claims, including those involving federal law and disputes between citizens of different states when the amount in controversy exceeds seventy-five thousand dollars.",
      "After the complaint is filed and served, the defendant has an opportunity to respond, either by answering the complaint or filing preliminary objections challenging its legal sufficiency. If preliminary objections are filed, the court will rule on them before the case proceeds — a process that can add months before the substantive dispute is even reached. Assuming the case survives preliminary objections, the parties enter discovery.",
      "Discovery is the formal process of exchanging information. It includes interrogatories — written questions that each party must answer under oath — requests for production of documents, depositions of parties and key witnesses, and in some cases expert discovery. In a moderately complex commercial dispute, document production alone can be a months-long exercise. Depositions are scheduled one by one, often around the availability of counsel and witnesses across multiple parties. Discovery in even a routine case frequently takes six to twelve months; complex cases can take years.",
      "The quality of documentary evidence collected before filing — emails, contracts, financial records, text messages — often determines how a case ultimately resolves. Evidence that demonstrates a clear breach of obligation, a specific monetary loss, and a traceable connection between the two positions a plaintiff well for settlement or trial. Evidence that is ambiguous or incomplete gives the defendant room to dispute liability, which increases cost and uncertainty for everyone. The time to gather and preserve evidence is before the dispute escalates, not after.",
      "Several practical realities about civil litigation in Pennsylvania deserve emphasis. The statute of limitations for most contract claims is four years from the date of the breach. For personal injury claims, it is two years. These are hard deadlines — missing them means losing the right to sue entirely, regardless of how strong the underlying claim is. Filing a complaint does not toll the statute of limitations indefinitely; service must be completed within the required period as well.",
      "Litigation is expensive and unpredictable even in strong cases. A straightforward commercial dispute that should be worth sixty thousand dollars may cost twenty thousand to litigate through trial. If the defendant files counterclaims, the cost rises further. Attorney's fees are generally not recoverable in Pennsylvania commercial disputes unless the contract provides for fee-shifting or a specific statute authorizes it. This means that a plaintiff who prevails at trial may net far less than the judgment amount after accounting for legal fees.",
      "Trial is the exception, not the rule. The overwhelming majority of civil cases settle before reaching a courtroom, and settlement is often the most rational outcome when the cost, time, and uncertainty of trial are weighed against a realistic range of recoveries. Early legal involvement — before the dispute escalates into filed litigation — consistently produces better outcomes. Understanding the strength of the claim, the likely range of recovery, and the cost of litigation before deciding to proceed is not a luxury. It is the minimum preparation a prospective plaintiff should have."
    ]
  },
  {
    id: "civil-2",
    category: "Civil Litigation",
    image: "assets/civil-mediation.jpg",
    title: "Mediation, Arbitration, and Trial: Understanding the Differences",
    date: "May 2026",
    excerpt: "When a legal dispute arises, a courtroom trial is not the only path to resolution. Understanding the range of options, and when each is appropriate, can save significant time and money.",
    pullQuote: "Binding arbitration produces an enforceable award that is extremely difficult to appeal, even if the arbitrator makes a legal error. The finality that makes it efficient also makes the choice of arbitrator consequential.",
    takeaways: [
      "Mediation is non-binding and confidential. Either party can walk away without a result, making it most effective when both sides genuinely want resolution.",
      "Arbitration is more formal and typically produces a binding, enforceable award. It offers speed and privacy but limits the right to appeal.",
      "Many commercial contracts include mandatory arbitration clauses that require disputes to go to arbitration rather than court. These clauses are generally enforceable.",
      "Trial provides the greatest procedural protections — including the right to jury trial and full appellate review — but is the most expensive and least predictable option.",
      "The right forum depends on the nature of the dispute, the relationship between the parties, the amount at stake, and how much certainty versus flexibility matters to each side."
    ],
    body: [
      "When a legal dispute arises, a courtroom trial is not the only path to resolution. Understanding the range of options, and when each is appropriate, can save significant time and money.",
      "Mediation is a non-binding process in which a neutral third party facilitates negotiation between the parties. The mediator does not decide the outcome. Instead, the mediator helps the parties communicate, identify their actual interests beneath their stated positions, and work toward a voluntary agreement. Mediation is typically confidential, meaning statements made during the process cannot be used in subsequent litigation. A skilled mediator can often help parties reach agreements that address concerns that a court could not. Mediation is most effective when both sides have a genuine interest in resolution and some flexibility on terms.",
      "Because mediation is non-binding, either party can walk away without a result. A party who participates in bad faith — attending the mediation without any real intention of settling — wastes everyone's time and money. This is why the timing and framing of a mediation request can be as strategically important as the substance of what is offered at the table. A well-prepared mediation brief that concisely presents the strengths of your case and the risks of continued litigation can shape the negotiation before it begins.",
      "Arbitration is a more formal process that more closely resembles a trial. An arbitrator or panel of arbitrators hears evidence and arguments and issues a decision. In binding arbitration, the award is enforceable in court and extremely difficult to appeal — courts will set aside binding arbitration awards only in narrow circumstances, such as fraud, corruption, or an arbitrator who exceeded their authority. This finality is what makes binding arbitration attractive to parties who want a definitive result more quickly than litigation provides, but it also means that legal errors by the arbitrator are generally not correctable on appeal.",
      "Many commercial contracts include mandatory arbitration clauses that require disputes to go to a specific arbitral forum, such as the American Arbitration Association or JAMS, rather than court. These clauses are generally enforceable under both federal and Pennsylvania law. If you are signing a commercial contract with an arbitration clause, you should understand what you are agreeing to: you are trading the right to a jury trial, broad discovery, and full appellate review for a process that is typically faster, less expensive, and private, but with limited recourse if the outcome is unfavorable.",
      "The selection of the arbitrator in binding arbitration is far more consequential than it may appear. Unlike a judge, whose decisions can be appealed and whose conduct is subject to judicial ethics rules, an arbitrator's decisions on both the law and the facts are largely final. Researching the background, professional experience, and track record of potential arbitrators before agreeing to a selection is time well spent.",
      "Trial is the most formal and most expensive option. It provides the greatest procedural protections — broad discovery rights, the right to a jury in most civil cases, and full appellate review — but also carries the most uncertainty. Preparation for trial is intensive, the outcome is difficult to predict even in well-prepared cases, and the costs can be significant relative to the amount in dispute.",
      "The right forum depends on the nature of the dispute, the relationship between the parties, the amount at stake, the quality of evidence available, and the degree to which each side needs certainty versus flexibility in the outcome. An attorney with experience in all three forums can advise on which is most likely to produce a good result efficiently."
    ]
  },
  {
    id: "civil-3",
    category: "Civil Litigation",
    image: "assets/civil-gavel.jpg",
    title: "Consumer Fraud and Your Legal Options in Pennsylvania",
    date: "May 2026",
    excerpt: "Pennsylvania provides some of the strongest consumer protection laws in the country, and many residents are not aware of what those laws cover or how to enforce them.",
    pullQuote: "Courts have discretion to award treble damages — three times the actual loss — for willful violations of the Pennsylvania consumer protection statute. The statute also provides for attorney's fees when the consumer prevails.",
    takeaways: [
      "The Pennsylvania Unfair Trade Practices and Consumer Protection Law covers a broad range of deceptive and unfair business practices, including a catchall provision for misleading conduct.",
      "A consumer who proves a violation may recover actual damages or $100 per violation, whichever is greater — and courts may award treble damages for willful violations.",
      "The statute provides for attorney's fees to a prevailing consumer, making meritorious claims economically viable even when individual damages are modest.",
      "Common enforcement areas include home improvement fraud, deceptive lending, misrepresentation in the sale of goods, and unlawful debt collection.",
      "Preserving evidence early — contracts, advertisements, emails, text messages, receipts — is essential to building a viable claim."
    ],
    body: [
      "Pennsylvania provides some of the strongest consumer protection laws in the country, and many residents are not aware of what those laws cover or how to enforce them.",
      "The Pennsylvania Unfair Trade Practices and Consumer Protection Law, commonly called the UTPCPL, prohibits a broad range of deceptive and unfair business practices in the context of consumer transactions. The statute specifically prohibits false advertising, bait-and-switch sales tactics, misrepresentation of the character or origin of goods or services, and deceptive conduct in the collection of debts. Most importantly for consumers, the statute includes a broad catchall provision that reaches any fraudulent or deceptive conduct that creates a likelihood of confusion or misunderstanding about the goods or services being purchased.",
      "What distinguishes the UTPCPL from a common law fraud claim is both its breadth and its remedies. Under a common law fraud theory, a plaintiff must typically prove scienter — that the defendant knew their representation was false. The UTPCPL extends protection to cases of negligent misrepresentation and deceptive conduct that did not require proof of the defendant's intent, though recent appellate decisions have refined the intent requirement in ways that vary by the specific provision alleged.",
      "The remedies available under the UTPCPL are meaningful. A consumer who proves a violation may recover actual damages — the measurable financial loss caused by the deceptive conduct — or alternatively one hundred dollars per violation, whichever is greater. Courts have discretion to award treble damages, meaning three times the actual damages, in cases involving willful or intentional violations. And the statute provides for attorney's fees when the consumer prevails. The fee-shifting provision is significant: it makes meritorious consumer fraud claims economically viable for plaintiffs whose individual damages might otherwise be too modest to justify the cost of litigation.",
      "The UTPCPL has been applied in a wide range of commercial contexts. Home improvement fraud — contractors who take deposits and perform no work, or who perform work that does not meet the agreed specifications — is among the most commonly litigated categories. Deceptive lending practices, including misrepresentations about loan terms, interest rates, or the nature of fees, have generated substantial UTPCPL litigation. Misrepresentations in the retail sale of goods, particularly involving the origin, quality, or specifications of products, are also regularly enforced. Unlawful debt collection practices, which may implicate both the UTPCPL and the federal Fair Debt Collection Practices Act, represent another significant area.",
      "Important limitations apply. The statute generally applies to consumer transactions rather than purely commercial business-to-business dealings. A claim under the UTPCPL requires proof of a causal connection — that the deceptive conduct actually caused the harm the plaintiff is seeking to remedy. A consumer who made a purchase that turned out to be disappointing but was not misled about anything material may not have a viable UTPCPL claim, regardless of how dissatisfied they are with the result.",
      "The threshold question in any consumer fraud matter is whether the conduct falls within the statute's prohibitions and whether the claimed harm flows directly from that conduct. A claim can be strong on the deception element and weak on causation, or vice versa. Getting that analysis right before filing is essential to realistic expectations about the case.",
      "If you believe you have been the victim of fraud or deceptive business practices, early consultation with an attorney can help you understand whether a viable claim exists, what remedies may be available, and how to preserve the evidence necessary to pursue it. The documentation that exists at the time of the dispute — contracts, advertisements, emails, text messages, receipts — tends to tell the story most clearly, and it can disappear quickly if not preserved."
    ]
  }
];

function unsplash(id, w) {
  if (!id) return "";
  if (id.startsWith("assets/") || id.startsWith("/") || id.startsWith("http")) return id;
  return "https://images.unsplash.com/" + id + "?auto=format&fit=crop&q=80" + (w ? "&w=" + w : "");
}

/* ── Article card (list view) ── */
function ArtCard({ article }) {
  return (
    <a href={"Articles.html#" + article.id} className="art-card">
      <div className="art-card-img">
        <img src={unsplash(article.image, 640)} alt={article.title} loading="lazy" />
      </div>
      <div className="art-card-body">
        <div className="art-card-meta">
          <span className="art-cat">{article.category}</span>
          <span className="art-dot">·</span>
          <span className="art-date">{article.date}</span>
        </div>
        <h3 className="art-title">{article.title}</h3>
        <p className="art-excerpt">{article.excerpt}</p>
        <span className="art-read">Read Article <span className="arr">→</span></span>
      </div>
    </a>
  );
}

/* ── Article detail view ── */
function ArticleDetail({ article }) {
  useReveal();

  React.useEffect(() => { window.scrollTo(0, 0); }, [article.id]);

  const categoryLinks = {
    "Estate Planning": "Estate Planning.html",
    "Real Estate Law": "Real Estate Law.html",
    "Business Law": "Business Law.html",
    "Civil Litigation": "Civil Litigation.html",
  };

  return (
    <React.Fragment>
      <Nav current="articles" />

      <div className="art-detail-hero">
        <div className="art-detail-bg">
          <img src={unsplash(article.image, 1600)} alt={article.title} />
        </div>
        <div className="art-detail-overlay"></div>
      </div>

      <div className="art-detail-body">
        <div className="art-detail-hd">
          <div className="art-detail-crumb">
            <a href="Articles.html">Articles</a>
            <span className="sep">/</span>
            <span>{article.category}</span>
          </div>
          <h1 className="art-detail-title">{article.title}</h1>
          <div className="art-detail-meta">
            <span className="art-cat">{article.category}</span>
            <span className="art-dot">·</span>
            <span className="art-date">{article.date}</span>
          </div>
        </div>
        <div className="art-detail-text">
          {article.body.map((para, i) => (
            <React.Fragment key={i}>
              <p>{para}</p>
              {i === 2 && article.pullQuote && (
                <blockquote className="art-pull">{article.pullQuote}</blockquote>
              )}
            </React.Fragment>
          ))}
          {article.takeaways && (
            <div className="art-takeaways">
              <div className="art-takeaways-title">Key Takeaways</div>
              <ul>
                {article.takeaways.map((t, i) => <li key={i}>{t}</li>)}
              </ul>
            </div>
          )}
        </div>
        <div className="art-detail-foot">
          <a href="Articles.html" className="btn btn-ghost">← Back to Articles</a>
          <a href={categoryLinks[article.category] || "Practice Areas.html"} className="btn btn-ghost">
            {article.category} <span className="arr">→</span>
          </a>
          <a href="Contact.html" className="btn btn-primary">Schedule Consultation <span className="arr">→</span></a>
        </div>
      </div>

      <Footer />
    </React.Fragment>
  );
}

/* ── Articles list view ── */
function ArticlesList({ articles }) {
  useReveal();

  const categories = ["Estate Planning", "Real Estate Law", "Business Law", "Civil Litigation"];

  return (
    <React.Fragment>
      <Nav current="articles" />

      <section className="page-hero">
        <div className="inner">
          <div className="crumb reveal">
            <a href="Home.html">Home</a>
            <span className="sep">/</span>
            <span>Articles</span>
          </div>
          <h1 className="reveal d1">Legal <em>Insights.</em></h1>
          <p className="ld reveal d2">
            Practical guidance on estate planning, real estate, business law, and civil litigation
            in Pennsylvania and New Jersey.
          </p>
        </div>
      </section>

      {categories.map(cat => {
        const items = articles.filter(a => a.category === cat);
        return (
          <section key={cat} className="section" style={{borderBottom:"1px solid var(--line)"}}>
            <div className="section-head">
              <div className="eyebrow reveal">Practice Area</div>
              <h2 className="section-title reveal d1">{cat}</h2>
            </div>
            <div className="art-grid">
              {items.map(article => <ArtCard key={article.id} article={article} />)}
            </div>
          </section>
        );
      })}

      <section className="cta-band">
        <div className="inner">
          <h2 className="reveal">Have a specific <em>question?</em></h2>
          <p className="reveal d1">The best answers come from a direct conversation. Consultations are private and complimentary.</p>
          <div className="actions reveal d2">
            <a href="Contact.html" className="btn btn-primary">Schedule Consultation <span className="arr">→</span></a>
            <a href="tel:6104003147" className="btn btn-ghost">Call 610.400.3147</a>
          </div>
        </div>
      </section>

      <Footer />
    </React.Fragment>
  );
}

/* ── Root: hash-based routing + JSONBin live data ── */
function ArticlesPage() {
  const [articles, setArticles] = React.useState(articlesData);
  const [currentId, setCurrentId] = React.useState(
    () => window.location.hash.slice(1) || null
  );

  // Fetch live articles from JSONBin if a Bin ID is configured
  React.useEffect(() => {
    if (!JSONBIN_BIN_ID) return;
    fetch("https://api.jsonbin.io/v3/b/" + JSONBIN_BIN_ID + "/latest")
      .then(r => r.json())
      .then(data => {
        if (data.record && Array.isArray(data.record) && data.record.length > 0) {
          setArticles(data.record);
        }
      })
      .catch(() => {}); // silently fall back to hardcoded data
  }, []);

  React.useEffect(() => {
    function onHash() { setCurrentId(window.location.hash.slice(1) || null); }
    window.addEventListener("hashchange", onHash);
    return () => window.removeEventListener("hashchange", onHash);
  }, []);

  const article = currentId ? articles.find(a => a.id === currentId) : null;

  if (article) return <ArticleDetail article={article} />;
  return <ArticlesList articles={articles} />;
}

ReactDOM.createRoot(document.getElementById("root")).render(<ArticlesPage />);
